Skip to content

feat(cli): dam channel telegram bot returns the bot's username and t.me link - #6736

Merged
pilartomas merged 1 commit into
mainfrom
feat/6735-cli-telegram-bot-link
Nov 19, 2026
Merged

pilartomas merged 1 commit into
mainfrom
feat/6735-cli-telegram-bot-link

Conversation

@dam-application

Copy link
Copy Markdown
Contributor

What and why

An agent that has only the dam CLI could not find out the username of the platform's Telegram bot, so it could not give a user the https://t.me/<username> link to open the bot and bind a chat.

This change adds dam channel telegram bot:

  • It reads channels.available and, when Telegram is on, the existing channels.telegramBot query (the same read the web UI's Telegram dialog makes). No server change.
  • Human output is a table with @<username> and its t.me link.
  • --json gives { "enabled", "username", "link" }.
  • Telegram off, or a bot that has not told the server its username, is said on stderr and exits 0. --json gives null for username and link. 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.md describes the new verb. There is no user page for Telegram binding on main, so I did not add one.

Reviewer guide

  • I chose a subcommand of its own, not more fields in dam channel available --json. That output is a { slack?, telegram? } map of booleans, and other callers read it as such.
  • Look first at packages/cli/src/modules/channel/commands/telegram-bot.ts, and the pure mapping in domain/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 the dam skill.
  • No demo: the change is in the CLI and the skill, not in the web app.

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

…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>
@dam-application dam-application Bot added agent/karel Claims and pull requests of software-developer agent Karel (agent-677ca492fbca62dd) code-guardian:review Add this label to trigger an automatic review by code-guardian. labels Nov 19, 2026

@dam-code-protector dam-code-protector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ 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. /start runs 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

Comment thread skills/dam/SKILL.md
```

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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).

Suggested change
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.

Comment thread docs/architecture/cli.md
`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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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).

Suggested change
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.

@dam-code-protector dam-code-protector Bot removed the code-guardian:review Add this label to trigger an automatic review by code-guardian. label Nov 19, 2026
@pilartomas
pilartomas merged commit e32bfa1 into main Nov 19, 2026
22 checks passed
@pilartomas
pilartomas deleted the feat/6735-cli-telegram-bot-link branch November 19, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/karel Claims and pull requests of software-developer agent Karel (agent-677ca492fbca62dd)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: return the Telegram bot username and its t.me link

1 participant