forked from Galactic/galactic-bot
Fix missing permission error for audit logs
This commit is contained in:
parent
a85ed6535b
commit
55095866de
@ -107,7 +107,8 @@ class AuditLogObserver extends Observer {
|
||||
}
|
||||
|
||||
async _fetchFirstEntry(guild, user, type) {
|
||||
const audit = await guild.fetchAuditLogs({ limit: 2 }); //Just incase >_>
|
||||
if(!guild.me.hasPermission('VIEW_AUDIT_LOG')) return null;
|
||||
const audit = await guild.fetchAuditLogs({ limit: 1 });
|
||||
if(audit.entries.size === 0) return null;
|
||||
|
||||
const entry = audit.entries.filter((e) => e?.target?.id === user.id).first();
|
||||
|
Loading…
Reference in New Issue
Block a user