# Smartbot Pro –  messenger marketing tool

An indispensable tool for an SMM specialist, marketer, social media gamification specialist.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FlJnsfM8frlIvvIHAvXCl%2Fimage%201.png?alt=media\&token=f53e6d8f-28a4-43e7-b76e-6d15786a11ff)

Here you will find useful materials and instructions about the Smartbot Pro service that will help you implement a bot of any complexity in messengers and get more customers for your business.


# Most important

**Smartbot Pro** is a set of marketing tools for instant messengers. Smartbot Pro is based on the Smartbot service for VKontakte, which is used by tens of thousands of VK groups.&#x20;

Tasks that the smartbot solves:&#x20;

1. Sales automation via messengers&#x20;
2. Optimization of resources for user support in social networks&#x20;
3. Creation of sales funnels with branched logic, delayed events, collection of statistics and various tools for increasing conversions.

**Bot scripts** are the heart of the service.

{% hint style="info" %}
**Script** is a sequence of steps that the bot performs in response to events, such as an incoming message in a messenger, joining a group on a social network, or paying for an item in your online store.
{% endhint %}

A script can be linked to multiple channels.

{% hint style="info" %}
**A channel** is a medium for communicating with your subscribers. For example, a Telegram bot.
{% endhint %}

To launch a bot using Smartbot, you need to create a dialogue script and connect the desired channel. All this takes very little time.&#x20;

The following articles describe in detail all the functionality of the service.


# Mini-course

В этой главе мы пройдемся по основным возможностям бота и вместе сделаем бота.


# Registration and personal account

Go to smartbotpro.ru. Here you can read about the service:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F12YWXCP0RdiPjb6uI8Q8%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.00.58.png?alt=media\&token=057f0c6c-3c6a-46ca-9142-befaabc421af)

To get to the authorization page, click on the "Start for free" button:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fm7dyA3W3cPUTUexG105l%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01_222.png?alt=media\&token=ad2380dc-d768-4074-bce8-ad34f0e3fb79)

After registration, a free trial period will begin, which is valid for 1 week.&#x20;

During this time, all the features of the service will be available to you. After registration, you need to register an account. All your scripts and projects will be here. If you are a marketing agency, you can do separate projects for each client, and they will not overlap.&#x20;

To register an account, select a name, domain, field of activity and click "Create":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FgWFPiapYotjEuha4REeu%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.03.00.png?alt=media\&token=3b1242fc-0dbf-4ef5-8e04-de08980a2017)

After that, we immediately get into our personal account:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FG9qvQ1bpefOjyPrHhsFo%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.03.07.png?alt=media\&token=fb0f57ae-0bda-436a-a60e-bc6c1ddeed41)

At this moment, the selected domain is already in the address bar. Now you can hit the constructor at this address.&#x20;

Look: at the top right, you can see all the cabinets that you have already connected to. Now there is one cabinet - this is KTS\_smarttest.&#x20;

Initially, one main project was created, but you can create more. There can be several of them within the cabinet, the payment will be total from the balance of the cabinet.


# Initial scripting tools

After creating an account, you are taken to the script screen. This is the main screen from which all interaction occurs. Initially, you will already have a Smartbot FAQ script created. A script is a graphical representation of a user's dialogue with bots in the form of a flowchart. The user can use a template or create a completely custom script.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FrmI199Mzxa7ncz2uChsd%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.03.49.png?alt=media\&token=9878089f-db32-4ee0-af35-46801e31e8f1)

Flowcharts consist of chains of bot actions. Chains start with events - some user actions. For example, chat messages:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FVAjOO43tudt3FegpNW7m%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.05%20copy_22.png?alt=media\&token=a2dea525-1173-4b01-83cc-a37a14bf6082)

Now, if the user writes in the chat: “What a smartbot can do”, this event will fire. The bot will follow the arrow and send a message:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqedMTuGTWKoIwgOZzFhe%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.05%20copy_22_1.png?alt=media\&token=628bf0b8-f25c-488d-895b-12f4c0c193e8)

Note that there are already many different chains in the original script.&#x20;

There are questions here: “What a smartbot can do”, “What kind of business is a smartbot useful for”, “What social networks does it work in”. After each of these questions, the bot will run the appropriate chain of scripts.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FZXv9P5Pi1Bufua3FObpb%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.06.17.png?alt=media\&token=67d789d6-a8f5-42aa-9acd-75b6f582c805)

You can do the same - create many answers to frequently asked questions about your product or service.&#x20;

Pay attention to the message comparison mode. In the example above, it is set to “similar to”, but there are others:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FDeVrEl9YO78ikIHQlOBv%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-18%20%D0%B2%2015.07.00.png?alt=media\&token=ad3b88d1-1515-4ddc-8977-f078c8801984)

The "looks like" mode is responsible for fuzzy matches. If the user makes a mistake, misses a word in the request, or even writes something similar in meaning, the bot will still understand it with some degree of probability. So you can make a bot that will communicate a little more freely.


# Creating the first script

In the future, you can use one of the ready-made templates:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fq9wtjFmJcWqMHmqCav3W%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.06.52.png?alt=media\&token=6b43d266-f794-4b72-9863-b21ac7ec5e2b)

But now for training, we will create our own:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQEPPKwDCXc9sv4rVe2wj%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.07.43.png?alt=media\&token=a47edadf-c145-4ba9-a5e7-4bdf4d038d07)

Let's create a bot in Telegram. It will respond to the start button or the "Hi" message:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqY6tfwVIjWFWXyyQ04wk%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.08.42.png?alt=media\&token=759e04bb-7619-47a8-8cbc-ea154b8af72a)

The bot will respond to this with “Hello from the bot!”

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FC0lJ5Oex2eI98dkgaVU1%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.09.12.png?alt=media\&token=3c2d16b5-ffbf-48bc-b779-3c7a6133402b)

To publish a script, you need to link a channel. Click on the "Publish" button at the top right and we get a message:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FPgBxt8AJ1UwUYdz7wTbq%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.09.36.png?alt=media\&token=5e87bd5d-df4b-4589-bd07-59b7258a6966)

A channel is any VK community or a chat bot in Telegram, which must first be added to the system.&#x20;

If we click "Create a channel", we will see that so far the list of channels is empty. Let's create a new bot. To do this, follow the link in BotFather:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F5TJIauLFNCoXtD0fcmmD%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2016.03.17.png?alt=media\&token=34e6af56-8eb2-45e7-8b16-449870889575)

A dialogue will open in Telegram. Here you need to execute the /newbot command, select a name and username and get a token from BotFather:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fymn4Har4HswgLKmKBFIh%2Fbotfather_1.png?alt=media\&token=11ce18f1-08b8-45e1-bc99-39ad83b31044)

Copy the token, paste it into the service window and click "Create":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FS8Sc9cChFXPIECK0efpG%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2016.05.02.png?alt=media\&token=9f8e0295-8922-424f-b638-aea6227b48a9)

The channel is now bound to the script:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FLoqL3ynis2EGWqvJderH%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2016.05.57.png?alt=media\&token=a6687a4c-4284-49e7-9839-f36e904c73af)

Pay attention to the words "Account is linked". Now it's set to "No". You need to click "bind" and send a specific message to your bot:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FpJphlTtECJeNLzU1RIxx%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2016.07.15.png?alt=media\&token=f8302ce5-cdfb-4c71-8c68-61377d76f1ad)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FdE0dPpK9lkblEfrH53QX%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.11%20copy.png?alt=media\&token=376d6817-4647-4f1f-8a91-0f77783428b9)

This will link your Telegram account to the service and confirm that you are an administrator. Now you can publish the script, go to the bot and test its work:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FsGZi2gzwF1C0qcdEVIdZ%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.11%20copy_mybot_test_1.png?alt=media\&token=7cbc52f7-847d-49e2-bab2-e8fcfb26a537)

The administrator can also test unpublished scenarios, we will talk about this in more detail a little later.


# Users and collection of information

As soon as the user writes to the bot, he automatically goes to the "Users" section:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F6euu6IEH8feMUyDZg655%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-01%20%D0%B2%2019.16.37.png?alt=media\&token=33e0df56-be4b-4a82-bf2c-3a08ce181c67)

This gives you an added edge if you're marketing or launching your own products.&#x20;

The classic scheme for launching a product is as follows: you make a landing page, describe the product, insert an application form. What is the problem: when a user comes to this landing, he is impersonal. He can leave at any moment: when he looks at a photo, reads about you, fills out an order form.&#x20;

Although this is usually tracked through systems like Google Analytics and Yandex.Metrica, the bot has a plus. Once a user has contacted a bot, you automatically get all of their contacts, which opens up new possibilities.&#x20;

Let's go back to our script and expand it a bit by gathering more information from the user. We already know the last name, first name or nickname from Telegram, so let's ask the phone:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FgOEvseNk3u9xWeWQtt9N%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-18%20%D0%B2%2018.23.12.png?alt=media\&token=fd018d2d-0811-4f25-a357-40bce1707bcd)

To pick up the user number, use the "Process message" block.&#x20;

Note that you can also right-click anywhere in the script and create the desired block. This is the same as the menu on the left:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FvWv4eewNnowTnv2IJf5H%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2016.08.42.png?alt=media\&token=060cd45d-cb66-4d01-9a28-36b3177ca49c)

When the user writes something, the bot will process his response and save the data to the specified variable:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FcjSy0fq5fSH96UxpUG6F%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-18%20%D0%B2%2018.30.38.png?alt=media\&token=f1a331e8-525a-4752-8743-bab920757cd6)

A variable is a key by which either some value is written for each user, or a common, global value for all users at once. For example, a global counter of customers who have submitted an application.&#x20;

Now we need a phone. Therefore, I will create a variable with the same name and type "User" - it will be tied to a specific user. If we needed a common variable for all users at once, we would choose the "Global" type.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FSKkC1f9Je4t57pCtxSbt%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2016.35.07.png?alt=media\&token=d8437faf-ab5f-44ec-9471-cbd0ffa2813b)

Now the bot will store the phone number. Let's add one more block to the script - so that the bot answers: "Thank you, we will call you back at %Phone%".&#x20;

Script testing can be started from a specific step. To do this, hover over the blue button next to it and click "run":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FKJtYBCYMY97m01GmRVtO%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-18%20%D0%B2%2020.15.09.png?alt=media\&token=65f62316-fb97-42ca-b533-18b880ba6c73)

We check the script, we see that everything works. The bot saved the variable and now we can use it:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FGwbJcwSdSqEF9qijbiJX%2F%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7_1.png?alt=media\&token=b7d2829c-080f-4396-a465-8cb6cee04c33)

Now in the "Users" section, you can add a new variable and see its value next to the user:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FFJ93g0NQWUE4WH0b0X4k%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-18%20%D0%B2%2020.20.03.png?alt=media\&token=bd818b31-a044-49b7-82a9-120d2d5af53f)


# Applications, variables and managers

In the previous lesson, we asked the user for a phone number and saved it to a variable. The variable can be immediately transferred to the administrator.&#x20;

In the script, add the "Write to manager" block and link it to the previous one. Then the bot will send you or the selected manager the specified message. You can also forward a message from a user.&#x20;

We tell the manager that a new application with a phone number has arrived and we remind you what needs to be done:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQlw86tImvaEtTnSFbp2v%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-18%20%D0%B2%2020.29.12.png?alt=media\&token=e3a7c982-9558-4bd6-8120-751b1aa3bc39)

Here I also select the managers to whom I need to send a message, and channels. I can choose a channel with another bot, and then a message about a new application will come from him.&#x20;

To do this, select a channel:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F6dEwtkMXKiyVW5aJStj2%2F%D0%B7%D0%B0%D1%8F%D0%B2%D0%BA%D0%B8_1.png?alt=media\&token=836cb3f7-dddf-44e7-95c7-fff91dc5f1e6)

And now, if we register a phone in the first bot, the second one will write to us:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fu53mI0N5Tx15WaPk8Cqa%2F%D0%B7%D0%B0%D1%8F%D0%B2%D0%BA%D0%B8_3.png?alt=media\&token=9cf1cdf1-3939-40a4-8aee-97283cdc3b0c)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqRe9k20R1yTz9L7EyRSD%2F%D0%B7%D0%B0%D1%8F%D0%B2%D0%BA%D0%B8_2.png?alt=media\&token=4b845529-64bf-4bee-9f27-3ce48329b037)

Please note that the bot can work in Telegram, but send messages to VK or other channels - for example, Viber.


# Data validation

Now let's find out if it is possible to set up data validation using the example of a phone number.

### Option 11

In the "Process message" block there is a checkbox "Use template".&#x20;

This way I can choose the format of the response that I expect from the user. For example, you can set the following pattern: "My phone is ". Whatever the user writes in place between "<" and ">" must follow a certain format. It can be a number, email, phone number:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FFvxQ6J2dvGtx8USsuYOC%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2016.50.37.png?alt=media\&token=42bf54cf-660c-4c51-89de-e2828df4847d)

If the user writes a message that does not match the template, an error exit will be triggered. Graphically, it is indicated by an exclamation point. Write a hint to the user:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FUr8YBOQUKZ0vbMyxBCwm%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2014.09.34.png?alt=media\&token=c22ca2c9-91eb-491e-afa6-0220aebb82c5)

Now the bot will explain to the user what is expected of him, and will again wait for a response.&#x20;

### Option 2

You can make it easier: add a button to send the phone. This is a native Telegram button that allows the user to send the number associated with the account. Please note that this option is available only in Telegram.&#x20;

Now there is no need for data validation:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FN6TN3h8HFuxrNRuppNDY%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2014.19.05.png?alt=media\&token=8b29af76-a631-471e-ade7-69df36a26901)


# Collection of applications for a webinar within Telegram

If you use a template when creating a scenario, you can choose either "Application Collection" or "Webinar Auto Funnel".&#x20;

The template already has all the variables set, you only need to publish the script:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FhoeEm7tTtGFXH7J7jN7q%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2014.27.33.png?alt=media\&token=811b2d84-e962-4f9c-8f59-6c8a4119d492)

If you need to send a link to the start of the broadcast, you need to do this.&#x20;

You have a link that you created in Zoom, either manually or through a special bot. This link will host the webinar. You need to insert the link into the message and schedule the mailing list - for example, 10 minutes before the start of the broadcast.


# Testing unpublished scripts

You can test different changes in the project without fear of breaking existing logic.&#x20;

For example, you have several thousand customers using a bot. You need to make changes, but in a way that doesn't break the current script. For this, there is a draft and a clean draft of the project - the published and unpublished versions.&#x20;

Pay attention to script cards:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F8KttscjwlJ41Zr12BjRp%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2014.32.08.png?alt=media\&token=d2ebff8a-d034-4be2-b574-e0cf62a85963)

On the notes with yellow dies, the status is written: “not published”, “there are unpublished changes”.&#x20;

Below is written about inclusion in the published and unpublished versions of the project. This is done so that you can test new features of the bot when the previous one is already active.&#x20;

Let's look at an example. I can change the message that the bot sends to the user in response to /star. Previously, the first line was written: "Hello!" I changed those words to "How do you do?"

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FyaRvxBc7XQ28B92bXQwq%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2014.44.35.png?alt=media\&token=8781a86d-b60c-469c-b300-cd75dfe56e85)

\
\
If I write /start to the bot, I will see a new message:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fr2w7QPAXduwgNHEtABvG%2F%D1%82%D0%B5%D1%81%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5_1.png?alt=media\&token=51e4e55c-ccfe-4d46-b16b-d5972b2d9112)

To understand why this happens, let's look at the project settings. Now everything is clear:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FOPBtxh3YpFz2EkKlwuBt%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2017.01.34.png?alt=media\&token=90f57d85-d064-49be-8605-1b8e6802511d)

Since I am a confirmed bot admin, I communicate with the unpublished version of the project. If you change this setting, the bot will respond to me in the same way as other users. You can also turn off a specific script in the published or unpublished versions:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FYmZs5KCmOJsL1Cdfl5Gh%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2014.53.53.png?alt=media\&token=1ece0109-7ce0-4e5b-b9f7-e9ccef271980)


# Newsletters

To create a newsletter, go to the appropriate section and click on "Create":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FmVkT9uZfCnXs8JMTR8uw%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2017.17.47.png?alt=media\&token=72b7ebdb-61c5-4553-a3cc-ed29b2ae2b21)

The mailing list looks the same as a regular script. But she always has a starting block, which is called “Start mailing”.&#x20;

Let's ask the user to write something in this starting block and move on to another script:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FD5Kp2zutaB2Q2sK4QgrE%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2019.41.09.png?alt=media\&token=1be231b1-30ab-4f8e-affd-01379591b6fd)

To send a newsletter, click "Set up a newsletter". Here we can choose which channel to send the newsletter to, which users, set additional conditions:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FLUc735VVPtDry8ZWleHz%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2017.29.55.png?alt=media\&token=c3a2aea2-2ed3-46f9-871b-4d9cdd7e3aa9)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FfSKV9HXBqAR6LHPiti3C%2F%D1%80%D0%B0%D1%81%D1%81%D1%8B%D0%BB%D0%BA%D0%B8_1.png?alt=media\&token=2f0fa3c6-041c-4087-b5ce-1c1f1f828512)

For example, the subscriber wrote to the bot, but did not leave the phone. I send out a mailing list to all users without a number and ask you to leave contact information for the bot. Our script does not yet provide for such a technique, but you can create a variable that marks such users.&#x20;

Once set up, the newsletter can be sent or scheduled for the future. Immediately after sending, we get to the screen with information about the mailing:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FXIF8PucgNoUXf5r12dQ1%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2020.07.29.png?alt=media\&token=c47460e3-bbdd-4348-aedf-f2612c39701f)

And in Telegram, we receive a message, by answering which we get into another script, as it was intended:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FRILWBFZjFWJwtu7juDjA%2F%D1%80%D0%B0%D1%81%D1%81%D1%8B%D0%BB%D0%BA%D0%B8_2.png?alt=media\&token=304b00e7-f537-4b11-8986-9af003202fcc)


# Template "Test with a set of points"

If the user writes "Test" or "Take the test", the bot will offer testing:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fu2ZiBCcbxQRI2VoEecIY%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2017.51.27.png?alt=media\&token=64f3b388-aa46-4ac6-8148-995c4270d093)

For each correct answer, we will award points. We will store them in the variable "points" for the test. We reset this variable before starting the test:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fj0RmkVBuILCLIx6SvSoY%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2017.52.18.png?alt=media\&token=a11ef3af-2e7f-4680-9532-b83925334477)

Now you can ask the first question.

There are 4 answer buttons for the question. One of them leads to a message about the correct answer and points. All the rest - to the message that the user answered incorrectly. After that, for any outcome, the bot writes the correct answer, waits 10 seconds and moves on to the next question.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FXe4RvSfwz8d0jRoBpkpB%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2017.53.36.png?alt=media\&token=96c4a94a-34ab-4891-ae4d-496c602c8fed)

Pay attention to the block with crediting points:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F7dHw7B7X4KRK2vRSiEra%2F%D1%82%D0%B5%D1%81%D1%82_%D1%81_%D0%B1%D0%B0%D0%BB%D0%BB%D0%B0%D0%BC%D0%B8_1.png?alt=media\&token=7a3cb5c6-8321-4315-b094-00fa0704bb71)

In double curly braces, you can write any arithmetic expressions with variables, as well as use our special [SmartQuery](https://docs.smartbotpro.ru/smartquery/sintaksis-yazyka) language, in which you can do a variety of things - from arithmetic to processing API return data:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FTikBjn2oj3MY8kf41odS%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2017.49.46.png?alt=media\&token=d1f12599-dee2-40bc-aa62-3b4bdf56d363)

The 2nd question of the test is: “How far (in millions of kilometers) is the Earth from the Sun? Write the approximate number of million km.&#x20;

The user must enter the answer himself. We save the answer in the %Answer to the second question% variable and proceed to the condition: the variable must be in the range from 140 to 160. Then we will assume that the user knows the answer approximately.&#x20;

After that, we follow the familiar pattern: if the answer is correct, we go to the script branch with crediting points. If incorrect, then we say that the user made a mistake and continue:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FfGS510fF3sUKhs2FUGmy%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2017.56.09.png?alt=media\&token=6baf0521-6853-4900-8404-11af2c38e49c)

The 3rd question is: “Which planet from the Sun is the Earth?” Thanks to the “Wait for a response from the user” checkbox, we expect a response in the same block. This allows you not to take extra steps like "Process message" or "Save to variable". After that, we make a condition on the message itself from the user. This condition always works on the last message, which must be equal to "3" for the correct option.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FzMg57tvFbAWGuoLwDUIk%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2017.57.41.png?alt=media\&token=b09ec12f-1572-430a-a932-99d83dccf55b)


# Statistics

Usually, this is the most interesting :)

Here you can monitor how your channel - or channels - grows.&#x20;

In this section, you will see how many users wrote, how their number grew or fell, select the period for which you want to view the data.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FTL9tkMAolD0z6x2oP4nX%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-20%20%D0%B2%2015.47.28.png?alt=media\&token=b79157db-f7e0-40ec-a3b9-ddbaddc5b9fa)

You can even watch specific blocks.&#x20;

For example, if we look at the statistics of a test with answers to questions, we can separately consider how many people entered the block of the 1st question.

### Marks

There is a special block "Write to statistics". Inside it, you can create some kind of special label that will be visible in the statistics:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FLn4Y1Wtn5H4NIHHRPutp%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-20%20%D0%B2%2015.53.29.png?alt=media\&token=258213f0-a340-44b6-8578-51d55b991945)

You can, for example, ask the subscriber for a phone number and mark it in the statistics through the “Have a phone number” label. Of course, the user can leave a non-existent number - or leave no number at all, but that's another story. By the way, this can also be noted in the statistics through labels - for example, "You need to check your phone number."


# Interface hacks

### How can I copy blocks of the same type

Hold Ctrl to select blocks and press Ctrl + C/ Ctrl + V.

### Link Arrow Interface&#x20;

You can change the appearance of links between blocks in the scenario settings menu:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fb0YEnKJea1TParKlRt0W%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2018.02.26.png?alt=media\&token=5c72a06a-f954-4e6e-a622-8f546fe963f8)

### Minimap&#x20;

Navigating through the larger scenario can be more convenient with the minimap in the lower right corner.&#x20;

Starting events are highlighted in white.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqC1iH4PUO8BnZCT8Ew83%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2018.04.48.png?alt=media\&token=12d1713c-247d-4bca-aa98-c5e0ebc8baa4)

### Block search

Blocks can be named and then searched in the search:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FHTjxTQYOYD2fof5kwEGf%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2018.08.25.png?alt=media\&token=3735a2e4-48f1-4508-a857-8a5fc8aca216)

### Building Blocks&#x20;

You can right click anywhere in the script and create the desired block. This is the same as the menu on the left:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F6GLZSePwoNmxOmUnnQsp%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2018.10.17.png?alt=media\&token=23763e13-3495-4da2-b117-2bd8221e644d)

### Testing from any block

Scenario testing can be started from a specific step. To do this, hover over the blue button next to it and click "run":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FI1OR6FuNYisKYxq5MKiG%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2018.11.51.png?alt=media\&token=9d09384b-b75a-4e44-9767-cc3ee72e180a)


# Registration in the service

If you like video instructions more than text with pictures, then there is a short video for you on how to register in Smartbot Pro:

{% embed url="<https://www.youtube.com/watch?v=QMBF4V7RT5M>" %}

And here is the text with illustrations.

Before you start working, you need to register in the service. To do this, go to the [authorization page](https://smartbotpro.ru/auth/initial/) and click the "register" button:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FccT0zpvGDrSV6rUCvElA%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-12%20%D0%B2%2013.43.47.png?alt=media\&token=e52fb88b-9cbd-499e-8480-903f7f23737d)

Fill out the form and click "register".

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FXUVkPHF4mwjCg0GKyeNC%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-12%20%D0%B2%2013.45.42.png?alt=media\&token=8a51211c-d172-4e43-898f-6fa8af31975f)

The next step is to create an account.

{% hint style="info" %}
The account is your personal domain, through which you and your team members will be able to access the service.
{% endhint %}

To create an account, enter a name, for example, the name of your company or just any word you like. Note that the account name will be used as the domain for accessing the account. You can change the domain, but it must comply with the rules:&#x20;

1. Only latin characters, numbers, -, \_&#x20;
2. Length from 7 to 23 characters&#x20;
3. Must not start or end with "-" and "\_"&#x20;

After creating the domain, you will be taken to the main screen of the service and will be able to create bot scripts:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FHC7O627gTaCd28r0Ppf4%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-12%20%D0%B2%2013.54.03.png?alt=media\&token=ad48bb8a-4f1d-45b5-af7f-6581f1636fd9)


# More about scripts

В этом разделе мы рассмотрим, что такое сценарии

Brief video instruction for this section:

{% embed url="<https://www.youtube.com/watch?v=hdMlUPyUma8>" %}

After you have registered with the service, you will have access to a test script - onboarding.

{% hint style="info" %}
**Script** is a sequence of steps that the bot performs in response to events, such as an incoming message in a messenger, joining a group on a social network, or paying for an item in your online store.
{% endhint %}

Go to script. You will see a graph of the bot's dialogue with the subscriber:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqpPgdxTOyadA1rqLXDfv%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2015.16.24.png?alt=media\&token=017a1a9d-02c2-421e-96e0-f52d787e4176)

Script has *events* and *actions*

An event is an external influence that the bot can respond to. For example, the receipt of a message from a subscriber. An action is a step that the bot performs in response to an event.&#x20;

{% hint style="info" %}
**An event** is an external influence that the bot can respond to. For example, the receipt of a message from a subscriber
{% endhint %}

{% hint style="info" %}
**An action** is a step that the bot performs in response to an event&#x20;
{% endhint %}

Look at the generated script. It has several events (they are highlighted in blue) and arrows leading from them to actions:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FrC0eg7DUvK8P9deuTTAu%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2016.03.37.png?alt=media\&token=43096c99-29b1-4a9b-abd9-a2ee401a9214)

In the example above, you can see 2 events "message is similar to hello" and "message is equal to acquaintance". This means that the user can get into this scenario if they write the message "hello" or "acquaintance". Moreover, depending on the message, it will fall into different chains.&#x20;

{% hint style="info" %}
**A chain** is an event and the actions that follow it within a script.
{% endhint %}

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FnDtViL4UJnm4nXsOgcd1%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2016.11.43.png?alt=media\&token=82fd8e72-b03b-42b9-b3e9-ccbebbe6ff4d)

Smartbot works on a simple principle:&#x20;

If at the moment the user is not in any of the chains, then at the time of the event (for example, a message from the user has arrived), smartbot will look for a suitable scenario and launch the desired chain.


