Angelia

A free tool from Angelia · Updated

Telegram bot token and chat id checker

Paste the token @BotFather gave you. The page asks Telegram who the bot is, and lists the chats that wrote to it in the last 24 hours, with their chat ids. Those ids are what a route in Angelia needs.

Your token stays in this browser. The page sends it only to api.telegram.org, which is how every Telegram bot talks to Telegram. There is no server of ours in between, no analytics on this page, and nothing is stored: reload the page and the token is gone. The page's security policy lets it connect to api.telegram.org and nowhere else.

From @BotFather: digits, a colon, then about 35 letters, digits, - and _. Paste the token; do not type it.

Stop Angelia, or any other program that polls this bot, first. Telegram gives a bot's updates to one reader at a time. A check interrupts the other program's open request: that program gets 409 Conflict. Angelia retries by itself; another program may not.

If Angelia already runs with this token, you do not need this page: a chat that is not in routing.yaml gets no answer, and ~/.angelia/daemon.log gets one line with its chat id.

What the check does

  1. getMe: is the token valid, and which bot is it. A wrong or revoked token answers 401 Unauthorized.
  2. getWebhookInfo: does the bot send its updates to a webhook.
  3. getUpdates: the updates Telegram holds for the bot, up to 100. The page reads each update's chat. It sends no offset, so it marks nothing as read; another program still gets the same updates.

All three only read; nothing on the bot changes. One side effect: if another program is polling the bot, the check ends that program's open request (see below).

Find a chat id

When getUpdates fails

Telegram gives a bot's updates to one reader at a time. getUpdates answers 409 Conflict in two cases.

Use the ids with Angelia

Angelia routes each Telegram chat to a coding agent CLI on your Mac. angelia init pairs your first chat for you. To add a chat by hand, put a route in ~/.angelia/workspace/routing.yaml:

routes:
  - { platform: telegram, chat: 111111111,      profile: coding }
  - { platform: telegram, chat: -1001234567890, profile: house, owners: [111111111] }

telegram: { token_env: TELEGRAM_BOT_TOKEN }

The token goes in ~/.angelia/env as TELEGRAM_BOT_TOKEN=…, never in the table. In a group, owners lists the user ids that may talk to the agent and approve what it runs. Put only your own there. Your user id is the chat id of your direct chat with the bot. Then run angelia check-config and send /restart in a chat you own.

Sources

Try Angelia

curl -fsSL https://useangelia.com/install | sh

It checks the release's signature, then a wizard pairs your first chat. Free and open source (MIT). How it works · Security model · GitHub