Skip to content

Enable slash command support for all party cog commands#143

Merged
psykzz merged 3 commits into
mainfrom
claude/enable-hybrid-commands-for-party-cog
May 27, 2026
Merged

Enable slash command support for all party cog commands#143
psykzz merged 3 commits into
mainfrom
claude/enable-hybrid-commands-for-party-cog

Conversation

@Claude

@Claude Claude AI commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

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

psykzz commented Apr 21, 2026

Copy link
Copy Markdown
Owner

@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

Copilot AI commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

@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

psykzz commented Apr 23, 2026

Copy link
Copy Markdown
Owner

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

Copilot AI commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@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.

Claude AI and others added 3 commits May 27, 2026 20:50
…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>
@psykzz psykzz force-pushed the claude/enable-hybrid-commands-for-party-cog branch from 2e01b30 to 3da76d2 Compare May 27, 2026 19:52
@psykzz psykzz merged commit 08d088e into main May 27, 2026
3 checks passed
@psykzz psykzz deleted the claude/enable-hybrid-commands-for-party-cog branch May 27, 2026 19:55
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