From f05270e066e7467d851cceda7f9a3a8f270a7726 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sat, 22 Apr 2023 16:19:38 -0500 Subject: [PATCH] Update players.py Injury gif updates --- cogs/players.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/cogs/players.py b/cogs/players.py index 90e9dfa..ed88cb6 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -3096,21 +3096,30 @@ class Players(commands.Cog): logging.info(f'injury rating: {rating.value}p{games.value} / array: {injury_list}[{injury_roll - 2}] / result: {injury_result}') if isinstance(injury_result, int): - await interaction.edit_original_response( - content=random_gif(random_from_list(['salute', 'press f', 'pay respects'])) - ) + try: + await interaction.edit_original_response( + content=random_gif(random_from_list(['salute', 'press f', 'pay respects'])) + ) + except Exception as e: + logging.info(f'failed to post funny gif') injury_string += f'With a roll of {injury_roll}, the injury length is **{injury_result} ' \ f'game{"s" if injury_result > 1 else ""}**.' elif injury_result == 'REM': - await interaction.edit_original_response( - content=random_gif(random_from_list(['could be worse', 'not too bad'])) - ) + try: + await interaction.edit_original_response( + content=random_gif(random_from_list(['could be worse', 'not too bad'])) + ) + except Exception as e: + logging.info(f'failed to post funny gif') injury_string += f'With a roll of {injury_roll}, the injury length is **REMAINDER OF GAME** for batters ' \ f'or **FATIGUED** for pitchers' else: - await interaction.edit_original_response( - content=random_gif(random_from_list(['it is fine', 'nothing to see here', 'i wasn\'t worried'])) - ) + try: + await interaction.edit_original_response( + content=random_gif(random_from_list(['it is fine', 'nothing to see here', 'i wasn\'t worried'])) + ) + except Exception as e: + logging.info(f'failed to post funny gif') injury_string += f'With a roll of {injury_roll}, the player is **OKAY** - no injury!' embed = await self.get_dice_embed(