fix(*): Ignore messages in DM with the bot

This commit is contained in:
2020-10-26 16:42:08 +00:00
parent 065f808689
commit a80a4b8dfc
+2 -1
View File
@@ -156,9 +156,10 @@ function deleteChannel(message, channelId) {
}
client.on('message', function (message) {
// Ignore messages from the bot and that don't begin with the prefix
// Ignore messages from the bot and that don't begin with the prefix, and do not run in DMs to bot
if (message.author.bot) return;
if (!message.content.startsWith(config.prefix)) return;
if (message.channel instanceof Discord.DMChannel) return;
const commandBody = message.content.slice(config.prefix.length);
const args = commandBody.split(' ');