From a80a4b8dfc21b5c479a968604869cffb94bfed26 Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Mon, 26 Oct 2020 16:42:08 +0000 Subject: [PATCH] fix(*): Ignore messages in DM with the bot --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9f932d0..e8bd8d2 100644 --- a/index.js +++ b/index.js @@ -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(' ');