bugfix
This commit is contained in:
parent
d81553e668
commit
5d6c5c5747
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user