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.
- Install the application and register Telegram.
- Add the bot named BotFather to the contact list.
-
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.
Driver Settings
Telegram driver setup sequence:
- Create a separate communication line containing a single device of the Telegram type. Use the wizards that are called using the and buttons.
- Open the device properties, enter the bot token obtained earlier and click the Save button.
- Upload the project for execution by the button.
- Open the Communicator > Drivers page, select the DrvTelegram driver and register the driver.
- 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.
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.
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.
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.
Automatic sending of notifications when certain conditions are met and events occur is carried out by Automatic Control Module.