From ebfab450b9bd102a9077305250b20da55c96b313 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 17 Oct 2023 21:19:52 -0500 Subject: [PATCH] Update players.py Update /player pagination to only fire with more than one card --- cogs/players.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/cogs/players.py b/cogs/players.py index b6a72d0..bb1384d 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -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)