# How to add messenger

A short video about publishing bots to the right channels:

{% embed url="<https://www.youtube.com/watch?v=EgJB3_rttX4>" %}

When the script is ready to be tested, it needs to be published. To do this, go to the scenario settings by clicking on the "settings" button in the left menu:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FeGBrh7ucv7DL70oyaavG%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2016.40.15.png?alt=media\&token=5f1171a5-c8ef-4d89-904b-0308b0a94fb8)

The Connected Channels list shows all the channels to which the script is connected. This means that the script will run in those channels.&#x20;

{% hint style="info" %}
**A channel** is a medium for communicating with your subscribers. For example, a Telegram bot.
{% endhint %}

To add a new channel, click on the "Add Channels" button. You will be taken to the service settings, where you can manage all channels:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FHCVQnVZ3y7xMg12dgcS6%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2016.42.48.png?alt=media\&token=f6133b9a-5b25-4ebc-a468-5ed2d4e6c3ff)


# Adding Telegram

To add a bot to telegram, you need to enter the bot's token in the "Token" field. You can use the token of a previously created bot or create a new one using [BotFather](https://.me/BotFather).&#x20;

Follow the link and create a bot by following the instructions in Telegram:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F9MGad9fu8gTYXGH1lfxR%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2016.46.35.png?alt=media\&token=a2139129-9429-471f-8b03-02bc6dd42fd8)

In the add channel interface (above), paste the copied token and click "create". You can immediately select a scenario in which you can connect the created telegram bot. Once created, the new channel will appear in the list.


# Adding a bot to a group chat in Telegram

In order to add a bot to a group chat, you need to:

1. **Make sure the bot can be added to group chats.**\
   To do this, go to BotFather and select your bot settings: Bot Settings -> Allow groups?

<figure><img src="https://lh5.googleusercontent.com/WXDVzN7r3Oz2nm4RTPsAymX5ns8vmyt48-zDQeHD9jTZNW1tNJJjxw0L2WWH9s_gRl_ZfuQ3FPaRxWGN0pJn1P_uMuOKnxFCPlxqQZHTy6Et8SfwtLoYXZEkC7WcKumK89awAp0DrtMwfP4mr_7nDK67asXmwS45DfvcJlyLZ18V-GYia9pa1C5o2A" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh3.googleusercontent.com/-4EdDmvgPzt9l4Zc1TaR5x9T8TPupj7KpvCC2iDOov-CQ-hVjR7NdlaR10JefveNmTEB-TzH1s7avY8yRKTjv3lZVSFANmJHKXI_rFIZFsemsVkX9ZHoJJYp7GWghWQTskUVg1ztzrn3eHuZfYfQtkSCzgrKvIHV1A-fEv8hfs6eBsVHGWaJKbRaIg" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FwtNGzR1F7BgL23QkxLEN%2Fimage.png?alt=media&amp;token=56c39bd4-7de0-4d69-b038-144db1741118" alt=""><figcaption></figcaption></figure>

2\. **Check the status of the “Privacy mode” setting.**\
Pay attention to the setting “Privacy Mode” (Group Privacy).&#x20;

<figure><img src="https://lh6.googleusercontent.com/P68SQT2VQnUlHWjllrWkP518JEd9E3HMakGP_dFUKh_vBPkspVRCuUqgQzR_-iXFcm8cwvrwodwRL-RqzR0jWXk2B2Y7XgBZjXQWRlG37n0Q7vG3ZHGs-h-fsebgy13Iic_11AZbK07WQunoHTm8RfttaUl90Bw40w5wOOH6I3KFCgNJpQlp1rh5kQ" alt=""><figcaption></figcaption></figure>

By default, privacy mode is enabled, and the bot in a conversation will only respond to certain messages:&#x20;

* Messages starting with '/'&#x20;
* Bot's own messages&#x20;
* Service messages (people added or removed from the group, etc.)&#x20;
* Messages from the channels he belongs to&#x20;

You can read more about this feature [here](https://core.telegram.org/bots#privacy-mode).&#x20;

{% hint style="info" %}
If you want the bot to respond to all messages, turn off the privacy mode: in the “Privacy mode is enabled” state, click the “Turn off” button.
{% endhint %}

<figure><img src="https://lh3.googleusercontent.com/YZOxdnXRrg7oxzjLAUg3BJSxZa2_3DbOdFU1xmEnfkybl9jxbu-48izCB_16HIQUsuqJW9sO7dqbX_jnyEfuFELGiwr2x_NupPs_ugbrThdCRakBKWFeKtd41EUYEX1nqHIYTbB8cphSv782ggUVHarMx5ehIb5f9M4uxOTF2mE_XSQ40JVUt3mFrA" alt=""><figcaption></figcaption></figure>

3\. **The bot must be an admin in the group chat.** There are two options here:&#x20;

* Add a member and elevate their privileges:

<figure><img src="https://lh4.googleusercontent.com/F-jAt04MmXIBf_rif11hTCYIhI_Gq7MRrQpEe8IDZ6I_s_tWySrOJMbzRv4a8NdecMU-SY4Q6NxzXqrycfIPgzRqR1keuJZK9xp440q2AOBrZ07PHSeFevwsU3EhK4oXyiyP6QgTO4gCeyXWC_vzd23HkBcTM26V1XgT8NO3vnUOAdm9v3XeBEZqiQ" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh4.googleusercontent.com/9wHdKp3io7yZrt1aH9BFwqv3X-7FzQClD059cylVwqPtPMn9ql4PcQnSK8DdbNjheHmY4vvTFdaKjPCaZOKzIuOjmXs6gBCF_rL8ub28JJwwmVLjvbywUKzf69N64Ect1QHdqtZXbpPRIAPvO0gmL7gLEXL7I_RfmH2Y3ElHGaHmfqj4RDNnGcCwOA" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh6.googleusercontent.com/rYo-lLWgEhBz05Qgp-_ylMsyQy4zPZ3RH8s82vcDcIiPiiI9_1jW3vquZnpbbgIvY3mojAJ-UndHR0T0G8e6sOugYBHWxvFKcLs4nly0tZbk0v4t4SLxxefroE5LgIa9LQZqiXD-avzwKD2C_nOWOLGTx3l90mlBU3q3se3wKaPzXmSm7yEvwQ1lAA" alt=""><figcaption></figcaption></figure>

* Immediately make the admin (the minus of this option is that if the group is non-public, the bot will not appear in the search).

<figure><img src="https://lh3.googleusercontent.com/McNhJdPnFduHe-0OV9wN-rzr73NyWOJAXO_ILfigMwcanBxMA5AplAkfY7vjnLxYtxEhd9ylhPhx4-OcH15jduRHAm0oB5tFV1H4W3taBCrUBP1KYIUEKqwSSAfK5heDY0hzaYAiKOoYblhX31X_DSuMKN4cuteWBB946WizRgVkMJGOHyf8oHSbuQ" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh6.googleusercontent.com/x4LeYuUkkQWVf_2OUZUsiyv7naATt6qIKF2n8u75TTDiuCTpWvI3iHPRA1TOw-35sNsFNfpYr1GGGUAwuQioI4Nf5ZQdterMMtg1CSTMpIMTYEvcyh9j7UjRzR1_U9DC9kcI4Urts6u_mINuHdxv9vgRvcHYsZidd_u-0Scm_y2K99EKbQjl-8X-Pw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh4.googleusercontent.com/Mqu0yz4fs0yEUhFV91eKlN-z7oHKWYmPOJMEJNHEGMXG83q-FgCzARvLP-bl6rQv2NEAdhMCzWw_U_YrDj3trbsKFHcbgAot3-Xyg-6qNqbskmUTtzYtzokE8vxZ2kKZqJZYSoDmkqiApoxd8_lKz-SHGMimJAil0917oqFIXp5xwJp0HsLUeZBjkg" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh6.googleusercontent.com/rYo-lLWgEhBz05Qgp-_ylMsyQy4zPZ3RH8s82vcDcIiPiiI9_1jW3vquZnpbbgIvY3mojAJ-UndHR0T0G8e6sOugYBHWxvFKcLs4nly0tZbk0v4t4SLxxefroE5LgIa9LQZqiXD-avzwKD2C_nOWOLGTx3l90mlBU3q3se3wKaPzXmSm7yEvwQ1lAA" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Excellent! Your bot is now working in a group chat!
{% endhint %}

<figure><img src="https://lh5.googleusercontent.com/xXZmXtE7TGlXq4AMgK1aShJCo0TxaFofzjvEMrBqPMN_3VUu--wtMPtBfLGaUNpyqteSy2QBYyRt5a4sW99J7CaIXlRvSqhlhInzIx_w0Ub5zgyYH3m6aGRVBB5o1_nDzKuwIDxVpwXiC71Fgy7DPphEhZiMoI-6wYncT8Him20t8dYfSvp3Hf4btg" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh4.googleusercontent.com/joGSt1p4URoLwDcElM4F9Wu15JmbKd43c1TWU4FFsr0tp1clvAloTWBqvLk-sYMSwnu6rMqgwAkfEecLy9H7FrWdZXezmao7yqyaSwSvlJ74IaU7QivRYoabIEI-UoYWaPsiODgDcuJ3jWk-rEEWFRpNf0nQwJ-Cl7WyEsPPZ_xXRs-ZF0AgsuexZg" alt=""><figcaption></figcaption></figure>


# Adding ВК

The bot can work in a chat or a VKontakte group. To connect VK, select the VKontakte logo in the "add channel" menu:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FOlprEAMapfm6GOV4b7ZD%2Fimage.png?alt=media\&token=19c043db-dcaf-4250-9922-d1d224935859)

You will be redirected to the VKontakte authorization page and after passing it, the VK groups in which you are an administrator will appear in the list of available groups. Select the desired group where you want to add the bot and click "create a channel":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FbRpIYACBq8X6uE0V1HTn%2Fimage.png?alt=media\&token=6be00a15-ba29-487d-a635-d53d701ea9ad)

After that, you will be redirected to the VK page, where you need to grant rights to work with the group:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FLWNyW11ZXtDGmFBCLdIa%2Fimage.png?alt=media\&token=c48d44d4-79bd-4eb8-a450-7d5897d97c7c)

Click the "Allow" button at the bottom of the page.&#x20;

The selected VK group will appear in the list of connected channels:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FDE1ItV6lBdaOmDbpEUX1%2Fimage.png?alt=media\&token=da62bf03-181c-4170-b805-4c0b6dc7f4a9)

{% hint style="info" %}
The admin account of the VKontakte group is automatically linked when adding a VK channel. If you add your colleagues to the project, they will need to link their VK account according to [this instruction](https://app.gitbook.com/o/-M0DMiuC0q5onO-ID_le/s/uRfd5lEYYH6D50QjzeAX/~/changes/996w3IhouLXkvHdJdNpB/beginning-of-work/how-to-add-messenger/adding-vk#undefined).
{% endhint %}


# Adding Viber

To get started, create a bot in Viber through the [admin panel](https://partners.viber.com/login). Click the "Create Bot Account" button and fill in the fields:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FCx2Jio1W1zxrfYJET398%2Fimage.png?alt=media\&token=4bed1ae4-7497-49ca-9bbb-3ec2e4f2521c)

{% hint style="info" %}
Important: all correspondence and subscribers in Viber are tied to a phone number, so it must belong to the actual owner of the channel. Losing access to the phone is tantamount to losing the channel.
{% endhint %}

The item "The account contains adult content" means that your channel contains content for an adult audience. If you enable it, Viber will ask subscribers to verify their age.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F51HEaNbOA4aZW9WYfbog%2Fimage.png?alt=media\&token=232ade89-2924-4f78-8504-47af08de973c)

Check all the boxes and click the "Create" button (Create)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqXt34rLlSNnPF1yew4aG%2Fimage.png?alt=media\&token=00e77cab-0d0b-459c-b964-92d191b90b37)

Pay attention to the second point: this is an agreement to pay for Viber services in case of sending more than 25,000 messages.&#x20;

When everything is done, you will receive your bot token in Viber:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fz5bS27CUtGVeEP2IRGtt%2Fimage.png?alt=media\&token=39e41ad8-431c-498e-8cb1-828a58ec6d0b)

It remains only to copy it and paste it in the "Channels" section of Smartbot Pro

![](https://lh4.googleusercontent.com/iQ1rJJtTlYRM9KOUow5svJP-esMjHmb9yA3UmTiF6h15Xl8LWroCI86ZGC52Qr0TnXlrzeDiYI39SNoT1OG3GeeRdE6seoaloNqfrM-6uZhAZbaWnr5K2JI77NxLop_hHRSFQjfu2IaslvEqWw)

{% hint style="success" %}
Ready! Now you can communicate with your audience in Viber!&#x20;
{% endhint %}

Some features of Viber:&#x20;

* inline buttons are not supported and are sent as regular buttons
* The keyboard with buttons disappears after each new message (including debugging). Therefore, in order to test the transition on the button, you need to write the exact text from the button to the chat (it is better to copy this text directly from the constructor).


# Connecting a channel to a script

In order for the bot to start working in the channel, go to the scenario settings by clicking on the "settings" button in the left menu. In the window that opens, select the channels in which the script should work. By default, all channels will be connected to the script:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fl4EG7fVpY4ARFYCihWQR%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2019.11.28.png?alt=media\&token=c05d4e4b-72e5-4595-8633-4b77e22f5e25)

The "Connect all channels" checkbox means that the script will work, not only in all channels connected at the moment, but also in those that will be connected in the future.&#x20;

New channels will be added to this script automatically.

To test the bot in a channel, simply click on the channel link and write a start message that the script should respond to. In an onboarding script, this could be a "hello" or "introduction" message.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fk3dPIVYCqf6jKHDPdmBS%2Fimage.png?alt=media\&token=2a0b9657-dc69-4af2-964e-050890413d17)![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FI29VwY4UsLL34JXuiCau%2Fimage.png?alt=media\&token=3e18b1ad-9fe0-424e-b99a-64854df5182e)

{% hint style="success" %}
Congratulations! You launched your first bot  :thumbsup:
{% endhint %}

Now we can move on to more advanced scripting.


# Linking a social network account

Great, you have successfully added the channel and it will show up in the list. Pay attention to the "Account is linked" column. Displays here whether you have linked your social network account

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FAeKsNEmg1o99MjwaOtqf%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2016.53.14.png?alt=media\&token=04cd73b6-5e09-43cc-8c50-7137d73f3857)

Until the account is linked, you, as a manager, will not be able to test changes not published in the script, see debug messages, or use the "Works only for admin" setting.&#x20;

{% hint style="info" %}
Link your VKontakte and Telegram accounts to test unpublished changes, see debug messages, and use the "Works for admin only" setting
{% endhint %}

Click on the "Link" button:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F9mDfXPBl08O8HA3yNpLq%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2016.55.23.png?alt=media\&token=3acd1ed7-9b4c-4ee2-b3e1-11887bbeb792)

Copy the message and send it to your bot:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FUNpN02qyj0oDx8lUslTE%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2016.58.35.png?alt=media\&token=e005d6bf-aabf-40c2-b3fc-38c00ce2dd99)

After that, the value should change to "Yes", that is, the account has been successfully linked.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FMq0bATP6rAZnIJiPN3In%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2016.59.44.png?alt=media\&token=cac10fe2-44c7-4cc5-9b82-37290714a911)

{% hint style="success" %}
Excellent! You have successfully added a channel to Telegram and linked your account in order to be able to use the testing functionality in full! 👏
{% endhint %}


# Basics

In this section, we'll learn how to get started with scripting.


# Create a script

In this section, we will look at the process of creating and running our own scripts.

{% hint style="info" %}
**Script** is a sequence of steps that the bot performs in response to events, such as an incoming message in a messenger, joining a group on a social network, or paying for an item in your online store.&#x20;
{% endhint %}

Before reading this section, we recommend that you familiarize yourself with the [basic principles of scripting. ](https://app.gitbook.com/o/-M0DMiuC0q5onO-ID_le/s/uRfd5lEYYH6D50QjzeAX/~/changes/996w3IhouLXkvHdJdNpB/beginning-of-work/more-about-scripts)

To create a script, go to the "scripts" section through the menu on the left and click the "add script" button:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FK3Ma3WBIs7arbiT3Stq8%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2019.28.24.png?alt=media\&token=7d36fa0c-2251-47e9-81f2-1b9cf7be739e)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FfHGqtKKUf9n6o6CTR95Y%2Fimage.png?alt=media\&token=380242c2-7407-43b6-8536-17b39ff73e60)

Enter a script name and click "create".&#x20;

After that, you will be taken to a blank script creation screen. Take a look at the menu on the left:

* Events are external influences that can trigger a scenario. For example, a message from a user
* Actions are the steps that the bot performs in response to events
* Conditions - you can set the conditions under which the logic of the dialogue can change. For example, if a person has already bought a product from you before, offer him another product
* Variables - a list of available variables for use in scripts
* Settings - scenario settings

Let's create a simple conversation chain where the bot will respond with the message "great" to the question "how are you?".&#x20;

To do this, select "user input" in the events. An event block will be created on the scenario graph and its settings will open:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FiPKuDPz1lUffQrOV5MGT%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2019.37.18.png?alt=media\&token=9a2b8abb-5b33-4b84-ab16-3f39237e77de)

Pay attention to block settings.&#x20;

You can specify the name of the event (so it will be easier to search for it on the graph), the condition for the user's message and additional settings.&#x20;

Now it is enough for us to specify only the condition. We expect the user to ask "how are you". Let's add it to the message condition:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FAMSme4vcDOnxTM6POAxV%2Fimage.png?alt=media\&token=d5c2c1c4-7305-4714-8e6f-05b0c581b991)

Great, now let's add the "send message" action. Select the "actions" section in the left menu and click on "send message". A block for sending a message will be added to the script graph and the settings will open:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fq7tesEl3t1fhaELn9M0K%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2019.47.35.png?alt=media\&token=4546fdf7-ae7d-4f21-a500-471942cb2a99)

We will consider the settings of the "send message" action in detail in other sections, but for now it is enough to enter the desired message. Write "excellent" in the message input field. After that, the script graph will look like this:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FCaGNcaac6ajmDtY1ohRF%2Fimage.png?alt=media\&token=deedd0f1-2e69-4ceb-b5f7-22f9f85c66e8)

These blocks are not linked. To set the dialog sequence (event -> send message), hover over the event block. A circle will appear from which you can drag an arrow to the message send block:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fo9nXNNnzjBd74GsKe9d2%2Fimage.png?alt=media\&token=310a16a3-0e34-4e58-b86c-e122f887083f)

The blocks are now connected. By the way, it was possible to link them through the "next block" setting in the event settings menu:

<img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FLejhlcXa1kd67oW5rU2q%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2019.51.47.png?alt=media&amp;token=b793da52-af84-49be-bc9e-4c62f62f9293" alt="" data-size="original">

This can be convenient when the script graph is very large and it is difficult to drag an arrow from one block to another.


# Script templates

You will learn how to use ready-made scripts

Smartbot Pro has publicly available script templates: bot menu, lead form, registration for services (the list will be updated!)&#x20;

**A template** is a ready-made script, the basis of your chatbot. All functions are already configured. You only need to adapt the template for yourself: add texts, media files, if necessary, give your names to lists and variables.

{% hint style="success" %}
There is no need to figure out how to create a bot from scratch when there are ready-made examples. Use them!&#x20;
{% endhint %}

The catalog of available templates is in the "Scripts" section 👇

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FaXfTb6F6oBNol9Pam6Yi%2F1.png?alt=media\&token=4789b8df-4b76-4c64-92db-3b7d022715cb)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FpTRqvqXxTulNXeMVh1IU%2F2.png?alt=media\&token=df39e39a-2249-4a49-810d-55de5266623b)

To add a template to your project and access its editing and customization, click "Use". The button is available both from the catalog and after previewing the template.&#x20;

Once you have added a template to your project, you can edit and add to it.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FZRdbEKRDJqjvxr3u9f51%2F3.png?alt=media\&token=23433f96-dd31-45ef-a3ce-3d19850b8f1d)

Next to the blocks that can cause difficulty, there are text explanations. They will help you get used to Smartbot Pro functions even faster and solve even the most complex business tasks.

{% hint style="info" %}
If you haven't found a suitable scenario, but you know which template would be useful to you and other users - write to us! We will complete the catalog
{% endhint %}


# Editor interface

In this section, we will consider the main functionality of the script editor interface.

In the ["Creating a Script"](https://app.gitbook.com/o/-M0DMiuC0q5onO-ID_le/s/uRfd5lEYYH6D50QjzeAX/~/changes/996w3IhouLXkvHdJdNpB/scripts/basics/create-a-script) article, we created a simple script. Let's take a look at the editor interface:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FLCituC0lgZq5Dqd0i7ga%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2019.59.07.png?alt=media\&token=0a01e999-4307-461c-8c51-923fed1227ec)

On the left side of the interface there is a menu of blocks and script settings. All actions are covered in other sections.

## Interface control

### Removing blocks

To delete a block, click on it and press the recycle bin icon in the block settings menu or press the DELETE key.&#x20;

To delete an arrow, select it and press the DELETE button.

### Copying and pasting blocks

To copy a block, click on it and press CTRL + C or CMD + C (for mac os). A notification about copying blocks will appear.

To paste the copied blocks, use the key combination CTRL + V or CMD + V (for mac os).

### Block selection

To select multiple blocks at once, hold down CTRL and select the desired blocks.&#x20;

Then you can copy and paste or delete the highlighted blocks using the keys described above.

### Rescaling the Script Graph

To change the scale of the graph, use the mouse wheel or the pinch gesture or cmd + scroll (for mac os).

## Block search

On the top right is a button to search for a block by name.

Click on the search icon. A menu will pop up in which you can enter the name of the block (if you gave it) or select a block from the list:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fwi40spegvy5GuhX3skKf%2Fimage.png?alt=media\&token=1a824e67-f16c-49c6-88a7-429074e6ee06)

By clicking on the name, the script viewing area will automatically move to the corresponding block and its settings will open.&#x20;

## Script Minimap

At the bottom right, there is a mini-map of the script for quick navigation between blocks. Click on the map icon to open it:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FJLf92ggVZkxr9H2S1Vcp%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2020.05.39.png?alt=media\&token=80fdf978-a0d9-4928-a11f-ac4f1dd3486e)

You can move the mini-map and the position of the graph will change accordingly. This allows you to quickly find the necessary "pieces" of the script.


# Publishing a script

Briefly talk about the script publishing interface

## Publishing a script

The publishing interface shows the current state of the script. Possible states:&#x20;

* Script not published
* The script has been published and has been modified since the last publication&#x20;

"The script is not published" means that it does not work in any channel and is still a draft. If the script is not published, the publish button will be available to you. More information about connecting channels is written in the article "How to connect the messenger".&#x20;

If the script was published earlier, then it is already working for your subscribers. However, you can change it in draft mode. For example, you want to change the logic of the bot, but do not want to publish it right away, but first you want to test it. In such a case, you can modify the script and test it, but not publish it. In this case, the publishing interface will look like this:

Интерфейс публикации показывает текущее состояние сценария. Возможные состояния:

* Сценарий не опубликован
* Сценарий опубликован и был изменен с момента последней публикации

"Сценарий не опубликован" означает, что он не работает ни в одном канале и пока является **черновиком**. Если сценарий не опубликован, вам будет доступна кнопка публикации. Подробнее про подключение каналов написано в статье ["Как подключить мессенджер"](/beginning-of-work/how-to-add-messenger).

Если сценарий был опубликован ранее, то для ваших подписчиков он уже работает. При этом вы можете его изменять в режиме черновика. Например, вы захотели изменить логику бота, но не хотите сразу публиковать ее, а сначала хотите проверить. В таком случае вы можете изменить сценарий и тестировать его, но не публиковать.

В этом случае интерфейс публикации будет выглядеть так:

&#x20;

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FKLTJMwn6wpgJDA9o6DqB%2Fimage.png?alt=media\&token=2714c06f-da0d-4499-b3fa-d25390e4c144)

By clicking on the "show published version" button, you will switch to the "clean" version of the script, that is, the last published version. Your followers see it.&#x20;

By clicking on the "reset changes" button, all your changes relative to the last published (clean) version will be deleted. The script will return to its last published state. The "changes not published".

icon is shown if you have changed the script graph after publishing. That is, what you see now is a draft version.&#x20;

To publish a draft, click the publish button. Then your draft (what you see in the script editor at this moment) will become a "clean draft" and will work for all subscribers.


# Script testing

Here we will tell you how to check the operation of your chain in one click

Before running the script for users, it is worth testing it for yourself.&#x20;

We advise you to first enable the output of debug messages in the project settings in order to see exactly what actions the bot performs.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FRLeeIMUodbd44CrAdyN2%2F%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B8%20%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D0%B0.png?alt=media&amp;token=7cf1d385-e760-4a3f-a603-6868bbf36763" alt=""><figcaption><p>Переходим в настройки проекта</p></figcaption></figure>

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FvjG4NWfYoKWzAflrOlRU%2F%D0%9E%D1%82%D0%BB%D0%B0%D0%B4%D0%BA%D0%B0.png?alt=media&amp;token=c48615bd-b4a1-46af-b549-f469e3bcb034" alt=""><figcaption><p>Включаем режим отладки</p></figcaption></figure>

Now we need to go to the script that we will test.&#x20;

Hover over the block you want to start testing from. An indicator with three dots will appear on the right.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FBxGHsC3K2YsxzYHeOrP5%2F%D0%A2%D1%80%D0%B8%20%D1%82%D0%BE%D1%87%D0%BA%D0%B8.png?alt=media&amp;token=30324757-852e-4362-b579-66cb0c72c3e0" alt=""><figcaption></figcaption></figure>

When you hover over this indicator, a context menu will appear, where you will see the item "Test"

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FGWza57CUBcAftoLWe4RD%2F%D0%A1%D0%B8%D0%BD%D1%8F%D1%8F%20%D0%BA%D0%BD%D0%BE%D0%BF%D0%BA%D0%B0.png?alt=media&amp;token=5c70447f-b331-4abb-b6f6-02c2f9bcd810" alt=""><figcaption></figcaption></figure>

Click on this item, and a list of your channels associated with the scenario will appear on the side.&#x20;

It remains only to click on the "Start" button.&#x20;

