Graceful draft cancellation

This commit is contained in:
Cal Corum 2023-03-28 12:07:37 -05:00
parent 5850672e05
commit 91f1b028a5
2 changed files with 3 additions and 1 deletions

View File

@ -810,6 +810,8 @@ class Players(commands.Cog):
try: try:
await gauntlets.run_draft(interaction, main_team, this_event, draft_team) await gauntlets.run_draft(interaction, main_team, this_event, draft_team)
except ZeroDivisionError as e:
return
except Exception as e: except Exception as e:
logging.error(f'Failed to run {event_name} draft for the {main_team["sname"]}: {e}') logging.error(f'Failed to run {event_name} draft for the {main_team["sname"]}: {e}')
draft_team = db_get('teams', params=[('abbrev', f'Gauntlet-{main_team["abbrev"]}')]) draft_team = db_get('teams', params=[('abbrev', f'Gauntlet-{main_team["abbrev"]}')])

View File

@ -204,7 +204,7 @@ async def run_draft(interaction: discord.Interaction, main_team, this_event, dra
if not view.value: if not view.value:
await interaction.edit_original_response(content=None, embed=intro_embed, view=None) await interaction.edit_original_response(content=None, embed=intro_embed, view=None)
await interaction.channel.send('You\'ll be back') await interaction.channel.send('You\'ll be back')
return raise ZeroDivisionError()
def get_embeds(include_links=True): def get_embeds(include_links=True):
top_embed = helpers.get_team_embed(f'{embed_title} - Round {round_num}') top_embed = helpers.get_team_embed(f'{embed_title} - Round {round_num}')