fix(statistics): Fix several display errors.

This commit is contained in:
2023-10-01 14:21:59 +03:00
parent 5cb391eab3
commit 8a2c85113e
4 changed files with 6 additions and 6 deletions

Submodule src/gui updated: 0153ee258b...24e94d10e2

View File

@@ -126,7 +126,7 @@ class StatsData(Registry):
@classmethod
@log_wrap(action='study_times_between')
async def study_times_between(cls, guildid: int, userid: int, *points) -> list[int]:
async def study_times_between(cls, guildid: Optional[int], userid: int, *points) -> list[int]:
if len(points) < 2:
raise ValueError('Not enough block points given!')
@@ -165,8 +165,8 @@ class StatsData(Registry):
return (await cursor.fetchone()[0]) or 0
@classmethod
@log_wrap(action='study_times_between')
async def study_times_since(cls, guildid: int, userid: int, *starts) -> int:
@log_wrap(action='study_times_since')
async def study_times_since(cls, guildid: Optional[int], userid: int, *starts) -> int:
if len(starts) < 1:
raise ValueError('No starting points given!')

View File

@@ -76,7 +76,7 @@ async def get_profile_card(bot: LionBot, userid: int, guildid: int):
else:
next_rank = None
achievements = (0, 1)
achievements = (0, 1, 2, 3)
card = ProfileCard(
user=username,

View File

@@ -34,7 +34,7 @@ async def get_stats_card(bot: LionBot, userid: int, guildid: int, mode: CardMode
# Extract the study times for each period
if mode in (CardMode.STUDY, CardMode.VOICE):
model = data.VoiceSessionStats
refkey = (guildid, userid)
refkey = (guildid or None, userid)
ref_since = model.study_times_since
ref_between = model.study_times_between
elif mode is CardMode.TEXT: