Removed unnecessary checks at beginning of messageCreate

This commit is contained in:
Essem 2021-08-09 19:09:32 -05:00
parent 4dc1b9f5a9
commit 9a1fd3b6f3
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -20,10 +20,9 @@ module.exports = async (client, cluster, worker, ipc, message) => {
if (cachedPrefix) { if (cachedPrefix) {
prefixCandidate = cachedPrefix; prefixCandidate = cachedPrefix;
} else { } else {
let guildDB = message.channel.guild ? await database.getGuild(message.channel.guild.id) : null; let guildDB = await database.getGuild(message.channel.guild.id);
if (message.channel.guild && !(guildDB && guildDB.disabled)) { if (!guildDB) {
const fixedDB = await database.fixGuild(message.channel.guild); guildDB = await database.fixGuild(message.channel.guild);
guildDB = fixedDB ? fixedDB : guildDB;
} }
prefixCandidate = guildDB.prefix; prefixCandidate = guildDB.prefix;
collections.prefixCache.set(message.channel.guild.id, guildDB.prefix); collections.prefixCache.set(message.channel.guild.id, guildDB.prefix);