Telegram bot CLI

Telegram bots CLI connector for use in pandora alerts.

Introduction

Ver. 080621

Telegram bots CLI connector for use in pandora alerts.

Compatibility matrix

Python3 for source code
Linux x64 for compiled
Does not work on Windows systems

New Page

The requirements are as follows:

Configuration

Creating a BOT in Telegram

From a Telegram account you must type /start to the user BotFather (https://telegram.me/botfather) to create a bot.

It will return a series of parameters and instructions that we can do for the creation and manipulation of bots.

image-1629719208995.png

We will use the /newbot option with which we will create a new bot.
It will ask us the name we want to give to our bot, in my case I have selected Pandora_FMS_Test_bot , but you can put the one you prefer.

Now it will ask us for a user id for the bot, this has to end in _bot in this case I will use the same one. Pandora_FMS_Test_bot.

Now it will return us the information of our bot and some instructions for its administration, we will copy and save the API token that is the one with which we will authenticate us as that bot.

image-1629719275374.png

Create a group and add the bot


To create a group from Telegram we simply click on create group and select the users that will be in that group. It is important that one of those users is our bot in order to be able to send messages to that specific group. We can also simply add the bot to an existing group.

image-1629719345270.png

Get the id of the group to send messages from the CLI

Now we need to obtain the id of the group in which we have added our bot, there are different ways to do it, but one of the easiest is to add another bot that extracts this information very easily GetIDs Bot (https://t.me/getidsbot).
We add it to the group we want to know the id and it will give us a series of instructions for its use. But just by adding it, it will give us the information we need, which is the group id.