Repository navigation
feat(cli): dam channel telegram bot returns the bot's username and t.me link - #6736
Conversation
…me link An agent with only the CLI can now hand a user the link to open the platform's Telegram bot and bind a chat. Telegram off, or a bot with no known username, is said and exits 0; --json gives null for both. The dam skill tells the agent to send that link in the Telegram flow. Fixes #6735 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🛡️ Code Guardian 🛡️ — ✅ Code Review @ f92ffa7
PR #6736: feat(cli): dam channel telegram bot returns the bot's username and t.me link
Author: dam-application[bot] | Branch: feat/6735-cli-telegram-bot-link → main | Changes: +317 −2 (7 files)
Summary
The PR adds dam channel telegram bot. The command reads the existing Telegram bot query and prints the bot's username and its t.me link, also under --json. The dam skill now tells an agent to send that link with the bind steps.
Limits: 1 skill(s) did not run: react-ui-engineering.
1 suggestion(s) dropped under the 🟢 budget.
Findings
- 🟢 Start button step (
skills/dam/SKILL.md:494) - 🟢 tRPC name on the CLI page (
docs/architecture/cli.md:144) - ✅ Looks good: The skill's bind steps match the server.
/startruns the bind flow, only group admins can bind a group, and the bind flow lives 10 minutes (OAUTH_FLOW_TTL_MS).
Documentation Check (doc-drift)
✅ No findings.
Issue Fit
✅ No findings.
TypeScript Engineering Review
✅ No findings.
Verdict
APPROVE — No blocking finding; the two suggestions are text edits.
Review by Code Guardian 🛡️ · automated code guardian · ibm/aws/claude-opus-5-5 on pi
| ``` | ||
|
|
||
| A Telegram chat is bound from inside the chat with the bind command, not from the CLI. | ||
| When the user asks to connect an agent on Telegram, run `dam channel telegram bot --json` and send them its `link`, the bot's `https://t.me/<username>` page, with the steps: for a private chat, open the link and press **Start**; for a group, add the bot to it and send `/bind` there, which only a group admin can; then follow the link the bot posts and pick the agent within about 10 minutes. |
There was a problem hiding this comment.
🟢 Suggestion: Telegram shows the Start button only in a chat with no history. A user who opened the bot before sees no button, so this step stops there. The web dialog tells every chat to send /bind (packages/ui/src/modules/sandboxes/components/channels/messenger-instructions.tsx:44-46).
| When the user asks to connect an agent on Telegram, run `dam channel telegram bot --json` and send them its `link`, the bot's `https://t.me/<username>` page, with the steps: for a private chat, open the link and press **Start**; for a group, add the bot to it and send `/bind` there, which only a group admin can; then follow the link the bot posts and pick the agent within about 10 minutes. | |
| When the user asks to connect an agent on Telegram, run `dam channel telegram bot --json` and send them its `link`, the bot's `https://t.me/<username>` page, with the steps: for a private chat, open the link and press **Start**, or send `/bind` when the chat shows no **Start** button; for a group, add the bot to it and send `/bind` there, which only a group admin can; then follow the link the bot posts and pick the agent within about 10 minutes. |
| `channel slack-dm status|connect|disconnect` is the DM Bridge ([channels](channels.md)): `status` is read-only, sending nothing and binding nothing, and reports whether the owner's Slack account is linked, pairable by verified email, off, or unavailable with the reason; `connect <agent> [--purpose <text>]` binds that Agent to the owner's own 1:1 DM with the bot, as the DM's default only while it has none, and posts one hello naming what the Agent sends and how to undo it; `disconnect <agent>` releases the binding, the threads its sessions owned there, and only an `email` pairing. | ||
| An ambient or channel history connect against a server that doesn't understand it fails loud rather than silently landing without it. | ||
| Telegram binds in-chat (`/bind`), so it has no CLI verb. | ||
| Telegram binds in-chat (`/bind`), so it has no CLI verb; `channel telegram bot` reports the install's bot — its username and `https://t.me/<username>` link, the same `channels.telegramBot` read the web UI's Telegram dialog makes — so an Agent with only the CLI can hand a user the link to open; Telegram off, or a bot that has not told the server its name, is said, not an error, and `--json` gives null for both. |
There was a problem hiding this comment.
🟢 Suggestion: This line names the tRPC procedure channels.telegramBot. The page keeps procedure names in the code (docs/architecture/cli.md:121). Reported by Documentation Check (doc-drift).
| Telegram binds in-chat (`/bind`), so it has no CLI verb; `channel telegram bot` reports the install's bot — its username and `https://t.me/<username>` link, the same `channels.telegramBot` read the web UI's Telegram dialog makes — so an Agent with only the CLI can hand a user the link to open; Telegram off, or a bot that has not told the server its name, is said, not an error, and `--json` gives null for both. | |
| Telegram binds in-chat (`/bind`), so it has no CLI verb; `channel telegram bot` reports the install's bot — its username and `https://t.me/<username>` link, the same read the web UI's Telegram dialog makes — so an Agent with only the CLI can hand a user the link to open; Telegram off, or a bot that has not told the server its name, is said, not an error, and `--json` gives null for both. |
What and why
An agent that has only the
damCLI could not find out the username of the platform's Telegram bot, so it could not give a user thehttps://t.me/<username>link to open the bot and bind a chat.This change adds
dam channel telegram bot:channels.availableand, when Telegram is on, the existingchannels.telegramBotquery (the same read the web UI's Telegram dialog makes). No server change.@<username>and itst.melink.--jsongives{ "enabled", "username", "link" }.--jsongivesnullforusernameandlink. When Telegram is off, the bot is not asked for.skills/dam/SKILL.md→ Channels now tells the agent to run the command when a user asks to connect on Telegram, and to send the link with the bind steps (private chat: open and press Start; group: add the bot and send/bind, admins only; then pick the agent on the page the bot links, within about 10 minutes).docs/architecture/cli.mddescribes the new verb. There is no user page for Telegram binding on main, so I did not add one.Reviewer guide
dam channel available --json. That output is a{ slack?, telegram? }map of booleans, and other callers read it as such.packages/cli/src/modules/channel/commands/telegram-bot.ts, and the pure mapping indomain/telegram-bot.ts.How it was verified
packages/cli/src/__tests__/channel-telegram-bot.integration.test.ts: the real router behind a fake context. It covers Telegram on (table and--json), Telegram off (message, exit 0, nulls, no bot read), and Telegram on with no known username.mise run check; the CLI test suite (82 files, 806 tests); the four api-server unit test files that read thedamskill.Fixes #6735
Written by this agent — https://dam-dev.apps.dam-cl.fmaas.res.ibm.com/a/agent-677ca492fbca62dd?s=c144fb44-54b3-435f-9536-4bbe006b47fc
🤖 Generated with Claude Code