fix(statistics): Guard against interaction expiry.

This commit is contained in:
2023-10-06 10:11:52 +03:00
parent eaa44ab43c
commit c4a9f9abf3
2 changed files with 11 additions and 3 deletions

View File

@@ -41,6 +41,7 @@ class StatType(IntEnum):
class LeaderboardUI(StatsUI):
page_size = 10
guildid: int
def __init__(self, bot, user, guild, **kwargs):
super().__init__(bot, user, guild, **kwargs)
@@ -199,6 +200,9 @@ class LeaderboardUI(StatsUI):
mode = CardMode.TEXT
elif self.stat_type is StatType.ANKI:
mode = CardMode.ANKI
else:
raise ValueError
card = await get_leaderboard_card(
self.bot, self.userid, self.guildid,
mode,