The bot will send messages to the specified channel.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fp3bmP7XJSuQCakRgVfgZ%2F%D0%97%D0%B0%D0%BF%D1%83%D1%81%D0%BA%20%D1%82%D0%B5%D1%81%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F%20%D0%B2%20%D0%BA%D0%B0%D0%BD%D0%B0%D0%BB%D0%B5.png?alt=media&amp;token=4abb1ff1-adc8-4bfe-ad19-93845eebca72" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FMwhWM3kSXJwgwTkZuwbI%2F%D0%A2%D0%B5%D1%81%D1%82%20%D0%B2%20%D0%A2%D0%93.png?alt=media&amp;token=927a6451-cb77-4868-8094-3e7ac0024ef2" alt=""><figcaption></figcaption></figure>

You can test the scenario both from the very beginning and from any block :thumbsup:


# How the script is chosen

In this article, we will tell you how Smartbot chooses a script to run

Before reading, we recommend that you read the [article about scripts. ](https://app.gitbook.com/o/-M0DMiuC0q5onO-ID_le/s/uRfd5lEYYH6D50QjzeAX/~/changes/996w3IhouLXkvHdJdNpB/beginning-of-work/more-about-scripts)

When an event occurs, to which you set a reaction in one of the scenarios, the bot starts checking the scenarios to find the best one.&#x20;

For example, you have created several scripts and in each of them you have set a "user input" event with the expectation of a particular message.&#x20;

When the subscriber writes one of these messages to the bot, or another script trigger condition is triggered, the bot will start executing the corresponding chain.&#x20;

Note that within a script, you can specify multiple chains at once. To do this, it is enough to create several start events inside the script:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FpLypUqSRaEoVjpG00l93%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2021.19.48.png?alt=media\&token=54a95086-f6b8-4319-b31b-f5acc3a97348)

The screenshot shows 3 events, from which there are different chains. But all these events are combined into one scenario. In fact, a script is a set of events and bot logic united by one subject area. For example, you can make a "delivery questions" script and add several chains there that will answer the questions "what cities do you deliver to", "how long does it take for delivery", "how much does delivery cost", and so on.


# Script events

{% hint style="info" %}
**An event** is an external influence that the bot can respond to. For example, the receipt of a message from a subscriber.&#x20;
{% endhint %}

The bot always starts the script on some of the events. And chooses exactly the event that fits best. You can read more about this in [this article.](https://app.gitbook.com/o/-M0DMiuC0q5onO-ID_le/s/uRfd5lEYYH6D50QjzeAX/~/changes/996w3IhouLXkvHdJdNpB/scripts/basics/how-the-script-is-chosen)

{% content-ref url="/pages/aNLbFPznLCk2ZdUj9B0H" %}
[Message from user](/scripts/script-events/message-from-user)
{% endcontent-ref %}

{% content-ref url="/pages/37ZECzlfYaapDk1jzOny" %}
[No appropriate script](/scripts/script-events/no-appropriate-script)
{% endcontent-ref %}

{% content-ref url="/pages/wWtw4c8qvPDX2Jy9bjGn" %}
[First message](/scripts/script-events/first-message)
{% endcontent-ref %}

{% content-ref url="/pages/1RUUkv4EBCznm4UQKIsN" %}
[VK Events](/scripts/script-events/vk-events)
{% endcontent-ref %}

{% content-ref url="/pages/DKOcK4CReXU2Z3UeKPZO" %}
[Webhook](/scripts/script-events/webhook)
{% endcontent-ref %}


# Message from user

In this section, we will cover the input event in detail.

The "user input" event is responsible for the message from the subscriber. When a message is received on the [channel connected to the script](https://app.gitbook.com/o/-M0DMiuC0q5onO-ID_le/s/uRfd5lEYYH6D50QjzeAX/~/changes/996w3IhouLXkvHdJdNpB/beginning-of-work/how-to-add-messenger), this event fires.&#x20;

To add an event to a script, select it in the left menu of the script [editor interface](https://app.gitbook.com/o/-M0DMiuC0q5onO-ID_le/s/uRfd5lEYYH6D50QjzeAX/~/changes/996w3IhouLXkvHdJdNpB/scripts/basics/editor-interface)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FRPp7r6DixN1t4H7kjeqa%2Fimage.png?alt=media\&token=3fe41c17-d489-43e3-b3af-66681400f1f2)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FbfyYxF2CbLIxxCYQLUUn%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-13%20%D0%B2%2021.26.42.png?alt=media\&token=a2d13627-61a0-48cd-b65f-fcde188d2a5a)

On the right you will see the event block settings. Let's take them in order:

## General settings

The name of the event allows you to set any name of the block that is convenient for searching. This field does not affect the execution logic in any way.&#x20;

The next block indicates the block that the bot will execute immediately after the event occurs, that is, immediately after receiving a message from the user.&#x20;

In the IF conditions section, you can specify different conditions for checking a message or user data, or even use complex conditions in the internal SmartQuery language. A separate article is available about conditions and different types of comparison.

## Global entry

The "global input" checkbox means that this event will always be checked when the bot cannot process user input while already in the current scenario.&#x20;

For example, the bot is already running in your scenario and performing actions. But then the user writes something that is not intended by your script (for example, you expect the user to answer, and he enters an option that is not provided by the condition.&#x20;

In this case, instead of completing the scenario, the bot will go through the conditions of those events within the current scenario, in which the "global entry" checkbox is checked.&#x20;

## Chain priority

Sometimes it can happen that several event conditions fire at once. For example, you can make 2 events with exactly the same conditions, or use the "similar to" fuzzy comparison mode. In this case, by default, the bot uses a random chain.&#x20;

But you can influence this behavior by specifying the chain priority.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQD88V23polhTWGpwkbgp%2Fimage.png?alt=media\&token=4b85c4b0-22aa-45f3-94d1-43797b8c6860)

The higher the priority, the earlier the block condition will be checked. Therefore, if there are several conditions triggered at the same time, the bot will choose the one with the higher priority.&#x20;

This way you can control the highest priority chains of dialogs or, conversely, make "backup" lower priority chains that will work if the priority ones did not work.


# No appropriate script

In this article, you will learn how to set up a bot to respond if a message from a user does not fit any script.

1. Go to any scenario or create a separate one
2. On the left, in the events section, select "No suitable scenario"
3. Further, you can associate this block, for example, with sending a clarifying request to the user, or with another necessary action

![Образец настройки, при которой бот, не найдя подходящего сценария, просит пользователя уточнить запрос ](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FRfXZSxGn0E6YDIQCxlnz%2F%D0%9D%D0%B5%D1%82%20%D0%BF%D0%BE%D0%B4%D1%85%D0%BE%D0%B4%D1%8F%D1%89%D0%B5%D0%B3%D0%BE%20%D1%81%D1%86%D0%B5%D0%BD%D0%B0%D1%80%D0%B8%D1%8F.png?alt=media\&token=992085d0-1059-4be1-b52b-dfd65117c29c)

Now, without finding a suitable answer, your bot will still be able to answer.


# First message

Here you will learn how to set up a greeting in response to the user's very first message.

The event fires when a user first writes to you in a group or channel.&#x20;

Thus, for an individual, it is disposable. You can set up a greeting, a warning, a bonus issue, or familiarization with the rules, if necessary.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FSImhSxAxjQIjQgEsaNoa%2F%D0%9F%D0%B5%D1%80%D0%B2%D0%BE%D0%B5%20%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D0%B5.png?alt=media\&token=cab84114-77b1-4267-8336-d29c5fbe8f73)

Now you know how to make a first impression!


# VK Events

Here we will tell you how to set up a bot to respond to likes, reposts, joins and exits from your VK group

The list of VK events is in the left menu, in the "Events" tab:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F1WBYXlz3bVhNr9PNzXDo%2F%D0%A1%D0%BE%D0%B1%D1%8B%D1%82%D0%B8%D1%8F%20%D0%92%D0%9A.png?alt=media\&token=fbe4aaff-165d-410a-b007-37aa70bdd0ea)

Like/remove like and repost

> The event works only for VK channels

With the help of this event, you can earn points for likes and reposts, as well as prevent cheating by deleting likes.&#x20;

If the publication, like most VK posts, consists of text and a picture, the like reaction will work twice (on the post and on the picture).&#x20;

{% hint style="info" %}
To make your bot react to a specific post, open the block and select "Object ID condition". Here you can also select the type of object: post, picture, video, etc.
{% endhint %}

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FrczW0dqIYu5yNUG6pVTJ%2F%D0%9B%D0%B0%D0%B9%D0%BA.png?alt=media\&token=76acd314-c763-4ca0-b9f3-ceb97b6fe091)

Deleting likes and reposts works the same way.&#x20;

### Joining/leaving a group&#x20;

> Only available for VK groups

You can configure the action that the bot will perform if a person joins a group or subscribes to a community, for example: give him a bonus (by changing a variable), record an event in statistics, or send a message.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FvTERZ82FubjGyzFEXgVl%2F%D0%92%D1%81%D1%82%D1%83%D0%BF%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%B2%20%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D1%83.png?alt=media\&token=720af567-2100-437b-827c-3be0686169f3)

{% hint style="info" %}
Please note: a message will be sent to the user's LAN only if he has allowed the group to write to him in the LAN.&#x20;
{% endhint %}

If the user has unsubscribed, the bot can send them a “farewell letter” or a survey to understand the reasons for unsubscribing.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FPrEyniM7bDk4s9nN9kJ7%2F%D0%92%D1%8B%D1%85%D0%BE%D0%B4%20%D0%B8%D0%B7%20%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D1%8B.png?alt=media\&token=c658d599-7356-4eb3-b02a-a220b1177a68)

In such a simple way, you can apply VKontakte events!


# Webhook

This function allows you to launch the bot via API from any other service.

### Why is it needed&#x20;

Example: a user got into an online school bot.&#x20;

The bot told about the courses, and the client went to the site. Bought one of the courses there. If you set up webhook integrations in the course learning platform, then the bot will write to the client itself.&#x20;

That is, with the help of a webhook, another service can launch the desired Smartbot Pro script chain.

### Creating and configuring a webhook

1. **We create a token**

You can create a new token and see a list of all project tokens in the Integrations section.&#x20;

To run the bot, you need to create a token with the right to execute blocks. Click "Generate Token" and select "Access Level - Block Execution".

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FOmOpviRcuzM6x3MyPSmH%2Fimage.png?alt=media\&token=ce58d0aa-2c1d-4ee7-ae05-0dae71f8d3c2)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FtYbsTZymn4BkEHn3WZj0%2Fimage.png?alt=media\&token=766a5694-7176-4fee-af83-db516d9892e3)

**2. Create a "Webhook" event in the script**

In the script to start the chain from another service, you need to set up a special Webhook event that will allow you to launch the bot via the API.&#x20;

Go to the desired scenario, select "Events" --> "Webhook" in the side menu.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fdm9MMwriQbyahVC9GBft%2Fimage.png?alt=media\&token=c936670b-8e41-403b-bfd0-ed9ece35fd91)

**3. Specify the token**

In the Webhook block, select the created token or create a new one.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FyhgCru0qPUzKmF4effks%2Fimage.png?alt=media\&token=dd232ddd-197a-4dff-b14c-09ba21ec0634)

**4. Choose a channel**&#x20;

Select a channel on the social network where the bot will work after you "pull" it with a webhook.&#x20;

If the bot works simultaneously in the LAN and in the conversation, you must also specify the desired chat:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F2DqcJyYcu1Lf1Tfzqy9C%2Fimage.png?alt=media\&token=c23d4583-5a67-45f6-b196-e7d32d109960)

**5.** **Request parameters: URL and body.**

Copy the specified URL and send a POST request to it from your service.

![:](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FI3UEiS2xj47sepXjn4pC%2Fimage.png?alt=media\&token=f0654950-49e9-42f8-be16-93a1174a0627)

Copy the following JSON and paste it into the Request *Body*:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FtYGFifhKguQh1OSodmtz%2Fimage.png?alt=media\&token=02fb86ce-1d87-4b95-a025-39ff5d7ed8d4)

{% hint style="info" %}
peer\_id is the ID of the chat to which the message from the bot will be sent
{% endhint %}

* If the bot should work in a group chat, then the peer\_id will be set automatically
* If the bot should work in the LAN, then the peer\_id must be filled in independently in accordance with the prompt

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FxzRSL9kmj32yy1s22mme%2Fimage.png?alt=media\&token=8246391c-ce15-4159-acdc-4f58b0f76034)

### Requirements for sending a message via Webhook

For a user to receive a message via a webhook, two conditions must be met:

* allowed to send messages to PM
* the user has already communicated with the bot (the bot cannot be the first to write to the user)

### Deleting a token

If the token is stolen by an attacker, it must be deleted in the Integrations section.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F1SBPjlhWh0LO9Dy8Urtt%2Fimage.png?alt=media\&token=0cbc5305-48d6-4091-bb0f-1246bd73fc29)


# Actions

Actions in Smartbot Pro are steps taken by the bot in response to user commands.

There are 10 in total:&#x20;

1. send a message&#x20;
2. Process message&#x20;
3. set variable&#x20;
4. Extract data&#x20;
5. Write to statistics&#x20;
6. Run Smart Query&#x20;
7. Working with the user&#x20;
8. Switching to another scenario&#x20;
9. Scheduled transitions&#x20;
10. Write to the manager&#x20;

Actions are added to your script screen as rectangular boxes.&#x20;

There are two ways to add an action:&#x20;

1. Select the desired action in the additional menu

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fk1mDFSRwGDEI74WOs4ln%2F1.png?alt=media\&token=d07d58ff-3fe2-413a-8199-80e8c5554f95)

2\. Right-click anywhere on the screen of your scenario and select the desired action from the pop-up window

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQ5nrRPf1466UUZqyR3OS%2F2.png?alt=media\&token=f3504ed8-02af-4396-958b-dd6679b8b18c)

A new action block will appear in the middle of your script screen. The right menu of block settings will open automatically.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FhoQLMuPwcziAcdnAwbo7%2F3.png?alt=media\&token=bbe68fe6-ed82-4a59-bc6b-7feb081ee132)

Action blocks are connected by arrows.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F8b8GYp0kgscJpJvsjLuX%2F4.png?alt=media\&token=7d99be07-59aa-4e7d-971c-36fd111b5754)

In order not to look for the next action on the screen for a long time, you can select it in the block settings menu (on the right) in the "Next block" section:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FNCUbbBnwAnPtODPfFltO%2F5.png?alt=media\&token=99c1c670-cf53-45d6-9d6e-a7290a094152)

All blocks of your script are displayed here. When you select the right one, the arrow will automatically connect the two blocks.

### Quick Block Editing

Actions, like any other blocks, can be deleted, copied and pasted.

* **To delete an action**, click on it and press the trash can icon in the block settings menu or press the DELETE key.&#x20;
* **To copy a block**, click on it and press CTRL + C or CMD + C (for mac os). A notification about copying blocks will appear.&#x20;
* **To paste the copied blocks**, use the key combination CTRL + V or CMD + V (for mac os).&#x20;
* **To delete a connecting arrow**, highlight it and press the DELETE button. Don't forget that the bot always needs a message from the user to start working.&#x20;

Therefore, do not forget to associate bot actions with events.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FytcnI64VfrUYGqY5Fd1W%2F6.png?alt=media\&token=6a2d2bff-4983-4001-8ef4-069d8fe7619a)

When your script is ready, all you have to do is [publish it.](https://docs.smartbotpro.ru/scenarii/publikaciya-scenariya)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FhBsZlUgHV1A3Q6VMj9vc%2F7.png?alt=media\&token=e2236996-b92d-4bfe-b0ad-7bab6b908f72)

From now on, it will work in the [selected channel.](https://docs.smartbotpro.ru/nachalo-raboty/kak-podklyuchit-messendzher)


# Send a message

The "send message" action allows the bot to send text, emoji, buttons, and attachments to the user.

Right-click on an empty area of ​​the screen and select the action "send message":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQEWOv6004ojOXVomYZ9b%2F1.png?alt=media\&token=c541a3ab-c438-4574-91e1-17fdf6e075d6)

Or select the same action in the left additional menu:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F7k5xEa4ZWRSIO0eOYqAg%2F2.png?alt=media\&token=d6e5e9e5-2366-433d-9126-fca9c91a034f)

The "Send message" block will appear, and its settings menu will open on the right:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FXxqhoaWThqs6gxrg2qpF%2F3.png?alt=media\&token=f1a94ce1-89b8-4178-9f91-3c3db4dcc92b)

In the block settings menu, you can give a unique name to the action block, enter the desired message text, add buttons and attachments, and select the next block.

### Attachments

You can attach to the sent message:&#x20;

* image&#x20;
* video&#x20;
* audio recording&#x20;
* a voice message&#x20;
* sticker&#x20;
* document&#x20;
* other files&#x20;

To do this, click on the paperclip icon to the right of the text input field:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FjrMiiyue7hKiM3PHgY7Q%2F4.png?alt=media\&token=4a98ede8-ebe4-49a9-8d85-3fba7937a38f)

In the attachment download window that appears, select whether to download the file from your device or via social networks. net.&#x20;

*Please note: if your account in the social network is not linked to Smartbot PRO, then you first need to go through authorization.*

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FxvJurg6Miup8sQlGZoFn%2F5.png?alt=media\&token=8279e2ac-d1d7-4fde-9e59-dda55de946bb)

In the second case, you need to write in the LAN of your bot (in VK or Telegram) a special command /sb:upload

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FEIE7UJyzFWRuXoJ4I6tC%2F6.png?alt=media\&token=481d7ba0-2296-414a-90f8-0d98a3eb9df7)

After that, your bot will enter attachment download mode. It remains only to send the files.

![Так выглядит прикрепление вложений через TG ](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FxIBNWGBIxqtAsjeNtH5r%2F7.png?alt=media\&token=d59ca12a-701c-4344-8a4c-03ca24af1420)

Uploaded files are available in the attachment selection window. Click on the one you need so that a check mark appears on the right, and click the "Add Files" button:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FdSGyyHQ78xlOKDv779XX%2F8.png?alt=media\&token=02929c92-ea37-40c4-afa7-029bddff3b16)

Our picture appeared in the list of block menu attachments:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fq6RdutWtELmdnDdtiQaU%2F9.png?alt=media\&token=ca28cb86-02d4-4eb5-aa38-8f963d112d25)

### Additional settings for the "Send message" action

In additional settings, you can enable waiting for a response from the user. In this case, the bot will not do anything until the person writes to him. You need to wait for a message if you ask the user a question or offer a choice.

![Бот не будет ничего предпринимать, пока человек не напишет сообщение](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FAeqFFQNOzjGMgzebi1ii%2F10.png?alt=media\&token=f0e96b6b-5058-4a98-a896-2f125f0da190)

You can also set a timeout limit.&#x20;

Then a timer icon will appear on the block, and two ways to continue in the block menu: if the user managed to send a response and if the time has expired.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FjlSg3wnjlQDMmgzWgz0j%2F11.png?alt=media\&token=4c8d0f87-8613-48e0-803e-9ebafe9312b3)

If you check the "Disable global search" checkbox, the user will not be able to move from the current script chain to another one by writing a command of another chain.&#x20;

Don't forget that the bot always needs a message from the user to start working. So don't forget to bind actions to events:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FD2TbXs1CKr4YP8y0lva8%2F12.png?alt=media\&token=dce7c2cf-e008-4ae4-a29c-d1cc233f5c3e)

This is how a possible message with an attachment in Telegram looks like:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FxtNo6BO7KSD60gHdII3R%2F13.png?alt=media\&token=d7fe651f-ae3e-4713-9c43-fd4a89b6595a)

And so in VKontakte:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FvaiHBK9TtnfEF4deTGrz%2F14.png?alt=media\&token=97202a9d-5301-4b18-a927-ea5fc0e28bfd)

Now you know how to send messages to Smartbot Pro!


# Buttons

In this article, we will look at how to add interaction to your script using buttons.

Buttons make it much easier for the user to navigate within your scripts.&#x20;

To add buttons, let's create the "Send message" action (choose on the left auxiliary menu or right-click in an empty area of ​​the screen).

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fz5cneuOSRFVDAAXvqdCq%2F1.png?alt=media\&token=a24ddd5a-035e-452c-9e79-831874c89f40)

In the menu of the block itself (on the right), select "+Add button"

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fo6dEL2UPVCjp7R19yW8Z%2F2.png?alt=media\&token=b276b788-d823-4a26-a375-a3d863fe7815)

When our button appears, click on it, and a customization menu will appear on the side, where you can enter text on the button, select the type and color, and delete the button.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FJbXqZ2ZOj5gE5SbyUzWH%2F3.png?alt=media\&token=934a6349-6558-4ca1-8e0a-397f72b42a48)

In addition, you can choose whether to hide the buttons after use, or show them inside the message (inline):

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F1JZLyvA4MsKisMAeLudJ%2F4.png?alt=media\&token=a2c18b8a-1650-4b9d-a2a9-a4762e36404b)

This is what a possible result looks like:

![в Telegram](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FiAgow1dx45JdiSIUSlgA%2F5.png?alt=media\&token=1bdc7d9f-f20d-4551-a28e-c3da61a1c6f7)

![Вконтакте](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FZT2enI9JjIhKTsCIos6U%2F6.png?alt=media\&token=6891af83-bdbf-4eb3-8cb9-77c9c54f0124)

Now you know how to add and customize buttons in your bot!


# Process message

The "Process message" action processes the message from the subscriber. Allows you to immediately extract the necessary data and write it to a variable.&#x20;

To add an action, select it on the auxiliary panel (on the left), or right-click in an empty area of ​​the screen.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fdm6QAOxbonVjv4w9NV3l%2Fimage.png?alt=media\&token=10462ac4-f44d-46f3-8592-259875ae6b00)

An action block will appear on the script screen. A menu will open on the right.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FZnHtPdvutxUrYa1WGn2g%2Fimage.png?alt=media\&token=9c4c6144-8ef7-4c01-a0ee-f0a901504a10)

If you do not check any boxes in the block menu, the bot will simply allow the person to enter a message and move on to the next specified block.&#x20;

However, the "Set Message Template" and "Retrieve Attachments" options allow you to retrieve data and save user attachments to variables.&#x20;

Check the box "Set message template" and enter the template. The main element of the template is any word(s) in brackets <>

Template example: "phone and mail ". That is, we expect the user to send us their phone number and mail in this format.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F5UOYsnzqYOBZhaUU9nLE%2F4.png?alt=media\&token=2457983e-6cde-4e78-9aa8-e2cc9b667a9b)

For example, the message "phone number 89123456789 and mail <client@mail.ru>" is suitable for such a template (it is good to inform the user in advance that he needs to write his data in this way).&#x20;

The bot will extract "89123456789" and "<client@mail.ru>" and write it to the variables you specify.&#x20;

In the same way, you can extract attachments from a sent message, select their number, type, and maximum size.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FgFZ0PFh2WgsC2FTUNrs8%2F5.png?alt=media\&token=44da9bc8-0bac-422d-9b6c-1f565333515e)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F7LCeypMJQHHwTAhiUZd9%2F6.png?alt=media\&token=a654ce9e-716a-410d-a05e-ee2e1c7f9da1)

Now you know how to apply the "user input" action.


# Extract data

{% hint style="info" %}
The "retrieve data" action is an indispensable assistant in obtaining and saving information. With it, you can extract any content from any string in a given format.&#x20;
{% endhint %}

Let's add a block by selecting an action in the additional menu on the left or by right-clicking on a free area of ​​the screen.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FkcGAdIJGwd1apWHkk2nr%2F1.png?alt=media\&token=4e5065c6-5c6b-4389-96f1-b80a174655a7)

The action block menu contains an input value, a message template, a filter, and a variable to write the data to.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fb6ONOmioB24IvUcO7s70%2F2.png?alt=media\&token=bab23dc3-efc1-4d00-b2be-b8e1fce08740)

The "Input Value" field is an indication of any string from which to extract. &#x20;

{% hint style="info" %}
If you specify the %message% variable as the input value when performing the action, the bot will take data from the subscriber's last message
{% endhint %}

Start typing the pattern and the filters will appear.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FV3hByWFu5wA6yAMhkq4R%2F3.png?alt=media\&token=2a29fb82-0dab-49f1-964a-b6e3af5a7a74)

You can specify one of the filters and its settings, and then set a variable in which to write the received data.&#x20;

In addition, you can set *any string format* and extract the necessary data from its parts using a template.


# Change context

You will learn how to switch from one user to another, switch during communication to different chats within the same social network, from comments to private messages, and vice versa.

The context change block is created, like the others, by right-clicking in an empty area of ​​the desktop.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FbpBUYKCbOenbABUJ0chl%2F%D0%91%D0%BB%D0%BE%D0%BA%20%D0%BF%D0%BE%20%D1%83%D0%BC%D0%BE%D0%BB%D1%87%D0%B0%D0%BD%D0%B8%D1%8E.png?alt=media&amp;token=b8f6ac3f-2792-4ecf-b354-4e21ae894cf3" alt=""><figcaption></figcaption></figure>

### User change

In the "User" subsection, we choose whether to switch to another person or stay on the current one:

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FOLlop5ASmp8dGOWWid1Y%2F%D0%9F%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8C.png?alt=media&amp;token=b79a07f3-bd28-412e-85c1-718a1b0e9bf8" alt=""><figcaption></figcaption></figure>

If you need to change the context to another person, select the "Change user" item and enter in the window that appears:&#x20;

* user link
* or its id
* or a mention&#x20;
* or a variable that stores one of the above.&#x20;

One thing is enough for a bot.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FY0rW8uhMxZG6HaSlkr2J%2F%D0%92%D0%B2%D0%B5%D1%81%D1%82%D0%B8%20%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5%20%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8F.png?alt=media&amp;token=890992c6-6c52-4f4c-85b1-ee6063ca7777" alt=""><figcaption></figcaption></figure>

You can not only enter user data, but also switch to the manager.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fb8B2VbU1j5zbF1q4xFUi%2F%D0%9D%D0%B0%20%D0%BC%D0%B5%D0%BD%D0%B5%D0%B4%D0%B6%D0%B5%D1%80%D0%B0.png?alt=media&amp;token=e32e7f6f-0e7c-4956-8e97-f17be4925017" alt=""><figcaption></figcaption></figure>

And in order to return to the previous user after changing the context, it is enough to create another "Change context" block and check the box "Return to the previous user".

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F9x7gpZqJZAkl9gnvUg03%2F%D0%92%D0%BE%D0%B7%D0%B2%D1%80%D0%B0%D1%82%20%D0%BA%20%D0%BF%D1%80%D0%B5%D0%B4%D1%8B%D0%B4%D1%83%D1%89%D0%B5%D0%BC%D1%83.png?alt=media&amp;token=1873e6e9-fed8-4562-abb5-fa53b35fe86a" alt=""><figcaption></figcaption></figure>

### Change chat&#x20;

