Skip to main content

Telegram

This section is dedicated to the library for working with Telegram API. On this page, all the steps necessary to start working are described

Getting started

  • Create a Telegram bot

    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

    BF

    1. Choose /newbot command

    BF

    1. BotFather will prompt you to choose a name and a username for the bot, after which the creation process will be completed
  • Save the token that BotFather sent you after completing the bot creation

    BF

  • (Optional) Determine the purpose of the interaction

    The bot you created can now be used in two ways

    • Like a chat-bot
    • For automating channel management

    Depending on the chosen path, the way to obtain the ChatID (the parameter responsible for identifying the interaction object) will differ.

    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

    The token and chat ID are the primary parameters for all methods of working with the Telegram API