Blog and knowledge base of the service
How to set up scripts in a Telegram bot: a step-by-step guide
Published: 10.04.2025

A message script in a Telegram bot is a pre—thought-out and structured order of interaction between a bot and a user according to a given scenario consisting of several messages and buttons.


It determines what the bot will send and in what sequence, how it will react to user actions, and what response options it will offer.


Simply put:

The script is like a dialogue on roles, where the bot already has "replicas", and the user selects or writes his own.

How to set up scripts in a Telegram bot: a step-by-step guide

How do I create my own script in the BOT MARKET constructor?

An example of a simple scenario

Let's say a bot is for ordering pizza, let's imagine what it will look like in the bot:


  1. Bot: Hello! Do you want to order a pizza?


- Yes

"No," I said.


  1. If the answer is Yes:


Bot: Great! Which pizza would you like?

- Margarita

- Pepperoni

- Four cheeses


  1. If "Pepperoni" is selected:


Bot: Great choice! Specify the delivery address.

The user enters the address


  1. Bot: The order is accepted! Wait for 30 minutes.


After entering the delivery address, the script will reach its logical conclusion, even regardless of the choice of the customer's answers, exactly the one you gave the user.

Creating a simple script in the BOT MARKET

To create a script, the first step is to go to the desktop of the bot and click on the "Scripts" button:

Creating a simple script in the BOT MARKET-1
  1. Click on the "Add script" button and enter a name for the script.
Creating a simple script in the BOT MARKET-2

Important! There should not be several scripts with the same name. Many parameters depend on the script name, for example, if you want to create a command, you must specify "/" at the beginning of the script name, for example: /profile.


  1. The next step is to configure the sequence of messages in the script. To add messages to the script, click on the corresponding "Add message" button
Creating a simple script in the BOT MARKET-3
  1. To connect the button in the first message with the second, and so on, click on the "gray circle" and then on the "Connect" button, using the arrow that appears, connect the button with the message we need.
Creating a simple script in the BOT MARKET-4

The general setup of the scripts looks exactly like this:


  1. You add script blocks and link them to other messages using buttons and finalize the scheme until you reach the logical conclusion of the customized script.


  1. The setting of messages in the script is the same as the setting of free messages, all parameters are the same.