From d4ceb44be90e212ee06f4a27a4dd4d732c455f23 Mon Sep 17 00:00:00 2001 From: Navy Date: Sun, 13 Jun 2021 17:52:22 +0300 Subject: [PATCH] error handling for missing members --- structure/client/components/observers/GuildLogging.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/structure/client/components/observers/GuildLogging.js b/structure/client/components/observers/GuildLogging.js index 51fb317..18e42c7 100644 --- a/structure/client/components/observers/GuildLogging.js +++ b/structure/client/components/observers/GuildLogging.js @@ -72,7 +72,11 @@ class GuildLogger extends Observer { await message.guild.settings(); - if (!message.member) message.member = await message.guild.members.fetch(message.author.id).catch(); + if (!message.member) try { + message.member = await message.guild.members.fetch(message.author.id); + } catch (_) { + // Member not found, do nothing + } const { messageLog } = message.guild._settings; if(!messageLog.channel) return undefined;