Skip to content

Commit

Permalink
[ExtendedModLog] Fix member leaving events erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Feb 14, 2024
1 parent 8730371 commit 7e0f0c3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions extendedmodlog/eventmixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,9 @@ async def on_member_remove(self, member: discord.Member):
# set guild level i18n
time = datetime.datetime.now(datetime.timezone.utc)
entry = await self.get_audit_log_entry(guild, member, discord.AuditLogAction.kick)
if entry is not None:
perp = entry.user
reason = entry.reason

perp = getattr(entry, "user", None)
reason = getattr(entry, "reason", None)
if embed_links:
embed = discord.Embed(
description=member,
Expand Down Expand Up @@ -2333,9 +2333,8 @@ async def on_thread_update(self, before: discord.Thread, after: discord.Thread)
entry = await self.get_audit_log_entry(
guild, before, discord.AuditLogAction.channel_update
)
if entry is not None:
perp = entry.user
reason = entry.reason
perp = getattr(entry, "user", None)
reason = getattr(entry, "reason", None)

if perp:
msg += _("Updated by ") + str(perp) + "\n"
Expand Down

0 comments on commit 7e0f0c3

Please sign in to comment.