diff --git a/python/api_riot.py b/python/api_riot.py index 46ea921..935da4b 100644 --- a/python/api_riot.py +++ b/python/api_riot.py @@ -30,7 +30,7 @@ def last_match(player): matches = WATCHER.match.matchlist_by_account('EUW1', player['accountId']) recent_match = matches['matches'][0] match_detail = WATCHER.match.by_id('EUW1', recent_match['gameId']) - lst = [[],[[],[]]] + lst = [[],[[],[],[],[]]] for x, y in zip(match_detail['participants'], match_detail['participantIdentities']): lst[0].append([y['player']['summonerName'], x['stats']['totalDamageDealtToChampions'], @@ -41,6 +41,8 @@ def last_match(player): for team in match_detail['teams']: lst[1][0].append(team['win']) lst[1][1].append(team['firstBlood']) + lst[1][2].append(team['firstTower']) + lst[1][3].append(team['firstDragon']) ts = str(match_detail['gameCreation'])[:-3] dt = datetime.fromtimestamp(int(ts)).date() diff --git a/python/cmd_lol.py b/python/cmd_lol.py index 650b8e6..1419dd2 100644 --- a/python/cmd_lol.py +++ b/python/cmd_lol.py @@ -66,11 +66,16 @@ class LolCmds(commands.Cog, name='League of Legend commands'): await ctx.send(embed=embed) for i in range(0, -2, -1): 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(), - description=':drop_of_blood: First blood' if lst[1][1][i] else None) - 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:]) + '```') + discord.Colour.green() if lst[1][0][i] == 'Win' else discord.Colour.red(), description= + (':drop_of_blood: First blood\n' if len(lst[1][1]) != 0 and lst[1][1][i] else '') + + (':tokyo_tower: First tower\n' if len(lst[1][2]) != 0 and lst[1][2][i] else '') + + (':dragon_face: First dragon\n' if len(lst[1][3]) != 0 and lst[1][3][i] else '')) + 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) else: await ctx.send('The username you entered is unknown.')