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:
@@ -254,10 +254,8 @@ class General(commands.Cog):
|
||||
Default to False.
|
||||
"""
|
||||
guild = ctx.guild
|
||||
passed = (ctx.message.created_at - guild.created_at).days
|
||||
created_at = _("Created on {date}. That's over {num} days ago!").format(
|
||||
date=guild.created_at.strftime("%d %b %Y %H:%M"),
|
||||
num=humanize_number(passed),
|
||||
created_at = _("Created on <t:{0}:D>. That's <t:{0}:R>!").format(
|
||||
int(guild.created_at.replace(tzinfo=datetime.timezone.utc).timestamp()),
|
||||
)
|
||||
online = humanize_number(
|
||||
len([m.status for m in guild.members if m.status != discord.Status.offline])
|
||||
|
||||
Reference in New Issue
Block a user