From d6df756ecac44d004417ee7031bb1eb290302fae Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Sat, 6 Aug 2022 10:21:31 -0700 Subject: [PATCH] remove deprecated file --- events/messageCreate.js | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 events/messageCreate.js diff --git a/events/messageCreate.js b/events/messageCreate.js deleted file mode 100644 index 8ec36fa..0000000 --- a/events/messageCreate.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * @param {require("../structures/LinesPoliceCadBot")} client - * @param {require("discord.js").message} message - * @returns {void} or nothing if you didn't know - */ - -module.exports = async (client, message) => { - if (message.author.bot || message.channel.type === "dm") return; - let prefix = client.config.DefaultPrefix; - - let GuildDB = await client.GetGuild(message.guild.id); - if (GuildDB && GuildDB.prefix) prefix = GuildDB.prefix; - - //Prefixes also have mention match - const prefixMention = new RegExp(`^<@!?${client.user.id}> `); - prefix = message.content.match(prefixMention) - ? message.content.match(prefixMention)[0] - : prefix; - - if (message.content.indexOf(prefix) !== 0) return; - - if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(message.channel.id)) { - return message.channel.send(`You are not allowed to use the bot in this channel.`); - } - - const args = message.content.slice(prefix.length).trim().split(/ +/g); - //Making the command lowerCase because our file name will be in lowerCase - const command = args.shift().toLowerCase(); - - //Searching a command - const cmd = - client.commands.get(command) || - client.commands.find((x) => x.aliases && x.aliases.includes(command)); - - //Executing the codes when we get the command or aliases - if (cmd) { - cmd.run(client, message, args, { GuildDB }); - client.CommandsRan++; - } else return; -};