nasty workaround
This commit is contained in:
parent
c39c654e67
commit
111bebb2ea
@ -127,7 +127,7 @@ async def register(ctx, *args):
|
|||||||
return await ctx.send("Something went wrong...")
|
return await ctx.send("Something went wrong...")
|
||||||
|
|
||||||
@bot.command(aliases=['lead', 'l'])
|
@bot.command(aliases=['lead', 'l'])
|
||||||
async def leaderboard(ctx, players=5):
|
async def leaderboard(ctx, players="5"):
|
||||||
"""Shows the Top <players> leaderboard: !leaderboard <number_of_players/max>"""
|
"""Shows the Top <players> leaderboard: !leaderboard <number_of_players/max>"""
|
||||||
target = Target(ctx, bot)
|
target = Target(ctx, bot)
|
||||||
leaderboard = requests.get(f"{target.URL}/players").json()
|
leaderboard = requests.get(f"{target.URL}/players").json()
|
||||||
@ -135,6 +135,8 @@ async def leaderboard(ctx, players=5):
|
|||||||
return await ctx.send(f"We don't have that many players in the database. We have {len(leaderboard)}.")
|
return await ctx.send(f"We don't have that many players in the database. We have {len(leaderboard)}.")
|
||||||
if players == "MAX" or players == "max":
|
if players == "MAX" or players == "max":
|
||||||
players = len(leaderboard)
|
players = len(leaderboard)
|
||||||
|
#NASTY
|
||||||
|
players = int(players)
|
||||||
leaderboard = leaderboard[:players]
|
leaderboard = leaderboard[:players]
|
||||||
embed = discord.Embed(title=f"Top {players} players", description="Ordered by mmr", color=0xFF5733)
|
embed = discord.Embed(title=f"Top {players} players", description="Ordered by mmr", color=0xFF5733)
|
||||||
embed.set_author(name="custoMM", icon_url="https://git.confest.im/boyan_k/custoMM/raw/branch/main/images/smol_logo.png")
|
embed.set_author(name="custoMM", icon_url="https://git.confest.im/boyan_k/custoMM/raw/branch/main/images/smol_logo.png")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user