Update players.py
card-lookup command
This commit is contained in:
parent
8788a02124
commit
e72655d3dc
@ -495,6 +495,24 @@ class Players(commands.Cog):
|
||||
|
||||
await interaction.edit_original_response(content=None, embed=embed)
|
||||
|
||||
@app_commands.command(name='card-lookup', description='Look up individual cards by ID')
|
||||
@app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME)
|
||||
async def card_lookup_command(self, interaction: discord.Interaction, card_id: int):
|
||||
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.'
|
||||
|
||||
await interaction.edit_original_response(
|
||||
content=c_string,
|
||||
embeds=await get_card_embeds(c_query)
|
||||
)
|
||||
else:
|
||||
await interaction.edit_original_response(content=f'No card found with id {card_id}')
|
||||
|
||||
@commands.hybrid_command(name='branding-pd', help='Update your team branding')
|
||||
@commands.has_any_role(PD_PLAYERS_ROLE_NAME)
|
||||
@commands.check(legal_channel)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user