Add files via upload

This commit is contained in:
Florian SYLVAIN
2021-01-30 15:11:06 +01:00
committed by GitHub
parent 267079714a
commit 568a0f9c39
2 changed files with 18 additions and 41 deletions
+14 -17
View File
@@ -13,27 +13,24 @@ print("Loading...")
async def on_ready():
print('We have logged in as {0.user}'.format(bot))
# @client.event
# async def on_message(message):
# if message.author == client.user:
# return
# if message.content.startswith('$hello'):
# await message.channel.send('Hello!')
# @bot.command()
# async def test(ctx, arg):
# await ctx.send(arg)
@bot.command()
async def rank(ctx, arg):
try:
player = watcher.summoner.by_name(region, arg)
text = rank_track(arg, player)
embed= discord.Embed(title=arg, url="https://www.youtube.com/watch?v=dQw4w9WgXcQ", description=text)
embed.set_thumbnail(url="http://ddragon.leagueoflegends.com/cdn/11.2.1/img/profileicon/" + str(player['profileIconId']) + ".png")
await ctx.send(embed=embed)
ranks = rank_track(arg, player)
embed = discord.Embed(title = arg, url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ")
embed.set_thumbnail(url = "http://ddragon.leagueoflegends.com/cdn/11.2.1/img/profileicon/" + str(player['profileIconId']) + ".png")
if ranks == list:
for i in range(len(ranks)):
text = str(ranks[i][1]) + ' ' + str(ranks[i][2]) + ' ' + str(ranks[i][3]) + ' LP' + '\n' + str(ranks[i][4]) + 'W/' + str(ranks[i][5]) + 'L'
embed.add_field(name = ranks[i][0], value = text, inline = False)
else:
embed.description = ranks
await ctx.send(embed = embed)
except ApiError:
await ctx.send("Le pseudo est inconnu ou un problème est survenu. (ma gestion des erreurs est à chier, déso pas déso)")