In the "Chat" subsection, we can change the chat in the channel where communication with the user takes place, as well as switch from comments to PM and vice versa.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FfRLjjG4hEP79oBWRyPog%2F%D0%9F%D0%BE%D0%B4%D1%80%D0%B0%D0%B7%D0%B4%D0%B5%D0%BB%20%D0%A7%D0%B0%D1%82.png?alt=media&amp;token=7ff860db-5138-4326-a826-3883777d2c25" alt=""><figcaption></figcaption></figure>

In this case, you can both switch to a new person, or simply change the chat for the current user.&#x20;

For example, within the framework of VK, you can switch between conversations: the user writes in one and receives an answer in another.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F1iAMtjYtbQr6OiVezvSH%2F%D0%98%D0%B7%D0%BC%D0%B5%D0%BD%D0%B8%D1%82%D1%8C%20%D1%87%D0%B0%D1%82%202.png?alt=media&amp;token=e6694003-bfd6-4063-a71e-8fa26c776f51" alt=""><figcaption></figcaption></figure>

With the same success, you can switch from private messages of the group to comments and vice versa!

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FAB7Wz423ekQqLqm3uqfU%2F%D0%9D%D0%B0%20%D0%BA%D0%BE%D0%BC%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%80%D0%B8%D0%B9.png?alt=media&amp;token=6539daff-431b-4a5f-99cc-aaf8a80b8e0f" alt=""><figcaption><p>Укажите ссылку на комментарий, на который бот должен будет ответить</p></figcaption></figure>

{% hint style="info" %}
Remember that you can switch between chats only within the same social network: Telegram or VKontakte, but not between them&#x20;
{% endhint %}

Context change is a powerful tool for users to interact with each other and quickly change the field of communication. We hope you find it useful in your projects.:smile:


# Write to statistics

The action "Write to statistics" allows you to "mark" the necessary events in the bot, so that you can later view them in the "Statistics" section

Add this action through the auxiliary menu on the left, or by right-clicking on an empty spot on the screen and selecting "Record to statistics":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F0v8s30tZEcpDSRHWMMw3%2F1.png?alt=media\&token=1cc94912-2d60-416d-93ec-682f07d1e5fa) ![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F5AMtmK74AfNEhn1EnES5%2F2.png?alt=media\&token=d630d3fd-33a7-44b2-ae9d-0291960801bd)

In the block menu, we can assign a name to it, as well as create a label, by which we can later find the event in the "Statistics" section.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FWkFaBKRjXkQExP6BNzrR%2F4.png?alt=media\&token=ba693967-4ffa-422f-9ff7-303216e3c734)

You can choose from existing labels.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FJjyVkOZs5ehmBnagzaJt%2F3.png?alt=media\&token=2bbe326d-d2bf-4f45-956f-10b8f9ef659c)

When an event tag is created, all data on it is available in the "Statistics" section:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FBOwnKI5NUlMirbJ25Kpu%2F5.png?alt=media\&token=7d51561e-c1b0-4277-9c3d-74f9689755d5)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FaIOheRONS5JgJ7oUorkn%2F6.png?alt=media\&token=393bfc0f-97b7-4d3c-9805-7ce910c61816)

Selected labels are displayed below the graph:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQ17M4XPR88vy1zUt7gtf%2F7.png?alt=media\&token=854ff330-e8a0-482a-b5bd-d678fdb64c52)

This way you can track how many users reached the right place in the chain or took a key action.


# Send Notification

The "Send notification" action allows you to notify the account manager of certain events.

Let's add this action through the additional menu on the side or right-click in an empty area of the screen.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FgZBegjdotcx1NBnYbNxi%2F1.png?alt=media\&token=83c2fb47-bd8e-474e-98ef-513f55d896d6)

In the block menu, we can choose which of the managers to notify when the user performs the desired action.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fq1sAADgP4A1AblBXDRrE%2F2.png?alt=media\&token=37015720-9579-40a0-bcb2-df6a71d8c3c1)

{% hint style="info" %}
Please note that only managers who have linked their account on the social network will receive the notification. [Instructions on how to link an account on a social network.](/beginning-of-work/how-to-add-messenger#privyazka-akkaunta-v-socialnoi-seti)&#x20;
{% endhint %}

Then we select the necessary connected channels: a VK group, a Telegram channel, or all at once.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FlMvRIcfGHqJsXw308NSI%2F3.png?alt=media\&token=fb57cfc9-a539-4d21-b3e7-ca9cc618fb24)

Now it remains only to link the admin notification with an appropriate condition with an arrow. For example, if the user's message contains the word "product".

![The "User input" event is connected to the "Message to admins" action and set to condition if the message contains the word "product"](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FKX80Z3MAonQO4R6Lv0K4%2F5.png?alt=media\&token=1711aa1f-9ebb-4889-8167-251b8aa3a71e)

![Notification will be received by all managers in all channels](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FcifusVPi6bB24rt8Wbyb%2F6.png?alt=media\&token=517a51f7-ccb8-48e0-8ffb-36e135b537d5)

This is what the result looks like for your managers:

![VK](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FNw9yi9pbX8wkQ9ehtVTM%2F7.png?alt=media\&token=186f5ebc-520e-4253-b264-709047130a8b)

![Telegram](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FoR0TaNDO23Fjxjq05Lux%2F9.png?alt=media\&token=42468e12-fe78-49ed-bfeb-dbafcb67844f)


# Switching to another script

In this article, we will look at how to navigate to blocks of different scripts.

{% hint style="info" %}
"Move to another script" allows you to "redirect" the user to a neighboring script from the current thread.&#x20;
{% endhint %}

Let's create a transition through the side menu, or by right-clicking on a free area of ​​the screen.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FDOxXQN4EYK2XMN7RbWMr%2F1.png?alt=media\&token=dc2c783a-0d55-43d4-8b48-226a30075b05) ![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FnmkqPrx6yxt5Xohc0GTz%2F2.png?alt=media\&token=3ee5e3b5-b092-4cec-b93d-3ee6ea64d0f1)

In the block menu, you can enter the name of the action and choose where to go.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FATw4OSRJWhkMidyx8WDl%2F3.png?alt=media\&token=f9a75a1f-3f4e-4592-a0a2-0c752b62a07c)

Click "Create Transition". In the pop-up window, we need to select a script and a block for the transition.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FrZlcCdgi1FTnJcVDDfvE%2F4.png?alt=media\&token=2dacd9cb-7664-48ea-b29c-e759c97e6f1f)

It is important to give blocks unique names to save time when looking for the right one.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FcsuFx3T4N0FWYwA147qK%2F5.png?alt=media\&token=8e09d07f-cdaa-4ab9-aa6c-a09dccb20192)

When the appropriate block is selected, click "Add"&#x20;

Now the selected block is displayed in the "Transition" block menu:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FP0nHyOIrm8vl3nP0pU0v%2F6.png?alt=media\&token=a9c09f0b-7d58-4a95-b7ae-79aee4c3c1fe)

&#x20;

It remains only to embed the block with the action "Transition" in the right place in the chain:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F5U9Ps0QpgBG139sWb2I5%2F7.png?alt=media\&token=a03894cf-6ac1-4811-8522-77479a5f8326)

For example, first our user will go to the welcome chain (common to everyone); then select the "buy product" option, and the bot will send it to a separate script, where all the sale mechanics are worked out.&#x20;

Similarly, the user will be able to return.&#x20;

Now you know how to move the user between your scripts.


# Working with the user

How to create user lists

{% hint style="info" %}
With this action you will be able to add and remove users from the lists. Lists can be used in mailing lists, uploads, and script conditions.&#x20;
{% endhint %}

The "Work with user" action includes two steps:&#x20;

* Add user to list
* Remove user from the list&#x20;

Select "Add to list" in the additional menu on the left or by right-clicking in an empty area of ​​the screen:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqpQoJyA6Lveq7uHyXdaT%2F1.png?alt=media\&token=4456f64a-788d-4b11-b1e4-b94e16af7782) ![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FJxtXmr1KRworhQ6MV4E8%2F2.png?alt=media\&token=07412125-1b98-4f42-b6ff-0ae741887908)

In the block menu (on the right) you can select an existing list...

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fj0eXBQmsxt0DBbgJrTSj%2F3.png?alt=media\&token=24b81062-cd1b-474a-a682-16fb0f88d441)

or create a new one:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FywaGav18Nw5dAQxOXf2n%2F4.png?alt=media\&token=5697f04e-d1d6-4af4-a428-fd1dd79a361b)

The list with all its members is available in the "Users" section.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FAnbhKoac514nBVclXVpF%2F5.png?alt=media\&token=e4ac54de-1716-492a-b429-8b5de3bab881)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FApNqzzNphrFun6vr9kjG%2F6.png?alt=media\&token=cfb0fa21-5453-4976-9fb6-e4d11f3340bc)

There is also a separate subsection in which you can edit and delete lists manually.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F8DXLMkucqXu70jrLQjM4%2F7.png?alt=media\&token=d474934e-0fd6-4dbd-918b-797ab92dc44b)

So in Smartbot Pro, you can collect users into lists by interests. With this action, you can give a person the opportunity to subscribe to the newsletter of interest (or, conversely, unsubscribe).


# Set variable

In this article, we will look at how to change variables during the script.

{% hint style="info" %}
This action allows you to set and change the value of variables for the user at the right place in the script.&#x20;

Thus, you can accrue bonus points, save information from the user, set statuses and much more.
{% endhint %}

To set a variable, we add this action to the screen of our script by right-clicking in an empty space, or by selecting the desired action from the additional menu.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FbKJ4jFzrN7TlCDsiwFz6%2F1.png?alt=media\&token=189a5330-d31a-49e3-a791-dd881e20dad8) ![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FgRrkqqmjmHb8n7shTBa2%2F2.png?alt=media\&token=5a57410d-16d4-48d6-908c-e749f8f6f865)

In the block menu, we can give the action a name, choose which variable to change, or create a new variable.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FLWXAx9emP32lgqnzgNBB%2F3.png?alt=media\&token=c1e86d7f-4fe7-4698-8899-fb07ef913b41)

For example, let's create a new variable for accrual and calculation of user's bonus points and call it "Points"

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FSgijIImjNvrK51Gtw3gA%2F4.png?alt=media\&token=198f3df0-d09a-4caf-95a7-12df751f91e9)

A window for creating a variable will appear. Let's choose the variable type - number, so that it can be increased and decreased as needed.&#x20;

The access level is local, that is, its value will be different for each user.&#x20;

When everything is ready, click "Create":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fj6xb73kXqujupzgsm1uy%2F5.png?alt=media\&token=a475c2c1-b2f3-45c4-a909-95ca3b434b92)

Now in the block menu, increase its value by +1.&#x20;

Let's write a simple arithmetic operation in the right field:&#x20;

{{%Points%=%Points%+1}}

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqVnYiVnH4WKn8WzcVODu%2F6.png?alt=media\&token=a43aeac2-289c-4b14-8d6c-45dc875766c1)

{% hint style="info" %}
Please note: for operations with variables, all expressions must be framed with double curly braces {{ }}&#x20;
{% endhint %}

By the way, you can write more complex mathematical calculations in the right field, as well as use the SmartQuery syntax. Excellent! We just have to link this block with the key user action, for which he will receive a bonus. Let's say we'll award points for the first post in a group.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FRgGBjEq0tc4KsCNn1N2B%2F7.png?alt=media\&token=5b52bbcb-8ef6-42ef-b709-905f09d86e15)

You can also set several variables at once in one block by clicking the "Set one more variable" button

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FMDCHNLmYX3DyWKm9175t%2F8.png?alt=media\&token=d33d4618-cf06-412c-aa42-bf5c4a0ead3c)

Now you know how to work with the "Set Variable" action


# Scheduled transitions

{% hint style="info" %}
With the help of scheduled transitions, the bot can postpone any action for the future right in the process of script execution, after which it can continue to execute the chain. When the right time comes, the action will work.
{% endhint %}

"Planned Transitions" includes two steps:

* Schedule a transition
* Cancel a planned transition&#x20;

Both steps are created either by clicking in the additional menu (on the left) or by right-clicking on an empty space on the screen.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fq9Jn7ajqXg01rmmAhDYF%2F1.png?alt=media\&token=37eb93f0-360a-4d67-a1ff-bd1630d5e98f)

{% hint style="info" %}
A planned transition works across all your scenarios. It can be set to a specific time on a specific date or set a timer.
{% endhint %}

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FSXD1aiIRSOL4dH3x1kzt%2F3.png?alt=media\&token=e8f9f3f9-ed31-43ab-80b4-332104e7bce9)

The list of events for planning is opened by clicking on the "Specify planning block" button. In the window that opens, select the desired scenario and block.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FmXWFwsAuNnGJGWIRj1Ql%2F5.png?alt=media\&token=c096d32e-17c9-497e-8508-a0d1c178be31) ![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FNuLWLWHv6xOAujH2EPS3%2F6.png?alt=media\&token=db4d152b-6457-45b5-aba9-1bc98f36f939)

> *Note: "Next block" is NOT a jump destination. This specifies the action that will take place after the bot schedules an event.*

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FkjlwLxL2lW2yWY1POZIC%2F4.png?alt=media\&token=ddf201f2-dfb3-4210-8503-0dd06ee23b40)

You can also select a block to "fall back" to in case the failover fails for some reason.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fsrj8XkDLrvYdvKLwEFIB%2F3.5.png?alt=media\&token=00f2a6fc-858b-484d-bbe8-56c2f459538f)

The transition can loop on itself. This mechanic is useful for reminding you of daily activities, regular bonuses, and other long-term activities.&#x20;

To do this, in the block menu you need to check the box "Plan on repeated passage".

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F7Vg1G9lWNIjI0AZQQJF0%2F7.png?alt=media\&token=45240684-dda7-43d3-a7c5-a9e0a17574be)

For example, this is how a looped accrual of bonus points once a day looks like.&#x20;

Another use case: send a reminder to a person about an event (perhaps with a link to it), and after the event, a feedback form.&#x20;

The advantage of a scheduled transition is that you can create a whole "schedule" of actions that the bot will perform, regardless of which chain it is in.&#x20;

### Cancel the transition

To remove a planned transition without deleting the block from the script, add the "cancel planned transition" action to the scenario minimap:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FJYTS9JDWmwCJOUCvm21k%2F7.5.png?alt=media\&token=74ec8655-4e9e-4907-9eed-c6ac6cadbee8)

A new block will appear on the map and its menu will immediately open. Here you can choose whether to cancel one specific transition, or all transitions in the current scenario. In addition, you can cancel the transition for one user or all at once.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FNQizHumyXhRmteTQ0zuD%2F8.png?alt=media\&token=a9ac3db5-5517-4dcc-8bd8-fbd13d7332c8)

Click "Specify the block to be canceled", after which the script and block selection window will open. We find the right one and confirm our choice.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fb9K1qBecT3aA6C6Knya9%2F9.png?alt=media\&token=6b057545-9dd2-4563-9b3f-7d950b440db0)

The block is automatically connected by a red arrow with a cancelable transition:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FoxkZp529xhElsovsBenJ%2F10.png?alt=media\&token=f91368fc-67f9-4b27-a0ff-5b81d9314985)

{% hint style="info" %}
Cancellation of the transition is needed if the user later refused any action on the part of the bot. For example, he asked not to be reminded of the beginning of the webinar or left the event with daily activities.&#x20;
{% endhint %}

Now you know how to work with delayed events in Smartbot Pro.


# Run SmartQuery

This step allows you to process data from users directly in the bot, even if you have complex mathematical calculations, as well as perform complex operations with variables.

An action is created by right-clicking on a free area of ​​the screen or by selecting an action from the additional menu (on the left):

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FNjTtuTq1HhNnOksz1SZA%2F2.png?alt=media\&token=5a4807b7-c1d9-4008-baa5-a6454b5f3f9d)

You will have access to a field for entering expressions in the SmartQuery language specially developed in Smarbot:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fdj8CUjER023pIRI0UlYX%2F3.png?alt=media\&token=dbe865dd-e035-4ad5-9cea-5e4dd607e60d)

In addition, in this field you can declare (create) variables and perform arithmetic operations with them.

![%Баллы% = %Баллы%+1 Простейшая операция по увеличению числовой переменной на 1](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FhO7ATYkOGzWAFa7G2vGa%2F4.png?alt=media\&token=d3e290a4-5e81-42c4-900e-2fb66f9dc83d)

The above example could have been done with the Set Variables step, but the Run SmartQuery step allows for much more complex transformations.&#x20;

A [separate section](https://docs.smartbot-vk.ru/smartquery/vvedenie) of our documentation is devoted to the syntax and capabilities of the SmartQuery language.


# Conditions

{% hint style="info" %}
In Smartbot Pro, you can configure under what conditions this or that script chain will work. You can check what message the user wrote, whether he is in a certain list, what are the values of his variables.&#x20;
{% endhint %}

Conditions are an important element of the bot's work. With conditions, you can branch out the bot's execution logic. According to the conditions, the bot finds a suitable answer or chain to run.

{% content-ref url="/pages/lk17rWVyxFrnQcH4JxmY" %}
[Condition](/scripts/conditions/condition)
{% endcontent-ref %}

{% content-ref url="/pages/qRqNSxx63celRGEd6Zro" %}
[Condition with options](/scripts/conditions/condition-with-options)
{% endcontent-ref %}

{% content-ref url="/pages/JWT2H96SGAYDyfXUYrAx" %}
[Conditions of VKontakte](/scripts/conditions/conditions-of-vkontakte)
{% endcontent-ref %}


# Condition

{% hint style="info" %}
Conditions allow you to branch your script, guiding it, depending on the received messages and variables.
{% endhint %}

&#x20;For example, if a user came to VK, one chain can be launched for him, and another one for those who wrote in telegram. To add a branch, let's create a simple condition block on the screen. You can do this by right-clicking in an empty area of ​​the screen, or through the left auxiliary menu.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FBKLzjZ3yzkMy8BKW4Wl5%2F12.png?alt=media\&token=35b3dc76-78e8-4ba6-b7d2-ddd79c20ab1f)

Using the buttons, you can add conditions on messages and variables, as well as complex conditions in the SmartQuery language.&#x20;

There are also two fields that indicate where the chain will go if the conditions are met and otherwise.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FmcT0KDbTnQglfia7qMtH%2F13.png?alt=media\&token=10c3b685-6140-4427-b9dc-645fe0e475f3)

> Please note that the "Then" and "Else" fields at the bottom of the block menu are identical to the rectangles on the block itself. You can select the next block from the drop-down list, or connect the "To" rectangle with an arrow to the desired block directly on the screen.&#x20;

The condition consists of 3 elements: key, comparison type, value.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FfPJUQX7w0bYla2YKuXfa%2F1.png?alt=media\&token=c27a56c0-d1ab-4f84-be5d-040ab79668e3)

To check the condition, the bot takes the value of the key and checks it according to the specified comparison type. In the example above, the key is the user's last message, the bot checks if it is equal to the word "hello".&#x20;

## Condition groups

All conditions consist of 3 groups: conditions for a message, conditions for variables and complex conditions.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQxiSdG6EqjWVkfbhfmm5%2F2.png?alt=media\&token=0631cf51-f86a-40bd-8c25-1149dbdfe0fc)

The conditions are combined with each other according to the principle "do all or do only one".&#x20;

For example, if you want to run a script with the words "Hello", "Hello", "Good afternoon", then you need to configure the bot to select one of these conditions.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F2QwvQPiqWDKLI99JnpVm%2F3.png?alt=media\&token=a3e910b8-4799-40c5-ab55-7e79e84c94b3)

If you want to check several parameters at the same time, then check the item "All conditions":

![Например, здесь бот запустит цепочку, только если пользователь написал в ЛС группы ВКонтакте, и у него больше 10 баллов](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FzOxV6y2wUw5Vq3D7T6QS%2F4.png?alt=media\&token=ec7f9d46-eba4-48ce-9bbc-1c9486470c5c)

### Conditions for messages

The main condition is the condition on the message. Such condition checks the last message of the user.&#x20;

The check is carried out using the following types of comparison:

* equals
* not equal&#x20;
* it seems&#x20;
* contains&#x20;
* begin with&#x20;
* does not begin with&#x20;
* ends with&#x20;
* does not end with&#x20;
* contains the string&#x20;
* does not contain a string&#x20;

Let's consider some of them. Equal and Not Equal

### Equal and Not Equal

The equals and not equals comparison types check whether the message is explicitly equal or not equal to the given text. For example, the message "hello" will only match this text.

### Contains and does not contain

These comparison types check that the message contains the given words. The message can contain these words consecutively anywhere in the message.

### Starts and ends with

In this mode, the bot checks that the user's message starts or ends with the text specified in the condition.

### Similar to

> This condition compares texts using a smart algorithm that uses machine learning. This mode is best for comparing small phrases.&#x20;

For example, if you set the condition that the message should be similar to "delivery address", then the bot will respond to similar phrases

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FSShdY7KOttrXueHZEAYd%2F7.png?alt=media\&token=eadad34a-509d-400a-86d0-a104521ef6aa)

![Как работает проверка "Похоже на"](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FlHDGyuAzUFoZG5o9ANRj%2F8.png?alt=media\&token=15fb593d-53f4-4490-9f99-a0e4292cf1dc)

## Conditions on variables

Conditions on variables significantly expand the functionality of conditions! For example, you can check user data or special variables. To add a condition on variables, click "+ condition on a variable"

Чтобы добавить условие на переменные, нажмите **"+ условие на переменную"**

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F8uMFFEPlUrLiGsPtlNQz%2F5.png?alt=media\&token=d3383f90-d6d7-4b39-9629-a362eb327cc1)

The message condition group is checked TOGETHER with the variable condition group. Thus, for the general condition to be met, both groups must be satisfied

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FyZ3wpvfxH5kZmpkjpIo5%2F6.png?alt=media\&token=93e4ae1c-eb03-42bb-bd04-0a44372f66ea)

In the example above, the condition will be met only if the message is equal to "hello" AND if the type of the channel where the message was received is telegram.&#x20;

In conditions on variables, you can specify both special and your own custom variables.

## Difficult conditions

Complex conditions are written in the SmartQuery language.&#x20;

To add such a condition, click on the "+ Complex condition" button.

With their help, you can, for example, check for the presence of an element in an Array, or combine several conditions using AND and OR, for example

![len(%message)>3 - message length must be more than three characters](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FzFsJhvGAKUymMR3wm2vX%2F9.png?alt=media\&token=aba8d9d5-9dee-414c-b818-68b2530f6780)

![The message must be longer than three characters AND the %Points% variable must be greater than 5](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQ7Yz4erMx6h16ovNkS98%2F10.png?alt=media\&token=02aa2198-011c-4f94-8a8c-a5f2d88bfae1)

![OR the message must be longer than three characters, OR %points% is greater than 5](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fggbkpb512YnWAOkewcNI%2F11.png?alt=media\&token=18c3f4a7-e904-49d8-864c-3c47673d0643)

The "Check Code" button executes the code specified in the input field and, if there are no errors, shows the value of the resulting expression.&#x20;

{% hint style="info" %}
Please note that code verification is performed on behalf of the current user (admin). That is, its local and special variables will be used.&#x20;

Also note that when checking the syntax, the values of changed variables are NOT saved.
{% endhint %}


# Condition with options

Consider two main types of conditions in Smartbot Pro

{% hint style="info" %}
Conditions allow you to branch your script, guiding it, depending on the received messages and variables.&#x20;
{% endhint %}

For example, if a user came to VK, one chain can be launched for him, and another one for those who wrote in telegram.&#x20;

To add a branch, let's create a simple condition block on the screen. You can do this by right-clicking in an empty area of ​​the screen, or through the left auxiliary menu.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FBKLzjZ3yzkMy8BKW4Wl5%2F12.png?alt=media\&token=35b3dc76-78e8-4ba6-b7d2-ddd79c20ab1f)

### Feature of multiple conditions

A multiple condition allows you to write many actions at once for different values ​​of the same variable. For example, you can make different answers to different greetings with just one block.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FfLkKO5XpGcP6DFEBxcHy%2F15.png?alt=media\&token=b9b6d0fb-a84d-4315-b57c-cc7252681fae)

Or do a multi-level check of the score counter.

![Thus, a person with 6 points will receive one message, and one who has, for example, 17 points, another](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FgLavIBRZgbcb5gm0AHkh%2F16.png?alt=media\&token=446fa40e-6baa-4deb-84c1-a0bd77fd1148)

{% hint style="info" %}
Multiple condition will save you screen space when you need to compare one variable (or message) with multiple values&#x20;
{% endhint %}

Now you know how to use simple and multiple conditions in Smartbot Pro.


# Conditions of VKontakte

Here is a description of what conditions specifically for VK can be applied in Smartbot

### Subscription check

You can set up activities that are available only to subscribers of the VK group. To check if a person is a subscriber, select "Terms" - "VKontakte Terms" - "Check Subscription" in the left menu of the script

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fe5uAVQDSyk7kKhmpJDpH%2F%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0%20%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%81%D0%BA%D0%B8.png?alt=media\&token=68ac3b07-c1f9-4ac9-be93-68190f04ab5c)

After creating a block and opening it, you can select the desired VK group from among the connected script channels and set up two ways for the bot to proceed further.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FkDiZ3dnp8scUrZJRIF1T%2F%D0%A3%D1%81%D0%BB%D0%BE%D0%B2%D0%B8%D0%B5%20%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%81%D0%BA%D0%B8.png?alt=media\&token=3c322944-a5e2-4185-9743-f9164e3cfcb1)

It's quite easy to check whether a person is signed or not.


# Variables

In this section, we will look at what variables are in Smartbot Pro.

{% hint style="info" %}
Variables allow you to save messages and personal user parameters (for example, name, id, points scored, etc.), set conditions (current date and time, type of channel in which the message was received), perform mathematical operations and embed dynamic text in messages .
{% endhint %}

![Так выглядит раздел переменных в Smartbot Pro](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FNZ4CZIgFnizJqG7YHPFK%2F1.png?alt=media\&token=080012ba-e40b-40ed-94c5-1e37f9ceba5a)

{% hint style="info" %}
Variables are keys in the format %variable\_name% that will be replaced by the bot with variable values ​​in the message text or condition.&#x20;
{% endhint %}

For example, if you write %name% in the text of the message, the bot will replace this variable with the username. There are two main types of variables: special and user defined.

### Special Variables&#x20;

They are already pre-installed by the developer in the bot, they cannot be deleted or changed. Special variables perform complex functions, such as returning the user's id, storing the last message received, keeping track of local time, and so on.

