Repository navigation
Conversation
/agents, /context, /status, /tasks and /recap, each verified present in Claude Code 2.1.233. Menu names are limited to lowercase letters, digits and underscores, so hyphenated commands cannot be listed here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
set_my_commands was only ever called for the default scope. A narrower scope wins over the default one, so a stale all_private_chats list left by an earlier setup keeps hiding the real menu, and all_group_chats was never written at all — a bot used from a group, and forum topics in particular, shows no "/" menu. Clear each scope that may hold a stale list, then register the full command list on the default, private and group scopes. Both calls tolerate failure so one rejected scope cannot stop startup. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Problem
set_my_commandsis only ever called for the default scope, anddelete_my_commandsonly clears that one.Telegram resolves a chat's command list from the most specific scope that
matches, so:
all_private_chatslist — left by BotFather or an earlier version —keeps overriding the default list in private chats, and nothing in ccbot
clears it;
all_group_chatsis never written at all, so a bot used from a group showsno "/" menu. Forum topics are where this bites hardest, since that menu is
the only discoverable way to reach the forwarded Claude Code commands.
Change
post_initnow clears each scope that may hold a stale list, then registersthe full command list on the default, private and group scopes. Both calls
tolerate a rejected scope so one failure cannot stop startup.
Also adds five Claude Code commands to
CC_COMMANDS—/agents,/context,/status,/tasksand/recap— each verified present in Claude Code2.1.233. Menu names are limited to lowercase letters, digits and underscores,
so hyphenated commands can't be listed as-is.
Verification
pytest(258 passed),pyright src/ccbot/clean,ruff format --checkclean.This registration has been running against a forum-topic supergroup for the
past few days, where the "/" menu previously did not appear at all.
Related
competing, though it touches the same registration code, and its
hyphen-to-underscore conversion would cover the naming limit noted above.
/killalone. It is advertised in the menu with nohandler behind it, but feat: implement /kill and auto-clean dead topic state #81 and Harden tmux session isolation, improve interactive pane capture reliability, and add /kill command #46 both already address that.