# Telegram Setup

- Link: https://ubient.dscloud.biz/docs/ubient-software/rtmn/telegram-setup/
- Published: 2026-10-13T01:10:49+09:00
- Author: Ubient

Before installation, prepare a Telegram bot token and the chat IDs that will be 
allowed to control the gateway.

## Create a Bot

 1. Open `@BotFather` in Telegram.
 2. Send `/newbot`.
 3. Follow the prompts to set the bot name and username.
 4. Save the issued bot token securely.

The bot token is a secret. Do not expose it in shell history, documents, tickets,
chats, or logs.

## Find the Chat ID

Identify the Telegram chat ID that should be allowed.

For a personal chat, `@userinfobot` can show the user ID.

For a group or supergroup, use the actual group chat ID. Supergroup IDs are commonly
negative and may begin with `-100`.

## Token Usage Rules

Do not share one bot token across concurrently running `rtmn` instances.

Telegram long polling can race when multiple clients poll with the same bot token.
In that case, it becomes unpredictable which server or instance receives a message.

Recommended rules:

 * Use a different bot token per server.
 * Use a different bot token per account-isolated instance.
 * Rotate the token immediately if it is exposed.
 * Revoke unused bots in Telegram.
