From 9a1fd3b6f3b60c438153cdbe013f3e2e0e061dd1 Mon Sep 17 00:00:00 2001 From: Essem Date: Mon, 9 Aug 2021 19:09:32 -0500 Subject: [PATCH] Removed unnecessary checks at beginning of messageCreate --- events/messageCreate.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/events/messageCreate.js b/events/messageCreate.js index 5eec12c..950db8b 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -20,10 +20,9 @@ module.exports = async (client, cluster, worker, ipc, message) => { if (cachedPrefix) { prefixCandidate = cachedPrefix; } else { - let guildDB = message.channel.guild ? await database.getGuild(message.channel.guild.id) : null; - if (message.channel.guild && !(guildDB && guildDB.disabled)) { - const fixedDB = await database.fixGuild(message.channel.guild); - guildDB = fixedDB ? fixedDB : guildDB; + let guildDB = await database.getGuild(message.channel.guild.id); + if (!guildDB) { + guildDB = await database.fixGuild(message.channel.guild); } prefixCandidate = guildDB.prefix; collections.prefixCache.set(message.channel.guild.id, guildDB.prefix);