diff --git a/leaderboard/leaderboard.py b/leaderboard/leaderboard.py index c211ff3..b430103 100644 --- a/leaderboard/leaderboard.py +++ b/leaderboard/leaderboard.py @@ -113,9 +113,12 @@ class Leaderboard(commands.Cog): """Get a user's total points combining bank balance and levelup XP.""" total_points = 0 - # Get bank balance + # Get bank balance (credits) try: - balance = await bank.get_balance(user) + if await bank.is_global(): + balance = await bank.get_balance(user) + else: + balance = await bank.get_balance(user, _forced=True) total_points += balance except Exception as e: log.error(f"Error getting bank balance for {user}: {e}") @@ -124,9 +127,9 @@ class Leaderboard(commands.Cog): levelup = self.bot.get_cog("LevelUp") if levelup: try: - conf = levelup.db.get_conf(user.guild) - profile = conf.get_profile(user) - total_points += int(profile.xp) + profile = await levelup.get_user_profile(user) + if profile: + total_points += int(profile.total_xp) except Exception as e: log.error(f"Error getting LevelUp XP for {user}: {e}")