![Here is a far from complete list of special variables in Smartbot Pro that you can use](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FAReXuzMij35eAs3rT0D1%2F2.png?alt=media\&token=4ee5d44c-291c-4743-89ab-51577a2a0f52)

### User variables

You can create and modify them yourself. Just click the "+Add variable" button.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FOo5LkXKJY5kVYJJe6vwr%2F3.png?alt=media\&token=15962b04-09b7-4e77-86fb-122a777ca3c6)

Let's say it can be a bonus counter %Points% or a variable %already participated%, the initial value of which is "no", but after a certain action it will change to "yes" and will not allow the user to go through the activity again.&#x20;

Custom variables can be local (that is, the value is individual for each person) and global (the value is common to all users). Types of variables

### Types of variables

> **Attachment** - you can save a file into this variable: a picture, a document, an audio recording, etc.&#x20;

> **Line** - a word, a phrase, an individual code. For example: %status% = "client"

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fn3tLirxk02Zjh2RIbPYT%2F%D0%9A%D0%BB%D0%B8%D0%B5%D0%BD%D1%82.png?alt=media&amp;token=d0708bf3-7027-4702-af1a-d506dc44a282" alt=""><figcaption></figcaption></figure>

> **A number** is a number that can be used for calculations. For example, a replenishable bonus counter; personal balance in the game; virtual currency.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FUeLwzKmP9NMRDrgJAZzj%2F%D0%91%D0%B0%D0%BB%D0%B0%D0%BD%D1%81.png?alt=media&amp;token=b305bf1f-3c87-41ec-be8f-c65f94db6298" alt=""><figcaption></figcaption></figure>

> **A flag** is an analogue of a "tick" with built-in "yes" and "no" values. Useful if you are planning a one-time activity.&#x20;

> **An array** is a collection of data (numbers or strings).&#x20;
>
> It has the format: \["element 1", "element 2", "element 3", "element 4"] - square brackets, within which each element is written in quotation marks and separated by commas.&#x20;
>
> The array can store promotional codes for issuance, names of participants in a certain game, and many other useful things :)&#x20;

> **A dictionary** is a collection of key-value data pairs.&#x20;
>
> Dictionary format: {"key": "value", "key 2": "value 2"} - curly braces, double quotes for keys and values ​​(except for values ​​expressed as numbers) and separated by commas.

Thus, you can add to the array: "car, plane, ship"; and in the *dictionary*: “3 cars, 4 planes, 2 ships” and change their number right along the chain.

\
If you write it in the correct format, it will look like this: \
\["car", "aircraft", "ship"] into an array. \
{"car": 3, "aircraft": 4, "ship": 2} - to the *dictionary*

To work with arrays and dictionaries, use [smart query](/smartquery/introduction) - commands built into the bot, similar to a programming language.&#x20;

[More about working with dictionaries](https://docs.smartbotpro.ru/)[Русский](https://docs.smartbotpro.ru/)\
[And about working with arrays ](/smartquery/function-reference#rabota-s-massivami)

Variables allow you to significantly expand the functionality and implement almost any logic of the bot's actions :muscle:&#x20;


# Special Variables

In this article, we will talk about built-in variables that allow you to get special parameters: username, page id, local time, etc.

Special variables do not need to be created - they are in the bot initially.&#x20;

You can see them in the "Variables" section on the first tab:

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FRd8gmuae14JRqh4usXpR%2F%D0%A1%D0%BF%D0%B5%D1%86.%D0%BF%D0%B5%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5.png?alt=media&amp;token=d724d553-ee15-4d27-a68e-a12ce0e0b0d5" alt=""><figcaption></figcaption></figure>

Special variables include:

* %message\_text% - user's message text&#x20;
* %first\_name% - Username&#x20;
* %time% - local time&#x20;
* %weekday% - day of the week&#x20;
* and about 30 other parameters that the bot can automatically substitute.&#x20;

For example, the special variable %first\_name% can be used in greeting and communication (the bot will substitute the client's name from the social network itself), and %weekday% can be used to check if today is a working day or not.

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FOZsYndkhr7DOhoKtuUqr%2F%D0%92%D1%8B%D1%85%D0%BE%D0%B4%D0%BD%D0%BE%D0%B9.png?alt=media&amp;token=985176cf-f628-409a-9f2b-a5612b9676ae" alt=""><figcaption></figcaption></figure>

If you have just started working in Smartbot Pro, we advise you to look into the special variables section.&#x20;

It is likely that the parameter you need can be obtained without manually creating additional variables:thumbsup:


# User variables

There are 2 types of variables in Smartbot Pro: user (i.e., each user has its own value) and global (the value is the same for all bot users). In this article, we will talk about the first

User variables are anything you can create and assign to your clients, for example:&#x20;

* %Bonuses% (counter replenished with each target action)&#x20;
* %Status% ("buyer", "interested", "regular customer")&#x20;
* %Test passed% (current user status with yes-no values)&#x20;

These variables are created by you depending on your needs.&#x20;

{% hint style="info" %}
You can use variables in conditions by branching script logic&#x20;
{% endhint %}

To create a variable, go to the section of the same name and click "Add Variable"

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fnhh97jJJXGlTr6adJY94%2F%D0%94%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C%20%D0%BF%D0%B5%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%BD%D1%83%D1%8E.png?alt=media&amp;token=c6362566-d69b-4ecd-a0ee-300bee988407" alt=""><figcaption></figcaption></figure>

Select the desired type of variable, enter the name and make sure that the access level (lower window) is "User variable"

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F71RfD6htgniKj0bqgstD%2F%D0%9F%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D1%81%D0%BA%D0%B0%D1%8F.png?alt=media&amp;token=8a327f47-4913-42f3-8f85-1a9ba8be937d" alt=""><figcaption></figcaption></figure>

You can find out [what types of variables are in Smartbot Pro here](https://app.gitbook.com/o/-M0DMiuC0q5onO-ID_le/s/uRfd5lEYYH6D50QjzeAX/~/changes/pA05wngT4WvDNVoE80bp/scripts/variables#vidy-peremennykh).

Now the created variable will be individual for each user of the bot.


# Global variables

Here you will learn how to create a variable whose value will be the same for all users.

{% hint style="info" %}
**Global variables** store the same value for all users&#x20;
{% endhint %}

For example, you have created a global variable %number\_of\_orders% and you want to store in it the number of users who have left a request for your product.&#x20;

In such a case, at the end of the ticket collection script, you can add a "set variable" step that will add one to the %number\_of\_tickets% variable.&#x20;

So you can store exactly the total number of applications: each new one will be taken into account. The bot will increment the same variable regardless of which user it is chatting with. For such purposes, a global variable is great.&#x20;

And with the help of a global array variable, you can distribute limited promotional codes.


# Variable %ref%

Here we will tell you how to create referral links based on Smartbot Pro

### First a little theory

{% hint style="info" %}
**A referral link** is a link that contains information from where the user follows it.&#x20;
{% endhint %}

For example, we place a link in an advertising campaign, and users get to our bot through it.&#x20;

The bot reads the link, extracting the %ref% parameter, which specifies the referral source.&#x20;

Description of the %ref% and %ref\_source% parameters can be seen in the "Variables" section:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F3b5O2YtU5Bc20O5clCos%2FRef.png?alt=media\&token=80613727-d4cf-4155-8b59-b3f3e9ca8bf5)

### How to use it?

Write a link like this...

* For VK groups:

> [https://vk.me/группа?ref= ](https://vk.me/group?ref=)

* For Telegram:&#x20;

> <https://t.me/channel?start=>

Instead of "group" or "channel" - the name of your community from the address bar. After the = sign, indicate in Latin letters the source where you place this link, for example, "advertisement".

So the finished link might look like this:&#x20;

* <https://vk.me/club192634149?ref=advertisement>
* <https://t.me/smartbotpro?start=advertisement>

After clicking on the link, the "reklama" parameter will be saved as a person's user variable, and in the future, the parameter can be used for conditions in the script.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FxZvSIJjATv0TlB2RIfTR%2F%D0%A3%D1%81%D0%BB%D0%BE%D0%B2%D0%B8%D0%B5%20%D0%BD%D0%B0%20ref.png?alt=media\&token=99132bcd-6cf8-470d-996e-4dce30a4615c)

Now you know how to create and apply referral links in Smartbot Pro!


# Acceptance of payment

In this article, you will learn how to link payment cabinets\wallets to Smartbot Pro and accept payments on them

Smartbot Pro supports the following payment systems:

* Qiwi
* UCassa
* YuMoney
* Telegram Payments
* Prodamus

To receive money from clients, first we will link the necessary payment systems through the "Integration" section

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FEoUni2pUA2rMlSYpxMlv%2F%D0%98%D0%BD%D1%82%D0%B5%D0%B3%D1%80%D0%B0%D1%86%D0%B8%D0%B8.png?alt=media\&token=2a411c49-feb3-47f8-883a-e75f596ab532)

Each wallet has its own linking instructions. We do everything step by step - and you're done!

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FswNZMkR2CWHJVqfdIZ7X%2F%D0%9A%D0%B8%D0%B2%D0%B8.png?alt=media\&token=57ef348a-4482-4185-8792-0ddb779ce1af)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F2X4gAn1HXHN1uDlnzHyk%2F%D0%A2%D0%B5%D0%BB%D0%B5%D0%B3%D1%80%D0%B0%D0%BC-%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D0%B0.png?alt=media\&token=f5b5149c-afcb-4826-aee1-d0be86d10a6b)

When your wallet is linked to the bot, all that remains is to set up the issuance of payment buttons for the user.&#x20;

In any scenario, create a "Send message" block and add a button

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FIbXAbvgkJurcX9XlxNDy%2F%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%B5%D0%BC%20%D0%BA%D0%BD%D0%BE%D0%BF%D0%BA%D1%83.png?alt=media\&token=5adf73d4-a26b-4db2-85a6-d9a7a3cd0523)

Click on the pencil icon to edit the button:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FjJ81WMkftNmvcxi5ZMUB%2F%D0%98%D0%BA%D0%BE%D0%BD%D0%BA%D0%B0%20%D0%BA%D0%B0%D1%80%D0%B0%D0%BD%D0%B4%D0%B0%D1%88%D0%B0.png?alt=media\&token=4028fed7-6d9d-4f71-9fce-9fa2ba193c4e)

Select the button type "Create payment":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FM6OxkIcPgJNY4ddnWeh6%2F%D0%A2%D0%B8%D0%BF%20%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D1%82%D1%8C%20%D0%BF%D0%BB%D0%B0%D1%82%D0%B5%D0%B6.png?alt=media\&token=51a2efa9-ceed-42ef-b7fb-20e1bd300b38)

After that - just select the desired payment system and our linked wallet:clap:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FTfqluop2seHOjk9mRKBk%2F%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0%20%D0%BA%D0%BD%D0%BE%D0%BF%D0%BA%D0%B8.png?alt=media\&token=565be18f-6725-46a8-8db3-a9071a63c252)

You can add multiple payment buttons at once:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F55DXzJFj6j2SYJ0nHU5M%2F%D0%93%D0%BE%D1%82%D0%BE%D0%B2%D1%8B%D0%B5%20%D0%BA%D0%BD%D0%BE%D0%BF%D0%BA%D0%B8%20%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D1%8B.png?alt=media\&token=f2780481-a3d2-4579-8a73-e20546d0d422)

Not difficult at all, right?&#x20;

Now you are ready to accept payments from customers! :thumbsup:


# Telegram bot menu

We tell you how to make a menu in Telegram chat with commands like /start /help for end-to-end navigation - quick access to the most popular functions of your bot!

Ready-made commands are useful in that they make life easier for the user, eliminating the need for manual typing.&#x20;

Here's how it looks in Telegram:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FCMZII9KQtU7gfalTTXlR%2F2.png?alt=media\&token=9f21a974-1442-40a1-883a-95a771cfb57b)

To use the menu, you need to click on the icon to the left of the message input field or write a slash / -- the bot will prompt the available commands.&#x20;

{% hint style="info" %}
Note that these commands have the highest priority. They will be executed even if the user was in another chain.
{% endhint %}

## How to add a menu

### 1. Set up a channel&#x20;

To create a command menu for a bot in Telegram:&#x20;

1. Go to the project settings on the "Channels" tab
2. Click on the desired Telegram channel
3. In the "Teams" section, click on the "Add team" button: enter the name of the team and its description.

![Interface adding a menu for channels in Telegram](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FHvgYv7hkb31VS3BFo4fU%2F1.png?alt=media\&token=2a7e7f02-e829-45fa-a6f9-a0bba82528da)

{% hint style="info" %}
**The command format** is fixed - /command. The slash is set by default, the command name can consist of lowercase Latin letters, numbers and \_.
{% endhint %}

### 2. Set up the script&#x20;

Successfully?

Great, now you need to configure the behavior of the bot for each command. To do this, add commands to the script.

Go to the desired script or create a new one, add the "Message from user" block and write the condition:&#x20;

If the user's message **is** /`command` (any command you want here).&#x20;

We connect this block with the action that should be performed when this command is selected (for example, with the menu block).

![In this case, the /start command leads to a welcome and subsequent steps.](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F1Y0m7Ba6uUOtE77xxf9Z%2F3.png?alt=media\&token=4c218be0-42db-40ad-bc54-d4db527e243e)

{% hint style="success" %}
It remains only to publish the changes, and your telegram users can easily navigate in the side menu of the bot 👌
{% endhint %}


# Integrations

In this article, we will look at how Smartbot Pro works with built-in services


# Google-таблицы

В этой статье мы рассмотрим, как Smartbot Pro работает с таблицами Google

{% hint style="info" %}
You can interact with your google-sheets through the bot: enter information (in rows and cells), as well as retrieve it. You will need a google account.&#x20;
{% endhint %}

Let's create a suitable action by selecting "Google Spreadsheet" integration from the left additional menu or by right-clicking in an empty area of ​​the screen. Please note that "Actions" and "Integrations" are separate sections.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F95T5HHTaGo2lDoAR0FCX%2F1.png?alt=media\&token=11e9d3e5-dec5-4c82-859f-45751d3001ef)

## Linking an account

When we select the desired operation, a block will appear in the center of the screen, and its menu will open on the right. Click on the authorization button to link your Google account to Smartbot Pro.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F6DgwPa1tOoDVPSA3qOec%2F2.png?alt=media\&token=9a7159af-2267-4a33-9f65-7f0939b9e4a3)

First, you will be prompted to select the desired account.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FO0xHAjklHKbrjIHs8fdO%2F3.png?alt=media\&token=20e4cab9-4ee6-4a32-b360-8eff89b10857)

First, you will be prompted to select the desired account.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FG5qHGs6g9vltyvIs89iw%2F4.png?alt=media\&token=e2a8fa68-1722-4060-9952-04329cff1005)

If everything went well, you will see this inscription.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FdxlbO6C1D5PWY8MGpr9h%2F5.png?alt=media\&token=dc68e03a-d678-4586-8ab0-b84f895cbc6f)

You can close the tab with it.&#x20;

Let's go to the Google account to create a table and make it available to our bot.&#x20;

Open the account menu in the upper right corner, scroll down a little and select tables.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fj4ShHxOU8q41wxOBnwsv%2F6.png?alt=media\&token=6459cd8b-d485-4fa2-9fff-7b2f603dd941)

You can then select an existing table or create a new one.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F600Oh4G1OBmopggVUVZe%2F7.png?alt=media\&token=5274f002-8249-45b2-953c-ddc115f92ae5)

Click on "Access Settings":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fo1WZdXHcQahjJHrAGRCz%2F8.png?alt=media\&token=30d2996e-00ea-4998-bd7b-a717970abe3d)

Let's open access to the table by reference. After that, copy it and paste it into our bot.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F2JUVZ1sJJHIkjNWUnjc7%2F9.png?alt=media\&token=bf6cedb4-b634-4422-8a4e-961a1d994bd6)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F5xhVqwV60gMatuKVIu9G%2F10.png?alt=media\&token=804fccec-3146-4ac3-99d2-034c7a098aa3)

## Adding a row to a table

We return to the settings of the Smartbot Pro script, to the Google Tables block.&#x20;

Paste the copied link and hit enter.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FnQPhyEoELj27Cmz6oa0k%2F11.png?alt=media\&token=7d3cb8c4-ce0c-4c90-8d2d-d617e7912eed)

New fields will appear.&#x20;

In the case of writing to a table, this will be the choice of a sheet and variables for cells

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FrUtcJTCW4hhmu5gNjWzY%2F12.png?alt=media\&token=158bf6f7-04bd-41d2-b5d7-75f5b6c37b9b)

Now let's make a simple chain: the user writes "Hello", the bot answers and enters the user's data into the table.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FSqld7LP9Zz6hu9uBefeK%2F13.png?alt=media\&token=cb18b79d-1568-4999-8c8e-d1245bf2fa63)

![Пишем приветствие в Telegram](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Ff1djhJMlI1kYPV52VThc%2F14.png?alt=media\&token=947596a1-3251-43ae-940c-7e27b02539a5)

![Бот вносит в таблицу указанные переменные: тип канала и id пользователя](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FHhPMyrQJ4AtneVe3h527%2F15.png?alt=media\&token=26b501ac-fc18-4543-ba1e-ef7451d465c7)

## Getting data from a table

Getting data from a table works similarly. We insert a link to the table, select which cell (or range of cells) to read the data from, and indicate in which variable to write this information (in string format).

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FRzE0YRPNWnYobP7VJPB1%2F16.png?alt=media\&token=c3d83529-5638-40dc-a6c3-a87e77b458fa)

With the integration with Google Sheets, you can store all the necessary data (for example, phone numbers, addresses, and other information about orders) in one place.&#x20;

Now you know how to use tables in Smartbot Pro!


# http request

{% hint style="info" %}
The HTTP request integration allows you to send arbitrary HTTP requests to third-party servers. This allows you to integrate Smartbot with your website, CRM or online store.&#x20;
{% endhint %}

Please note that in order to submit requests to any site, you must verify that you are the owner of the site. The easiest way: write to Smartbot Pro technical support.&#x20;

To set up an http request, let's create an appropriate block on the script screen. This can be done through the right additional menu ("integration" section), or by right-clicking on a free area.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FO2zH9n1mFYwIovkgIxs7%2F2.png?alt=media\&token=a9e1c094-a1de-46de-b21d-44aeeca85a81)

The new block will appear on the screen, and its menu will automatically open on the right.

![Меню блока](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FuMxsqVVLuFh9vt2QNNqF%2F1.png?alt=media\&token=5cc25bbf-31fc-4ea4-8cde-4d92929c6eea)

If you are integrating with an existing service, then you can find all the necessary information to configure this step in the official API documentation for this service, or contact the developers of your site.&#x20;

A brief reference on the step fields:&#x20;

* Request type (http method): GET/POST/...&#x20;
* URL address: the page (endpoint) that Smartbot should access, you can immediately specify query query parameters, for example: <https://some.site/some\\_endpoint?key1=value1\\&key2=value2&#x20>;
* Request body: payload, can be given in three different formats:&#x20;
  * Form: the body of the request is a form (list of key-value pairs), the request will be sent with a header Content-Type: application/x-www-form-urlencoded (unless this header is explicitly set differently)&#x20;
  * JSON: The request body is a JSON document. The request will be sent with the header Content-Type: application/json (unless this header is explicitly set differently)&#x20;
  * Text: data is sent as-is, no additional headers are added&#x20;
* Headers: additional information, such as authorization data: Authorization: Bearer \[token]

Below, after setting the request parameters, variables are set in which the server response will be saved:&#x20;

* Response Body: The data sent by the server in response. If Content-Type is application/json, then the type of this variable will be Dictionary, otherwise String&#x20;
* Response status: number, such as 200, 400, or 500 you can check the response status to see if the request completed successfully&#x20;
* Response headers: the server can also send some additional information in the form of headers, they will be stored in a Dictionary type variable&#x20;

By default, all this data is stored in temporary variables: %body%, %status% and %headers% respectively.


# amoCRM

This article will show you how to connect amoCRM to your chatbot.

We have created a public widget for amoCRM users. To get access to all the features of our integration, install it.&#x20;

When installing a widget in amoCRM, you only need to enter the token received in the amoCRM integrations section and click "Save".&#x20;

All other settings of amoCRM bots are carried out on the Smartbot Pro website. You can find our widget in the amoCRM account settings in the integration section by typing Smartbot Pro in the search, or follow the link in the integration settings section.&#x20;

To connect Smartbot Pro to amoCRM, you will need a valid amoCRM account. Next you need:&#x20;

1. Go to the section with integrations and select amoCRM&#x20;
2. In the modal window that appears, enter the name of your account in amoCRM. It can be obtained from the address in the browser, an example of a link: <https://smartbot.amocrm.ru/> - where smartbot is the name of the account&#x20;
3. This window will appear with the points that you need to complete to complete the integration

<figure><img src="https://lh5.googleusercontent.com/G2hF436DH1V6MMBvBXhY3junxFKM-fSAfSYmYJ-RHUpqTDkBt2gtdNDLBPyCSPelQq4508KsSAdnJZ2jvexP4XPW1YMhn7cw8ShxpQwPEN4wU0o_VxvaiH_iY0v_HGd0dV7vJTkJGvcmU6WQe1ljF6NK3L415ajI9sktslm_dwhkHLH9Ki11eF9Q" alt=""><figcaption></figcaption></figure>

Go to the settings of the Smartbot Pro application. In the “code word” field, you need to paste the token copied in step 3), click on the checkbox “I agree to the transfer of personal data from amoCRM to Smartbot Pro” and click the “Install” button.

<figure><img src="https://lh3.googleusercontent.com/0MiUCVQsWRTKXve_-l7w1vb5VSvp9QHC6KomN_kzfrXNzgIswSo4goSLGw4_l5R1N5H0_DbmCFYw-jIdkgQySZKs_Azu2HrOYOI_zJ0ucf9ZEtkB4ensU-YPv6n8EsoQlEAwjvyr8f9sTXFOA-DmTkSSqT4aaX05gmJw2lhZE_aJ2Qv_M0bAn5zIIA" alt=""><figcaption></figcaption></figure>

After completing all the steps in the integration section, your account will appear

<figure><img src="https://lh5.googleusercontent.com/Wsv5HIcySlon-P8-eraZEktYv3H09uNa3Wv3VtusQSloCbATkXdQ_at9PjHcgBXy4HoHBetvfY-XACaUXGqYu9AbRDSS6afSOGJk0g-B9ZZZmZ6Fz-RR0TI2hUF4dmPVu24ThgABkjzBGvnpWatt1fEifYm1wxy-a3MGlxNS4biWigPBPSftzlMVtA" alt=""><figcaption></figcaption></figure>

### Create a deal

Using our constructor, you can create deals and add contacts to them. Go to the desired scenario, click on the "Integrations" section and select "amoCRM".

<figure><img src="https://lh6.googleusercontent.com/v1CkOYiGoIMnja7kcLNI-xYPtSDA8pxgZS22k3WYdZpNId_l9eB4m3nbdgxLHr_12IrW3E5CgO9AY551bYBJOO2ZaEa3wJAmmd5VVuk0eP-C1SCR71k36HY0oAPOgmnSqQ9VS3_OaVP6sJYZOALGAI0f6gyKCX2-LqnTBThEnjcognCCY9IEeEXVnw" alt=""><figcaption></figcaption></figure>

In the block settings that open, select an account in amoCRM.

<figure><img src="https://lh4.googleusercontent.com/qOIz_Qle9f32TaHMyBUcaKpvnsSfnLsApKj5zMk167PBaQuZfP0czy8jcUwL6iRdFsngkgGG7_9U3N2m9kq6ZxF4FsZ1yAmhurKHuybh-TYWk2IPgXVSX5nh0iPUbV581VdaM8RNQ3B38yFGQyZ6c9hsCEYqL1raqIBkR4G9WF7iqaaHSVprotasew" alt=""><figcaption></figcaption></figure>

Next, you can select the funnel to which you want to add the deal, and the status of the deal.

<figure><img src="https://lh3.googleusercontent.com/XOHkrnqW3cyvCOHQnxMPonXw8mJNBWcsaVZF4z4aCtggyn34hqJ_WhYejY8wNNeqd_U4ckNCI7-MDKXbI70hpFdIk-9oAz-6UT2zlS2fqxYTP5lqx3V8vJZ5jTb3FNjl010kqLuXIpTK-c4ByzXMWhPdEN6gj09Q4JkNljh-coc47dMLK58vEHRh2A" alt=""><figcaption></figcaption></figure>

It is also possible to attach a contact to a deal, you can select an existing one from the contact list, or create a new one and attach it to the deal being created.&#x20;

To do this, you need to enter the first and last name, as well as additionally a phone number and email.

<figure><img src="https://lh6.googleusercontent.com/_SHQcsdcWCzI_KTnbgSEK5g3hcuXG1p_5pk3IZMfCytlXcB7WLMPHqWPJOL_Iz1key0GWbOF5eRqc0N8ExxWF5yoylQvwcx11EK-D1VAjIu5BgJgCU-YBaDyQNLmk15U0Z9hdBAKCboFZPS5dIH9ZWVdJF6zKNCDXYal2-YnShTtsMjnY0I4l8NwcQ" alt=""><figcaption></figcaption></figure>

Through this block, you can also add additional parameters to the deal in the “Name-value” format.

### Deleting a deal

To remove the integration from Smartbot Pro, go to your account in amoCRM, in the installed applications section, find Smartbot Pro and click "disable"

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FHxaIOdkGxGmbkTzIxp4i%2Fimage.png?alt=media&amp;token=96ef8e7f-0df9-41eb-9092-58a4d42afccd" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FujdbeDzXvIwW3x5CmDBT%2Fimage.png?alt=media&amp;token=4fbd83c7-79d4-4565-9d78-45ad16cc73dd" alt=""><figcaption><p>результат после отключения</p></figcaption></figure>

{% hint style="success" %}
Now you know how to use amoCRM with our bot!
{% endhint %}


# Get Course

In this article, we will tell you how to enroll people in Get Course and accept payments through Smartbot Pro

Get Course is one of the largest platforms for online schools. At its base is:&#x20;

* website and landing page builder
* ready-made distance learning system (LMS)
* payment acceptance
* mailing lists&#x20;

and other useful tools. So if you are teaching courses at your online school, Get Course will help you bring all the processes together in one place.&#x20;

And with the help of our constructor, you can add students through social networks. networks and even accept payments from them.&#x20;

Click on the "Integrations" section and select "Get Course"

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FbzQkxreGzGXHpZRgFQ5l%2FGet%20Course.png?alt=media\&token=a2b86447-868e-484a-b41e-3cf836fce680)

### Adding a user

