From 3fbf42600329f50ba7a5069048b85654e83a5264 Mon Sep 17 00:00:00 2001 From: Red-GitHubBot <88117545+Red-GitHubBot@users.noreply.github.com> Date: Sat, 4 Jun 2022 03:01:37 +0200 Subject: [PATCH] [3.4] add timestamps to all audio embeds (#5632) (#5741) (cherry picked from commit 78e64ec5598a92fc15a5e74b67443e704d460b1b) Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com> Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com> --- 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 cd50b6a26..293744ca1 100644 --- a/redbot/cogs/audio/core/utilities/miscellaneous.py +++ b/redbot/cogs/audio/core/utilities/miscellaneous.py @@ -83,10 +83,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: