Skip to content
Benoît de Witte edited this page Oct 10, 2025 · 3 revisions

Create the .warnme file

Create a Telegram Bot and Retrieve Its Token

To begin, you need to create a bot using BotFather, the official Telegram tool for managing bots.

Here are the steps:

  1. Open Telegram and search for @BotFather.

  2. Start a conversation with BotFather and send the following command:

    /newbot
    
  3. BotFather will ask you for the following information:

    • The name of your bot (e.g., MySuperBot)
    • The username of your bot (must end with bot, e.g., MySuperBot_123bot)
  4. Once the bot is created, BotFather will give you a token in the following format:

    1234567890:ABCDefghIJKLMNOpqrstUVWXyz
    

Retrieve Your Telegram Chat ID

To interact with your bot via a script, you need your Telegram chat ID.

Here’s how to get it:

  1. Add your bot to a private chat or to a group if you want to receive notifications there.

  2. Open a browser and go to the following URL, replacing YOUR_BOT_TOKEN with the token you got earlier:

    https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
    
  3. Send a message to your bot from Telegram (for example: Hello).

  4. Refresh the browser page — you should see a JSON response containing a line like this:

    "chat": {"id": 123456789}
    

    ➡ **This number (123456789) is your Telegram chat ID.

Create the .warnme config file

Create a file in $HOME/.config/.warnme

nano `$HOME/.config/.warnme`

fill it with variables you got from previous steps

TELEGRAM_TOKEN=token
TELEGRAM_CHAT_ID=chat_id