From a2608fd479a9dfa2e5e03dc90e3254810c99257d Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 2 May 2023 12:23:22 -0500 Subject: [PATCH] Update players.py error handling --- cogs/players.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cogs/players.py b/cogs/players.py index b81a7d0..b6d0c26 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -501,10 +501,14 @@ class Players(commands.Cog): await interaction.response.defer() c_query = db_get('cards', object_id=card_id) if c_query: - c_string = f'Card ID {card_id} is a {c_query["player"]["description"]} owned by the ' \ - f'{c_query["team"]["sname"]}' - if c_query["pack"] is not None: - c_string += f' pulled from a {c_query["pack"]["pack_type"]["name"]} pack.' + c_string = f'Card ID {card_id} is a {c_query["player"]["description"]}' + if c_query['team'] is not None: + c_string += f' owned by the {c_query["team"]["sname"]}' + if c_query["pack"] is not None: + c_string += f' pulled from a {c_query["pack"]["pack_type"]["name"]} pack.' + else: + c_query['team'] = c_query["pack"]["team"] + c_string += f' used by the {c_query["pack"]["team"]["sname"]} in a gauntlet' await interaction.edit_original_response( content=c_string,