Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions website/docs/user-guide/messaging/telegram.md
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,32 @@ With `guest_mode: true`, a message from a non-allowlisted group is processed **o

DMs and allowlisted groups behave exactly as before.

### Native guest replies (Bot API 10.0)

Telegram's Bot API 10.0 added **Guest Bots**: a bot can receive an `@mention` from a group it has never joined via a `guest_message` update, and reply to it exactly once via `answerGuestQuery`. This is the delivery mechanism behind `guest_mode: true` above — when your bot's Telegram client library and Bot API version support it, Hermes uses it automatically. There's no separate config flag; it's covered by the same `guest_mode: true` setting.

**How a reply looks to the user:**

1. Someone @mentions the bot in a group it isn't a member of.
2. The bot immediately posts a placeholder (a short "⏳ Thinking..." style message) — guest replies are one-shot and Telegram expects a fast acknowledgement.
3. Once the agent finishes processing, that placeholder is edited in place with the final answer.

**Media in guest replies.** A `guest_message` reply can only carry text and buttons — Telegram doesn't allow pushing a file directly into it. If the agent's reply includes a file (image, audio, video, document), Hermes instead edits the placeholder to a **"✅ Ready — tap to receive"** button. Tapping it sends a fresh `guest_message` carrying a one-time delivery token; the bot answers that one with the actual file, delivered inline as a cached-file result. This two-step dance is purely a side effect of the one-shot `answerGuestQuery` constraint — from the user's side it's just "tap the button to get the file."

This requires one more setting: a home chat the bot **is** a member of, used to stage the file before Telegram will let it be reused as a cached inline result. This can be a group/channel (negative id) or simply your own private DM with the bot (positive id) — any chat the bot can already message works.

```bash
TELEGRAM_HOME_CHANNEL="123456789" # e.g. your own DM with the bot, or a group/channel id
```

Without `TELEGRAM_HOME_CHANNEL` set, guest-mode media delivery falls back to a text-only reply (no button, no file).

**Limitations:**

- Delivery tokens expire **10 minutes** after the button is posted. Tapping "tap to receive" after that shows an error instead of the file — just ask again.
- Tapping the same button more than once re-delivers the file rather than erroring, as long as it's still within the 10-minute window.
- Same as plain `guest_mode`: no session stickiness. Every guest interaction — including tapping the deliver button — is its own one-shot exchange; the bot doesn't remember prior guest turns between mentions.

## Slash Command Access Control

By default, every allowed user can run every slash command. To split your allowlist into **admins** (full slash command access) and **regular users** (only commands you explicitly enable), add `allow_admin_from` and `user_allowed_commands` to the platform's `extra` block:
Expand Down
Loading