Telegram Driver

Overview

Telegram Driver is designed to send notifications using the popular Telegram messenger. The advantages of using Telegram is quickness of receiving notifications, no fee for the service and easy management of notification groups.

Installation

Telegram Driver is installed in accordance with the general sequence of installing drivers.

Configuring

Creating Bot

In order for the driver to interact with the Telegram messenger, it is necessary to create a Telegram bot.

  1. Install the application and register Telegram.
  2. Add the bot named BotFather to the contact list.
    Telegram BotFather
  3. In the dialog with BotFather, run the command /newbot and follow the instructions from BotFather to create a new bot. Once the bot is created, copy the bot token.
    Creating a bot
Important! Keep the bot token secret.

Driver Settings

Telegram driver setup sequence:

  1. Create a separate communication line containing a single device of the Telegram type. Use the wizards that are called using the and buttons.
  2. Open the device properties, enter the bot token obtained earlier and click the Save button.
    Entering a bot token
  3. Upload the project for execution by the button.
  4. Open the Communicator > Drivers page, select the DrvTelegram driver and register the driver.
  5. Re-upload the project for execution.

After completing the described actions, use the communication line log to check that requests to the Telegram server are sent successfully and that responses are received.

Communication line log

Managing Subscriptions

To receive messages sent by the Telegram driver, create a chat in which one of the participants will be your bot. In the Telegram application, create a new group, add the previously created bot and other contacts who will receive messages.

If the settings are correct, your bot will respond to commands sent from the messenger, for example, the /help command. Run the /info command to get the chat ID and name.

Chat info

Enter the chat ID and name in the device properties form as shown in the figure below. After saving the properties, upload the project for execution again.

Subscriptions

Sending Messages

To send a message to a Telegram group, you need to send a command with the Notif code, containing the group name (or identifier) and the message text. An example of sending a command from the Administrator application is shown in the following figure.

Sending a message

Automatic sending of notifications when certain conditions are met and events occur is carried out by Automatic Control Module.