2024-06-05 12:19:46 +02:00
---
id: Telegram
sidebar_class_name: Telegram
---
< img src = {require('../../static/img/APIs/Telegram.png').default} width = '64px' / >
# Telegram
2024-06-05 14:34:54 +02:00
This section is dedicated to the library for working with Telegram API. On this page, all the steps necessary to start working are described
2024-06-05 12:19:46 +02:00
## Getting started
2024-06-05 18:52:17 +02:00
- Create a Telegram bot
2024-06-05 12:19:46 +02:00
2024-06-05 18:52:17 +02:00
1. All actions with the Telegram API are carried out through bots. To create a new bot, you need to start a conversation with [@BotFather ](https://t.me/BotFather )
2024-06-05 12:19:46 +02:00
![BF ](../../static/img/Docs/Telegram/2.png )
2024-06-05 18:52:17 +02:00
2. Choose */newbot* command
2024-06-05 12:19:46 +02:00
![BF ](../../static/img/Docs/Telegram/3.png )
2024-06-05 18:52:17 +02:00
3. BotFather will prompt you to choose a name and a username for the bot, after which the creation process will be completed
2024-06-05 12:19:46 +02:00
2024-06-05 18:52:17 +02:00
- Save the **token** that BotFather sent you after completing the bot creation
2024-06-05 12:19:46 +02:00
![BF ](../../static/img/Docs/Telegram/1.png )
2024-06-05 18:52:17 +02:00
- (Optional) Determine the purpose of the interaction
2024-06-05 12:19:46 +02:00
2024-06-05 18:52:17 +02:00
The bot you created can now be used in two ways
2024-06-05 12:19:46 +02:00
2024-06-05 18:52:17 +02:00
- Like a chat-bot
- For automating channel management
2024-06-05 12:19:46 +02:00
2024-06-05 18:52:17 +02:00
Depending on the chosen path, the way to obtain the **ChatID** (the parameter responsible for identifying the interaction object) will differ.
2024-06-05 12:19:46 +02:00
2024-06-05 18:52:17 +02:00
In the case of a chat bot, the chat ID will be the user ID with whom the bot is conversing. If the bot is to be used for channel management, after adding it as an administrator, you can use the channel's name with @ (e.g., @MyChannel ) instead of the chat ID
2024-06-05 12:19:46 +02:00
2024-06-05 18:52:17 +02:00
The token and chat ID are the primary parameters for all methods of working with the Telegram API