Register bot commands (setMyCommands) + /help handler #3
Labels
No labels
epic
in-review
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
weiwen/evie#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Make commands discoverable in Telegram's menu and add a
/helphandler. Highest-value interaction affordance; no new update type.Current state
/clearis the only command, handled by a rawtext == "/clear"string match inhandle_message(src/telegram/mod.rs:54)./help;/startand any other slash-command fall through and are sent to pi as a literal prompt.Scope
setMyCommandsonce at startup inrun()(global scope — single-user + allowlist, so scope is irrelevant). Register/helpand/clearonly./helphandler: static reply describing what evie is + the command list./startby aliasing to/help, but do not register it in the command menu (avoids Telegram's auto Start button being forwarded to pi as a literal prompt)./clearcheck into a small command dispatch so adding handlers isn't ad-hoc string comparisons./that isn't a known command gets a one-line "unknown command — try /help" reply and is not forwarded to pi (stops pi receiving noise like/claer). Non-slash text is unaffected.Acceptance
/helpand/clear(not/start)./helpand/startboth return the help text; neither reaches pi./clearstill resets the session./foo) gets the hint reply and never reaches pi.Implemented bot command registration and /help handler:
All 24 tests pass (). File changed:
Implemented bot command registration and /help handler:
All 24 tests pass (cargo test). File changed: src/telegram/mod.rs