Skip to content

Commit

Permalink
[Discord] Update to use datetime.UTC alias in Bot.on_message_edit method
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Dec 18, 2023
1 parent 5175235 commit 7bfdc75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Discord/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ async def on_message_edit(self, before, after):
ON CONFLICT (edited_at, message_id) DO
UPDATE SET before_content = $3, after_content = $4
""",
after.edited_at.replace(tzinfo = datetime.timezone.utc), after.id,
after.edited_at.replace(tzinfo = datetime.UTC), after.id,
before.content.replace('\N{NULL}', ""), after.content.replace('\N{NULL}', "")
)
before_embeds = [embed.to_dict() for embed in before.embeds]
Expand All @@ -1102,7 +1102,7 @@ async def on_message_edit(self, before, after):
ON CONFLICT (edited_at, message_id) DO
UPDATE SET before_embeds = CAST($3 AS jsonb[]), after_embeds = CAST($4 AS jsonb[])
""",
after.edited_at.replace(tzinfo = datetime.timezone.utc), after.id, before_embeds, after_embeds
after.edited_at.replace(tzinfo = datetime.UTC), after.id, before_embeds, after_embeds
)
except OSError as e:
self.print(f"Error processing message edit: {e}")
Expand Down

0 comments on commit 7bfdc75

Please sign in to comment.