To add a student, select this action and open the block. Next, you will need to select your classroom in Get Course.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FNcQo6n3JG6bTRgbfej3N%2F%D0%94%D0%BE%D0%B1%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8F.png?alt=media\&token=be400894-d440-441c-ba8e-f4f03386c0eb)

Through this block, you can transfer and save the name, phone number, email, country and city of your client to Get Course.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqJCeZQLr7ebPSErdbHjr%2F%D0%98%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D1%8F%20%D0%BE%20%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D0%B5.png?alt=media\&token=f0639fc4-26aa-4b54-a81d-779121aa6e72)

{% hint style="info" %}
Please note: contact information must first be collected and stored in variables. This is easy to do by sending several messages with questions and then processing them.&#x20;
{% endhint %}

In addition, you can collect a lot of referral parameters to keep track of where customers got into the bot

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fh0ojiKLye7xQTpg4p1H4%2F%D0%A0%D0%B5%D1%84%D0%B5%D1%80%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F%20%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D1%8F.png?alt=media\&token=156d6d32-fc48-42e4-96d9-08ee05d7d0ec)

### Creating a payment

You can also accept payments via Smartbot Pro to your account balance in Get Course.&#x20;

Just select this action in the integrations section and fill in the fields inside the block.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FnxzlXS7iVZzl7nviHjnI%2F%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5%20%D0%BF%D0%BB%D0%B0%D1%82%D0%B5%D0%B6%D0%B0.png?alt=media\&token=584b5477-4b5f-49b6-bdf2-448d4e889172)

The link to the payment and the order number can be stored in user variables.&#x20;

Through this block, you can also save many referral parameters to track the source of a person's referral.

Now you know how to use Get Course with our bot!


# Yukassa for receiving payments

From the article, you will learn how to connect Yukassa for legal entities and accept payments from customers using buttons.

### Добавление магазина в Smartbot Pro

Чтобы привязать кассу и начать принимать платежи, перейдем в настройки проекта и выберем раздел "Интеграции" --> "Прием платежей". Нажмите на кнопку справа.<br>

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQEm0VAbF0DOWS1og6lxW%2F1.png?alt=media\&token=44558cc4-10ea-42ee-9b7b-2c662405d1de)

You will be redirected to the Yukassa website, where you will need to register or log in.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FPPWhplsaMyir20eX0Cbn%2F2.png?alt=media\&token=1bac610d-9833-44a9-ae04-3a2eef042f44)

After that, your e-shop will appear in Smartbot Pro.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FxEkcEA4VlQXBggTT4c4P%2F3.png?alt=media\&token=be1616f6-5c13-471b-877b-8fb61134b739)

You can connect several stores, and also choose the type of taxation.&#x20;

### Set up payment in script

From the moment the store is connected, a payment button will appear in the "Send message" block.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FdRY4GfJbHapeEuZLKurQ%2F4.png?alt=media\&token=5bc99c1b-68d7-4425-8ea4-5fb54af79c24)

Enter the name of the button and select the store where the money will go from the drop-down list.&#x20;

In the next block, you can set up gratitude for payment, or other options you need.&#x20;

When finished it will look like this:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FhRPFjMCpPvdWFV7Y355o%2F5.png?alt=media\&token=f73119ca-0b0a-4f7b-8732-32a3ca310fa1) ![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fq7XrGtvGh8EPvadFWPZz%2F6.png?alt=media\&token=7c220b00-2007-4707-a7b8-a089dd27e556) ![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FJMTh96dhZDLg6C4a9yca%2F7.png?alt=media\&token=e4c76378-fa1c-46df-b937-6bb1348cb5a0)

{% hint style="success" %}
Now you know how to connect an electronic cash desk and accept customer payments! 😉
{% endhint %}


# Reactions

In this article, you will learn how to use Smartbot Pro reactions section

The section is available on the main page of the project, where all our scenarios are listed.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FjNOs5QACRqZ4nt3Qe5Yp%2F%D0%A0%D0%B5%D0%B0%D0%BA%D1%86%D0%B8%D0%B8.png?alt=media\&token=505804db-cfe5-4918-887c-08a5b558ad92)

Currently there is a preprocessing filter here

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FTIf7tR7CalEUBFJ2FSWe%2F%D0%A4%D0%B8%D0%BB%D1%8C%D1%82%D1%80.png?alt=media\&token=0de15f69-7962-4256-a3cf-e2454f04aea1)

### Preprocessing filter

Fires before all other events and actions. Needed for preliminary user verification. You can add any number of conditions: whether a person is on a certain list, what value his variables have, what social network he wrote to, etc.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fm1dMbrhIxYasxMtvIOx3%2F%D0%A4%D0%B8%D0%BB%D1%8C%D1%82%D1%80%202.png?alt=media\&token=88ef73a6-0e1a-4b76-a69b-334cc581f37c)

Note two specific actions within a reaction: abort message processing and continue processing.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FGzFujlyIwKpaPGrClh8a%2F%D0%A4%D0%B8%D0%BB%D1%8C%D1%82%D1%80%201.png?alt=media\&token=a07c3fc1-f624-4ca6-a278-3d72b027bbe3)

Suppose: if the %ban% variable has the value “yes” for the user, then the bot immediately stops processing.


# Newsletters

In this article, we will tell you how to launch a segmented mailing list in Smartbot Pro

Newsletters are a useful tool for messenger marketing. With the help of mailing lists, you can notify customers about events, promotions, or simply congratulate them on the holidays 🙃&#x20;

Newsletters are located in the main menu, here:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fhsg28AeDJo6kahTvOOyJ%2Fimage.png?alt=media\&token=4bd9f1fd-269b-4693-8fe5-f205282863ea)

After creating a new newsletter, it goes to the *Drafts* section. A newsletter remains a draft until it is launched or scheduled for a specific time.&#x20;

*Scheduled mailings* - mailings that you have already set up and scheduled for delayed sending to selected user segments; If the mailing is in the process of being sent or completed, then it is located in the *Sent mailings* section.

### Creating Newsletter

Creating a mailing list Click on the "Create Newsletter" button in the upper right corner. A window with the name of the mailing will pop up. By default, the name of the newsletter consists of the date and time of creation, but you can change it.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F8B7CPJthYmVOujMskqoR%2F2.png?alt=media\&token=ef93ead5-3526-4a23-a2e4-13f138bd516f)

Click "Create" and get into the mailing editing field. Initially, there is only one block - "Start mailing".

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fur4qUwwej671r8tU5Mms%2F3.png?alt=media\&token=a9a1c3a4-1985-45b5-901c-97294c240fa3)

Enter the message that your newsletter audience will receive. You can attach [buttons](/scripts/actions/send-a-message/buttons), [attachments](/scripts/actions/send-a-message#vlozheniya) or add stickers to the newsletter message 😉&#x20;

### Mailing setup&#x20;

To select the channel(s) where the mailing will work and set up recipient lists, click "Set up mailing list" in the upper right corner of the graph.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FYaXFqKjEsqhgNVnwCf8o%2Fimage.png?alt=media\&token=534f7e87-d79d-466f-a28c-2dc21915e6d3)

The mailing settings will open, where we can choose:&#x20;

* Which channel will be sent to. You can specify multiple channels on the same or different social networks
* Lists of mailing recipients. These are the subscribers who will receive the newsletter in the specified channel
* The black list allows you to exclude some users from the mailing list recipients - users from the lists specified here will not receive the mailing list. For example, these may be users who have previously unsubscribed from mailing lists and are on the "Unsubscribed" list.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F2736JrknKNArWud6UL8A%2Fimage.png?alt=media\&token=fe31d0b7-3dd4-4d76-b3cd-355ae86a864b)

You can set additional conditions for variables, as well as write complex conditions in the SmartQuery language. These tools will help you to target your mailings as accurately as possible.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FZVrDUXVyPHii7b30tJNf%2Fimage.png?alt=media\&token=9274534b-6527-42e4-8be2-31e88d495928)

### Coverage estimate

Click the "Estimate Reach" button to find out how many of your subscribers qualify for the specified conditions and receive the newsletter.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FKcxgt7fjbz76yWBQdOGy%2Fimage.png?alt=media\&token=6d741d44-db0e-4e77-8f06-3d9ca9360a42)![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FOiEwHoHWKats6mbjNZgs%2Fimage.png?alt=media\&token=c2b779bc-c305-426b-bcd9-fa6a862674c4)

If you ran a reach assessment and then changed user lists or conditions, reassess to see the most up-to-date data with the new settings.&#x20;

### Sending and scheduling mailings

When all the conditions are set, let's move on to launching the mailing list. The newsletter can be launched instantly so that subscribers receive it right away, or you can postpone sending by choosing the date and time when the newsletter will be launched. We will tell you in detail how to set up a newsletter in both options 👇

#### **1.** Instant mailing&#x20;

Click the "Submit Newsletter" button to start your newsletter right now.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FTXSTCZ246Y5PZpGazi60%2Fimage.png?alt=media\&token=a9487e50-0827-4e91-b2bf-8519c2045136)

#### **2.** Delayed mailing

The mailing can be scheduled for a specific moment in the future or sent after a certain time.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F21dv0TXUx1AfSY5gObGp%2F6.png?alt=media\&token=fb874f35-8e8f-4a44-80dc-1a0caeda29c2)

Scheduled mailing will be available in the section of the same name.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FnC6ljhFOvkwPs2GkDqDw%2F9.png?alt=media\&token=776831e7-1ac8-48b5-809b-6aab113954c3)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FXIkSAQofpSxxmKOY7B9f%2F10.png?alt=media\&token=c87adc20-dab5-47e0-be33-6d0147138e9e)

{% hint style="info" %}
Please note: on the right side of the list, you can cancel, copy and delete any newsletter.
{% endhint %}

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FQNylCFzGtArBhQtoQtDM%2F11.png?alt=media\&token=89e713ec-f267-4beb-94cd-2cae8d6cfca8)

### Test mailing

A test mailing will help evaluate the content before the mailing goes to a large audience.&#x20;

Test mailing will be received only by you as an administrator in PM. In this case, all conditions will be ignored - you do not have to meet them to receive a test message. Lists and conditions will work only when you start mailing to users.&#x20;

To receive a test mailing, you need to specify the channel to which the mailing will be sent. After selecting a channel, sending a test mailing will become available. An obligatory condition for receiving a test mailing in a LAN is a linked account.

### Mailing stats

To see how many messages were sent and delivered in a particular mailing list, go to the sent mailing list and click on the down arrow next to the mailing list you are interested in.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FiwUrk0HJ9pX28mkLOmEn%2F12.png?alt=media\&token=915ef6b7-c47f-4902-b337-dfe064ea4a96)

### Complex scenarios in newsletters&#x20;

Each mailing can include not only a message, but also a whole set of actions you need, as a complete script.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FZGKWY2SK0D9a3e4GjO21%2F13.png?alt=media\&token=56fb4f63-b3d2-4cfc-b7b3-18a5bcb20730)

By default, a user who receives such a mailing will be removed from the chain in which he was at that time.


# Projects

In this section, we will explain what projects are and why they are needed. Consider project settings and how to give access to them to other users.

## What is a project

Pay attention to the column "Project" in the header of the service:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F0139qas5VVpwtTvKlGyb%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-18%20%D0%B2%2016.21.49.png?alt=media\&token=662fa19d-aa09-4a4c-b94a-27dfdd3fa7fc)

{% hint style="info" %}
**The project** combines channels, scripts, variables, subscribers and other service settings within itself. The project allows you to differentiate access rights.&#x20;
{% endhint %}

You can create different projects for different advertising campaigns so that they do not overlap and it is more convenient for you to manage the operation of the service.&#x20;

In addition, you can give access to the project to other users of the service. Then these users will be able to create and edit scripts within the project.&#x20;

To switch between projects, click on the arrow next to the current project in the service header and select the desired project.&#x20;

To go to the settings, click on the "Settings" item in the left menu:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F7mv8MjgJ9IoCn5jRcl9a%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-18%20%D0%B2%2016.26.52.png?alt=media\&token=a85f7056-3a3c-4e3a-939f-11f719d28ae1)

You will see the settings interface with the tabs "Settings", "Managers" and "Channels".&#x20;

Let's consider them in more detail.

## Project settings

### Bot enabled

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FNXNyjwWbtr5PZeJcT1vH%2Fimage.png?alt=media\&token=920d1738-df9c-4003-967c-c7fdf2c78adf)

This setting controls whether the bot is running and what messages it will respond to. You can completely disable the bot by unchecking this item, or choose who it will reply to (all or only admins) by clicking on the appropriate item.

### Debug Mode

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FvoNIKuYmOoVFxImORS89%2Fimage.png?alt=media\&token=846d7d4c-fce0-4ec1-94a8-b571c1c2e2f8)

This setting allows you to enable debug mode.&#x20;

{% hint style="info" %}
**Debug mode** means that the bot will write debug messages to admins during communication. Debug messages provide information about what actions the bot is performing and why. This is useful for finding errors in scripts or checking the bot's performance.&#x20;
{% endhint %}

You can specify where the debugging mode will work: only in the LAN with the bot or in all chats where the bot is present. Example: in VK you can write to the group's LAN or to the conversation where the bot is installed. The setting regulates in which case the debug mode will work.

### Timezone

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fjdcs2brfopVpzwzGMugr%2Fimage.png?alt=media\&token=7a1a2d7c-6cc7-40f8-a0cf-924232a3fa53)

The time zone is used when working with all the time settings of the service, for example, when scheduling mailings or when using time variables.&#x20;

### Probability threshold

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FR9ifubDZTGeEUCagseFE%2Fimage.png?alt=media\&token=348f2708-7eac-41cf-969d-ae825873b54c)

This setting is used in the "similar to" comparison mode in conditions. The higher the value, the more closely the subscriber's message and the specified text must match.&#x20;

### Message processing order

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FgOTjcc5HD4OR1grHLWe0%2Fimage.png?alt=media\&token=252d84aa-8a6f-4659-8fd5-62f74cc45556)

Sequential message processing will be needed if you use global variables that can be changed by several users at once. For example, if you store a certain number of "likes" in a global variable and your followers can "like" something through bot actions, then it is important that these likes are stored consistently so that the value is always up to date.

### Managers

Using the managers section, you can restrict access to the project:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FjzPhJg7lP1r74ycuiE6l%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-18%20%D0%B2%2016.43.38.png?alt=media\&token=420e9a44-b18b-45f9-b76b-c26e1216b648)

The list displays all managers and their access level. There are 2 levels available in total:

* **Observer** - such a user can only view the project (scripts, variables, statistics, ...), but not modify it.&#x20;
* **The editor** is a full user of the project, he can make changes to the scripts.&#x20;

To add a user to the project, fill out the form on the right and click "add manager". An invitation to the project will be sent to the specified email address. After that, the user will be able to enter the service and your project will be available to him.

## Channels

{% hint style="info" %}
**A channel** is a medium for communicating with your subscribers. For example, a VKontakte group or a telegram bot.
{% endhint %}

The article ["How to connect the messenger"](/beginning-of-work/how-to-add-messenger) describes in detail what channels are.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FjWgwv3iyyID3SDhSKuu2%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-18%20%D0%B2%2016.57.29.png?alt=media\&token=e2976378-90dc-4b87-9534-bdbc6d5ee1cc)

In the channels settings, you can view all the channels used in the project and add new ones.


# Cabinets

In this article, we will look at what cabinets are and why they are needed.

When registering in the service, you indicated the name of the account and the domain to access it.&#x20;

{% hint style="info" %}
**The cabinet** brings all your projects together inside a smartbot. The account contains a balance to pay for the service.
{% endhint %}

You can give access to the account (and therefore to all projects inside the account) to other users. To do this, go to the account settings by clicking on the smartbot logo on the main screen:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FLsBpVFwWpGWA0Op6IFAr%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202021-10-18%20%D0%B2%2016.59.11.png?alt=media\&token=23388f48-58e3-40f9-9fda-901441dc0704)

In the settings you will see all managers and their roles within the cabinet.&#x20;

Using the form on the right, you can give access to your account to other users. Enter the user's email and the desired role and click the "add" button. After that, a letter with a link will be sent to the specified email, by clicking on which the user will gain access to your account.&#x20;

There are 6 roles in total:&#x20;

1. Owner - manages cabinets, managers and projects&#x20;
2. Administrator - manages projects&#x20;
3. Editor - edits project scripts&#x20;
4. Observer - Views project scenarios&#x20;
5. Balance manager - deals with payments&#x20;
6. Guest - there are no rights in the office


# Statistics

In this section, you will learn how to collect and track statistics in Smartbot

{% hint style="info" %}
Collecting statistics allows you to track the performance of your scenario funnels. You can see at what stage of the scenario certain events occur: for example, users leave or, on the contrary, take a key action.&#x20;
{% endhint %}

You can enter the statistics section from the project menu, where all scenarios are presented.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FUysHsh0rdVkazuzjVGDM%2F1.png?alt=media\&token=6cbac01e-bba5-4598-867e-7b18f3e50ebc)

In the interface of the section, you can choose what to display on the chart:&#x20;

* What event (or several events) are you interested in. For example, how many messages were received from users.&#x20;
* What time range is needed (several days, a week, a month, etc.)&#x20;
* How many events happened, or how many users participated in them.

![Интерфейс раздела "Статистика"](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fuag0iqycCTgKazQmikyj%2F2.png?alt=media\&token=ecd57166-3f45-4405-a487-2a57cce25235)

### How to collect statistics

In the list of events, we can choose from several categories:&#x20;

* **Blocks of statistics.** These are the events that we ourselves created using the "Record event in statistics" action.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F50zcijtaWLJISotMYCkA%2F3.png?alt=media\&token=f70fa66b-19bb-4a53-be10-798f6218350a)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FVxT9UxAw5whJYFNTryDf%2F4.png?alt=media\&token=34c6cdfd-9b7b-4647-ade0-e7767c50a029)

![К примеру, здесь бот для сети зоомагазинов проводит опрос, какой у клиента питомец, и заносит в статистику варианты.](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FJCV95Xc1WMb3QmvIWQHf%2F5.png?alt=media\&token=aefb99c7-e1dd-4f01-b989-0417d141ba7e)

The label names are the blocks of statistics that we can create and subsequently view on the chart.&#x20;

* General events

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FfcIeyIvjoWOBb9H2FxB2%2F6.png?alt=media\&token=14740ef0-10e2-48fc-b6df-1b9f48567546)

In this category, you can see how many specific actions your bot performed in a given period: how many messages were written, how many variables were set, etc.&#x20;

* Named Blocks

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FKg773pw2mOnIhNNuuaRr%2F7.png?alt=media\&token=faf1a4f2-b3f2-4143-a32f-f13543676ee6)

Here, you can select a specific script block as a tracked event: how many times it was executed in a certain period.

![Например, здесь бот для зоомагазина с помощью блока записи в статистику фиксирует результат опроса пользователя ](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FwknHQpzx0OtBaDaIXL59%2F8.png?alt=media\&token=78cb233e-ab60-4385-a7bb-8ce2cab3669b)

* Special events&#x20;

In this section, your scheduled transitions (i.e., "schedule delayed transition" and "cancel" actions)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FPF3uPXvlf1xvjvtuccnE%2F10.png?alt=media\&token=603820ba-8a21-4577-b676-8c6dbd0357b6)

You can select any number of events to display on the chart, as well as download the table as a file for each of the selected events.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FGo6LmIKU0h539T3HQOyl%2F11.png?alt=media\&token=879e41cb-142b-4d3a-8cbc-f6c468e86f2b)

Now you know how to interact with statistics in Smartbot Pro!


# Users

This section allows you to track your users' data in Smartbot Pro

You can enter the section from the menu of your project

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FYMDd5cxvCRizugRCqxDY%2F1.png?alt=media\&token=28fc92e9-8630-4ed8-8291-ba2f9e595133)

{% hint style="info" %}
People are displayed here, which can be sorted by lists, channels and chats.&#x20;
{% endhint %}

By default, the "All users" list includes everyone who has interacted with your bot, regardless of whether they subscribe to the community. It is enough that the person wrote to you.&#x20;

You can select a specific list of people to view and a channel (VK group/telegram channel)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FqKSYEEHf3uwRmtT4YXAi%2F2.png?alt=media\&token=3118e204-e14e-4eb4-836b-4ca7e217d65c)

If you click on a username, an auxiliary menu will appear on the right with detailed information about him: what local variables he has, what lists he is in, what chats he has been in, and what pending events are scheduled for him.

![Значения локальных переменных можно поменять в этом же окне](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FjSQFCA091yyzAhiTel7M%2F3.png?alt=media\&token=9e9ce76e-3ce1-484e-b4c3-7079552769a4)

Knowing the user id, you can add him to your list yourself, even if he did not write anything to your bot.&#x20;

In addition, users can be added and uploaded by an Excel spreadsheet.

![Добавление и выгрузка пользователей](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FyLPwyMlpIJQcdm9d1N6l%2F4.png?alt=media\&token=26b47664-f90a-4173-b4fd-af6275bace44)

The main thing is that when loading the table, one column contains user names, and the other contains their ID numbers.&#x20;

Now you know how to work with users in Smartbot Pro!


# Introduction

SmartQuery (SQ) is a scripting programming language created specifically to extend the capabilities of Smartbot chains.

## Why do you need SmartQuery?  <a href="#zachem-nuzhen-smartquery" id="zachem-nuzhen-smartquery"></a>

* Creating complex conditions in chains (combination of AND and OR)&#x20;
* Working with arrays and dictionaries (promo codes, inventory, word guessing, shopping cart, ...)&#x20;
* Substitution of calculated values ​​in the text of messages (same as regular variables, but you can use arithmetic)&#x20;

## Some examples <a href="#nekotorye-primery" id="nekotorye-primery"></a>

```
# complex conditions
%sex% == 'male' and %ref% == '1' or %sex% == 'female' and %ref% == '2'

# work with arrays
%cart%.push('perfume')
%cart%.push('webinar')

# substitution of expression values ​​in message text
Your balance: {{ %balance% + %premium% }}
```

SmartQuery can be used everywhere where only ordinary variables could be used before: in the text of messages, in mailing lists, conditions and on landing pages.


# Language syntax

This section describes the syntax of the language

## Basics

### How SQ works

When, for example, an expression in double curly braces {{}} is found in the message text, the bot evaluates the expression inside the brackets and substitutes its value in the message text.&#x20;

For example, the value of the expression 2 \* 2 is the number 4, and the value of the expression "**hello**" is the string **hello**.

### Syntax examples

{% hint style="info" %}
The symbol >>> in the examples below marks the user's input, and the line below indicates the result of evaluating this expression.&#x20;

The # symbol marks comments (explanations) to the code.
{% endhint %}

#### Arithmetic

```
>>> 2 * 2
4

>>> 2 ** (4 + 10 / 5)
64
```

#### Variables&#x20;

Variables allow you to store user data.&#x20;

Variables are divided into types: numbers, strings, arrays and dictionaries.&#x20;

The type of variable determines the set of actions that can be performed with it. For example, numbers can be compared (>, <, >=, <=, ==, !=), divided, and multiplied.&#x20;

Strings can only be added. Bot variable names (special, local, and global) begin and end with a percent sign, such as **%message%**. From the point of view of SQ, these percentages are part of the variable name, and you can create new temporary variables in SQ itself without percent signs, for example, **x = 10.**

#### Comparison operations

```
>>> x = 10
>>> x > 0
True

>>> x <= 0
False

>>> x == 10
True

>>> x += 2
>>> x
12

>>> x *= 2
>>> x
24

>>> y = 0
>>> x == 0 and y > 0 or x != 0 and y < 0
False

>>> not (x == 0 and y > 0 or x != 0 and y < 0)
True

# let's say %sex% is "female"
>>> 'yes' if %gender% == 'female' else 'no'
'Yes'

# let's say %message% is "hello world"
>>> 'priv' in %message%
True

>>> ' ' in %message%
True

>>> 'yet' not in %message%
True
```

#### Calling Functions

Functions allow you to transform data, such as getting the length of a string, generating a random number, or adding an element to an array.

In SQ, there are 3 options for calling functions: through a dot, through a pipe (|) and explicitly - they are interchangeable and equivalent.

```
'hello' | len
6

>>>len('hello')
6

>>> 'hello'.len()
6
```

#### A couple of examples:

```
# suppose %message% is "hello world"
>>> %message%.startswith('hello')
True

>>> %message%.endswith('hello')
False

>>> %message%.endswith('world')
True

>>> round(0.23)
0

>>> round(0.23, 1)
0.2

>>> 12345678 | pretty
12 345 678

# note: \ is used to escape a quote in a string
>>> 12345678 | pretty('\'')
12'345'678

>>> rand([1, 2, 3])
1

>>> rand([1, 2, 3])
1
```

#### Working with arrays&#x20;

Arrays allow you to store multiple values ​​in one variable. For example, you can store a customer's shopping list.

```
>>> cart = []
>>> cart.push('bread')
>>> cart.push('buckwheat')
>>> shopping cart
['bread', 'buckwheat']

>>> 'bread' in basket
True

>>> 'cheese' in basket
False

>>> shopping cart | pretty('\n')
bread
buckwheat
```

#### Dictionaries

A dictionary is similar to an array, but it allows you to remember the mapping from one element to another. For example, the number of items in the cart.

```
>>> cart = {}
>>> basket['bread'] = 3
>>> basket['buckwheat'] = 10
>>> shopping cart
{'bread': 3, 'buckwheat': 10}

>>> 'bread' in basket
True

>>> 'cheese' in basket
False

>>> shopping cart | pretty
bread: 3
buckwheat: 10
```

## Functional programming

{% hint style="info" %}
This is a difficult section to understand if you were not previously familiar with programming. It is possible that you can skip this section)
{% endhint %}

### Lambdas (lambda expressions)

Lambda (lambda) is an anonymous function.&#x20;

SQ does not have the ability to declare its own functions, but for some tasks, such as array transformation, filtering, and sorting, you can use lambda expressions.

#### Syntax

For example, let's consider a function that takes 3 arguments: a, b, c and returns their sum:

```
a, b, c => a + b + c
```

Thus, a lambda expression consists of 2 parts: the list of arguments (before the arrow) and the expression (after the arrow). The result of the expression will be returned when this function is called.

Example

```
>>> cart = {}
>>> basket['bread'] = 3
>>> basket['buckwheat'] = 10

# display the dictionary in the format we need
>>> shopping cart | map((k, v) => k + ' - ' + v + 'kg') | join
bread - 3 kg
buckwheat - 10 kg
```

Here we used the *map()* function, to which we passed our lambda as an argument. The *map()* function will iterate over all the key-value pairs *(k, v)* in the *cart* dictionary and return a string instead, the result of adding **k**, a hyphen, **v**, and the word "**kg**".


