Update bot.js

This commit is contained in:
Ralph 2021-04-05 11:49:06 -04:00 committed by GitHub
parent 3e2cbd7ab5
commit 5225287699
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,7 +76,7 @@ function checkMessageForCommand(msg, isEdit) {
if (msg.author.id !== bot.user.id && msg.content.startsWith(config.prefix)) { if (msg.author.id !== bot.user.id && msg.content.startsWith(config.prefix)) {
let cmdTxt = msg.content.split(' ')[0].substring(config.prefix.length); let cmdTxt = msg.content.split(' ')[0].substring(config.prefix.length);
let suffix = msg.content.substring(cmdTxt.length + config.prefix.length + 1); //add one for the ! and one for the space let suffix = msg.content.substring(cmdTxt.length + config.prefix.length + 1); //add one for the ! and one for the space
if (msg.isMentioned(bot.user)) { if (msg.mentions.has(bot.user)) {
try { try {
cmdTxt = msg.content.split(' ')[1]; cmdTxt = msg.content.split(' ')[1];
suffix = msg.content.substring(bot.user.mention().length + cmdTxt.length + config.prefix.length + 1); suffix = msg.content.substring(bot.user.mention().length + cmdTxt.length + config.prefix.length + 1);