From 5d6c5c5747280f53284f326062dd40395e8cc08c Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 9 Aug 2022 18:51:06 +0300 Subject: [PATCH] bugfix --- src/structure/components/observers/GuildLogging.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/structure/components/observers/GuildLogging.js b/src/structure/components/observers/GuildLogging.js index 0c62be3..0ff1b20 100644 --- a/src/structure/components/observers/GuildLogging.js +++ b/src/structure/components/observers/GuildLogging.js @@ -152,11 +152,7 @@ class GuildLogger extends Observer { const wrapper = message.guildWrapper; const settings = await wrapper.settings(); - if (!message.member) try { - message.member = await message.guild.members.fetch(message.author.id); - } catch (_) { - // Member not found, do nothing - } + if (!message.member) message.member = await message.guild.members.fetch(message.author.id).catch(() => null); const { messages: messageLog } = settings; if (!messageLog.channel || !messageLog.enabled) return undefined; @@ -169,7 +165,7 @@ class GuildLogger extends Observer { if (missing.length) return this.client.emit('logError', { guild: wrapper, logger: 'messageLogger', reason: 'MSGLOG_NO_PERMS', params: { missing: missing.join(', ') } }); - if (bypass.length && message.member.roles.cache.size) { + if (bypass.length && message?.member.roles.cache.size) { const roles = message.member.roles.cache.map((r) => r.id); for (const role of bypass) { if (roles.includes(role)) return undefined;