mirror of
https://github.com/jcreek/denBot.git
synced 2026-07-13 19:03:45 +00:00
fix(*): Ignore messages in DM with the bot
This commit is contained in:
@@ -156,9 +156,10 @@ function deleteChannel(message, channelId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
client.on('message', function (message) {
|
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.author.bot) return;
|
||||||
if (!message.content.startsWith(config.prefix)) return;
|
if (!message.content.startsWith(config.prefix)) return;
|
||||||
|
if (message.channel instanceof Discord.DMChannel) return;
|
||||||
|
|
||||||
const commandBody = message.content.slice(config.prefix.length);
|
const commandBody = message.content.slice(config.prefix.length);
|
||||||
const args = commandBody.split(' ');
|
const args = commandBody.split(' ');
|
||||||
|
|||||||
Reference in New Issue
Block a user