Update players.py

Update /player pagination to only fire with more than one card
This commit is contained in:
Cal Corum 2023-10-17 21:19:52 -05:00
parent 714c47b877
commit ebfab450b9

View File

@ -401,14 +401,17 @@ class Players(commands.Cog):
all_embeds.extend(await get_card_embeds(x, include_stats=True))
logging.debug(f'embeds: {all_embeds}')
await interaction.edit_original_response(content=f'# {all_players["players"][0]["p_name"]}')
await embed_pagination(
all_embeds,
interaction.channel,
interaction.user,
timeout=20,
start_page=0
)
if len(all_embeds) > 1:
await interaction.edit_original_response(content=f'# {all_players["players"][0]["p_name"]}')
await embed_pagination(
all_embeds,
interaction.channel,
interaction.user,
timeout=20,
start_page=0
)
else:
await interaction.edit_original_response(content=None, embed=all_embeds[0])
@app_commands.command(name='record', description='Display team record against AI teams')
@app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME)