# Telegram setup for PopMCP

You paste one value into PopMCP: the bot token that @BotFather gives you when you create a bot inside Telegram. It looks like 123456789:AAH... and is free, instant and needs no approval.

- Auth: API credentials
- Setup time: 2 min
- API base URL: https://api.telegram.org/bot<token>
- Credentials screen: https://t.me/BotFather
- Provider docs: https://core.telegram.org/bots/api

## Before you begin

- A Telegram account, on the phone app, the desktop app or web.telegram.org
- A bot of your own, made with @BotFather in about a minute. Use a separate bot for PopMCP if one you already have runs somewhere else
- For a channel: you are an owner or administrator, so you can make the bot an administrator with permission to post

## Get your credentials

### 1. Open @BotFather in Telegram

Open Telegram on your phone, on desktop or at web.telegram.org, search for @BotFather and open the chat with the blue check mark, then press Start. BotFather is Telegram's own bot for making and managing bots; it also has a mini app with the same options.

Screen: https://t.me/BotFather

### 2. Create the bot with /newbot

Send `/newbot`. BotFather asks for a name, which people see in chats and you can change later, and then a username, which must end in `bot` (for example `acme_updates_bot`), must not be taken, and cannot be changed later.

Screen: https://t.me/BotFather

### 3. Copy the bot token

BotFather answers Done! with the link to your bot and its token, a number, a colon and a long code such as `123456789:AAH...`. Copy the whole token. Anyone who has it controls the bot, so keep it private. For a bot you made before, send `/mybots`, pick the bot and tap API Token.

Screen: https://t.me/BotFather

### 4. Add the bot to your channel or group (optional)

To post in a channel, open the channel's info, then Administrators, Add Admin, choose your bot and keep Post Messages on. For a group, add the bot as a member. While privacy mode is on, a bot in a group only sees commands, replies to it and mentions; make it an administrator, or send `/setprivacy` to BotFather and choose Disable and then add it to the group again, if it should see every message.

### 5. Paste the token into PopMCP

In PopMCP, paste the token into Bot token and connect. Under More options you can add a Default chat, such as `@yourchannel` or a numeric id, so the AI posts there when you do not name a chat; PopMCP checks that the bot can see it.

## Fields PopMCP asks for

- Bot token (botToken) [required]: In Telegram, open @BotFather and send /newbot (or /mybots, pick your bot, then API Token). Copy the token it shows. Stored encrypted and used only on our servers.
- Default chat (defaultChat): Optional. The channel or group the AI uses when you do not name one: its @username or numeric id. Add the bot to it first (as an administrator for a channel).

## Verify

PopMCP checks the token with Telegram's getMe and shows the connection as your bot's @username, noting whether privacy mode is on and whether the bot already sends its updates to a webhook of its own. Asking the AI for your bot's username, or to post a short test message to your default chat, confirms it works.

## Troubleshooting

### "Telegram rejected this bot token. In @BotFather send /mybots, pick the bot and tap API Token to copy it again (or send /token for a new one), then paste only the token."

Cause: Part of the token was missed when copying, or the token was replaced with /token or revoked in BotFather.

Fix: In BotFather send /mybots, choose the bot, tap **API Token** and copy the whole value, numbers and colon included.

### "That is not a bot token. A token from @BotFather looks like 123456789:AAH..."

Cause: Something else was pasted, often the api_id or api_hash from my.telegram.org, which are for apps, not bots.

Fix: Copy the token from @BotFather instead. It always has a colon between the bot's number and the long code.

### "The bot cannot see the default chat @yourchannel."

Cause: The bot is not in that chat, the username is wrong, or the chat is private and was given by @username.

Fix: Add the bot to the chat first (as an administrator for a channel), check the @username, use the numeric id for a private chat, or leave Default chat empty.

### Sending fails with "chat not found"

Cause: The chat id or @username is wrong, the bot is not a member of the chat, or the person never pressed Start in the bot.

Fix: Ask the AI to run list_chats to see the chats the bot can reach, add the bot to the chat, or ask the person to open the bot and press Start.

### "bot can't initiate conversation with a user" or "bot was blocked by the user"

Cause: Bots can only message people who started a chat with them, and someone who blocked the bot cannot receive its messages.

Fix: Share the bot's link (t.me/your_bot) and ask the person to press Start, or to unblock the bot.

### "not enough rights" or "need administrator rights in the channel chat"

Cause: The bot is a member but lacks the administrator right the action needs, such as Post Messages, Delete Messages or Ban Users.

Fix: Open the chat's Administrators list, edit the bot and switch on the right that is named in the error.

### Reading messages says the bot delivers its updates to a webhook

Cause: The bot already runs in another program, which receives its updates. Telegram allows only one receiver per bot.

Fix: Keep that program as it is. Create a separate bot for PopMCP if the AI should read incoming messages; sending works either way.

### Messages show raw asterisks, or fail with "can't parse entities"

Cause: Ordinary Markdown such as **bold** is not Telegram's text format, and MarkdownV2 needs special characters escaped.

Fix: Ask the AI to use send_rich_message with Markdown, or HTML formatting with send_message.

---

Source: https://www.docs.popmcp.com/docs/integrations/telegram/