# Function Reference

{% hint style="info" %}
The **\[]** symbol in subsection headings marks optional arguments. You can leave them out if the default value suits you.&#x20;

The symbol **>>>** in the examples below marks the user's input, and the line below indicates the result of evaluating this expression.&#x20;

The **#** symbol marks comments (explanations) to the code.
{% endhint %}

## General

### len(seq)

Returns the length of an array, the number of dictionary keys, or the length of a string.

```
>>> len([1, 2, 3])
3

>>> len('hello')
6
```

### int(v)

Converts the argument to an integer.

```
>>> int(10.2)
10

>>> int('10')
10

>>> '10' + 2
102

>>> int('10') + 2
12
```

### float(v)

Converts the argument to a fractional number.

```
>>> float('10.2')
10.2
```

### str(v)

Converts the argument to a string.

```
>>> str(10.2)
10.2
```

### pretty(container, \[delimiter])

Formats a number, array, or dictionary using delimiter as the element **separator**.

```
>>> 12345678 | pretty
12 345 678

>>> 12345678 | pretty('\'')
12'345'678

>>> ['один', 'два', 'три'] | pretty
один, два, три

>>> d = dict()
>>> d['x'] = 10
>>> d['y'] = 20

>>> d | pretty
x: 10
y: 20
```

## Arithmetic

### round(v, \[nd])

Rounds **v** to **nd** decimal places. If the second argument is not specified, it rounds up to an integer.

```
>>> round(10.2)
10

>>> round(10.992)
11

>>> round(10.992, 2)
10.99
```

### floor(v)

Rounds the argument down to an integer.

```
>>> floor(10.9)
10
```

### ceil(v)

Rounds the argument up to an integer.

```
>>> ceil(10.2)
11
```

### abs(v)

Returns the absolute value

```
>>> abs(-5)
5
```

### min(a, b, ...)

Returns the minimum argument.

```
>>> min(1, 2, 3)
1
```

### max(a, b, ...)

Returns the maximum argument.

```
>>> max(1, 2, 3)
3
```

### rand()

Returns a fractional number in the half-interval \[0, 1).

```
>>> rand()
0.43463103446060180612420253964955918490886688232421875
```

### rand(a, b)

Returns an integer in the interval \[a, b].

```
>>> rand(1, 10)
10
```

### rand(arr)

Returns a random array element.

```
>>> rand([1, 2, 3])
3
```

## Working with strings

### startswith(container, s)

Checks that the string **container** starts with the substring **s**.

```
>>> 'hello world'.startswith('hel')
True
```

### endswith(container, s)

Checks that the string **container** ends with the substring **s**.

```
>>> 'hello world'.endswith('rld')
True
```

### **lower(s)**

Converts a string to lower case. Convenient for later comparison with another string, case insensitive.

```
>>> 'hello' | lower
Hey

>>> 'hello' == 'hello'
False

>>> 'hello' | lower == 'hello'
True
```

### **upper(s)**

Converts a string to upper case.

```
>>> 'HeLlO' | upper
HELLO
```

### strip(s)

Removes extra spaces at the beginning and end of a string.

```
>>> '  hello     ' | strip
hello
```

### split(s, \[\[sep=' ', \[max\_split=-1]])

Converts a string to an array, splitting it at the specified **sep** character (default is a space), you can also specify **max\_split** - the maximum number of divisions.

```
>>> 'one two three' | split
['one two Three']

>>> 'one two three' | split(' ', 1)
['one two Three']
```

### replace(s, old, new, \[count=-1])

Replaces the substring **old** in the string s with the string **new**. By default (if **count** is not specified) all occurrences of the substring are replaced.

```
>>> 'Hi, Vasya'.replace('Vasya', 'Peter')
Hi Peter

>>> 'теxт, теxт, теxт'.replace('теxт', 'test')
'test, test, test'

>>> 'теxт, теxт, теxт'.replace('теxт', 'test', 1)
'test, теxт, теxт'
```

## Regular Expressions

Regular expressions allow you to check if a string matches a specified pattern, or to search for a substring by a pattern in another string. This is a rather complicated, but very powerful mechanism.

&#x20;You can read more here: [https://ru.wikipedia.org/wiki/Regular\_expressions ](https://ru.wikipedia.org/wiki/Регулярные_выражения)

You can test your regular expressions here: <https://regex101.com>

### match(s, pattern, \[flags])

Finds a substring in the string s that matches the regular expression pattern. If there is no such substring, None is returned.&#x20;

Supported flags:&#x20;

* i - case insensitive&#x20;
* m - multiline matching&#x20;
* s - . (dot) matches line breaks

```
>>> 'hello world' | match(r'world')
world

>>> 'hello world' | match(r'test')
None

# search for a number in a string
>>> 'top up, 500' | match(r'\d+')
500

# extract email from string
>>> 'My email: name@test.com' | match(r'\S+@\S+')
name@test.com

# search case sensitive (default)
>>> 'TEST' | match(r'test')
None

# case insensitive
>>> 'TEST' | match(r'test', 'i')
TEST

# ^$ means the entire string must match the filter
>>> 'top up, 500' | match(r'^refill, \d+$')
replenish, 500

# extra text does not match the filter
>>> 'fill up, 500 some extra text' | match(r'^refill, \d+$')
None
```

### match\_groups(s, pattern, \[flags])

Finds a substring in the string **s** that matches the regular expression **pattern**. If there is no such substring, **None** is returned.&#x20;

Unlike **match()** returns not a substring, but an array of groups. Moreover, the first element of the array is the entire found substring.&#x20;

Supported flags:&#x20;

* i - case insensitive&#x20;
* m - multiline matching&#x20;
* s - . (dot) matches line breaks

```
# select 2 groups: number and currency
>>> 'top up with 100 rubles' | match_groups(r'(\d+) (\w+)')
['100 rubles', '100', 'rubles']
```

### match\_all(s, pattern, \[flags])

Finds in the string s all substrings matching the regular expression **pattern**.&#x20;

Supported flags:&#x20;

* i - case insensitive&#x20;
* m - multiline matching&#x20;
* s - . (dot) matches line breaks

```
# find all numbers in a string
>>> '1, 2, 3, 4, 5' | match_all(r'\d+')
['1', '2', '3', '4', '5']
```

## Working with arrays

### Operators

```
>>> arr = [1, 2, 3]

# get value by index
>>> arr[0]
one

# the last element of the array can be obtained like this:
>>> arr[-1]
3

# check if the value is in the array
>>> 3 in arr
True

# check for the absence of a value in the array
>>> 4 not in arr
True

# change value by index
>>> arr[0] = 100
>>> arr
[100, 2, 3]

# delete value by index
>>> del arr[0]
>>> arr
[2, 3]
```

### Slices

```
>>> arr = [1, 2, 3, 4, 5]

# array elements starting at the specified index
>>> arr[2:]
[3, 4, 5]

# array elements up to the specified index
>>> arr[:2]
[12]

# every second element of the array
>>> arr[::2]
[1, 3, 5]

# flip the array
>>> arr[::-1]
[5, 4, 3, 2, 1]
```

### push(arr, v)

Adds the element **v** to the end of the **arr** array.

```
>>> arr = [1, 2]
>>> arr.push(3)
>>> arr
[1, 2, 3]
```

### pop(arr, \[i])

Removes the element at index **i**. If **i** is not specified, then the last element of the array is removed.

```
>>> arr = [1, 2, 3]
>>> arr.pop()
>>> arr
[1, 2]

>>> arr = [1, 2, 3]
>>> arr.pop(0)
>>> arr
[2, 3]
```

### insert(arr, i, v)

Inserts the value **v** in place of **i.**

```
>>> arr = [1, 2, 3]
>>> arr.insert(0, 100)
>>> arr
[100, 1, 2, 3]
```

### remove(arr, v)

Removes the first occurrence of the element with value **v**.

```
>>> arr = [1, 2, 100, 3]
>>> arr.remove(100)
>>> arr
[1, 2, 3]
```

### sorted(arr)

Returns a copy of the array, the values ​​in which are sorted in ascending order.

```
>>> arr = [2, 10, 1]
>>> arr | sorted
[1, 2, 10]
```

### sorted(arr, key, reversed=False)

Returns a copy of the array in ascending order (or descending if **reversed** is **True**). **key** is a function that returns a value by which to sort.

```
# sort by field 'x'
>>> [{'x': 30}, {'x': 10}, {'x': 20}] | sorted(el => el['x'])
[{'x': 10}, {'x': 20}, {'x': 30}]

# sort by field 'x' backwards
>>> [{'x': 30}, {'x': 10}, {'x': 20}] | sorted(el => el['x'], True)
[{'x': 30}, {'x': 20}, {'x': 10}]

# just sort in descending order
[30, 10, 20] | sorted(None, False)
[30, 20, 10]
```

### reversed(arr)

Returns a copy of an array whose values ​​are in reverse order.

```
>>> arr = [2, 10, 1]
>>> arr | reversed
[1, 10, 2]
```

### enumerate(arr)

Returns an array of (index, value) pairs.

```
>>> arr = [2, 10, 1]
>>> arr | enumerate
[(0, 2), (1, 10), (2, 1)]
```

### shuffle(arr)

Returns a copy of the array sorted randomly.

```
>>> arr = [2, 10, 1]
>>> arr | shuffle
[10, 1, 2]
```

### index\_of(arr, value)

Returns the index of the first array element equal to the specified **value**. If there is no element with the specified value in the array, **None** is returned.

```
>>> arr = [2, 10, 1]
>>> arr | index_of('10')
1
```

### join(arr, \[sep])

Concatenates the elements of an array into a single string using the sep separator.

```
>>> arr = [1, 2, 3]
>>> arr | join
1
2
3

>>> arr | join(':')
1:2:3
```

### sum(arr)

Returns the sum of the array elements.

```
>>> [1, 2, 3] | sum
6
```

### map(arr, l)

Returns a copy of the array resulting from applying the lambda function l to each of its elements.

```
# multiply each element by 2
>>> [1, 2, 3] | map(v => v * 2)
[2, 4, 6]
```

### filter(arr, l)

Returns a copy of an array whose elements match the filter specified by the l lambda function.

```
# filter out values ​​greater than 5
>>> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | filter(v => v > 5)
[6, 7, 8, 9, 10]
```

### reduce(arr, l)

Combines the elements of an array into a single entity by calling the passed lambda function **l** on each element. The first argument of the lambda function is the result accumulated at the moment, the second is the next element of the array.

```
# sum value
>>> [1, 2, 3] | reduce((acc, v) => acc + v)
6

# product value
>>> [1, 2, 3] | reduce((acc, v) => acc * v)
6

# sum of rows
>>> [1, 2, 3] | reduce((acc, v) => str(acc) + v)
123
```

## Working with dictionaries

### Operators

```
# dictionary declaration
>>> cart = {'bread': 3, 'buckwheat': 10}

# get value by key
>>> basket['bread']
3

# check if the key exists in the dictionary
>>> 'bread' in basket
True

# change value by key
>>> basket['bread'] = 2
>>> shopping cart
{'bread': 2, 'buckwheat': 10}

# delete value by index
>>> del basket['buckwheat']
>>> shopping cart
{'bread': 2}
```

### get(k, \[default])

Returns the value given by the key **k**. If there is no such key in the dictionary, **default** is returned.

```
>>> cart = {'bread': 3, 'buckwheat': 10}
>>> cart.get('bread')
3
>>> cart.get('sausages', 100)
100
```

### keys(d)

Returns an array of dictionary keys.

```
>>> cart = {'bread': 3, 'buckwheat': 10}
>>> shopping cart | keys
['bread', 'buckwheat']
```

### values(d)

Returns an array of dictionary values.

```
>>> cart = {'bread': 3, 'buckwheat': 10}
>>> shopping cart | values
[3, 10]
```

### map(d, l)

Returns the array resulting from applying the lambda function **l** to each key-value pair (**k, v**).

```
>>> shopping cart | map((k, v) => k + ': ' + v + ' pcs') | join
bread: 3 pcs
buckwheat: 10 pcs
```

### sorted(d, key, reversed=False)

Returns a copy of the dictionary in ascending order (or descending if **reversed** is **True**). **key** is a function that returns a value by which to sort.

```
# sort by value
>>> {'Vasja': 10, 'Tom': 5} | sorted((k, v) => v)
{'Tom': 5, 'Vasja': 10}

# sort by value (desc)
>>> {'Vasja': 10, 'Tom': 5} | sorted((k, v) => v, True)
{'Vasja': 10, 'Tom': 5}
```


# Privacy Policy

Last updated **November 02, 2022**

This privacy policy for SmartbotPro ("Company," "we," "us," or "our"), describes how and why we might collect, store, use, and/or share ("process") your information when you use our services ("Services"), such as when you:

**Questions or concerns?** Reading this privacy policy will help you understand your privacy rights and choices. If you do not agree with our policies and practices, please do not use our Services. If you still have any questions or concerns, please contact us at <help@support.smartbotpro.io>&#x20;

**SUMMARY OF KEY POINTS**

