From d95faed02bc5453362d35bc72cc56f32340ecdb2 Mon Sep 17 00:00:00 2001 From: Conatum Date: Tue, 7 Dec 2021 11:02:40 +0200 Subject: [PATCH] fix (stats): Repair some formatting issues. --- bot/modules/study/stats_cmd.py | 10 +++++----- bot/modules/study/top_cmd.py | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bot/modules/study/stats_cmd.py b/bot/modules/study/stats_cmd.py index 9b9329dc..dbd71302 100644 --- a/bot/modules/study/stats_cmd.py +++ b/bot/modules/study/stats_cmd.py @@ -2,12 +2,12 @@ from datetime import datetime, timedelta import discord from cmdClient.checks import in_guild -from utils.lib import strfdur, prop_tabulate, utc_now +from utils.lib import prop_tabulate, utc_now from data import tables from data.conditions import LEQ from core import Lion -from .tracking.data import study_time_since, session_history +from .tracking.data import session_history from .module import module @@ -15,7 +15,7 @@ from .module import module @module.cmd( "stats", group="Statistics", - desc="View a summary of your study statistics!", + desc="View your personal server study statistics!", aliases=('profile',) ) @in_guild() @@ -227,7 +227,7 @@ async def cmd_stats(ctx): acc_rate ) stats['Study Streak'] = "**{}** days{}".format( - streak, + current_streak, " (longest **{}** days)".format(max_streak) if max_streak else '' ) @@ -250,7 +250,7 @@ async def cmd_stats(ctx): # Add the study league field if current_badge or next_badge: current_str = ( - "You are currently in <@&{}>!".format(current_badge.roleid) if current_badge else "Not league yet!" + "You are currently in <@&{}>!".format(current_badge.roleid) if current_badge else "No league yet!" ) if next_badge: needed = max(next_badge.required_time - season_time, 0) diff --git a/bot/modules/study/top_cmd.py b/bot/modules/study/top_cmd.py index cb737ed8..cb4008f7 100644 --- a/bot/modules/study/top_cmd.py +++ b/bot/modules/study/top_cmd.py @@ -61,7 +61,6 @@ async def cmd_top(ctx): author_index = None entries = [] for i, (userid, time) in enumerate(user_data): - time = int(time) member = ctx.guild.get_member(userid) name = member.display_name if member else str(userid) name = name.replace('*', ' ').replace('_', ' ')