From ed1dc8c0599a70929bab9811b5dcfac9f14106ff Mon Sep 17 00:00:00 2001 From: Crenshaw Date: Thu, 18 Mar 2021 20:23:53 -0700 Subject: [PATCH] Update message.js --- events/message.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/events/message.js b/events/message.js index f734569..0820208 100644 --- a/events/message.js +++ b/events/message.js @@ -62,21 +62,18 @@ exports.run = async (client, message) => { try { // errors and overrides, the running the command + // not able to run in DMS if (command.DM === false && !message.guild) return client.err(message, "DMs", "This command cannot be ran in DMs"); - if (command.DM === true && !message.guild) { - console.log(`Ran ${command.name} \[${args.join(" ")}\]- ${message.author.username}#${message.author.discriminator} \(${message.author.id}\) (DM)`); - command.run(client, message, args, command); - return message.channel.stopTyping(true); + if (command.groups[0] == "nsfw" && message.guild === null) { + if (!message.channel.nsfw) return client.err(message, "NSFW", "This is not a NSFW channel"); } - if (command.groups[0] == "nsfw" && !message.channel.nsfw) return client.err(message, "NSFW", "This is not a NSFW channel"); - if (command.groups[0] == "owner" && message.author.id !== '766385575530856458') return client.err(message, "Crenshaw Only", "This command can only be run by the bot owner Crenshaw#1312"); + // owner only + if (command.groups[0] == "owner" && message.author.id !== '766385575530856458') return client.err(message, "Crenshaw Only", "This command can only be run by the bot owner, Crenshaw#1312"); // no overrides or nsfw filters stopped the command, run normally - console.log(`Ran ${command.name} \[${args.join(" ")}\]- ${message.author.username}#${message.author.discriminator} \(${message.author.id}\) (guild - ${message.guild.name})`); command.run(client, message, args, command); - - // stop typing - return await message.channel.stopTyping(true); + await message.channel.stopTyping(true); + return console.log(`Ran ${command.name} \[${args.join(" ")}\]- ${message.author.username}#${message.author.discriminator} \(${message.author.id}\) (guild - ${message.guild.name})`); } catch (err) { console.log(err);