From f7b7867d50beef43bfb5546eefb10275dbddc6bf Mon Sep 17 00:00:00 2001 From: insert Date: Sat, 21 Jun 2025 11:55:52 -0400 Subject: [PATCH] fix: return immediately upon invalid team --- cogs/team.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogs/team.py b/cogs/team.py index 0234d1f..bca3525 100644 --- a/cogs/team.py +++ b/cogs/team.py @@ -263,6 +263,7 @@ class team(commands.Cog): )): if team not in teams_dict: await interaction.response.send_message("Invalid Team!", ephemeral=True) + return await interaction.response.defer() teamid = teams_dict[team] data = requests.get(f"https://mmolb.com/api/team/{teamid}").json() @@ -307,6 +308,7 @@ class team(commands.Cog): )): if team not in teams_dict: await interaction.response.send_message("Invalid Team!", ephemeral=True) + return await interaction.response.defer() teamid = teams_dict[team] data = requests.get(f"https://mmolb.com/api/team/{teamid}").json() @@ -356,6 +358,7 @@ class team(commands.Cog): async def teamstats(self, interaction: nextcord.Interaction, team: str): if team not in teams_dict: await interaction.response.send_message("Invalid Team!", ephemeral=True) + return await interaction.response.defer() teamid = teams_dict[team] loop = asyncio.get_event_loop()