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)) all_embeds.extend(await get_card_embeds(x, include_stats=True))
logging.debug(f'embeds: {all_embeds}') logging.debug(f'embeds: {all_embeds}')
await interaction.edit_original_response(content=f'# {all_players["players"][0]["p_name"]}') if len(all_embeds) > 1:
await embed_pagination( await interaction.edit_original_response(content=f'# {all_players["players"][0]["p_name"]}')
all_embeds, await embed_pagination(
interaction.channel, all_embeds,
interaction.user, interaction.channel,
timeout=20, interaction.user,
start_page=0 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.command(name='record', description='Display team record against AI teams')
@app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME) @app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME)