view archetypes

This commit is contained in:
Sakimori 2022-09-18 12:23:38 -04:00
parent 85cbc0ef8a
commit 793c67da11

View file

@ -280,19 +280,21 @@ class ViewArchetypesCommand(Command):
template = "m;teamarchetypes [team name]" template = "m;teamarchetypes [team name]"
description = "Lists the current archetypes on the given team." description = "Lists the current archetypes on the given team."
async def execute(self, msg, command, flags): @client.tree.command()
team = get_team_fuzzy_search(command.strip()) @app_commands.rename(team_name="team")
if team is None: async def teamarchetypes(interaction, team_name):
raise CommandError("We can't find that team, boss.") team = get_team_fuzzy_search(team_name)
elif team.archetypes == {}: if team is None:
raise CommandError("That team doesn't have any specializations set.") raise CommandError("We can't find that team, boss.")
elif team.archetypes == {}:
raise CommandError("That team doesn't have any specializations set.")
embed_string = "" embed_string = ""
for player_name, archetype in team.archetypes.items(): for player_name, archetype in team.archetypes.items():
embed_string += f"**{player_name}**:\n{archetype.display_name}\n\n" embed_string += f"**{player_name}**:\n{archetype.display_name}\n\n"
embed = discord.Embed(color=discord.Color.dark_green(), title=f"{team.name} Archetypes") embed = discord.Embed(color=discord.Color.dark_green(), title=f"{team.name} Archetypes")
embed.add_field(name="-",value=embed_string) embed.add_field(name="-",value=embed_string)
await msg.channel.send(embed=embed) await interaction.reaction.send_message(embed=embed)
class ImportCommand(Command): class ImportCommand(Command):
name = "import" name = "import"
@ -1602,8 +1604,8 @@ commands = [
ShowPlayerCommand(), #done ShowPlayerCommand(), #done
SaveTeamCommand(), #done SaveTeamCommand(), #done
AssignArchetypeCommand(), #done AssignArchetypeCommand(), #done
ViewArchetypesCommand(), ViewArchetypesCommand(), #done
ArchetypeHelpCommand(), ArchetypeHelpCommand(), #done
ImportCommand(), ImportCommand(),
SwapPlayerCommand(), SwapPlayerCommand(),
MovePlayerCommand(), MovePlayerCommand(),