fix(commands): route slash commands to GeekBot instead of Rocket.cat#42
Open
sunba91-su wants to merge 1 commit into
Open
fix(commands): route slash commands to GeekBot instead of Rocket.cat#42sunba91-su wants to merge 1 commit into
sunba91-su wants to merge 1 commit into
Conversation
Register /standup as a client-only slash command via POST commands.register so Rocket.Chat delivers the message to the room instead of intercepting it. Add !standup prefix as a fallback for environments where registration is unavailable (e.g., insufficient permissions). Closes #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #41 — slash commands starting with
/standupwere intercepted by Rocket.Chat server (unknown command) and responded to by Rocket.cat instead of GeekBot.Root Cause
Rocket.Chat processes messages starting with
/server-side. Unregistered commands are rejected with "Invalid command" and never delivered to the room — GeekBots DDP subscription never receives the message.Changes
1.
internal/rocket/client.go— RegisterSlashCommand()Calls
POST /api/v1/commands.registerwith{"command": "standup", "clientOnly": true}. This tells the server the command is valid — the message is delivered to the room for GeekBot to pick up via its existing DDP subscription.2.
internal/commands/registry.go— Support!standupprefixDispatch()now accepts both/standupand!standupprefixes. This is the fallback — ifcommands.registerfails (insufficient permissions, old server), users can type!standup helpand it works immediately.3.
cmd/bot/main.go— Register at startupAttempts registration on connect. Non-fatal on failure — logs a warning and continues.
4.
internal/commands/help.go— Updated help textMentions both
/standupand!standupprefixes.Verification
go build ./...— passesgo test -race ./...— passesgo vet ./...— passesDo not merge — waiting for user review.