reformatting done :)

This commit is contained in:
s-prechtl 2022-03-21 02:43:00 +01:00
parent 6ddb040f89
commit 241219b575
2 changed files with 34 additions and 49 deletions

View file

@ -4,6 +4,7 @@ import discord
import riotwatcher
import APICommands.Command
from APICommands.Command import getSummonerNameFromMessage, getChampionsJSON, championIdToName
class Free2Play(APICommands.Command.Command, ABC):
@ -16,10 +17,41 @@ class Free2Play(APICommands.Command.Command, ABC):
super().__init__(pref, api, region, additionalKeywords)
async def execute(self, message: discord.Message):
pass
sumname = ""
output = "Derzeitige F2P Champions"
rot = self.api.champion.rotations(self.region)["freeChampionIds"]
championsJSON = getChampionsJSON()
try:
sumname = getSummonerNameFromMessage(message, 1)
except:
await self.usage(message)
if sumname != "":
if not await self.checkSumname(sumname, message):
return
output += " auf denen **" + sumname + "** noch keine Punkte hast: \n"
response = self.api.champion_mastery.by_summoner(self.region,
self.api.summoner.by_name(self.region,
sumname)["id"])
allIds = []
for i in response:
allIds.append(i["championId"])
for i in rot:
if i not in allIds:
output += ("\t- **" + championIdToName(i, championsJSON) + "**\n")
else:
output += ":\n"
for i in rot:
output += ("\t- **" + championIdToName(i, championsJSON) + "**\n")
await message.channel.send(output)
if len(output.split("\n")) <= 2:
await message.channel.send("\t- **Keine**")
async def info(self, message: discord.Message):
pass
async def usage(self, message: discord.Message):
pass
await message.channel.send("Wrong usage of" + self.commandName + "!\nUsage: " + self.pref + "f2p [Summoner ("
"optional)]")