Telegram docs

This commit is contained in:
headlessdev 2025-04-29 23:59:26 +02:00
parent c853da9d50
commit d574735caf

View File

@ -1,3 +1,49 @@
# Telegram
# Telegram Notification Setup
![Telegram](../assets/screenshots/notifications_telegram.png)
To enable Telegram notifications, you need the following:
- **Bot Token**
Generated by @BotFather when you create your bot.
- **Chat ID**
A unique identifier for the target chat (user, group, or channel).
## How to create the bot and get the Bot Token
1. Open Telegram and start a conversation with **@BotFather**.
2. Send the command `/newbot`, then follow the prompts to choose a name and username (must end with “bot”). :contentReference[oaicite:1]{index=1}
3. After completion, @BotFather replies with a message containing:
```
Use this token to access the HTTP API:
123456789:ABCdefGhIJKlmNoPQRsTuvWxYZ
```
Copy this token—this is your **Bot Token**.
## How to obtain the Chat ID
1. Start a chat with your new bot (send it any message).
2. Open in your browser:
```
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
```
3. Look for the `"chat":{"id":...}` field in the returned JSON. That number is the **Chat ID**. :contentReference[oaicite:3]{index=3}
### Example: getUpdates response excerpt
```json
{
"ok": true,
"result": [
{
"update_id": 123456789,
"message": {
"message_id": 1,
"from": { "id": 987654321, "is_bot": false, "first_name": "User" },
"chat": { "id": 987654321, "first_name": "User", "type": "private" },
"date": 1610000000,
"text": "Hello"
}
}
]
}
```
*Here, the Chat ID is `987654321`.*