def ranks(self, user_id: int, guild: discord.Guild) -> tuple:
"""Get ranking data about a user."""
all_accounts = await self.all_accounts()
all_ids = [account['id'] for account in all_accounts]
guild_ids = [account['id'] for account in all_accounts if
guild.get_member(account['id']) is not None]
try:
guildrank = guild_ids.index(user_id) + 1
except ValueError:
guildrank = -20
globalrank = all_ids.index(user_id) + 1
return guildrank, globalrank, len(guild_ids), len(all_ids)
评论列表
文章目录