From 7d0dc57bf8c26a24a0aae4d84806d87b591ac3c2 Mon Sep 17 00:00:00 2001 From: Eli Date: Sun, 27 Dec 2020 04:32:19 -0500 Subject: [PATCH] Make showteam a little more forgiving --- the_prestige.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/the_prestige.py b/the_prestige.py index 2d0f14a..2512d56 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -192,13 +192,17 @@ class ShowTeamCommand(Command): template = "m;showteam [name]" description = "You can view any saved team with this command" - async def execute(self, msg, command): - team = games.get_team(command.strip()) + team_name = command.strip() + team = games.get_team(team_name) if team is not None: await msg.channel.send(embed=build_team_embed(team)) else: - await msg.channel.send("Can't find that team, boss. Typo?") + teams = games.search_team(team_name.lower()) + if len(teams) == 1: + await msg.channel.send(embed=build_team_embed(teams[0])) + else: + await msg.channel.send("Can't find that team, boss. Typo?") class ShowAllTeamsCommand(Command): name = "showallteams"