> For the complete documentation index, see [llms.txt](https://docs.mavibot.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mavibot.ai/doc/uk/faq/questions/chatbot.md).

# простий чатбот

Спочатку ми створюємо блок із типом «Початок діалогу» або «Перевірка основної умови».

Потім ви вводите умову: слово або слова, на які бот реагуватиме.

Заповніть текст, і ось що ви матимете на цьому етапі:

![](https://lh5.googleusercontent.com/-kFQ2TfUdCmyPOw95KIzapltFsqgwocgZyU2R_-td135cUAO6CgET780xo0C-AQt89gEDZvokPgodB9NL62_D5MHjpw8tXiANoPxELdZY5AiTG_Lt4f8qIVrrViUSjTLZUMEHBFvqPg-8gThdw)

Далі ми створюємо нижче блок типу «Стан діалогу» і з’єднуємо його стрілкою з основним блоком, перетягнувши білий блок на зелений.

Увімкніть перемикач «Користувач вводить дані» і вкажіть назву змінної, у яку буде збережено відповідь.

![](https://lh3.googleusercontent.com/XtA5QZEoQ1Ntb7cfud4wFmEjRXQiOqftlsSpFHcPMTfFqP6WqRDiBc3APAd2zal3dI_Vgqc_gLuMAuf41fFrq2oXXhxCHCdvljim9dnc2nSgyUCakkOP6Zhiq4f4aKPI79vHDsstBlHHC2M8zg)

Тепер ми створюємо ще один блок нижче, з’єднуємо його з білим блоком вище, знову вмикаємо перемикач «Користувач вводить дані».

Вкажіть назву змінної, яка збереже відповідь, і за допомогою умови з відповідним вибором «Регулярний вираз» ми перевіряємо відповідь — таким чином бот дозволить лише цифри:

![](/files/58fa3cf7bf778fa7b06a50424ff9364c15526961)

Створіть ще один блок

З’єднайте його стрілкою

Налаштуйте таймер

![](https://lh6.googleusercontent.com/Ox9GN2ma8ER-gKoMuENxYX-AyL9idONKaO56QakhDuw8VJEJIYgP-rIzgnavs3-UHFT6Ky1ZHwedwa75QHOzALPnG8KPnf1ZqoH8IU-tC0QeG0U9Kr8uUthATUwbivz8R7a4060c)

Додайте кнопку до повідомлення

Створіть ще один блок і з’єднайте його

Введіть текст кнопки в умову, у нашому випадку це «Купівля»

![](https://lh3.googleusercontent.com/eVbw2fUgOVuwIg_aNFX8LG_6caxTg-JokjCEDcSdzRQS7sa60D2T9mScusRfZYTZpYUNxxKaHFXoBMQ8PojqSYauFAxeMCba_WAti0-jtJKMr7Aaa-MTPrmNGtZyRtaCDe28bLrY)

Тепер, якщо людина нічого не купила, ми робимо нагадування через день про те, що вже давно час щось купити.

Повторіть цикл: додайте кнопку, створіть блок, з’єднайте блок, налаштуйте таймер.

Але тепер ми з’єднуємо його з тим самим блоком, як видно на скриншоті:

![](https://lh5.googleusercontent.com/C9om8JP2own9vGdEa7HFGsdT9XgDfeqbwoB5vD1nwv5JY6ir5xBoxp4ityuL8dCD_J6BXjlHGWkLuQ-YUlZ4Sm0-CZ2uyZPOp2goVKVyBe2h0F7FBaqGdkjxIU9CUX2ERD9o1pOXTDGngNXUxg)

Ось так виглядає перша частина ланцюжка в Telegram:

![](https://lh3.googleusercontent.com/aadjApl-mWhVzDCQbuXlbOi4yjCRC4YY1mZcU8-osfpOwIlrwCDHb9JLdOBF_pfvBjkDJ4Mb_izI9_870zTVcDlEkcVe2wil220SUrwqy1KJt3tZRVrC2LVFuIuPDViexvdq3kTg)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.mavibot.ai/doc/uk/faq/questions/chatbot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
