Update players.py
error handling
This commit is contained in:
parent
e72655d3dc
commit
a2608fd479
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user