mirror of
https://github.com/insertapp/mmolbbot.git
synced 2025-07-01 14:27:03 +00:00
fix: return immediately upon invalid team
This commit is contained in:
parent
78ded6d7b7
commit
f7b7867d50
1 changed files with 3 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue