diff --git a/README.md b/README.md index b106f20..6228e32 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,7 @@ There must be a folder titled `readme-lol-items` in the repository that you wish "Target File": "README.md", "Toggle Credit": 1, "Skin Substitutions": { - "Yasuo": "Nightbringer Yasuo", - "Yone": "Dawnbringer Yone", - "Akali": "K/DA Akali", - "Taliyah": "Pool Party Taliyah", - "Katarina": "Battle Queen Katarina" + "Caitlyn": "Battle Academia Caitlyn" }, "Extra Info": { "Seconds of CC": 1, @@ -103,11 +99,11 @@ Here is an example layout (best viewed with proper formatting [here](https://git
Top 5 Recently Played Champions ------------------------- - - - - - + + + + + ------------------------- | Top 3 Champion Masteries ------------------------ diff --git a/main.py b/main.py index 36fc6dc..ff12d37 100644 --- a/main.py +++ b/main.py @@ -278,11 +278,15 @@ def get_main_section_data(puuid, api_key, extra_data, list_of_matches): for participant in response["info"]["participants"]: if participant["puuid"] == puuid: last_champs_played.append(participant["championName"]) - ability_usage += participant["challenges"]["abilityUses"] + + played_positions.append(participant["individualPosition"]) time_ccing += participant["timeCCingOthers"] - solo_kills += participant["challenges"]["soloKills"] - take_downs += participant["challenges"]["takedowns"] + + if "challenges" in participant: + ability_usage += participant["challenges"]["abilityUses"] + solo_kills += participant["challenges"]["soloKills"] + take_downs += participant["challenges"]["takedowns"] global_kills += participant["kills"] global_deaths += participant["deaths"] @@ -339,9 +343,9 @@ def get_main_section_data(puuid, api_key, extra_data, list_of_matches): Returns: - a dictionary which contains a list of lists. The lowests lists contain each champions name, their loading image title, and their mastery score. ''' -def get_mastery_section_data(id, api_key): +def get_mastery_section_data(puuid, api_key): # Get mastery information - champ_id_points = rf.get_masteries(id, api_key) + champ_id_points = rf.get_masteries(puuid, api_key) champ_data = dd.get_champion_data() for id in champ_id_points: @@ -407,7 +411,7 @@ def main(): # Returns the extra_data and a reverse list of the recently played champions main_widget_info = get_main_section_data(puuid, key, extra_data, matches) # Get Mastery Info - mastery_widget_info = get_mastery_section_data(id, key) + mastery_widget_info = get_mastery_section_data(puuid, key) # Gather the square and loading images diff --git a/readme-lol-items/Briar.png b/readme-lol-items/Briar.png new file mode 100644 index 0000000..eb96138 Binary files /dev/null and b/readme-lol-items/Briar.png differ diff --git a/readme-lol-items/Jhin.png b/readme-lol-items/Jhin.png deleted file mode 100644 index b1d0e5e..0000000 Binary files a/readme-lol-items/Jhin.png and /dev/null differ diff --git a/readme-lol-items/Kaisa.png b/readme-lol-items/Kaisa.png new file mode 100644 index 0000000..4ef8bf0 Binary files /dev/null and b/readme-lol-items/Kaisa.png differ diff --git a/readme-lol-items/Kindred.png b/readme-lol-items/Kindred.png new file mode 100644 index 0000000..1b185a6 Binary files /dev/null and b/readme-lol-items/Kindred.png differ diff --git a/readme-lol-items/KogMaw.png b/readme-lol-items/KogMaw.png new file mode 100644 index 0000000..dba8c11 Binary files /dev/null and b/readme-lol-items/KogMaw.png differ diff --git a/readme-lol-items/Lucian.png b/readme-lol-items/Lucian.png deleted file mode 100644 index 24778de..0000000 Binary files a/readme-lol-items/Lucian.png and /dev/null differ diff --git a/readme-lol-items/Twitch.png b/readme-lol-items/Twitch.png deleted file mode 100644 index 7d1f58e..0000000 Binary files a/readme-lol-items/Twitch.png and /dev/null differ diff --git a/readme-lol-items/Varus.png b/readme-lol-items/Varus.png deleted file mode 100644 index 6e25432..0000000 Binary files a/readme-lol-items/Varus.png and /dev/null differ diff --git a/readme-lol-items/Xayah.png b/readme-lol-items/Xayah.png new file mode 100644 index 0000000..16d2c41 Binary files /dev/null and b/readme-lol-items/Xayah.png differ diff --git a/readme-lol-items/Zeri.png b/readme-lol-items/Zeri.png deleted file mode 100644 index 1f7562c..0000000 Binary files a/readme-lol-items/Zeri.png and /dev/null differ diff --git a/readme-lol-items/config.json b/readme-lol-items/config.json index 26bd00c..78166a4 100644 --- a/readme-lol-items/config.json +++ b/readme-lol-items/config.json @@ -4,11 +4,7 @@ "Target File": "README.md", "Toggle Credit": 1, "Skin Substitutions": { - "Yasuo": "Nightbringer Yasuo", - "Yone": "Dawnbringer Yone", - "Akali": "K/DA Akali", - "Taliyah": "Pool Party Taliyah", - "Katarina": "Battle Queen Katarina" + "Caitlyn": "Battle Academia Caitlyn" }, "Extra Info": { "Seconds of CC": 1, diff --git a/readme-lol-items/extra_info.gif b/readme-lol-items/extra_info.gif index 8d7eac1..8287dbd 100644 Binary files a/readme-lol-items/extra_info.gif and b/readme-lol-items/extra_info.gif differ diff --git a/readme-lol-items/loading_Briar.gif b/readme-lol-items/loading_Briar.gif new file mode 100644 index 0000000..40dd802 Binary files /dev/null and b/readme-lol-items/loading_Briar.gif differ diff --git a/readme-lol-items/loading_Jhin.gif b/readme-lol-items/loading_Jhin.gif deleted file mode 100644 index f542407..0000000 Binary files a/readme-lol-items/loading_Jhin.gif and /dev/null differ diff --git a/readme-lol-items/loading_Kaisa.gif b/readme-lol-items/loading_Kaisa.gif new file mode 100644 index 0000000..f4cfba6 Binary files /dev/null and b/readme-lol-items/loading_Kaisa.gif differ diff --git a/readme-lol-items/loading_Kindred.gif b/readme-lol-items/loading_Kindred.gif new file mode 100644 index 0000000..7bae870 Binary files /dev/null and b/readme-lol-items/loading_Kindred.gif differ diff --git a/readme-lol-items/loading_KogMaw.gif b/readme-lol-items/loading_KogMaw.gif new file mode 100644 index 0000000..7181d29 Binary files /dev/null and b/readme-lol-items/loading_KogMaw.gif differ diff --git a/readme-lol-items/loading_Lucian.gif b/readme-lol-items/loading_Lucian.gif deleted file mode 100644 index 45d8ed1..0000000 Binary files a/readme-lol-items/loading_Lucian.gif and /dev/null differ diff --git a/readme-lol-items/loading_Twitch.gif b/readme-lol-items/loading_Twitch.gif deleted file mode 100644 index 52eb93c..0000000 Binary files a/readme-lol-items/loading_Twitch.gif and /dev/null differ diff --git a/readme-lol-items/loading_Varus.gif b/readme-lol-items/loading_Varus.gif deleted file mode 100644 index 204a575..0000000 Binary files a/readme-lol-items/loading_Varus.gif and /dev/null differ diff --git a/readme-lol-items/loading_Xayah.gif b/readme-lol-items/loading_Xayah.gif new file mode 100644 index 0000000..23d8ec1 Binary files /dev/null and b/readme-lol-items/loading_Xayah.gif differ diff --git a/readme-lol-items/loading_Zeri.gif b/readme-lol-items/loading_Zeri.gif deleted file mode 100644 index 8f5d1d9..0000000 Binary files a/readme-lol-items/loading_Zeri.gif and /dev/null differ diff --git a/readme-lol-items/mastery.gif b/readme-lol-items/mastery.gif index 655d6a2..0a4f207 100644 Binary files a/readme-lol-items/mastery.gif and b/readme-lol-items/mastery.gif differ diff --git a/riot_api_functions.py b/riot_api_functions.py index f05ebd2..d989396 100644 --- a/riot_api_functions.py +++ b/riot_api_functions.py @@ -100,8 +100,8 @@ def get_summoner_rank(id, api_key): Returns: - parsed -- list of dictionaries containing the id of a champion and the requested summoners mastery of them. ''' -def get_masteries(id, api_key): - mastery_data = riot_api_get("na1", f"lol/champion-mastery/v4/champion-masteries/by-summoner/{id}/top", {"api_key": api_key}) +def get_masteries(puuid, api_key): + mastery_data = riot_api_get("na1", f"lol/champion-mastery/v4/champion-masteries/by-puuid/{puuid}", {"api_key": api_key}) parsed = [] for champ in mastery_data: parsed.append({"championId": champ["championId"], "championPoints": champ["championPoints"]}) |
---|