# FAQ

1. [Chatbot](#chatbot)
2. [File attachments](#file-attachments)
3. [Funnel](#funnel)
4. [Others](#others)

## CHATBOT

### What should I do if the bot works in the test window but does not work in the messenger?

Your plan is either not paid for or the wrong plan has been paid.

{% hint style="warning" %}
A channel connection error is another reason why the bot may not work in messengers.&#x20; In this case, we recommend checking the connection settings according to the messenger integration instructions. <mark style="color:red;">**ссылка**</mark>
{% endhint %}

### How to obtain a valid (or correct) phone number from a client?

You need to add phone number validation using regex.

*Regular expressions* let the bot check if the entered data is in the right format (for example, to make sure it’s a phone number and not something else).

<details>

<summary>How to do the check?</summary>

When talking with clients, you often need to follow up by phone. So, how can a chatbot automatically collect client information? The answer is simple — by using regular expressions.

To use the function for collecting a phone number (or email), use the following regular expressions:

1. Phone number (Russia): ^((\\+7|7|8)+(\[0-9]){10})$ <mark style="color:red;">**поменять страну и номер**</mark>
2. Phone number (with country code): ^(\\+)?((\d{2,3}) ?\d|\d)((\[ -]?\d)|( ?(\d{2,3}) ?)){5,12}\d$
3. Email: ^\[-\w.]+@(\[A-z0-9]\[-A-z0-9]+\\.)+\[A-z]{2,4}$

{% hint style="danger" %}
Make sure there is no space before the arrow (->) in the condition!

<img src="/files/u4NYNl9nslxpMjKyoSSA" alt="" data-size="original">

Otherwise, the chatbot flow will work with errors.
{% endhint %}

{% hint style="info" %}
In the flow, we used a regular expression for phone numbers from any country.
{% endhint %}

Like the bot saved the client’s name and age, it will also save the user’s phone number or email (if you use the right regular expression).

Create a block where the bot sends a message asking the client to send their phone number (or email):

<figure><img src="/files/mP2Ze9wSEo4L5PIeflrB" alt=""><figcaption><p>Block with a message to collect the client’s phone number</p></figcaption></figure>

Next, connect an arrow from this block and set the appropriate regular expression as the condition for the arrow.

<figure><img src="/files/tGNAzuT8Nvo3Wi91zFjB" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
As mentioned earlier, don’t forget to set the matching option to "Regular expression" to avoid chatbot errors.
{% endhint %}

With the regular expression condition, the chatbot will only accept phone numbers as digits, and emails in the correct standard format.

If the client sends a message that isn’t a valid phone number (or email), you can create a block that tells the client their input is incorrect:

<figure><img src="/files/4XSFqcjuYKWITq44DjvJ" alt="" width="489"><figcaption></figcaption></figure>

From the block where you asked the client to send their phone number, create a second arrow and in the new block write a message like: "This is not a phone number. Please enter your phone number!"

<figure><img src="/files/h0xRKnB3yMECKf5be63B" alt=""><figcaption></figcaption></figure>

Choose the block type "Non-state" (see screenshot above). This type of block doesn’t have conditions like the "Dialog state" block, and you cannot navigate to it directly.

The "Non-state" block is perfect in our flow because the user won’t be able to move on from the previous block without entering their phone number, ensuring they provide it to continue down the funnel.

<figure><img src="/files/DnsYyYEQgHywmGuwHsvQ" alt="" width="458"><figcaption></figcaption></figure>

{% hint style="info" %}
You can read about the "Non-state" block and its features in the article called "Non-state block." <mark style="color:red;">**ссылка**</mark>
{% endhint %}

</details>

{% hint style="info" %}
You can find more details about regular expressions in the article titled "List of useful regular expressions." <mark style="color:red;">**ссылка**</mark>
{% endhint %}

### How to find out the number of bot subscribers?

The "Analytics" section shows both the total number of clients and the numbers broken down by messenger platforms. <mark style="color:red;">**ссылка**</mark>

<figure><img src="/files/4YQXD6CHLkX1lR0oyIkL" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="/files/W0q8A5vfSIFDRrswng4x" alt="" width="563"><figcaption></figcaption></figure>

### How to make the bot initiate the conversation itself

Each messenger has its own setting that allows the bot to send the first message.&#x20;

{% hint style="info" %}
The article "First message in messengers" is here. <mark style="color:red;">**ссылка**</mark>
{% endhint %}

### How to send a "Follow-up" message?

Sometimes a client may stop progressing through the funnel for personal reasons. To remind the client about you, you can send a follow-up message using the "Non-state" block.

<figure><img src="/files/Bc5O83D8NzXYhJ8JOehx" alt=""><figcaption></figcaption></figure>

This block will send a message to the user without moving them anywhere within the main funnel.

{% hint style="info" %}
You can read more about how such blocks work in the article "Non-state" blocks. <mark style="color:red;">**ссылка**</mark>
{% endhint %}

We also use a timer (delay) in the arrows and TURN ON the "Cancel if left the block" toggle.

<figure><img src="/files/9XavywHKZxgUzgjybBxe" alt=""><figcaption></figcaption></figure>

The "Cancel if left the block" toggle means that the arrow will only trigger for users who, after the specified time, are still in the green block and have not moved to the white block.&#x20;

### How to make a sequence of 2-3 messages open immediately?

You need to connect the blocks with arrows and set the delay to 0 seconds in the arrow connection settings.

<figure><img src="/files/y2X5Vzh5P9o5wx3btVRV" alt=""><figcaption></figcaption></figure>

### How can smart replies be disabled when an operator or manager joins the chat, so that the bot stops responding?

You need to set a delay after the operator’s response.

<figure><img src="/files/tdyyawQdDIh2YhZqWtlH" alt=""><figcaption></figcaption></figure>

### How can you track whether a person clicked the link from the previous message?

To do this, you need to use the proxy-link function.

Let's create a variable called link and assign it the value of proxy() with your link:

<figure><img src="/files/KrMm8ClyWwXPVEeXmEIh" alt="" width="563"><figcaption></figcaption></figure>

Next, create a button with its URL set to the link variable:

<figure><img src="/files/x8aMNLo0yFd5Xb1qzbMN" alt="" width="563"><figcaption></figcaption></figure>

Add the button to the block and test it. In the client conversation, you will see a notification like this in the corresponding section:

<figure><img src="/files/0cRm0dj2nayhnhOjL2a1" alt="" width="519"><figcaption></figcaption></figure>

Video tutorial

{% embed url="<https://www.youtube.com/watch?t=164s&v=2J25l8g8yYo>" %}

### I want to run targeted ads for this bot. Where can I get its link?

You can create a website (landing page) that will contain links to the bots.

<figure><img src="/files/n8Gi0RQvzkdd1Zizoel6" alt=""><figcaption></figcaption></figure>

Using a website or landing page isn’t mandatory; you can simply use proxy links.

{% hint style="danger" %}
You cannot use links from mini landing page buttons!
{% endhint %}

### Is the "Time delay" function used to send a message at a set time and date?

That’s correct. The message will be sent at the date and time set in the arrow (connection) settings.

<figure><img src="/files/MRVNcJvWYvp5D1KbhMIK" alt=""><figcaption></figcaption></figure>

If a delay before sending is set, this delay will be added to the specified time. For example, the message will be sent on 07/21/2025 at 11:00 because the delay set in the "Delay before response" field is added to the time set in the "Send time" field.

### Is it possible to create two different bots within one account?

You can create any number of projects within one account.

### Is it possible to configure a timer-based arrow with a condition for transition so that it doesn’t get scheduled after every client message?

If for some reason you disabled "Cancel timed messages" but still use a timer-based transition with a condition, we recommend adding #{question} to the "Strings not to respond to" field.

<figure><img src="/files/48V4NTsxUB2htQo3emHB" alt=""><figcaption></figcaption></figure>

### Why is the text "\&para" written in the block replaced with "¶"?

Unfortunately, in this case, the browser itself kicks in, detecting what it thinks is an error and automatically replacing \&para with ¶, which then displays as the "¶" symbol. To avoid this issue, we recommend using \&Para instead.

### Is it possible to configure notifications to our administrator when a client sends a message in the online chat?

Yes, it is possible. You can find more details about this in the article:

{% embed url="<https://docs.salebot.pro/api-v-konstruktore-salebot.pro/otpravka-zayavok-v-messendzhery>" %}

### Is it possible to have different links to the bot with different logic?

<details>

<summary>Message to support:</summary>

"Good afternoon! We have the following situation:\
We have two identical links that lead to the same website, but we made the division to understand where the leads come from.

Is it possible to do this using just one bot?

In other words, one link will be in the Telegram profile header, and the other will be used in our ads, and we want to separate these two channels while using a single bot."

</details>

&#x20;Yes, you can create two websites (landing pages) in the builder and assign each its own tag:

1. Create two sites with different tags:

<figure><img src="/files/7CEeaYjhfFX9SpPmo5s3" alt=""><figcaption></figcaption></figure>

2. Then, in the starting blocks, specify the tags in the block’s condition:

a) In other words, when a user enters the messenger via the "Course website" landing page, this setup will apply:

<figure><img src="/files/IkfctFD4RY7K7CK3ljB2" alt=""><figcaption></figcaption></figure>

b) When a user enters the messenger from the "Training" landing page, the second funnel will be triggered:

<figure><img src="/files/pBxdGJuhE7BEeKKqGvDZ" alt=""><figcaption></figcaption></figure>

### Is it possible to send a message the day after the bot’s first message?

<details>

<summary>Message to support: </summary>

"I have the following situation: A person clicks on an ad and enters the bot, receiving a welcome message. I need to send them a link exactly at 12 PM the next day. How can I configure it?"

</details>

Yes, you can. In the arrow’s "send date" field, you need to specify the variable next\_day along with the desired sending time.

<br>

<figure><img src="/files/raQ81LXSkmqu31evG1Wx" alt=""><figcaption></figcaption></figure>

### How can I configure the bot so it doesn’t interfere with communication between clients and operators?

In the **project settings**, there is a field called "Time in minutes during which the bot pauses after the operator’s response."

<figure><img src="/files/kmjPaMiZjprD7Bm6RfY7" alt=""><figcaption></figcaption></figure>

The countdown starts from the moment the operator sends a message. If you accidentally set a too high value and the bot stops responding to the client for too long, set the field to 0 and notify the client.

### How to configure unsubscribe via the chat bot?

{% embed url="<https://youtu.be/XQSgg-nPSwc>" %}

## FILE ATTACHMENTS

### Can I attach images?

Yes, the bot can send images in messages. To do this, in the builder, select the desired block, add an attachment, and choose the appropriate type (for example, image):

<figure><img src="/files/qUlZNEM84sWXw5L14cg5" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
ПMore details about sending attachments can be found here. <mark style="color:red;">**ссылка**</mark>
{% endhint %}

### How can I send multiple images (files)?

The blocks now support adding multiple attachments of the same type:

<figure><img src="/files/iLoM4pwWk8jav72mko2J" alt="" width="375"><figcaption></figcaption></figure>

You can also create several consecutive blocks, each sending an attachment without text by specifying the variable #{none} in the response field.

### Why do links come through instead of files?

This means either you selected the file sending type as a link, or there was an error when sending the file. It’s recommended to check whether the file exists at the link.

Here are some specifics about file sending:

1. When uploading, files must have **different names** because they are saved on the server. Each project has its own folder, and duplicate file names are not allowed.
2. If you send a file as a link, make sure the link is working.
3. Video files sent as "videos for viewing" are not supported.
4. Deleting a block also deletes its attached file.

### How can I make a link preview appear?

When adding links in the message text, you can enable link preview display by:

<figure><img src="/files/GwGgXjOvflqL7MCwqJkK" alt="" width="375"><figcaption></figcaption></figure>

The transformation of a link into a nice preview when sending it in social networks or messengers like **Telegram, WhatsApp, Facebook** are handled by Open Graph markup.

> Open Graph markup consists of additional meta tags that include the title (og:title), description (og:description), and image (og:image).

When you **change the image** or description for a link preview, you need to **clear the cache** using special tools.

### What is the maximum file size?

The maximum file size for uploading in the builder is 20 MB; there are no size limits when sending via a link.

### How can I send a random text or image?

We often get questions about how to send a value, image, etc., randomly selected from a data set. Here’s a detailed explanation:

#### Function format:

**random(low, high)** -  To get a random number,&#x20;the function takes two parameters as input: the lower bound and the upper bound.\
Example: `random(-10,10)`\
`The result is an integer between -10 and 10.`

#### Getting a random value from a data set

By a data set, we mean any source of stored information—an array, dictionary, or table.

Let’s look at an example using an array:

1. Array declaration:\
   `text = {`   \
   `"1": "Sunny Italy awaits you",`   \
   `"2": "I think fashionable France will lift your spirits",`   \
   `"3": "It’s time to visit the shores of native Crimea",`   \
   `"4": "Explore the corners of your homeland"`   \
   `}`

   `picture = {`   \
   `"1": "https://i.ibb.co/k4prZK0/itperv.jpg",`   \
   `"2": "https://i.ibb.co/mTthk8t/image.jpg",`   \
   `"3": "https://i.ibb.co/dJ1d6XK/5d42d4f8a593ad12cf3fb394-1.jpg",`   \
   `"4": "https://i.ibb.co/Y3YYGQD/DSCF6408-2.jpg"`   \
   `}`
2. &#x20;***Select a random value:***\
   *vibor=random(1,4)*
3. *Get the values from the arrays using the selected number:*\
   *txt = get(text, '#{vibor}')*\
   *pct = get(picture,'#{vibor}')*
4. *Output the results to the client.*\
   \
   *Example:*&#x20;

<figure><img src="/files/Pj0PuhtJ0GNU4SgfO3Sc" alt="" width="563"><figcaption></figcaption></figure>

When working with tables, the approach is the same as with arrays and dictionaries: you need to fill in the data first, then read a randomly selected row from the table.

## FUNNEL

### How can I split a funnel by messengers?

To identify which messenger the client came from, there are built-in variables #{client\_type} and #{messenger}. Both contain messenger information, but #{client\_type} returns a number, while #{messenger} returns the name.

For example, if a person came from the Online Chat, #{client\_type} returns 5, and #{messenger} returns "Online-чат."

Here are the values for client\_type:

<table><thead><tr><th width="195.3359375">Значение</th><th width="301.41796875">Мессенджер</th></tr></thead><tbody><tr><td>1  </td><td>Telegram </td></tr><tr><td>2  </td><td>Viber</td></tr><tr><td>3  </td><td>Facebook <em>messenger</em></td></tr><tr><td>5  </td><td>online chat</td></tr><tr><td>10</td><td>Instagram</td></tr><tr><td>14 </td><td>e-mail </td></tr><tr><td>16</td><td>Telegram Business Account </td></tr></tbody></table>

{% hint style="info" %}
You can find more details about variables here. <mark style="color:red;">**ссылка**</mark>
{% endhint %}

Let’s look at some examples:

To determine which messenger the client is writing from, create 3 branches. In the "Variable for comparison" field of each arrow, specify the corresponding conditions:

<figure><img src="/files/So84rznmAL1Dsnm77CE0" alt=""><figcaption></figcaption></figure>

Based on the messenger the client uses, he will follow the appropriate path in the funnel and reach the corresponding block.

1. If the client messages via Telegram, he will be directed to the block named "You are from Telegram":

<figure><img src="/files/aRDzTJgewmDeAgPg69Rv" alt="" width="375"><figcaption></figcaption></figure>

3. If the client messages from another messenger or the online chat, he will be directed to the block named "You didn’t come from Telegram":

<figure><img src="/files/PRHMovSg7PnGgkxZHhHe" alt="" width="563"><figcaption></figcaption></figure>

{% embed url="<https://youtu.be/Ryt4aRHjhos>" %}

### How can I split a funnel based on different logins?

For users connected to multiple accounts within the same messenger, it can be challenging to separate funnel functionality by account. To solve this, there is a built-in variable called #{group}. It returns the identifier of the bot account the client is interacting with.

<mark style="color:green;">**Example:**</mark>

In the "Channels" section, two Telegram bots are connected. Please copy the group\_id:

<figure><img src="/files/NeUT9j6SzP8DCpKw26nn" alt=""><figcaption></figcaption></figure>

You can use the comparison of the group variable’s value both in conditional blocks and in arrows. To do this, use the **"Variable for comparison"** field.

***Split the funnels in the starting blocks:***

In these blocks, the conditions to start the funnel are the same, but the "Variable for comparison" field checks the value of the group variable.

This block with the condition "start" will only trigger in the corresponding bot:

<figure><img src="/files/MQ9DfTvXGVGBuReeompC" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/viSesFjPbY4U8gpPPNDS" alt="" width="563"><figcaption></figcaption></figure>

To split the funnel by bot logins, you can also compare the value of the **group variable in connections** (arrows). This way, depending on which bot the client uses, users will receive different messages at specific stages of the funnel.

<figure><img src="/files/E00URSumfuGIQuEVyto5" alt="" width="563"><figcaption><p>Here’s one way to configure the arrows</p></figcaption></figure>

{% hint style="info" %}
You can find more details about variables here. <mark style="color:red;">**ссылка**</mark>
{% endhint %}

{% embed url="<https://youtu.be/rTR2dG2Crpk>" %}

### How can I notify an administrator if a user sends a message outside the funnel?

There are several ways to handle this.

Option 1: Create a "Non-state with condition" block that reacts to messages outside the bot’s defined conditions, and configure the calculator: message(187235469, 'Asked a question <https://mavibot.ai/projects/#{project\\_id}/clients/#{client\\_id}>') where the first parameter (187235469) is the manager’s client\_id.

{% hint style="info" %}
You can learn more about how the message() function works in this article. <mark style="color:red;">**ссылка**</mark>
{% endhint %}

Option 2:

In the project settings, put this in the "Message if bot doesn’t know the answer" field:

&#x20;\#{substring(message(187235469,'Задал вопрос <https://salebot.pro/projects/#{project\\_id}/clients/#{client\\_id}'),4)}>.

<figure><img src="/files/e5bjhGhfCgyFZpMgNQpi" alt=""><figcaption></figcaption></figure>

Then your project administrator will get a notification for any message the bot doesn’t know how to answer.

## OTHERS

### Where can I find the project number?

You can find the project number in your browser’s address bar:

<figure><img src="/files/AKxua2Wp0nzjT6V4kaWc" alt=""><figcaption></figcaption></figure>

Also, you can find it in the project list:

<figure><img src="/files/AuWtxwIoQX557hyLQZmr" alt=""><figcaption></figcaption></figure>

### How to refresh the Open Graph link cache?

#### Telegram

Start the bot @webpagebot and send the desired link. Then clear the cache by selecting one of the \[update …] commands.

<figure><img src="/files/EwOE1uBRSpWhKkxIFYd0" alt="" width="563"><figcaption></figcaption></figure>

#### Facebook

Go to the sharing debugger page, enter the link in the field, and click **Debug**. Then select "Scrape again" to refresh the image and description of the link.

For WhatsApp, links usually update automatically.

<figure><img src="/files/m5FtmqoY0FndyltcyyDh" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/wSn7nmSmbAA4XVsWJvJ3" alt=""><figcaption></figcaption></figure>

### How to check if a chat participant is in a specific list?

Here’s how to apply it in practice:\
Imagine you’ve given out a link to a private chat. Yes, the link is one-time use, but a savvy client might join the chat from someone else’s account. The bot hasn’t seen this user before, so it can’t kick them out after missed payment—and they keep consuming your content for free.

To prevent this:

* Add paying users to a list
* Create a separate list for curators/admins/VIP members
* When someone new joins the chat, the bot checks if they’re on any of the lists. If not, they get removed without mercy.<br>

So, the functions you’ll need for this setup are:\
\- [**add\_to\_list(номер списка)**](https://docs.salebot.pro/peremennye-1/kalkulyator#dlya-raboty-so-spiskami)- to add a user to a list\
\- [**tg\_create\_chat\_invite\_link(platform\_id, member\_limit=None, hours=None, request=None)** ](https://docs.salebot.pro/peremennye-1/api-v-kalkulyatore#kak-sozdat-ssylku-na-vstuplenie-v-chat) - to create a chat invite link (handles callback)\
\- [**some\_client\_in\_list(list\_id, recepient)**](https://docs.salebot.pro/peremennye-1/api-v-kalkulyatore#kak-proverit-sostoit-li-uchastnik-chata-v-opredelennom-spiske) - to check if a participant is in a specific list\
\- [**tg\_ban\_chat\_member(platform\_id, user\_id, hours=99999, revoke\_messages=True)**](https://docs.salebot.pro/peremennye-1/api-v-kalkulyatore#kak-zablokirovat-polzovatelya) - to ban a chat user

### How can I get links to messengers?

You can use the link to your bot in the messenger to invite clients.

Messenger links can be found in the "Channels" section:

<figure><img src="/files/aXuLOoI8yii0bQkJC77v" alt=""><figcaption></figcaption></figure>

Next, select the messenger for which you want to get the link. Each connected messenger has its own unique link.

You can also create a website where all the messenger links will be displayed:

<figure><img src="/files/n8Gi0RQvzkdd1Zizoel6" alt=""><figcaption></figcaption></figure>

It isn’t mandatory to use a website or landing page; you can simply use proxy links.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mavibot.ai/faq/faq.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
