async def messages(self, ctx): s = stats.getAllRows() boardTop = [] for i, user in enumerate(sorted(s, key=lambda x: x[11], reverse=True)): if int(user[11]) == 0: break name = self.utilsCog.getDisplayName(ctx, user[0]) if int(user[0]) == int(ctx.author.id): boardTop.append("**{} ({:,})**".format(name, round(int(user[11])))) else: boardTop.append("{} ({:,})".format(name, round(int(user[11])))) await self.startPaginated(ctx, boardTop, "Messages Leaderboard")
async def rob(self, ctx): users = list(stats.getAllRows()) boardTop = [] for i, user in enumerate(sorted(users, key=lambda x: x[4], reverse=True)): # Don't create an empty leaderboard if i == 0 and float(user[4]) == 0.0: return await self.emptyLeaderboard(ctx, "Rob Leaderboard", "Er heeft nog niemand Didier Dinks gestolen.") elif float(user[4]) > 0.0: # Only add people with more than 0 # Get the username in this guild name = self.utilsCog.getDisplayName(ctx, user[0]) if int(user[0]) == int(ctx.author.id): boardTop.append("**{} ({:,})**".format(name, math.floor(float(user[4])))) else: boardTop.append("{} ({:,})".format(name, math.floor(float(user[4])))) await self.startPaginated(ctx, boardTop, "Rob Leaderboard")
async def xp(self, ctx): s = stats.getAllRows() boardTop = [] for i, user in enumerate(sorted(s, key=lambda x: x[12], reverse=True)): if int(user[12]) == 0: break name = self.utilsCog.getDisplayName(ctx, user[0]) if int(user[0]) == int(ctx.author.id): boardTop.append("**{} (Level {:,} | {:,} XP)**".format(name, xp.calculate_level(round(int(user[12]))), round(int(user[12])))) else: boardTop.append("{} (Level {:,} | {:,} XP)".format(name, xp.calculate_level(round(int(user[12]))), round(int(user[12])))) await self.startPaginated(ctx, boardTop, "XP Leaderboard")
async def poke(self, ctx): s = stats.getAllRows() blacklist = poke.getAllBlacklistedUsers() boardTop = [] for i, user in enumerate(sorted(s, key=lambda x: x[1], reverse=True)): if i == 0 and int(user[1]) == 0: return await self.emptyLeaderboard(ctx, "Poke Leaderboard", "Er is nog niemand getikt.") elif int(user[1]) == 0: break # Don't include blacklisted users elif str(user[0]) not in blacklist: name = self.utilsCog.getDisplayName(ctx, user[0]) if int(user[0]) == int(ctx.author.id): boardTop.append("**{} ({:,})**".format(name, round(int(user[1])))) else: boardTop.append("{} ({:,})".format(name, round(int(user[1])))) await self.startPaginated(ctx, boardTop, "Poke Leaderboard")