1
0
Fork 0
mirror of https://gitlab.jonasled.de/jonasled/discordbot synced 2024-08-01 15:04:39 +02:00

fixed leaderboard

This commit is contained in:
Jonas Leder 2020-04-03 09:56:57 +02:00
parent 8aad52e1af
commit bc5b0554b8

2
bot.py
View file

@ -182,7 +182,7 @@ async def leaderboard(ctx):
badges = [":first_place: ", ":second_place: ", ":third_place: ", ":four: ", ":five: ", ":six: ", ":seven: ", ":eight: ", ":nine: ", ":keycap_ten: "]#the emoji in front of the username
message = ""#in this variable we will prepare in the next step the response
for entries in reversed(ranking):#loop through every user in reverse order to get the best first and andd his statistics to message
message = message + badges[len(ranking) - ranking.index(entries) - 1] + ": <@" + str(entries[0]) + "> **Total:** " + str(entries[1]) + " XP (**Text:** " + str(entries[2]) + " + **Reaction:** " + str(entries[3]) + " + **VC:** " + str(entries[4]) + ")\n"
message = message + badges[len(ranking) - ranking.index(entries) - 1] + ": <@" + str(entries[0]) + "> **Total:** " + str(entries[1] + entries[2] + entries[3]) + " XP (**Text:** " + str(entries[1]) + " + **Reaction:** " + str(entries[2]) + " + **VC:** " + str(entries[3]) + ")\n"
embed = discord.Embed(title="Leaderboard" , description=message)#make the response Box
await ctx.message.channel.send(embed=embed)#print the ressponse box