This commit is contained in:
Sakimori 2022-09-18 12:37:55 -04:00
parent 793c67da11
commit 03ab7c24bd

View file

@ -277,12 +277,12 @@ Short name: {arch.name}
class ViewArchetypesCommand(Command): class ViewArchetypesCommand(Command):
name = "teamarchetypes" name = "teamarchetypes"
template = "m;teamarchetypes [team name]" template = "teamarchetypes [team name]"
description = "Lists the current archetypes on the given team." description = "Lists the current archetypes on the given team."
@client.tree.command() @client.tree.command()
@app_commands.rename(team_name="team") @app_commands.rename(team_name="team")
async def teamarchetypes(interaction, team_name): async def teamarchetypes(interaction, team_name: str):
team = get_team_fuzzy_search(team_name) team = get_team_fuzzy_search(team_name)
if team is None: if team is None:
raise CommandError("We can't find that team, boss.") raise CommandError("We can't find that team, boss.")
@ -299,7 +299,7 @@ async def teamarchetypes(interaction, team_name):
class ImportCommand(Command): class ImportCommand(Command):
name = "import" name = "import"
template = "m;import [onomancer collection URL]" template = "m;import [onomancer collection URL]"
description = "Imports an onomancer collection as a new team. You can use the new onomancer simsim setting to ensure compatibility. Similarly to saveteam, you'll get a team embed with a prompt to confirm, hit the 👍 and your team will be saved!" description = "Imports an onomancer collection as a new team. You can use the new onomancer simsim setting to ensure compatibility. Similarly to saveteam, you'll get a team embed with a prompt to confirm, hit the 👍 and your team will be saved! Only functions in bot DMs."
async def execute(self, msg, command, flags): async def execute(self, msg, command, flags):
team_raw = ono.get_collection(command.strip()) team_raw = ono.get_collection(command.strip())
@ -318,13 +318,14 @@ class ShowTeamCommand(Command):
template = "m;showteam [name]" template = "m;showteam [name]"
description = "Shows the lineup, rotation, and slogan of any saved team in a discord embed with primary stat star ratings for all of the players. This command has fuzzy search so you don't need to type the full name of the team as long as you give enough to identify the team you're looking for." description = "Shows the lineup, rotation, and slogan of any saved team in a discord embed with primary stat star ratings for all of the players. This command has fuzzy search so you don't need to type the full name of the team as long as you give enough to identify the team you're looking for."
async def execute(self, msg, command, flags): @client.tree.command()
team_name = command.strip() @app_commands.rename(team_name="team")
team = get_team_fuzzy_search(team_name) async def showteam(interaction, team_name: str):
if team is not None: team = get_team_fuzzy_search(team_name)
await msg.channel.send(embed=build_team_embed(team)) if team is not None:
return await interaction.response.send_message(embed=build_team_embed(team))
raise CommandError("Can't find that team, boss. Typo?") return
raise CommandError("Can't find that team, boss. Typo?")
class ShowAllTeamsCommand(Command): class ShowAllTeamsCommand(Command):
name = "showallteams" name = "showallteams"
@ -1613,8 +1614,7 @@ commands = [
RemovePlayerCommand(), RemovePlayerCommand(),
ReplacePlayerCommand(), ReplacePlayerCommand(),
DeleteTeamCommand(), DeleteTeamCommand(),
ShowTeamCommand(), ShowTeamCommand(), #done
ShowAllTeamsCommand(),
SearchTeamsCommand(), SearchTeamsCommand(),
StartGameCommand(), #done StartGameCommand(), #done
StartRandomGameCommand(), #done StartRandomGameCommand(), #done