Skip to content

feat(commands): improve slash-command UX#58

Open
Haibread wants to merge 2 commits into
mainfrom
claude/improve-ui-ux-292Mm
Open

feat(commands): improve slash-command UX#58
Haibread wants to merge 2 commits into
mainfrom
claude/improve-ui-ux-292Mm

Conversation

@Haibread

@Haibread Haibread commented May 3, 2026

Copy link
Copy Markdown
Owner

Summary

Polish the user-facing surface of the bot — the slash commands.

  • /help now shows the command list and template field reference instead of a placeholder. Sourced from a new channels.TemplateHelp constant so the field list has a single source of truth.
  • /create-primary surfaces the underlying error (template parse/execute error, Discord API error on creation) instead of collapsing every failure to "An error occurred while testing the template", so users can tell which field is broken and why.
  • All replies are now ephemeral (MessageFlagsEphemeral) — command output no longer clutters the channel for everyone.
  • /ping and the /create-primary success message render as embeds with separate fields.
  • Fix hearbeat typo in /ping output.

No command schema changes, so ApplicationCommandBulkOverwrite won't churn registrations.

Test plan

  • go vet ./...
  • go test -race ./...
  • go build ./...
  • Run the bot in a test guild and verify:
    • /ping shows an ephemeral embed with the Command delay and Gateway heartbeat fields
    • /help shows an ephemeral embed listing commands, template fields, and examples
    • /create-primary default-name:foo template:{{.Bogus}} reports the underlying template error rather than a generic message
    • /create-primary without Manage Channels still reports the permission error
    • Successful /create-primary shows the embed with default-name and template fields and creates the channel

https://claude.ai/code/session_016tkC9bxfpYhFtrVQFp2vZa


Generated by Claude Code

claude added 2 commits May 3, 2026 08:37
- /help now shows the command list and template field reference instead
  of a placeholder
- /create-primary surfaces the underlying template/Discord error so users
  can tell what they got wrong
- Replies are now ephemeral (visible only to the invoking user) so
  command output no longer clutters channels
- /ping and the create-primary success message use embeds with separate
  fields
- Fix "hearbeat" typo in /ping output

https://claude.ai/code/session_016tkC9bxfpYhFtrVQFp2vZa
Commands & interactions:
- Defer slow /create-primary and /delete-primary interactions so users
  never see "the application did not respond" if Discord is slow
- Autocomplete the /create-primary template option with common presets
- /help takes an optional topic (commands|template) for focused output
- New /list-primaries shows registered primaries with active secondary
  counts; new /delete-primary removes a managed primary (refuses if it
  still has live secondaries to avoid orphaning channels)
- Consistent embed color across all replies

Bot configuration:
- New bot_activity_type config (Playing/Listening/Watching/Competing/
  Streaming) so the bot's status verb is no longer hard-coded

Live name updates:
- New presence-update handler triggers an immediate rename when a user's
  game changes; both it and the periodic sweep go through one per-channel
  throttle so we stay within Discord's 2-renames-per-10-min limit
- Throttle entries are cleared when a secondary channel is deleted so the
  map doesn't accumulate dead IDs

Template engine:
- {{.PartySize}} now returns the real voice-state user count instead of
  the "N/A" placeholder
- getNamefromTemplate split into resolveGameName / resolvePartySize /
  parentChannelID; error paths return early instead of falling through
- getMainActivity tie-breaks deterministically (count desc, name asc)
  via a new pure mostCommon helper, with unit tests
- Nil-presence guards in getMainActivity / getMainActivityUser

Docs:
- README config table includes bot_activity_type
- README troubleshooting section covers presence intent, rename rate
  limits, missing bot permissions, refusal to delete primaries with
  live secondaries, and template parse errors

https://claude.ai/code/session_016tkC9bxfpYhFtrVQFp2vZa
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.

2 participants