Knowledge base > Components > Telegram bot for receiving videos and camera snapshots
In today's interconnected world, messaging apps have become integral to our daily lives. Among them, Telegram stands out as a versatile platform offering a wide range of features, including the ability to create custom bots. These bots can automate tasks, provide information, and even entertain users. In this guide, we'll walk you through the process of creating your very own personal Telegram bot to receive surveillance alarms, recorcongs and even remote management of your surveillance system.
First things first, if you haven't already, download the Telegram app on your preferred device and create an account. Once you're logged in, you're ready to start building your bot.
Telegram's BotFather is the official bot used to create and manage other bots on the platform. Start a conversation with BotFather by searching for it in Telegram. Once you've found BotFather, follow steps below.
Type "/start" to initiate a conversation with BotFather.
Type "/newbot" to create a new bot.
BotFather will prompt you to choose a name for your bot. This name will be displayed in chats and contact lists, so choose wisely.
After selecting a name, BotFather will ask you to choose a username for your bot. This username must be unique and end in "bot" (e.g., BanalyticsHomeBot).
Once you've chosen a username, BotFather will provide you with an API token. This token is essential for interacting with your bot programmatically, so be sure to keep it safe and secure.
Now, your bot is ready to integrate into your Banalytics server. Click the + button next to the Telegram bot integration. Name your integration (note that this is not the bot name but the identifier of your integration with a particular bot. You can have several integrations with different bots). Insert the token you obtained at the last step of bot creation. Specify the access code. This is an additional security measure on Banalytics' side, while the Telegram bot has its own privacy settings.
Now, your Telegram bot is ready to receive notifications from your camera.
Value
Required?
Description
Default
Restart on failure
Yes
Restart mode upon catching an error:
Stop on failure - not restarted until triggered manually.
Immediately - tries to restart automatically immediately after catching an error.
10 sec - tries to restart automatically with a 10-seconds delay after catching an error.
30 sec - tries to restart automatically with a 30-seconds delay after catching an error.
1 min - tries to restart automatically with a 1-minute delay after catching an error.
10 sec
Title
Yes
Integration name. This is not the bot name but the identifier of your integration with a particular bot. You can have several integrations with different bots.
Bot token
Yes
The token you obtained at the last step of bot creation.
Authorization code
Yes
Password to limit access.
After configuring the Telegram bot, go to Messenger and choose to start it. The bot will ask for the authorization code you specified in Banalytics. After getting the necessary information, you can log out of the bot to prevent unauthorized access to your cameras through it.