From 7a21e6d666b0a4d09142ebb04cdadd371104cad3 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sun, 17 Dec 2023 20:58:38 -0600 Subject: [PATCH] [Discord] Update to use datetime.UTC alias in timestamp command --- Discord/cogs/discord.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Discord/cogs/discord.py b/Discord/cogs/discord.py index 8eef823da5..e09f4d97c0 100644 --- a/Discord/cogs/discord.py +++ b/Discord/cogs/discord.py @@ -382,7 +382,7 @@ async def timestamp( if ID: ID = ID.id time = discord.utils.snowflake_time(ID).replace( - tzinfo = datetime.timezone.utc + tzinfo = datetime.UTC ) await ctx.embed_reply( f"{discord.utils.format_dt(time)}\n{time}" @@ -391,7 +391,7 @@ async def timestamp( elif ctx.message.reference: ID = ctx.message.reference.message_id time = discord.utils.snowflake_time(ID).replace( - tzinfo = datetime.timezone.utc + tzinfo = datetime.UTC ) referenced_message = ( ctx.message.reference.cached_message or @@ -408,7 +408,7 @@ async def timestamp( if time: time = time.replace("from now", "") - now = datetime.datetime.now(datetime.timezone.utc) + now = datetime.datetime.now(datetime.UTC) if not (matches := self.calendar.nlp(time, sourceTime = now)): raise commands.BadArgument("Invalid time") parsed_datetime, context, start_pos, end_pos, matched_text = matches[0] @@ -418,10 +418,10 @@ async def timestamp( second = now.second, microsecond = now.microsecond ) time = parsed_datetime.replace( - tzinfo = datetime.timezone.utc + tzinfo = datetime.UTC ) else: - time = datetime.datetime.now(datetime.timezone.utc) + time = datetime.datetime.now(datetime.UTC) t = discord.utils.format_dt(time, style = 't') T = discord.utils.format_dt(time, style = 'T')