respect enable state

This commit is contained in:
Erik 2022-07-07 19:58:26 +03:00
parent c46d8aedf1
commit a41383d0ae
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -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;