feat(statistics): Implement achievements.

This commit is contained in:
2023-10-09 21:49:20 +03:00
parent cfc9ea5ea9
commit 01a0f337b7
4 changed files with 498 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ from gui.cards import ProfileCard
from modules.ranks.cog import RankCog
from modules.ranks.utils import format_stat_range
from ..achievements import get_achievements_for
if TYPE_CHECKING:
from ..cog import StatsCog
@@ -76,14 +77,15 @@ async def get_profile_card(bot: LionBot, userid: int, guildid: int):
else:
next_rank = None
achievements = (0, 1, 2, 3)
achievements = await get_achievements_for(bot, guildid, userid)
achieved = tuple(ach.emoji_index for ach in achievements if ach.achieved)
card = ProfileCard(
user=username,
avatar=(userid, avatar),
coins=lion.data.coins, gems=luser.data.gems, gifts=0,
profile_badges=profile_badges,
achievements=achievements,
achievements=achieved,
current_rank=current_rank,
rank_progress=rank_progress,
next_rank=next_rank