diff --git a/APICommands/HighestMasteryCommand.py b/APICommands/HighestMasteryCommand.py index efbf272..f4fa538 100644 --- a/APICommands/HighestMasteryCommand.py +++ b/APICommands/HighestMasteryCommand.py @@ -28,37 +28,34 @@ class HighestMastery(APICommands.Command.Command, ABC): return listlen = int(message.content.split(" ")[1]) if firstIsInt else 10 try: - output = getChampionMasteryList(sumname, listlen) + output = self.getChampionMasteryList(sumname, listlen) for i in output: await message.channel.send(i) except: await self.usage(message) + async def info(self, message: discord.Message): + pass -async def info(self, message: discord.Message): - pass + async def usage(self, message: discord.Message): + await message.channel.send("Wrong usage of" + self.commandName + "!\nUsage: " + self.pref + "hm [count] [" + "Summonername]") - -async def usage(self, message: discord.Message): - await message.channel.send("Wrong usage of" + self.commandName + "!\nUsage: " + self.pref + "hm [count] [" - "Summonername]") - - -def getChampionMasteryList(sumname, listlen): - output = ["Der Spieler " + sumname + " hat den höchsten Mastery auf diesen " + str( - listlen) + " Champions\n"] - count = 0 - response = self.api.champion_mastery.by_summoner(self.region, self.getEncryptedSummonerID(sumname))[ - :listlen] - championsJSON = getChampionsJSON() - for i in response: - champname = championIdToName(i["championId"], championsJSON) - mpoints = i["championPoints"] - mastery = i["championLevel"] - out = "**" + champname + "**" + " Points: " + str(mpoints) + " Level: " + str( - mastery) + "\n" - if len(output[count]) + len(out) >= 2000: - output.append("") - count += 1 - output[count] += out - return output + def getChampionMasteryList(self, sumname, listlen): + output = ["Der Spieler " + sumname + " hat den höchsten Mastery auf diesen " + str( + listlen) + " Champions\n"] + count = 0 + response = self.api.champion_mastery.by_summoner(self.region, self.getEncryptedSummonerID(sumname))[ + :listlen] + championsJSON = getChampionsJSON() + for i in response: + champname = championIdToName(i["championId"], championsJSON) + mpoints = i["championPoints"] + mastery = i["championLevel"] + out = "**" + champname + "**" + " Points: " + str(mpoints) + " Level: " + str( + mastery) + "\n" + if len(output[count]) + len(out) >= 2000: + output.append("") + count += 1 + output[count] += out + return output