Skip to content

Commit

Permalink
[ExtendedModLog] fix error when invites created_at is None
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Sep 30, 2023
1 parent 6bc15ea commit 10430b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extendedmodlog/eventmixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,7 @@ async def on_invite_create(self, invite: discord.Invite) -> None:
"max_age": _("Max Age:"),
"temporary": _("Temporary:"),
}
invite_time = getattr(invite, "created_at", datetime.datetime.now(datetime.timezone.utc))
invite_time = invite.created_at or datetime.datetime.now(datetime.timezone.utc)
msg = _("{emoji} {time} Invite created ").format(
emoji=self.settings[guild.id]["invite_created"]["emoji"],
time=discord.utils.format_dt(invite_time),
Expand Down Expand Up @@ -2033,7 +2033,7 @@ async def on_invite_delete(self, invite: discord.Invite) -> None:
"max_age": _("Max Age:"),
"temporary": _("Temporary:"),
}
invite_time = getattr(invite, "created_at", datetime.datetime.now(datetime.timezone.utc))
invite_time = invite.created_at or datetime.datetime.now(datetime.timezone.utc)
msg = _("{emoji} {time} Invite deleted ").format(
emoji=self.settings[guild.id]["invite_deleted"]["emoji"],
time=discord.utils.format_dt(invite_time),
Expand Down

0 comments on commit 10430b9

Please sign in to comment.