error handling for missing members

This commit is contained in:
Erik 2021-06-13 17:52:22 +03:00
parent 757601c608
commit d4ceb44be9
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16

View File

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