Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ChatBotGroup/riotConverter.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15 lines (12 sloc)
666 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from riotRequests import requestChampionData | |
# Riot API documentation was used. | |
# https://developer.riotgames.com/api-methods/ and https://developer.riotgames.com/static-data.html | |
def champNameByID(champID): | |
"""Returns champion name by taking champion id as input. Champion Data function is used""" | |
championData = requestChampionData() | |
allChampions = championData['data'] | |
# Loops trough all champions until the given id matches with champion id so it can return champion name. | |
for champion in allChampions: | |
if champID == allChampions[champion]['key']: | |
champName = allChampions[champion]['name'] | |
return champName |