From 78e64ec5598a92fc15a5e74b67443e704d460b1b Mon Sep 17 00:00:00 2001 From: Draper <27962761+Drapersniper@users.noreply.github.com> Date: Sat, 2 Apr 2022 01:37:44 +0100 Subject: [PATCH] add timestamps to all audio embeds (#5632) --- redbot/cogs/audio/core/utilities/miscellaneous.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/redbot/cogs/audio/core/utilities/miscellaneous.py b/redbot/cogs/audio/core/utilities/miscellaneous.py index 1f91c18fe..4b03f36bb 100644 --- a/redbot/cogs/audio/core/utilities/miscellaneous.py +++ b/redbot/cogs/audio/core/utilities/miscellaneous.py @@ -81,10 +81,13 @@ class MiscellaneousUtilities(MixinMeta, metaclass=CompositeMetaClass): embed = {} colour = embed.get("color") if embed.get("color") else colour contents.update(embed) - if timestamp and isinstance(timestamp, datetime.datetime): - contents["timestamp"] = timestamp embed = discord.Embed.from_dict(contents) embed.color = colour + if timestamp and isinstance(timestamp, datetime.datetime): + timestamp = timestamp.replace(tzinfo=datetime.timezone.utc) + embed.timestamp = timestamp + else: + embed.timestamp = datetime.datetime.now(tz=datetime.timezone.utc) if footer: embed.set_footer(text=footer) if thumbnail: