mirror of
https://github.com/Floriansylvain/Risitas_BOT.git
synced 2026-08-19 19:53:19 +02:00
Add files via upload
This commit is contained in:
@@ -5,16 +5,16 @@ from private import token_bot
|
|||||||
from riot_api import rank_track, watcher, region
|
from riot_api import rank_track, watcher, region
|
||||||
from riotwatcher import ApiError
|
from riotwatcher import ApiError
|
||||||
|
|
||||||
client = discord.Client()
|
|
||||||
bot = commands.Bot(command_prefix='$')
|
|
||||||
print("Loading...")
|
print("Loading...")
|
||||||
|
bot = commands.Bot(command_prefix='$')
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
print('We have logged in as {0.user}'.format(bot))
|
print('We have logged in as {0.user}'.format(bot))
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def rank(ctx, arg):
|
async def rank(ctx, arg, argF=None):
|
||||||
|
if argF is None:
|
||||||
try:
|
try:
|
||||||
player = watcher.summoner.by_name(region, arg)
|
player = watcher.summoner.by_name(region, arg)
|
||||||
ranks = rank_track(arg, player)
|
ranks = rank_track(arg, player)
|
||||||
@@ -22,7 +22,7 @@ async def rank(ctx, arg):
|
|||||||
embed = discord.Embed(title = arg, url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ")
|
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")
|
embed.set_thumbnail(url = "http://ddragon.leagueoflegends.com/cdn/11.2.1/img/profileicon/" + str(player['profileIconId']) + ".png")
|
||||||
|
|
||||||
if ranks == list:
|
if type(ranks) is list:
|
||||||
for i in range(len(ranks)):
|
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'
|
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)
|
embed.add_field(name = ranks[i][0], value = text, inline = False)
|
||||||
@@ -32,7 +32,9 @@ async def rank(ctx, arg):
|
|||||||
await ctx.send(embed = embed)
|
await ctx.send(embed = embed)
|
||||||
|
|
||||||
except ApiError:
|
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)")
|
await ctx.send("Le pseudo est inconnu.")
|
||||||
|
else:
|
||||||
|
await ctx.send("Si vous essayez d'entrer un pseudo aved des espaces, veillez à l'entourer avec des guillemets.")
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def aled(ctx):
|
async def aled(ctx):
|
||||||
|
|||||||
Reference in New Issue
Block a user