|
| 1 | +--- |
| 2 | +title: Telegram |
| 3 | +description: How to add Telegram to your system |
| 4 | +--- |
| 5 | + |
| 6 | +import {Steps, Callout} from "nextra/components"; |
| 7 | + |
| 8 | +<Steps> |
| 9 | + |
| 10 | +### Step 1: Create a Telegram Bot |
| 11 | +1. Open Telegram and message [@BotFather](https://t.me/botfather). |
| 12 | +2. Click Start |
| 13 | +3. Click Menu |
| 14 | + - click "Create a new bot" |
| 15 | + - Enter a name for your bot (e.g., `MyPostizBot`). |
| 16 | + |
| 17 | + |
| 18 | + - Choose a unique username ending with "bot" (e.g., `MyPostizBot_bot`). |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +Once your bot is created, **BotFather** will give you an **API Token**. Keep it safe—you’ll need it later. |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +### Step 2: Configure Bot Group Permissions (optional but recommended) |
| 27 | +1. Click on "Menu" |
| 28 | +2. Click on "Edit your bots" |
| 29 | +3. Select your bot |
| 30 | +4. Click on "Bot Settings" |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +5. Click on "Group Privacy" |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +6. if "Privacy mode" is enabled, turn it off (it is enabled by default) |
| 39 | + |
| 40 | + |
| 41 | +### Step 3: Add Your Bot to Telegram Groups or Channels |
| 42 | +1. Navigate to your group/channel |
| 43 | +2. Add your bot to your group/channel |
| 44 | +3. The bot requires these permissions to work with Postiz: |
| 45 | + - access to messages || so the bot can read messages sent in the group/channel |
| 46 | + - Send Text Messages || so the bot can send messages |
| 47 | + - Send Media || so the bot can send media |
| 48 | + |
| 49 | +<Callout type="info"> |
| 50 | +**INFO:** While not strictly required, making your bot an `admin` is **recommended**. It will give the bot all the permissions needed and make the setup easier and faster. |
| 51 | +</Callout> |
| 52 | + |
| 53 | +### Step 4: Add Bot Token to Your Application |
| 54 | +In your `.env` file, add the **Telegram Bot Name** (Without the @) and the **Telegram Bot API Token** that you received from **BotFather** in Step 1: |
| 55 | + |
| 56 | +```env |
| 57 | +TELEGRAM_BOT_NAME="MyPostizBot_bot" |
| 58 | +TELEGRAM_TOKEN="MyPostizBot token" |
| 59 | +``` |
| 60 | + |
| 61 | +<Callout type="info"> |
| 62 | +**INFO:** If you are using Docker Compose, include the `NTBA_FIX_350: 1` variable directly in your `docker-compose.yml`. |
| 63 | +see [Node Telegram Bot API](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#file-options-metadata) for reference. |
| 64 | +</Callout> |
| 65 | + |
| 66 | +You should be able to connect your group/channel to Postiz now! |
| 67 | +</Steps> |
0 commit comments