add timestamps to all audio embeds (#5632)

This commit is contained in:
Draper 2022-04-02 01:37:44 +01:00 committed by GitHub
parent d932abad16
commit 78e64ec559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: