From a41383d0ae1939d07709f7a026307d860fabc434 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 7 Jul 2022 19:58:26 +0300 Subject: [PATCH] respect enable state --- src/structure/components/observers/GuildLogging.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/structure/components/observers/GuildLogging.js b/src/structure/components/observers/GuildLogging.js index fb58386..da6b3bf 100644 --- a/src/structure/components/observers/GuildLogging.js +++ b/src/structure/components/observers/GuildLogging.js @@ -153,7 +153,7 @@ class GuildLogger extends Observer { } const { messages: messageLog } = settings; - if (!messageLog.channel) return undefined; + if (!messageLog.channel || !messageLog.enabled) return undefined; const { bypass, ignore } = messageLog; const logChannel = await wrapper.resolveChannel(messageLog.channel); @@ -327,7 +327,7 @@ class GuildLogger extends Observer { const wrapper = this.client.getGuildWrapper(guild.id); const settings = await wrapper.settings(); const chatlogs = settings.messages; - if (!chatlogs.channel) return; + if (!chatlogs.channel || !chatlogs.enabled) return; const logChannel = await wrapper.resolveChannel(chatlogs.channel); if (!logChannel) return undefined; @@ -510,7 +510,7 @@ class GuildLogger extends Observer { const settings = await wrapper.settings(); const chatlogs = settings.messages; - if (!chatlogs.channel) return; + if (!chatlogs.channel || !chatlogs.enabled) return; const { ignore, bypass, channel: _channel } = chatlogs; @@ -639,7 +639,7 @@ class GuildLogger extends Observer { const settings = await wrapper.settings(); const setting = settings.voice; - if (!setting || !setting.channel) return; + if (!setting || !setting.channel || !setting.enabled) return; const logChannel = await wrapper.resolveChannel(setting.channel); if (!logChannel) return; @@ -683,7 +683,7 @@ class GuildLogger extends Observer { const { guild, guildWrapper: wrapper } = member; const settings = await wrapper.settings(); const setting = settings.members; - if (!setting.channel) return; + if (!setting.channel || !setting.enabled) return; const logChannel = await wrapper.resolveChannel(setting.channel); if (!logChannel) return; @@ -703,7 +703,7 @@ class GuildLogger extends Observer { const { guild, guildWrapper: wrapper } = member; const settings = await wrapper.settings(); const setting = settings.members; - if (!setting.channel) return; + if (!setting.channel || !setting.enabled) return; const logChannel = await wrapper.resolveChannel(setting.channel); if (!logChannel) return; @@ -725,7 +725,7 @@ class GuildLogger extends Observer { const { guild, user, guildWrapper: wrapper } = oldMember; const settings = await wrapper.settings(); const setting = settings.nicknames; - if (!setting.channel) return; + if (!setting.channel || !setting.enabled) return; const logChannel = await wrapper.resolveChannel(setting.channel); if (!logChannel) return;