From 77229d9fc5362fd7649e4779b0bcbe61eb037840 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:40:30 +0000 Subject: [PATCH 1/2] Initial plan From 23a78f7fbeb0a74d570f2a807e7740bc2a479daa Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:44:52 +0000 Subject: [PATCH 2/2] Add optional compact parameter to party embeds - Removed global EMBED_FIELD_INLINE constant - Added 'compact' boolean field to party data structure (default: False) - Updated create_party_embed to use party['compact'] for inline field setting - Added optional compact parameter to party_create command - Updated CreatePartyModal, party_template_use, and party_list to use compact setting - Default behavior is NOT compact (inline=False) for better readability Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com> --- party/party.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/party/party.py b/party/party.py index d609846..3f6cdde 100644 --- a/party/party.py +++ b/party/party.py @@ -13,9 +13,6 @@ # Discord embed field character limit EMBED_FIELD_MAX_LENGTH = 1024 -# Whether embed fields should be displayed inline -EMBED_FIELD_INLINE = False - class RoleSelectionModal(discord.ui.Modal): """Modal for selecting a role when signing up for a party (for freeform entry).""" @@ -264,6 +261,7 @@ async def on_submit(self, interaction: discord.Interaction): "channel_id": None, "message_id": None, "scheduled_time": scheduled_time, + "compact": False, # Default to not compact (inline=False) } # Initialize signups for each predefined role @@ -1180,6 +1178,9 @@ async def create_party_embed(self, party: dict, guild: discord.Guild = None) -> color=discord.Color.blue() ) + # Get the compact setting (inline fields) - default to False (not compact) + compact = party.get("compact", False) + # Show scheduled time if set scheduled_time = party.get("scheduled_time") if scheduled_time: @@ -1188,7 +1189,7 @@ async def create_party_embed(self, party: dict, guild: discord.Guild = None) -> embed.add_field( name="📅 Scheduled Time", value=f"\n()", - inline=EMBED_FIELD_INLINE + inline=compact ) except (ValueError, OSError): pass @@ -1209,7 +1210,7 @@ async def create_party_embed(self, party: dict, guild: discord.Guild = None) -> else: value = "-" - embed.add_field(name=role, value=value, inline=EMBED_FIELD_INLINE) + embed.add_field(name=role, value=value, inline=compact) # Add roles that have signups but aren't in the predefined list (freeform roles) for role, users in signups.items(): @@ -1219,11 +1220,11 @@ async def create_party_embed(self, party: dict, guild: discord.Guild = None) -> value = ', '.join(user_mentions) if len(value) > EMBED_FIELD_MAX_LENGTH: value = value[:EMBED_FIELD_MAX_LENGTH-3] + "..." - embed.add_field(name=role, value=value, inline=EMBED_FIELD_INLINE) + embed.add_field(name=role, value=value, inline=compact) # If no roles defined and no signups, show a message if not roles and not any(users for users in signups.values()): - embed.add_field(name="Signups", value="-", inline=EMBED_FIELD_INLINE) + embed.add_field(name="Signups", value="-", inline=compact) # Get owner name for footer owner_name = await self._get_user_display_name(party['author_id'], guild) @@ -1243,7 +1244,8 @@ async def party_create( self, ctx, name: Optional[str] = None, - roles: Optional[str] = None + roles: Optional[str] = None, + compact: Optional[bool] = False ): """Create a new party with predefined roles. @@ -1260,6 +1262,8 @@ async def party_create( The name of the party roles : Optional[str] Space or comma-separated list of roles (e.g., "Tank Healer DPS" or "Tank, Healer, DPS") + compact : Optional[bool] + Display party in compact mode (inline fields). Default is False (not compact). Examples: - [p]party create (opens interactive modal) @@ -1268,6 +1272,7 @@ async def party_create( - [p]party create "Game Night" "Player1 Player2 Player3 Player4" - [p]party create "PvP Team" "Warrior, Mage, Archer" - [p]party create "Siege" "Siege Crossbow, Energy Shaper, GA" + - [p]party create "Compact Party" "Tank Healer DPS" True """ # If no arguments provided, show the modal if name is None: @@ -1352,6 +1357,7 @@ async def modal_button_callback(interaction: discord.Interaction): "channel_id": None, "message_id": None, "scheduled_time": None, + "compact": compact, # Use the compact parameter from command } # Initialize signups for each predefined role @@ -1522,7 +1528,9 @@ async def party_list(self, ctx): f"{time_text}" f"{link_text}" ) - embed.add_field(name=party["name"], value=value, inline=EMBED_FIELD_INLINE) + # Use party's compact setting, default to False + compact = party.get("compact", False) + embed.add_field(name=party["name"], value=value, inline=compact) await ctx.send(embed=embed) @@ -1887,7 +1895,8 @@ async def party_template_list(self, ctx): roles_text = ', '.join(template['roles']) if len(roles_text) > EMBED_FIELD_MAX_LENGTH: roles_text = roles_text[:EMBED_FIELD_MAX_LENGTH - 3] + "..." - embed.add_field(name=label, value=roles_text, inline=EMBED_FIELD_INLINE) + # Templates list display is not compact by default + embed.add_field(name=label, value=roles_text, inline=False) await ctx.send(embed=embed) @@ -1945,6 +1954,7 @@ async def party_template_use(self, ctx, template_name: str, *, title: str): "channel_id": None, "message_id": None, "scheduled_time": None, + "compact": False, # Default to not compact } # Initialize signups for each predefined role