Telegram
Anyy connects to Telegram through a bot token and the Bot API long-polling profile. It supports direct messages, groups, inbound media, pairing, and live health checks.
1. Create a Telegram Bot
In Telegram, open the official BotFather account:
- Send
/newbot. - Choose the bot's display name and username.
- Copy the bot token once.
- Review BotFather privacy/group settings if you will add the bot to groups.
Treat the token as a password. Anyone who has it can act as the bot.
2. Add the Account in Anyy
Open Dashboard → Channels → Add channel → Telegram. Choose the Bot API long-polling profile, enter an account label and bot token, then review access policies before enabling.
CLI setup is also available:
anyy setup channel telegram
The setup flow stores the token as a Profile secret reference and verifies the remote identity with Telegram getMe before the adapter becomes healthy.
3. Choose Access Policies
Default policies are:
| Conversation | Default |
|---|---|
| Direct messages | pairing |
| Groups | mention |
Direct-message policy can be open, allowlist, pairing, or disabled. Group policy can be mention, allowlist, open, pairing, or disabled. Allowlist values use Telegram numeric user or chat identities shown by the channel setup/diagnostic surface.
An open bot can spend provider quota and expose tools to unexpected senders. Confirm approval and tool policies before widening access.
4. Start and Verify
anyy channel reload
anyy channel doctor telegram
Then send the bot a direct message. With the default pairing policy, approve the pending sender in Dashboard → Channels, or list and approve it from the CLI:
anyy channel pairing list --channel telegram
anyy channel pairing approve --request REQUEST_ID
After approval, send another message and confirm that Anyy replies in the same Telegram conversation.
Groups and Mentions
Add the bot to a group and use its @username with the default mention policy. If Telegram privacy settings prevent the bot from receiving the intended group messages, adjust them in BotFather and re-add/reload the bot as required by Telegram.
Telegram threads are not claimed by the current adapter; do not rely on topic-specific routing.
Media and Long Replies
Anyy can stage supported inbound Telegram media for the session. Long outbound text is split to the configured chunk size. Media download and message size still depend on Telegram and the Profile's configured limit.
Troubleshooting
| Symptom | Check |
|---|---|
| Token is rejected | Regenerate/copy the BotFather token and replace the saved credential |
| Bot stays in backoff | Run anyy channel doctor telegram; verify getMe and network access to Bot API |
| DM receives pairing notice but no answer | Approve the pending request, then send a new message |
| Group message is ignored | Mention the bot, check group policy/allowlist, and review BotFather privacy mode |
| Duplicate/old messages appear | Inspect long-poll health and reload; Anyy persists the Telegram update offset |
For shared channel controls, see Messaging Platforms.