commit b4e273863ca23b1408b72f59c4f0a199e03c7d2e
parent d3fb6c7d6aa660cbc16d65e0fbac9f8f46b84012
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date: Fri, 5 Feb 2021 09:29:38 -0800
Fix rate calculation in speed command.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/bot.py b/bot.py
@@ -709,7 +709,8 @@ async def speed(ctx, period=24.0):
# Create embed
embed=discord.Embed(title="Countdown Speed")
embed.description = f"**Period Size:** {period}\n"
- embed.description += f"**Average Progress per Period:** {round(stats['rate']):,}\n"
+ rate = (stats['total'] - stats['current'])/((countdown.messages[-1].timestamp - countdown.messages[0].timestamp) / period)
+ embed.description += f"**Average Progress per Period:** {round(rate):,}\n"
embed.description += f"**Record Progress per Period:** {max(speed[1]):,}\n"
embed.description += f"**Progress during Last Period:** {speed[1][-1]:,}\n"
embed.set_image(url="attachment://image.png")