move treating command

moves treating command message down to valid command to avoid logging all messages with activator !
This commit is contained in:
MSFTserver 2018-03-31 16:14:13 -07:00 committed by GitHub
parent 5198918ed4
commit 1f92b7b663
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,6 @@ function checkMessageForCommand(msg, isEdit) {
return;
});
}
console.log('treating ' + msg.content + ' from UserID:' + msg.author + ' || UserName: ' + msg.author.username + ' as command');
var cmdTxt = msg.content.split(' ')[0].substring(config.prefix.length);
var suffix = msg.content.substring(cmdTxt.length + config.prefix.length + 1); //add one for the ! and one for the space
if (msg.isMentioned(bot.user)) {
@ -166,6 +165,7 @@ function checkMessageForCommand(msg, isEdit) {
}
} else if (cmd) {
// Add permission check here later on ;)
console.log('treating ' + msg.content + ' from UserID:' + msg.author + ' || UserName: ' + msg.author.username + ' as command');
try {
cmd.process(bot, msg, suffix, isEdit);
} catch (e) {