Skip to content

Enable slash command support for all party cog commands#143

Open
Claude wants to merge 3 commits into
mainfrom
claude/enable-hybrid-commands-for-party-cog
Open

Enable slash command support for all party cog commands#143
Claude wants to merge 3 commits into
mainfrom
claude/enable-hybrid-commands-for-party-cog

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 21, 2026

The party cog commands were using the legacy @commands.command() and @commands.group() decorators, which only support text-based commands. This prevents users from discovering and using party commands through Discord's native slash command interface.

Changes

  • Main command group: Converted @party.command@party.hybrid_command for all 7 subcommands (create, delete, list, config, description, settime, rename-option)
  • Template subgroup: Converted @party.group(name="template")@party.hybrid_group(name="template") and all 6 template subcommands to @party_template.hybrid_command

All commands now work with both traditional text commands ([p]party create) and Discord slash commands (/party create) while maintaining backward compatibility with existing usage patterns.

# Before
@party.command(name="create")
async def party_create(self, ctx, ...):
    ...

# After  
@party.hybrid_command(name="create")
async def party_create(self, ctx, ...):
    ...

@psykzz
Copy link
Copy Markdown
Owner

psykzz commented Apr 21, 2026

@copilot fix the linting Failed to import party: 'HybridGroup' object has no attribute 'hybrid_command'

@psykzz psykzz marked this pull request as ready for review April 21, 2026 11:01
…n-existent .hybrid_command()/.hybrid_group()

Agent-Logs-Url: https://github.com/psykzz/cogs/sessions/0adbf7cb-0d3b-4316-81f8-9bbc801d31c9

Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

@copilot fix the linting Failed to import party: 'HybridGroup' object has no attribute 'hybrid_command'

Fixed in 47dd1bb. HybridGroup objects only have .command() and .group() methods — not .hybrid_command() or .hybrid_group(). Subcommands registered via .command() on a HybridGroup are automatically hybrid, so the slash support is preserved. Changed:

  • @party.hybrid_command(...)@party.command(...) for all 7 party subcommands
  • @party.hybrid_group(name="template")@party.group(name="template")
  • @party_template.hybrid_command(...)@party_template.command(...) for all 6 template subcommands

Copilot AI requested a review from psykzz April 21, 2026 11:06
@psykzz
Copy link
Copy Markdown
Owner

psykzz commented Apr 23, 2026

@copilot can you review this PR and fix and mistakes or issues?

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

@copilot can you review this PR and fix and mistakes or issues?

Reviewed and fixed in 2e01b30. Found one real bug: ctx.message.delete() was being called in party_create and party_template_use without guarding against slash command invocations where ctx.message is None. Added if not ctx.interaction: guards around both deletions so they only run for text commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants