Demo Telegram Bot

Updated October 16, 2025

A Telegram bot on a Yandex Cloud serverless stack that returns the same message sent by the user. Implemented on Node.js with the Telegraf.js library.

You can modify the Telegram bot’s skills as you see fit.

The cost of resources for the application includes:

Deployment instructions
  1. Register your bot in Telegram and get a token:

    1. Start the BotFather bot and send it the /newbot command.
    2. Enter a name for your bot, such as Serverless Echo Telegram Bot. This is the name users will see when talking to the bot.
    3. Specify a username for your bot, such as ServerlessHelloTelegramBot. You can use the username to search for the bot in Telegram. The user name must end with ...Bot or ..._bot.
      Your Telegram bot’s token will be displayed.
  2. Create a Yandex Lockbox secret. In the Key field, enter TG_TOKEN, and in the Value field, enter the returned Telegram bot token.

  3. In the management console, select the folder where you want to deploy the application.

  4. Select Cloud Apps.

  5. On the left-hand panel, select Marketplace.

  6. Select Demo Telegram Bot and click Use.

  7. Specify the following:

    • Application name.
    • (Optional) Application description.
    • Service account with the admin role for the folder, or select Auto to have the service account created when installing the application. This service account will be used to create the application resources.
    • ID of the previously created Yandex Lockbox secret.
  8. Click Install and wait for the installation to complete.

  9. On the Overview page, find the API gateway under Application resources, go to the gateway page, and copy the service domain link.

  10. To bind the function to the Telegram bot, run a request. Replace the <bot token> with the Telegram bot token and the <API gateway domain> with a link to the API gateway’s service domain.

    curl \
      --request POST \
      --url https://api.telegram.org/bot<bot token>/setWebhook?url=<API_gateway_domain>/echo
    
    curl ^
      --request POST ^
      --url "https://api.telegram.org/bot<bot token>/setWebhook?url=<API_gateway_domain>/echo"
    
    curl.exe `
      --request POST `
      --url https://api.telegram.org/bot<bot token>/setWebhook?url=<API_gateway_domain>/echo
    

    Result:

    {"ok":true,"result":true,"description":"Webhook was set"}
    
  11. Write to the bot on Telegram.

Free

The usage cost for the product and the minimum required resource configuration
Billing type
Free
Type
Cloud Apps
Category
Developer tools
Publisher
Yandex Cloud
Use cases

Personal Telegram-bot creation

Technical support

Yandex Cloud technical support responds to requests 24 hours a day, 7 days a week. The types of requests available and their response time depend on your pricing plan. You can activate paid support in the management console. Learn more about requesting technical support.

Application resources
Resource typeQuantity
Service accounts4
Static access key1
Folder members7
Message Queue1
Serverless function1
Trigger1
API gateway1
Terms
By using this product you agree to the Yandex Cloud Marketplace Terms of Service

Free

The usage cost for the product and the minimum required resource configuration
Billing type
Free
Type
Cloud Apps
Category
Developer tools
Publisher
Yandex Cloud