Set it up
1
Create the bot
In Telegram, open @BotFather, send
/newbot and follow the prompts. BotFather answers with the bot token, a string like 123456:ABC-DEF….2
Find your user ID
The allow-list takes numeric user IDs, not usernames. Any “user info” bot in Telegram shows yours.
3
Configure ChatCLI
.env to keep them across sessions.4
Start the gateway
Environment variables
Shared settings (voice, images, size limits, the Conversation Hub) are on the Chat gateway page.
Who can reach the bot
A message from a user who is not on the list is dropped without a reply; the gateway logs the sender’s ID, which is a convenient way to find an ID you forgot to add.Messages
- Text and captions: the message text, or the caption of a photo or voice note when there is no text.
- Voice notes and audio files are downloaded (up to
CHATCLI_GATEWAY_MAX_AUDIO_BYTES, 20 MB by default) and transcribed before the agent runs; see Voice messages. - Images: the largest size of a photo, or a document whose type is an image. One image per message reaches the model.
- Replies are plain text. Telegram is sent no formatting mode, so Markdown in a reply shows as typed.
- Voice replies arrive as a native voice note when the reply audio is OGG (the default), or as an audio file otherwise, with the text as its caption. See Voice replies.
- Groups: a group is one conversation shared by its members. Forum topics are not distinguished; the bot answers in the group.
Limits
- A reply is cut at 3500 characters and ends with
…; the rest is not sent. - A reply that carries a voice note or an image uses its text as the caption, which Telegram limits to 1024 characters; no separate text message follows.
- Edited messages, channel posts and button callbacks are ignored.
Troubleshooting
The bot never answers
The bot never answers
/gateway statusshould listtelegram. If it does not,CHATCLI_TELEGRAM_BOT_TOKENis not set in the environment the daemon started with: set it and run/gateway stopthen/gateway start.- Check
~/.chatcli/gateway.logfor a “not in allow-list” line with your user ID. - A bot that has a webhook set on the Telegram side cannot also be long-polled. Remove the webhook (Bot API
deleteWebhook) if the bot was used with another service before.
The bot ignores messages in a group
The bot ignores messages in a group
By default Telegram bots in groups only receive commands and messages that mention them (privacy mode). Turn privacy mode off with BotFather (
/setprivacy) if the bot should see every message.Voice notes are not understood
Voice notes are not understood
See Voice messages:
/gateway status shows the transcription backend in use.See also
Chat gateway
How messages run, voice, images, continuity and the other channels.
Voice replies
Answer voice with voice, and how each conversation turns it on or off.