# Telegram Output

The Telegram Output Action allows you to send notifications to a Telegram group. Before utilizing this node, it is essential to collect some required information in advance, such as an API key.

### API Token

Instructions to set up your Telegram bot. No coding is required, and you can complete the process directly on your device:

#### **Step 1**

Locate the Telegram bot named "@botfather." This bot will assist you in creating and managing your own bot.

<figure><img src="https://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/X1tvV0x0kdNwXbYFJiTX/image.png" alt="" width="216"><figcaption><p>Telegram BotFather</p></figcaption></figure>

#### **Step 2**

Create a new bot by typing "/newbot" or clicking on the corresponding option. Follow the instructions provided by @botfather to generate a new name for your bot. If your bot is purely for experimentation, you can add a unique touch by including your name before it in its username, as the bot's name must be unique. The screen name can be anything of your choice.

<figure><img src="https://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/ReALwSunkZQDAuGHO4ca/image.png" alt="" width="216"><figcaption><p>Telegram BotFather</p></figcaption></figure>

#### **Step 3**

Congratulations! You have successfully created your Telegram bot. A new API token will be generated for your bot.

In the example above, the token is 270485614:AAHfiqksKZ8WmR2zSjiQ7\_v4TMAKdiHm9T0.

Copy your API token and paste it into the designated node.

Tutorial source:  <https://www.siteguarding.com/en/how-to-get-telegram-bot-api-token><br>

### Recipient-ID

#### Step 1

Locate the Telegram bot named "@RawDataBot" or "Telegram Bot Raw"; it will assist you in obtaining the ID of your group.

#### Step 2

Create a new group and give it a name of your choice.

#### Step 3

Add the bot @RawDataBot to this group. Once the bot is inside, it will respond with a message containing various metadata, one of which is the chat group ID.

<figure><img src="https://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/87szQReACiIwA7N3MenO/image.png" alt="" width="375"><figcaption><p>Telegram Bot returning information</p></figcaption></figure>

```json
"chat": {
            "id": -655476556,
            "title": "Helmut Telegram Group",
            "type": "group",
            "all_members_are_administrators": true
        },
```

The complete ID, prefixed with a hyphen "-655476556," is the recipient ID that can be copied into the node. After the bot reveals the ID, it can be removed from the group.

<br>

### Store and use API-Token / Recipient-ID

To facilitate easier management of the API-Token and recipient-ID, these can be stored in variable storage. This enables seamless modification or variation of the group, such as incorporating the group name into the combination.

<figure><img src="https://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/sGQYmdx4WzeMRz5PtnAz/image.png" alt=""><figcaption><p>Store Variables for Telegram Message node</p></figcaption></figure>

### Send Message via Telegram

<figure><img src="https://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/VtyD4WLLneertgurQSKJ/image.png" alt=""><figcaption><p>Telegram Output node</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/sIhkStDTqZXKYOEjttYb/image.png" alt=""><figcaption><p>Message from the Telegram Output node in Telegram</p></figcaption></figure>
