Jaa


Connect a bot to Telegram

APPLIES TO: SDK v4

You can configure your bot to communicate with people using the Telegram messaging app. This article describes how create a Telegram bot and connect it to your bot in the Azure portal.

Tip

For information about which features are supported on each channel, see the channels reference article.

Prerequisites

  • An Azure account. If you don't already have one, create a free account before you begin.
  • An existing bot published to Azure.
  • A device with Telegram installed and a Telegram account.

Create a new Telegram bot with BotFather

Create a Telegram bot with BotFather before connecting your bot to Telegram.

  1. Start a new conversation with the BotFather.

    Visit Bot Father

  2. Send /newbot to create a new Telegram bot.

  3. When asked, enter a name for the bot.

  4. Give the Telegram bot a unique username. Note that the bot name must end with the word "bot" (case-insensitive).

  5. Copy and save the Telegram bot's access token for later steps.

Configure Telegram in the Azure portal

Now that you have an access token, you can configure your bot in the Azure portal to communicate with Telegram.

  1. Log in to the Azure portal.
  2. Go to your bot. Then select Channels from Settings.
  3. Select Telegram from the list of Available Channels.
  4. Enter the token you copied previously into the Access Token field and select Apply.

Your bot's now successfully configured to communicate with users in Telegram.

Additional information

For information about using Telegram-specific actions in messages, see how to Implement channel-specific functionality.