mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
Initial support for Discord timestamping (#5155)
* Initial support for Discord timestamping * Fix timezones * Fix userinfo for users with member.joined_at equal to None * Simplify Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -432,9 +432,9 @@ class Case:
|
||||
until = None
|
||||
duration = None
|
||||
if self.until:
|
||||
start = datetime.utcfromtimestamp(self.created_at)
|
||||
end = datetime.utcfromtimestamp(self.until)
|
||||
end_fmt = end.strftime("%Y-%m-%d %H:%M:%S UTC")
|
||||
start = datetime.fromtimestamp(self.created_at, tz=timezone.utc)
|
||||
end = datetime.fromtimestamp(self.until, tz=timezone.utc)
|
||||
end_fmt = f"<t:{int(end.timestamp())}>"
|
||||
duration = end - start
|
||||
dur_fmt = _strfdelta(duration)
|
||||
until = end_fmt
|
||||
@@ -454,9 +454,7 @@ class Case:
|
||||
|
||||
last_modified = None
|
||||
if self.modified_at:
|
||||
last_modified = "{}".format(
|
||||
datetime.utcfromtimestamp(self.modified_at).strftime("%Y-%m-%d %H:%M:%S UTC")
|
||||
)
|
||||
last_modified = f"<t:{self.modified_at}>"
|
||||
|
||||
if isinstance(self.user, int):
|
||||
if self.user == 0xDE1:
|
||||
|
||||
Reference in New Issue
Block a user