mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 02:37:57 -05:00
fix uptime for uptime of less than a second (#3009)
* fix uptime for uptime of less than a second * changelog * More conclusive fix
This commit is contained in:
@@ -327,9 +327,10 @@ class Core(commands.Cog, CoreLogic):
|
||||
"""Shows Red's uptime"""
|
||||
since = ctx.bot.uptime.strftime("%Y-%m-%d %H:%M:%S")
|
||||
delta = datetime.datetime.utcnow() - self.bot.uptime
|
||||
uptime_str = humanize_timedelta(timedelta=delta) or _("Less than one second")
|
||||
await ctx.send(
|
||||
_("Been up for: **{}** (since {} UTC)").format(
|
||||
humanize_timedelta(timedelta=delta), since
|
||||
_("Been up for: **{time_quantity}** (since {timestamp} UTC)").format(
|
||||
time_quantity=uptime_str, timestamp=since
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user