reformatting done :)
This commit is contained in:
parent
6ddb040f89
commit
241219b575
2 changed files with 34 additions and 49 deletions
|
|
@ -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)]")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue