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
+4 -24
View File
@@ -6,35 +6,15 @@ watcher = LolWatcher(token_riot)
region = 'EUW1'
def rank_track(nickname, player):
ranked_stats = watcher.league.by_summoner(region, player['id'])
if not ranked_stats:
return str(nickname) + ' n\'est pas ranked.'
return 'Unranked cette saison.'
else:
liste = []
for infos in ranked_stats:
if infos['queueType'] == 'RANKED_SOLO_5x5':
what_rank = 'Solo Queue'
elif infos['queueType'] == 'RANKED_FLEX_SR':
what_rank = 'Flexible'
return infos['summonerName'] + ' est ' + str(infos['tier']) + ' ' + str(infos['rank']) + ' ' + str(infos['leaguePoints']) + ' LP en ' + str(what_rank) + '. ' + str(infos['wins']) + ' W / ' + str(infos['losses']) + 'L.'
# def match_track(nickname, player):
# matche = watcher.match.matchlist_by_account(region, player['accountId'])
# last_match = matche['matches'][0]
# match_detail = watcher.match.by_id(region, last_match['gameId'])
# print(match_detail)
# def main():
# while 1:
# nickname = str(input("Entrez votre pseudo league of legend : "))
# try:
# player = watcher.summoner.by_name(region, nickname)
# rank_track(nickname, rank_track, player)
# # match_track(nickname, player)
# break
# except ApiError:
# print("Le pseudo est inconnu.")
# if __name__ == '__main__':
# main()
liste.append([what_rank, infos['tier'], infos['rank'], infos['leaguePoints'], infos['wins'], infos['losses']])
return liste