***This summary provides key points from our privacy policy, but you can find out more details about any of these topics by clicking the link following each key point or by using our table of contents below to find the section you are looking for. You can also click*** [***here***](https://app.termly.io/dashboard/website/6dc7954e-d30f-4c65-9be1-efd058d9c188/privacy-policy#toc) ***to go directly to our table of contents.***

**What personal information do we process?** When you visit, use, or navigate our Services, we may process personal information depending on how you interact with  the Services, the choices you make, and the products and features you use.&#x20;

**Do we process any sensitive personal information?** We do not process sensitive personal information.

**Do we receive any information from third parties?** We may receive information from public databases, marketing partners, social media platforms, and other outside sources.&#x20;

**How do we process your information?** We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and to comply with law. We may also process your information for other purposes with your consent. We process your information only when we have a valid legal reason to do so. Click [here](https://app.termly.io/dashboard/website/6dc7954e-d30f-4c65-9be1-efd058d9c188/privacy-policy#infouse) to learn more.

**In what situations and with which parties do we share personal information?** We may share information in specific situations and with specific third parties.&#x20;

**What are your rights?** Depending on where you are located geographically, the applicable privacy law may mean you have certain rights regarding your personal information.&#x20;

**How do you exercise your rights?** The easiest way to exercise your rights is by filling out our data subject request form available [here](https://app.termly.io/notify/eb514140-7145-4eb3-84f3-1922656ca7b4), or by contacting us. We will consider and act upon any request in accordance with applicable data protection laws.

**1. WHAT INFORMATION DO WE COLLECT?**

**Personal information you disclose to us**

***In Short:** We collect personal information that you provide to us.*

We collect personal information that you voluntarily provide to us when you register on the Services, express an interest in obtaining information about us or our products and Services, when you participate in activities on the Services, or otherwise when you contact us.

**Sensitive Information.** We do not process sensitive information.

All personal information that you provide to us must be true, complete, and accurate, and you must notify us of any changes to such personal information.

**Information automatically collected**

***In Short:** Some information — such as your Internet Protocol (IP) address and/or browser and device characteristics — is collected automatically when you visit our Services.*

We automatically collect certain information when you visit, use, or navigate the Services. This information does not reveal your specific identity (like your name or contact information) but may include device and usage information, such as your IP address, browser and device characteristics, operating system, language preferences, referring URLs, device name, country, location, information about how and when you use our Services, and other technical information. This information is primarily needed to maintain the security and operation of our Services, and for our internal analytics and reporting purposes.

Like many businesses, we also collect information through cookies and similar technologies.&#x20;

**2. HOW DO WE PROCESS YOUR INFORMATION?**

***In Short:** We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and to comply with law. We may also process your information for other purposes with your consent.*

**We process your personal information for a variety of reasons, depending on how you interact with our Services, including:**

**3. WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION?**

***In Short:** We may share information in specific situations described in this section and/or with the following third parties.*

We may need to share your personal information in the following situations:

* **Business Transfers.** We may share or transfer your information in connection with, or during negotiations of, any merger, sale of company assets, financing, or acquisition of all or a portion of our business to another company.
* **Affiliates.** We may share your information with our affiliates, in which case we will require those affiliates to honor this privacy policy. Affiliates include our parent company and any subsidiaries, joint venture partners, or other companies that we control or that are under common control with us.
* **Business Partners.** We may share your information with our business partners to offer you certain products, services, or promotions.

**4. DO WE USE COOKIES AND OTHER TRACKING TECHNOLOGIES?**

***In Short:** We may use cookies and other tracking technologies to collect and store your information.*

We may use cookies and similar tracking technologies (like web beacons and pixels) to access or store information.&#x20;

**5. HOW DO WE HANDLE YOUR SOCIAL LOGINS?**

***In Short:** If you choose to register or log in to our Services using a social media account, we may have access to certain information about you.*

Our Services offer you the ability to register and log in using your third-party social media account details (like your VKontakte logins). Where you choose to do this, we will receive certain profile information about you from your social media provider. The profile information we receive may vary depending on the social media provider concerned, but will often include your name, email address, friends list, and profile picture, as well as other information you choose to make public on such a social media platform.&#x20;

We will use the information we receive only for the purposes that are described in this privacy policy or that are otherwise made clear to you on the relevant Services. Please note that we do not control, and are not responsible for, other uses of your personal information by your third-party social media provider. We recommend that you review their privacy policy to understand how they collect, use, and share your personal information, and how you can set your privacy preferences on their sites and apps.

**6. IS YOUR INFORMATION TRANSFERRED INTERNATIONALLY?**

***In Short:** We may transfer, store, and process your information in countries other than your own.*

If you are accessing our Services from the country other than the Site location, please be aware that your information may be transferred to, stored, and processed by us in our facilities and by those third parties with whom we may share your personal information (see "[WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION?](https://app.termly.io/dashboard/website/6dc7954e-d30f-4c65-9be1-efd058d9c188/privacy-policy#whoshare)" above), in and other countries.

If you are a resident in the European Economic Area (EEA) or United Kingdom (UK), then these countries may not necessarily have data protection laws or other similar laws as comprehensive as those in your country. However, we will take all necessary measures to protect your personal information in accordance with this privacy policy and applicable law.

**7. HOW LONG DO WE KEEP YOUR INFORMATION?**

***In Short:** We keep your information for as long as necessary to fulfill the purposes outlined in this privacy policy unless otherwise required by law.*

We will only keep your personal information for as long as it is necessary for the purposes set out in this privacy policy, unless a longer retention period is required or permitted by law (such as tax, accounting, or other legal requirements).

When we have no ongoing legitimate business need to process your personal information, we will either delete or anonymize such information, or, if this is not possible (for example, because your personal information has been stored in backup archives), then we will securely store your personal information and isolate it from any further processing until deletion is possible.

**8. DO WE COLLECT INFORMATION FROM MINORS?**

***In Short:** We do not knowingly collect data from or market to children under 18 years of age.*

We do not knowingly solicit data from or market to children under 18 years of age. By using the Services, you represent that you are at least 18 or that you are the parent or guardian of such a minor and consent to such minor dependent’s use of the Services. If we learn that personal information from users less than 18 years of age has been collected, we will deactivate the account and take reasonable measures to promptly delete such data from our records. If you become aware of any data we may have collected from children under age 18, please contact us at <help@support.smartbotpro.io>,

**9. WHAT ARE YOUR PRIVACY RIGHTS?**

***In Short:**  You may review, change, or terminate your account at any time.*

If you are located in the EEA or UK and you believe we are unlawfully processing your personal information, you also have the right to complain to your local data protection supervisory authority. You can find their contact details here: <https://ec.europa.eu/justice/data-protection/bodies/authorities/index_en.htm>.

If you are located in Switzerland, the contact details for the data protection authorities are available here: <https://www.edoeb.admin.ch/edoeb/en/home.html>.

**Withdrawing your consent:** If we are relying on your consent to process your personal information, which may be express and/or implied consent depending on the applicable law, you have the right to withdraw your consent at any time. You can withdraw your consent at any time by contacting us by using the contact details provided in the section "[HOW CAN YOU CONTACT US ABOUT THIS POLICY?](https://app.termly.io/dashboard/website/6dc7954e-d30f-4c65-9be1-efd058d9c188/privacy-policy#contact)" below.

However, please note that this will not affect the lawfulness of the processing before its withdrawal nor, when applicable law allows, will it affect the processing of your personal information conducted in reliance on lawful processing grounds other than consent.

**Account Information**

If you would at any time like to review or change the information in your account or terminate your account, you can:

Upon your request to terminate your account, we will deactivate or delete your account and information from our active databases. However, we may retain some information in our files to prevent fraud, troubleshoot problems, assist with any investigations, enforce our legal terms and/or comply with applicable legal requirements.

**10. CONTROLS FOR DO-NOT-TRACK FEATURES**

Most web browsers and some mobile operating systems and mobile applications include a Do-Not-Track ("DNT") feature or setting you can activate to signal your privacy preference not to have data about your online browsing activities monitored and collected. At this stage no uniform technology standard for recognizing and implementing DNT signals has been finalized. As such, we do not currently respond to DNT browser signals or any other mechanism that automatically communicates your choice not to be tracked online. If a standard for online tracking is adopted that we must follow in the future, we will inform you about that practice in a revised version of this privacy policy.

**11. DO CALIFORNIA RESIDENTS HAVE SPECIFIC PRIVACY RIGHTS?**

***In Short:** Yes, if you are a resident of California, you are granted specific rights regarding access to your personal information.*

California Civil Code Section 1798.83, also known as the "Shine The Light" law, permits our users who are California residents to request and obtain from us, once a year and free of charge, information about categories of personal information (if any) we disclosed to third parties for direct marketing purposes and the names and addresses of all third parties with which we shared personal information in the immediately preceding calendar year. If you are a California resident and would like to make such a request, please submit your request in writing to us using the contact information provided below.

If you are under 18 years of age, reside in California, and have a registered account with Services, you have the right to request removal of unwanted data that you publicly post on the Services. To request removal of such data, please contact us using the contact information provided below and include the email address associated with your account and a statement that you reside in California. We will make sure the data is not publicly displayed on the Services, but please be aware that the data may not be completely or comprehensively removed from all our systems (e.g., backups, etc.).

**12. DO WE MAKE UPDATES TO THIS POLICY?**

***In Short:** Yes, we will update this policy as necessary to stay compliant with relevant laws.*

We may update this privacy policy from time to time. The updated version will be indicated by an updated "Revised" date and the updated version will be effective as soon as it is accessible. If we make material changes to this privacy policy, we may notify you either by prominently posting a policy of such changes or by directly sending you a notification. We encourage you to review this privacy policy frequently to be informed of how we are protecting your information.

**13. HOW CAN YOU CONTACT US ABOUT THIS POLICY?**

If you have questions or comments about this policy, you may email us at  <help@support.smartbotpro.io>&#x20;

**14. HOW CAN YOU REVIEW, UPDATE, OR DELETE THE DATA WE COLLECT FROM YOU?**

Based on the applicable laws of your country, you may have the right to request access to the personal information we collect from you, change that information, or delete it. To request to review, update, or delete your personal information, please submit a request to <help@support.smartbotpro.io><br>


# Terms of service

**TERMS OF SERVICE**

Last updated November 02, 2022

**1. AGREEMENT TO TERMS**

These Terms of Service constitute a legally binding agreement made between you, whether personally or on behalf of an entity (“you”) and SmartbotPro ("**Company**", “**we**”, “**us**”, or “**our**”), concerning your access to and use of the <https://smartbotpro.io> website as well as any other media form, media channel, mobile website or mobile application related, linked, or otherwise connected thereto (**collectively, the “Site”, “Smartbot”**). You agree that by accessing the Site, you have read, understood, and agree to be bound by all of these Terms of Service. IF YOU DO NOT AGREE WITH ALL OF THESE TERMS OF SERVICE, THEN YOU ARE EXPRESSLY PROHIBITED FROM USING THE SITE AND YOU MUST DISCONTINUE USE IMMEDIATELY.

Supplemental terms and conditions or documents that may be posted on the Site from time to time are hereby expressly incorporated herein by reference. We reserve the right, in our sole discretion, to make changes or modifications to these Terms of Service from time to time. We will alert you about any changes by updating the “Last updated” date of these Terms of Service, and you waive any right to receive specific notice of each such change. Please ensure that you check the applicable Terms every time you use our Site so that you understand which Terms apply. You will be subject to, and will be deemed to have been made aware of and to have accepted, the changes in any revised Terms of Service by your continued use of the Site after the date such revised Terms of Service are posted.

The information provided on the Site is not intended for distribution to or use by any person or entity in any jurisdiction or country where such distribution or use would be contrary to law or regulation or which would subject us to any registration requirement within such jurisdiction or country. Accordingly, those persons who choose to access the Site from other locations do so on their own initiative and are solely responsible for compliance with local laws, if and to the extent local laws are applicable.

The Site is intended for users who are at least 18 years old. Persons under the age of 18 are not permitted to use or register for the Site.

The headings used in these Terms of Service are included for convenience only and will not limit or otherwise affect these Terms.

**2. INTELLECTUAL PROPERTY RIGHTS**

Unless otherwise indicated, the Site is our proprietary property and all source code, databases, functionality, software, website designs, audio, video, text, photographs, and graphics on the Site (collectively, the “Content”) and the trademarks, service marks, and logos contained therein (the “Marks”) are owned or controlled by us or licensed to us or owned or controlled by the third parties, and are protected by copyright and trademark laws and various other intellectual property rights and unfair competition laws of the applicable laws, international copyright laws, and international conventions. The Content and the Marks are provided on the Site “AS IS” for your information and personal use only. Except as expressly provided in these Terms of Service, no part of the Site and no Content or Marks may be copied, reproduced, aggregated, republished, uploaded, posted, publicly displayed, encoded, translated, transmitted, distributed, sold, licensed, or otherwise exploited for any commercial purpose whatsoever, without our express prior written permission.

Provided that you are eligible to use the Site, you are granted a limited license to access and use the Site and to download or print a copy of any portion of the Content to which you have properly gained access solely for your personal, non-commercial use. We reserve all rights not expressly granted to you in and to the Site, the Content and the Marks.

**3. USER REPRESENTATIONS**

By using the Site, you represent and warrant that: (1) you have the legal capacity and you agree to comply with these Terms of Service; (2) you are not a minor in the jurisdiction in which you reside; (3) you will not access the Site through automated or non-human means, whether through a bot, script or otherwise; (4) you will not use the Site for any illegal or unauthorized purpose; and (5) your use of the Site will not violate any applicable law or regulation.

If you provide any information that is untrue, inaccurate, not current, or incomplete, we have the right to suspend or terminate your account and refuse any and all current or future use of the Site (or any portion thereof).

You are responsible for determining whether our Services are suitable for you to use in light of any applicable regulations such as EU Data Privacy Laws or other laws. If you’re subject to regulations (such as HIPAA) and you use our Service, then we won’t be liable if our Service doesn’t meet those requirements. You may not use our Service for any unlawful or discriminatory activities, including acts prohibited by the Federal Trade Commission Act, Fair Credit Reporting Act, Equal Credit Opportunity Act, or other laws that apply to commerce. You are also responsible to notify the end-user of data collection in connection with the Software, as required by applicable law.

You represent and warrant that you shall be solely responsible for obtaining end user consent for text messaging in full compliance with all applicable laws, rules, and regulations. You further represent and warrant that you shall not use the service to communicate with consumers who have requested that you cease contacting them.”

**4. FEES AND PAYMENT**

Payment terms and monthly rates are posted on the site <https://smartbotpro.io> and may be changed from time to time.

You may be required to purchase or pay a fee to access some of our services. You agree to provide current, complete, and accurate purchase and account information for all purchases made via the Site. You further agree to promptly update account and payment information, including email address, payment method, and payment card expiration date, so that we can complete your transactions and contact you as needed. We bill you through an online billing account for purchases made via the Site. Sales tax will be added to the price of purchases as deemed required by us. We may change prices at any time.&#x20;

You agree to pay all charges or fees at the prices then in effect for your purchases, and you authorize us to charge your chosen payment provider for any such amounts upon making your purchase.&#x20;

We reserve the right to correct any errors or mistakes in pricing, even if we have already requested or received payment. We also reserve the right to refuse any order placed through the Site.&#x20;

<br>

We may change our fees at any time by posting a new pricing structure to the Site and/or sending you a notification by email.

We may offer a free trial to new users who register with the Site in accordance with the effective payment terms posted on the Site. The account will be charged according to the user’s chosen subscription at the end of the free trial.

**5. PRODUCTS OR SERVICES (if applicable)**

Products or Services are available exclusively online through the Site. These products or Services may have limited quantities and are subject to refunds only according to Section 6 of these Terms of Service.

We reserve the right, but are not obligated, to limit the sales of our products or Services to any person, geographic region, or jurisdiction. We may exercise this right on a case-by-case basis. We reserve the right to limit the quantities of any products or services that we offer. All descriptions of products or product pricing are subject to change at anytime without notice, at the sole discretion of us. We reserve the right to discontinue any product at any time. Any offer for any product or service made on this Site is void where prohibited.

We do not warrant that the quality of any products, services, information, or other material purchased or obtained by you will meet your expectations, or that any errors in the Service will be corrected.

**6. CANCELLATION AND REFUND CONDITIONS**

You can cancel your subscription and get refund in case refund conditions stated on the Site are met.

Refund conditions:

* application for refund sent to SmartbotPro no later than 5 (five) calendar days from the date of payment;
* the user promptly notified the SmartbotPro through the support service of circumstances e-mail with a return request (no later than 24 hours from the moment of sending);
* the reasons why the User requires a refund are justified.

In the absence of one or more of the refund conditions specified above, SmartbotPro has the right to refuse to satisfy the user's requirement.

SmartbotPro has the right to refuse to satisfy the refund application if it is submitted by the user for the following reasons:

* the user's access is blocked due to violation of the Terms of Service;
* change of priorities or interests of the user;
* software on the user's personal computer and its technical funds do not allow user to use the service correctly.

The decision to refund requested funds or refuse to return funds is made by SmartbotPro within 3 (three) business days from the date the user's application for a refund by e-mail is received.

If you are unsatisfied with our services, please email us at <help@support.smartbotpro.io>

**7. PROHIBITED ACTIVITIES**

You may not access or use the Site for any purpose other than that for which we make the Site available. The Site may not be used in connection with any commercial endeavors except those that are specifically endorsed or approved by us.

As a user of the Site, you agree not to:

* Systematically retrieve data or other content from the Site to create or compile, directly or indirectly, a collection, compilation, database, or directory without written permission from us.
* Trick, defraud, or mislead us and other users, especially in any attempt to learn sensitive account information such as user passwords.
* Circumvent, disable, or otherwise interfere with security-related features of the Site, including features that prevent or restrict the use or copying of any Content or enforce limitations on the use of the Site and/or the Content contained therein.
* Disparage, tarnish, or otherwise harm, in our opinion, us and/or the Site.
* Use any information obtained from the Site in order to harass, abuse, or harm another person.
* Make improper use of our support services or submit false reports of abuse or misconduct.
* Use the Site in a manner inconsistent with any applicable laws or regulations.
* Engage in unauthorized framing of or linking to the Site.
* Upload or transmit (or attempt to upload or to transmit) viruses, Trojan horses, or other material, including excessive use of capital letters and spamming (continuous posting of repetitive text), that interferes with any party’s uninterrupted use and enjoyment of the Site or modifies, impairs, disrupts, alters, or interferes with the use, features, functions, operation, or maintenance of the Site.
* Engage in any automated use of the system, such as using scripts to send comments or messages, or using any data mining, robots, or similar data gathering and extraction tools.
* Delete the copyright or other proprietary rights notice from any Content.
* Attempt to impersonate another user or person or use the username of another user.
* Upload or transmit (or attempt to upload or to transmit) any material that acts as a passive or active information collection or transmission mechanism, including without limitation, clear graphics interchange formats (“gifs”), 1×1 pixels, web bugs, cookies, or other similar devices (sometimes referred to as “spyware” or “passive collection mechanisms” or “pcms”).
* Interfere with, disrupt, or create an undue burden on the Site or the networks or services connected to the Site.
* Harass, annoy, intimidate, or threaten any of our employees or agents engaged in providing any portion of the Site to you.
* Attempt to bypass any measures of the Site designed to prevent or restrict access to the Site, or any portion of the Site.
* Copy or adapt the Site’s software, including but not limited to Flash, PHP, HTML, JavaScript, or other code.
* Except as permitted by applicable law, decipher, decompile, disassemble, or reverse engineer any of the software comprising or in any way making up a part of the Site.
* Except as may be the result of standard search engine or Internet browser usage, use, launch, develop, or distribute any automated system, including without limitation, any spider, robot, cheat utility, scraper, or offline reader that accesses the Site, or using or launching any unauthorized script or other software.
* Use a buying agent or purchasing agent to make purchases on the Site.
* Make any unauthorized use of the Site, including collecting usernames and/or email addresses of users by electronic or other means for the purpose of sending unsolicited email, or creating user accounts by automated means or under false pretenses.
* Use the Site as part of any effort to compete with us or otherwise use the Site and/or the Content for any revenue-generating endeavor or commercial enterprise.

**8. USER GENERATED CONTRIBUTIONS**

The Site does not offer users to submit or post content. We may provide you with the opportunity to create, submit, post, display, transmit, perform, publish, distribute, or broadcast content and materials to us or on the Site, including but not limited to text, writings, video, audio, photographs, graphics, comments, suggestions, or personal information or other material (collectively, "Contributions"). Contributions may be viewable by other users of the Site and through third-party websites. As such, any Contributions you transmit may be treated in accordance with the Site Privacy Policy. When you create or make available any Contributions, you thereby represent and warrant that:

* The creation, distribution, transmission, public display, or performance, and the accessing, downloading, or copying of your Contributions do not and will not infringe the proprietary rights, including but not limited to the copyright, patent, trademark, trade secret, or moral rights of any third party.
* You are the creator and owner of or have the necessary licenses, rights, consents, releases, and permissions to use and to authorize us, the Site, and other users of the Site to use your Contributions in any manner contemplated by the Site and these Terms of Service.
* You have the written consent, release, and/or permission of each and every identifiable individual person in your Contributions to use the name or likeness of each and every such identifiable individual person to enable inclusion and use of your Contributions in any manner contemplated by the Site and these Terms of Service.
* Your Contributions are not false, inaccurate, or misleading.
* Your Contributions are not unsolicited or unauthorized advertising, promotional materials, pyramid schemes, chain letters, spam, mass mailings, or other forms of solicitation.
* Your Contributions are not obscene, lewd, lascivious, filthy, violent, harassing, libelous, slanderous, or otherwise objectionable (as determined by us).
* Your Contributions do not ridicule, mock, disparage, intimidate, or abuse anyone.
* Your Contributions are not used to harass or threaten (in the legal sense of those terms) any other person and to promote violence against a specific person or class of people.<br>
* Your Contributions do not violate any applicable law, regulation, or rule.<br>
* Your Contributions do not violate the privacy or publicity rights of any third party.<br>
* Your Contributions do not violate any applicable law concerning child pornography, or otherwise intended to protect the health or well-being of minors.<br>
* Your Contributions do not include any offensive comments that are connected to race, national origin, gender, sexual preference, or physical handicap.<br>
* Your Contributions do not otherwise violate, or link to material that violates, any provision of these Terms of Service, or any applicable law or regulation.

Any use of the Site in violation of the foregoing violates these Terms of Service and may result in, among other things, termination or suspension of your rights to use the Site.

**9. CONTRIBUTION LICENSE**

You and the Site agree that we may access, store, process, and use any information and personal data that you provide following the terms of the Privacy Policy and your choices (including settings).

By submitting suggestions or other feedback regarding the Site, you agree that we can use and share  such feedback for any purpose without compensation to you.

We do not assert any ownership over your Contributions. You retain full ownership of all of your Contributions and any intellectual property rights or other proprietary rights associated with your Contributions. We are not liable for any statements or representations in your Contributions provided by you in any area on the Site. You are solely responsible for your Contributions to the Site and you expressly agree to exonerate us from any and all responsibility and to refrain from any legal action against us regarding your Contributions.

**10. SUBMISSIONS**

You acknowledge and agree that any questions, comments, suggestions, ideas, feedback, or other information regarding the Site ("Submissions") provided by you to us are non-confidential and shall become our sole property. We shall own exclusive rights, including all intellectual property rights, and shall be entitled to the unrestricted use and dissemination of these Submissions for any lawful purpose, commercial or otherwise, without acknowledgment or compensation to you. You hereby waive all moral rights to any such Submissions, and you hereby warrant that any such Submissions are original with you or that you have the right to submit such Submissions. You agree there shall be no recourse against us for any alleged or actual infringement or misappropriation of any proprietary right in your Submissions.

**11. THIRD-PARTY WEBSITES AND CONTENT**

The Site may contain (or you may be sent via the Site) links to other websites ("Third-Party Websites") as well as articles, photographs, text, graphics, pictures, designs, music, sound, video, information, applications, software, and other content or items belonging to or originating from third parties ("Third-Party Content"). Such Third-Party Websites and Third-Party Content are not investigated, monitored, or checked for accuracy, appropriateness, or completeness by us, and we are not responsible for any Third-Party Websites accessed through the Site or any Third-Party Content posted on, available through, or installed from the Site, including the content, accuracy, offensiveness, opinions, reliability, privacy practices, or other policies of or contained in the Third-Party Websites or the Third-Party Content. Inclusion of, linking to, or permitting the use or installation of any Third-Party Websites or any Third-Party Content does not imply approval or endorsement thereof by us. If you decide to leave the Site and access the Third-Party Websites or to use or install any Third-Party Content, you do so at your own risk, and you should be aware these Terms of Service no longer govern. You should review the applicable terms and policies, including privacy and data gathering practices, of any website to which you navigate from the Site or relating to any applications you use or install from the Site. Any purchases you make through Third-Party Websites will be through other websites and from other companies, and we take no responsibility whatsoever in relation to such purchases which are exclusively between you and the applicable third party. You agree and acknowledge that we do not endorse the products or services offered on Third-Party Websites and you shall hold us harmless from any harm caused by your purchase of such products or services. Additionally, you shall hold us harmless from any losses sustained by you or harm caused to you relating to or resulting in any way from any Third-Party Content or any contact with Third-Party Websites.

<br>

**12. SITE MANAGEMENT**

We reserve the right, but not the obligation, to: (1) monitor the Site for violations of these Terms of Service; (2) take appropriate legal action against anyone who, in our sole discretion, violates the law or these Terms of Service, including without limitation, reporting such user to law enforcement authorities; (3) in our sole discretion and without limitation, refuse, restrict access to, limit the availability of, or disable (to the extent technologically feasible) any of your Contributions or any portion thereof; (4) in our sole discretion and without limitation, notice, or liability, to remove from the Site or otherwise disable all files and content that are excessive in size or are in any way burdensome to our systems; and (5) otherwise manage the Site in a manner designed to protect our rights and property and to facilitate the proper functioning of the Site.

We are not responsible if information made available on the Site is not accurate, complete or current. The material on this Site is provided for general information only and should not be relied upon or used as the sole basis for making decisions without consulting primary, more accurate, more complete or more timely sources of information. Any reliance on the material on this Site is at your own risk.

This Site may contain certain historical information. Historical information, necessarily, is not current and is provided for your reference only. We reserve the right to modify the contents of this site at any time, but we have no obligation to update any information on our site. You agree that it is your responsibility to monitor changes to our site.

<br>

**13. PRIVACY POLICY**

We care about data privacy and security. By using the Site, you agree to be bound by our Privacy Policy. Please be advised the Site may be hosted in country different from the country of your location. If you access the Site from any other region of the world with laws or other requirements governing personal data collection, use, or disclosure that differ from applicable laws of the country of the Site, then through your continued use of the Site, you are transferring your data to the country, and you agree to have your data transferred to and processed in this country.&#x20;

**14. TERM AND TERMINATION**

These Terms of Service shall remain in full force and effect while you use the Site. WITHOUT LIMITING ANY OTHER PROVISION OF THESE TERMS OF SERVICE, WE RESERVE THE RIGHT TO, IN OUR SOLE DISCRETION AND WITHOUT NOTICE OR LIABILITY, DENY ACCESS TO AND USE OF THE SITE (INCLUDING BLOCKING CERTAIN IP ADDRESSES), TO ANY PERSON FOR ANY REASON OR FOR NO REASON, INCLUDING WITHOUT LIMITATION FOR BREACH OF ANY REPRESENTATION, WARRANTY, OR COVENANT CONTAINED IN THESE TERMS OF SERVICE OR OF ANY APPLICABLE LAW OR REGULATION. WE MAY TERMINATE YOUR USE OR PARTICIPATION IN THE SITE OR DELETE ANY CONTENT OR INFORMATION THAT YOU POSTED AT ANY TIME, WITHOUT WARNING, IN OUR SOLE DISCRETION.

If we terminate or suspend your account for any reason, you are prohibited from registering and creating a new account under your name, a fake or borrowed name, or the name of any third party, even if you may be acting on behalf of the third party. In addition to terminating or suspending your account, we reserve the right to take appropriate legal action, including without limitation pursuing civil, criminal, and injunctive redress.

**15. MODIFICATIONS AND INTERRUPTIONS**

We reserve the right to change, modify, or remove the contents of the Site at any time or for any reason at our sole discretion without notice. However, we have no obligation to update any information on our Site. We also reserve the right to modify or discontinue all or part of the Site without notice at any time. We will not be liable to you or any third party for any modification, price change, suspension, or discontinuance of the Site.

We cannot guarantee the Site will be available at all times. We may experience hardware, software, or other problems or need to perform maintenance related to the Site, resulting in interruptions, delays, or errors. We reserve the right to change, revise, update, suspend, discontinue, or otherwise modify the Site at any time or for any reason without notice to you. You agree that we have no liability whatsoever for any loss, damage, or inconvenience caused by your inability to access or use the Site during any downtime or discontinuance of the Site. Nothing in these Terms of Service will be construed to obligate us to maintain and support the Site or to supply any corrections, updates, or releases in connection therewith.

**16. GOVERNING LAW**

These conditions are governed by and interpreted following the laws of the England and Wales, and the use of the United Nations Convention of Contracts for the International Sale of Goods is expressly excluded. &#x20;

**17. DISPUTE RESOLUTION**

**Informal Negotiations**

To expedite resolution and control the cost of any dispute, controversy, or claim related to these Terms of Service (each "Dispute" and collectively, the “Disputes”) brought by either you or us (individually, a “Party” and collectively, the “Parties”), the Parties agree to first attempt to negotiate any Dispute (except those Disputes expressly provided below) informally for at least 30 days before initiating judicial dispute resolution. Such informal negotiations commence upon written notice from one Party to the other Party.

Subject to the above paragraph, any Dispute arising under these Terms of Service or your use of the Site (whether it be contractual or non-contractual), will be subject to the exclusive jurisdiction of the courts of England and Wales.

**18. CORRECTIONS**

There may be information on the Site that contains typographical errors, inaccuracies, or omissions, including descriptions, pricing, availability, and various other information. We reserve the right to correct any errors, inaccuracies, or omissions and to change or update the information on the Site at any time, without prior notice.

**19. DISCLAIMER**

THE SITE IS PROVIDED ON AN AS-IS AND AS-AVAILABLE BASIS. YOU AGREE THAT YOUR USE OF THE SITE AND OUR SERVICES WILL BE AT YOUR SOLE RISK. TO THE FULLEST EXTENT PERMITTED BY LAW, WE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, IN CONNECTION WITH THE SITE AND YOUR USE THEREOF, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. WE MAKE NO WARRANTIES OR REPRESENTATIONS ABOUT THE ACCURACY OR COMPLETENESS OF THE SITE’S CONTENT OR THE CONTENT OF ANY WEBSITES LINKED TO THE SITE AND WE WILL ASSUME NO LIABILITY OR RESPONSIBILITY FOR ANY (1) ERRORS, MISTAKES, OR INACCURACIES OF CONTENT AND MATERIALS, (2) PERSONAL INJURY OR PROPERTY DAMAGE, OF ANY NATURE WHATSOEVER, RESULTING FROM YOUR ACCESS TO AND USE OF THE SITE, (3) ANY UNAUTHORIZED ACCESS TO OR USE OF OUR SECURE SERVERS AND/OR ANY AND ALL PERSONAL INFORMATION AND/OR FINANCIAL INFORMATION STORED THEREIN, (4) ANY INTERRUPTION OR CESSATION OF TRANSMISSION TO OR FROM THE SITE, (5) ANY BUGS, VIRUSES, TROJAN HORSES, OR THE LIKE WHICH MAY BE TRANSMITTED TO OR THROUGH THE SITE BY ANY THIRD PARTY, AND/OR (6) ANY ERRORS OR OMISSIONS IN ANY CONTENT AND MATERIALS OR FOR ANY LOSS OR DAMAGE OF ANY KIND INCURRED AS A RESULT OF THE USE OF ANY CONTENT POSTED, TRANSMITTED, OR OTHERWISE MADE AVAILABLE VIA THE SITE. WE DO NOT WARRANT, ENDORSE, GUARANTEE, OR ASSUME RESPONSIBILITY FOR ANY PRODUCT OR SERVICE ADVERTISED OR OFFERED BY A THIRD PARTY THROUGH THE SITE, ANY HYPERLINKED WEBSITE, OR ANY WEBSITE OR MOBILE APPLICATION FEATURED IN ANY BANNER OR OTHER ADVERTISING, AND WE WILL NOT BE A PARTY TO OR IN ANY WAY BE RESPONSIBLE FOR MONITORING ANY TRANSACTION BETWEEN YOU AND ANY THIRD-PARTY PROVIDERS OF PRODUCTS OR SERVICES. AS WITH THE PURCHASE OF A PRODUCT OR SERVICE THROUGH ANY MEDIUM OR IN ANY ENVIRONMENT, YOU SHOULD USE YOUR BEST JUDGMENT AND EXERCISE CAUTION WHERE APPROPRIATE.

**20. LIMITATIONS OF LIABILITY**

IN NO EVENT WILL WE OR OUR DIRECTORS, EMPLOYEES, OR AGENTS BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, EXEMPLARY, INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES, INCLUDING LOST PROFIT, LOST REVENUE, LOSS OF DATA, OR OTHER DAMAGES ARISING FROM YOUR USE OF THE SITE, EVEN IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. NOTWITHSTANDING ANYTHING TO THE CONTRARY CONTAINED HEREIN, OUR LIABILITY TO YOU FOR ANY CAUSE WHATSOEVER AND REGARDLESS OF THE FORM OF THE ACTION, WILL AT ALL TIMES BE LIMITED TO THE AMOUNT PAID, IF ANY, BY YOU TO US. CERTAIN US STATE LAWS AND INTERNATIONAL LAWS DO NOT ALLOW LIMITATIONS ON IMPLIED WARRANTIES OR THE EXCLUSION OR LIMITATION OF CERTAIN DAMAGES. IF THESE LAWS APPLY TO YOU, SOME OR ALL OF THE ABOVE DISCLAIMERS OR LIMITATIONS MAY NOT APPLY TO YOU, AND YOU MAY HAVE ADDITIONAL RIGHTS.

**21. INDEMNIFICATION**

You agree to defend, indemnify, and hold us harmless, including our subsidiaries, affiliates, and all of our respective officers, agents, partners, and employees, from and against any loss, damage, liability, claim, or demand, including reasonable attorneys’ fees and expenses, made by any third party due to or arising out of: (1) use of the Site; (2) breach of these Terms of Service; (3) any breach of your representations and warranties set forth in these Terms of Service; (4) your violation of the rights of a third party, including but not limited to intellectual property rights; or (5) any overt harmful act toward any other user of the Site with whom you connected via the Site. Notwithstanding the foregoing, we reserve the right, at your expense, to assume the exclusive defense and control of any matter for which you are required to indemnify us, and you agree to cooperate, at your expense, with our defense of such claims. We will use reasonable efforts to notify you of any such claim, action, or proceeding which is subject to this indemnification upon becoming aware of it.

**22. USER DATA**

We will maintain certain data that you transmit to the Site for the purpose of managing the performance of the Site, as well as data relating to your use of the Site. Although we perform regular routine backups of data, you are solely responsible for all data that you transmit or that relates to any activity you have undertaken using the Site. You agree that we shall have no liability to you for any loss or corruption of any such data, and you hereby waive any right of action against us arising from any such loss or corruption of such data.

**23. ELECTRONIC COMMUNICATIONS, TRANSACTIONS, AND SIGNATURES**

Visiting the Site, sending us emails, and completing online forms constitute electronic communications. You consent to receive electronic communications, and you agree that all agreements, notices, disclosures, and other communications we provide to you electronically, via email and on the Site, satisfy any legal requirement that such communication be in writing. YOU HEREBY AGREE TO THE USE OF ELECTRONIC SIGNATURES, CONTRACTS, ORDERS, AND OTHER RECORDS, AND TO ELECTRONIC DELIVERY OF NOTICES, POLICIES, AND RECORDS OF TRANSACTIONS INITIATED OR COMPLETED BY US OR VIA THE SITE. You hereby waive any rights or requirements under any statutes, regulations, rules, ordinances, or other laws in any jurisdiction which require an original signature or delivery or retention of non-electronic records, or to payments or the granting of credits by any means other than electronic means.

**24. MISCELLANEOUS**

These Terms of Service and any policies or operating rules posted by us on the Site or in respect to the Site constitute the entire agreement and understanding between you and us. Our failure to exercise or enforce any right or provision of these Terms of Service shall not operate as a waiver of such right or provision. These Terms of Service operate to the fullest extent permissible by law. We may assign any or all of our rights and obligations to others at any time. We shall not be responsible or liable for any loss, damage, delay, or failure to act caused by any cause beyond our reasonable control. If any provision or part of a provision of these Terms of Service is determined to be unlawful, void, or unenforceable, that provision or part of the provision is deemed severable from these Terms of Service and does not affect the validity and enforceability of any remaining provisions. There is no joint venture, partnership, employment or agency relationship created between you and us as a result of these Terms of Service or use of the Site. You agree that these Terms of Service will not be construed against us by virtue of having drafted them. You hereby waive any and all defenses you may have based on the electronic form of these Terms of Service and the lack of signing by the parties hereto to execute these Terms of Service.

**25. CONTACT US**

In order to resolve a complaint regarding the Site or to receive further information regarding use of the Site, please contact us at: <help@support.smartbotpro.io>


# Subscription and rates

The subscription price depends on the number of account users. You can top up your balance by any amount or pay for the service a month in advance. When replenishing for several months, we give discou

## How to activate a subscription to the service

There are several options:

1. Pay the monthly cost of the service at your current tariff&#x20;
2. Pay for several months of using the service at your current tariff and get a discount&#x20;
3. Pay any amount, but not less than 100 rubles

Regardless of the activation method, the deposited amount will go to the account balance and will be spent daily according to the tariff: in accordance with the current user base for all connected channels.

{% hint style="info" %}
Important!

The subscription cost is calculated by the number of user contacts in the Smartbot database (section "Users").

If, for example, your VK group has 10,000 subscribers, but there are only 100 in the Smartbot database, the tariff will be calculated from 100 people.&#x20;

Users enter the contact database when they contact the bot or when they are loaded into the database directly through the "users" section.
{% endhint %}

If the number of users changes, the cabinet will switch to a different tariff in accordance with the new number of users and the daily charge amount will also change. Don't worry, we'll notify you in advance of charges.

## What is included in the price

All tariffs allow you to use the functionality of the service without any restrictions.&#x20;

Available:&#x20;

* Bots for Telegram, Vkontakte and Viber&#x20;
* Unlimited number of bots&#x20;
* Unlimited messages&#x20;
* Unlimited mailings&#x20;
* Free database of template scripts for various tasks&#x20;
* Unlimited number of independent projects within the cabinet&#x20;
* Unlimited scripts per project&#x20;
* Unlimited number of managers for joint work in the office Built-in integrations with YuKassa, YuMoney, QIWI payment systems, as well as support for native payments within Telegram&#x20;
* Integration with Prodamus and GetCourse&#x20;
* Calling bots from external services using Webhook&#x20;
* Custom service integrations using HTTP requests&#x20;
* Built-in SmartQuery programming language&#x20;

Tariffs and prices

| Bot subscribers (number of contacts in the database) | Prices ($/month)\* |
| ---------------------------------------------------- | ------------------ |
| < 1000                                               | 13                 |
| 1 000 - 2 000                                        | 20                 |
| 2 000 - 5 000                                        | 33                 |
| 5 000 - 10 000                                       | 58                 |
| 10 000 - 30 000                                      | 115                |
| 30 000 - 50 000                                      | 165                |
| 50 000 - 100 000                                     | 300                |
| 100 000 - ∞                                          | 500                |

\*if the entire month of use, the number of subscribers corresponds to this tariff.

## Discounts and promotions

When replenishing for 3 months, a 5% discount&#x20;

When replenishing for 6 months, a 10% discount&#x20;

When replenishing for 12 months, a 20% discount&#x20;

Don't forget to follow us on social. networks to learn about other promotions and discounts 🙂


