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) {
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);