Before you start
- A Telegram account (telegram.org/apps).
- AG2 Space installed and signed in on your Mac (desktop.ag2.space).
1
Start a chat with BotFather
Search Telegram for BotFather and open the result with the blue verified checkmark (@BotFather); the others are lookalikes. Tap Start, then send
/newbot.2
Pick a name and a username
BotFather asks for a display name (anything) and a username, which must be unique across Telegram and end in
bot, for example lucy_sutando_bot. It then replies with a token of the form 123456789:ABCdefGHIjklMNOpqrSTUvwxYZ.3
Paste the token into AG2 Space
Copy the token. In AG2 Space open Settings → Channels, paste it into Telegram bot token and click Save at the bottom. The field shows a running badge once the agent connects. The token is stored locally on your Mac.
4
Say hi
Open your bot in Telegram, tap START (or send
/start), then send “hello”. The first time, the local services may take a minute or two to pick up the new bridge.How Sutando knows it is you
The first person to DM a fresh bot is enrolled as the owner: their Telegram user ID is written to~/.claude/channels/telegram/access.json, and DMs from anyone else are dropped by default. To allow another person, run this in the agent terminal:
Troubleshooting
"Username is invalid" or "already taken"
"Username is invalid" or "already taken"
It must end in
bot (any case) and be globally unique. Add your name or the year and try again.The bot does not reply
The bot does not reply
AG2 Space must be running on your Mac; Telegram reaches it by long-polling. If it is running, the token may have been truncated: copy it again from BotFather, paste, Save.
Adding the bot to a group
Adding the bot to a group
Add it as a member and @mention it. By default Telegram’s privacy mode shows a bot only messages that mention or reply to it;
/setprivacy → your bot → Disable in BotFather lets it see every message.I lost the token
I lost the token
In BotFather send
/mybots, pick the bot and tap API Token. /revoke rotates it.