def get_current_game_data(self, summoner_name): summoner_id = RiotApi.get_summoner_id(summoner_name) if not summoner_id: return None current_game = RiotApi.get_current_game_data(summoner_id) if current_game: players = current_game.get("participants") for player in players: del player["masteries"] del player["runes"] del player["profileIconId"] player["champion"] = self.champions[str(player["championId"])] player["spell1"] = self.summoner_spells[str(player["spell1Id"])] player["spell2"] = self.summoner_spells[str(player["spell2Id"])] return players return None
def get_current_game_data(self, summoner_name): summoner_id = RiotApi.get_summoner_id(summoner_name) if not summoner_id: return None current_game = RiotApi.get_current_game_data(summoner_id) if current_game: players = current_game.get("participants") for player in players: del player["masteries"] del player["runes"] del player["profileIconId"] player["champion"] = self.champions[str(player["championId"])] player["spell1"] = self.summoner_spells[str( player["spell1Id"])] player["spell2"] = self.summoner_spells[str( player["spell2Id"])] return players return None
def get_summoner_mastery_info(self, summoner_name): summoner_id = RiotApi.get_summoner_id(summoner_name) if not summoner_id: return None mastery = RiotApi.get_champion_mastery_data(summoner_id) return mastery