mirror of
https://github.com/Floriansylvain/Risitas_BOT.git
synced 2026-08-19 11:43:16 +02:00
✨ - $lol_lastgame improved
This commit is contained in:
+3
-1
@@ -30,7 +30,7 @@ def last_match(player):
|
|||||||
matches = WATCHER.match.matchlist_by_account('EUW1', player['accountId'])
|
matches = WATCHER.match.matchlist_by_account('EUW1', player['accountId'])
|
||||||
recent_match = matches['matches'][0]
|
recent_match = matches['matches'][0]
|
||||||
match_detail = WATCHER.match.by_id('EUW1', recent_match['gameId'])
|
match_detail = WATCHER.match.by_id('EUW1', recent_match['gameId'])
|
||||||
lst = [[],[[],[]]]
|
lst = [[],[[],[],[],[]]]
|
||||||
for x, y in zip(match_detail['participants'], match_detail['participantIdentities']):
|
for x, y in zip(match_detail['participants'], match_detail['participantIdentities']):
|
||||||
lst[0].append([y['player']['summonerName'],
|
lst[0].append([y['player']['summonerName'],
|
||||||
x['stats']['totalDamageDealtToChampions'],
|
x['stats']['totalDamageDealtToChampions'],
|
||||||
@@ -41,6 +41,8 @@ def last_match(player):
|
|||||||
for team in match_detail['teams']:
|
for team in match_detail['teams']:
|
||||||
lst[1][0].append(team['win'])
|
lst[1][0].append(team['win'])
|
||||||
lst[1][1].append(team['firstBlood'])
|
lst[1][1].append(team['firstBlood'])
|
||||||
|
lst[1][2].append(team['firstTower'])
|
||||||
|
lst[1][3].append(team['firstDragon'])
|
||||||
|
|
||||||
ts = str(match_detail['gameCreation'])[:-3]
|
ts = str(match_detail['gameCreation'])[:-3]
|
||||||
dt = datetime.fromtimestamp(int(ts)).date()
|
dt = datetime.fromtimestamp(int(ts)).date()
|
||||||
|
|||||||
+10
-5
@@ -66,11 +66,16 @@ class LolCmds(commands.Cog, name='League of Legend commands'):
|
|||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
for i in range(0, -2, -1):
|
for i in range(0, -2, -1):
|
||||||
embed = discord.Embed(title='Team 1' if not i else 'Team 2', colour=
|
embed = discord.Embed(title='Team 1' if not i else 'Team 2', colour=
|
||||||
discord.Colour.green() if lst[1][0][i] == 'Win' else discord.Colour.red(),
|
discord.Colour.green() if lst[1][0][i] == 'Win' else discord.Colour.red(), description=
|
||||||
description=':drop_of_blood: First blood' if lst[1][1][i] else None)
|
(':drop_of_blood: First blood\n' if len(lst[1][1]) != 0 and lst[1][1][i] else '') +
|
||||||
embed.add_field(name='Players', value='```\n' + ''.join(players[:5] if not i else players[5:]) + '```')
|
(':tokyo_tower: First tower\n' if len(lst[1][2]) != 0 and lst[1][2][i] else '') +
|
||||||
embed.add_field(name='Total damage dealt to champions', value='```\n' + ''.join(tab[:5] if not i else tab[5:]) + '```')
|
(':dragon_face: First dragon\n' if len(lst[1][3]) != 0 and lst[1][3][i] else ''))
|
||||||
embed.add_field(name='K / D / A', value='```\n' + ''.join(kda[:5] if not i else kda[5:]) + '```')
|
embed.add_field(name='Players',
|
||||||
|
value='```\n' + ''.join(players[:5] if not i else players[5:]) + '```')
|
||||||
|
embed.add_field(name='Total damage dealt to champions',
|
||||||
|
value='```\n' + ''.join(tab[:5] if not i else tab[5:]) + '```')
|
||||||
|
embed.add_field(name='K / D / A',
|
||||||
|
value='```\n' + ''.join(kda[:5] if not i else kda[5:]) + '```')
|
||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
else:
|
else:
|
||||||
await ctx.send('The username you entered is unknown.')
|
await ctx.send('The username you entered is unknown.')
|
||||||
|
|||||||
Reference in New Issue
Block a user