Fix activity log lookup
This commit is contained in:
parent
1c36fdf3b8
commit
c47d0373d4
1 changed files with 3 additions and 5 deletions
|
@ -298,8 +298,7 @@ class Jarvis(Client):
|
|||
|
||||
async def process_verify(self, before: Member, after: Member) -> Embed:
|
||||
"""Process user verification."""
|
||||
guild = await self.fetch_guild(after._guild_id)
|
||||
auditlog = await guild.fetch_audit_log(user_id=before.id, action_type=AuditLogEventType.MEMBER_ROLE_UPDATE)
|
||||
auditlog = await after.guild.fetch_audit_log(user_id=before.id, action_type=AuditLogEventType.MEMBER_ROLE_UPDATE)
|
||||
audit_event = get(auditlog.events, reason="Verification passed")
|
||||
if audit_event:
|
||||
admin_mention = "[N/A]"
|
||||
|
@ -321,8 +320,7 @@ class Jarvis(Client):
|
|||
if before.roles == after.roles:
|
||||
return
|
||||
|
||||
guild = await self.fetch_guild(after._guild_id)
|
||||
auditlog = await guild.fetch_audit_log(user_id=before.id, action_type=AuditLogEventType.MEMBER_ROLE_UPDATE)
|
||||
auditlog = await after.guild.fetch_audit_log(user_id=before.id, action_type=AuditLogEventType.MEMBER_ROLE_UPDATE)
|
||||
new_roles = {}
|
||||
removed_roles = {}
|
||||
|
||||
|
@ -374,7 +372,7 @@ class Jarvis(Client):
|
|||
if (before.display_name == after.display_name and before.roles == after.roles) or (not after or not before):
|
||||
return
|
||||
|
||||
log = await Setting.find_one(q(guild=guild.id, setting="activitylog"))
|
||||
log = await Setting.find_one(q(guild=before.guild.id, setting="activitylog"))
|
||||
if log:
|
||||
channel = await before.guild.fetch_channel(log.value)
|
||||
await asyncio.sleep(0.5) # Wait for audit log
|
||||
|
|
Loading…
Add table
Reference in a new issue