# Функции калькулятора

## **Как отправлять сообщения через калькулятор**

```
line_send_message(platform_id, text, buttons, attachments, quote_token, bot_group_id)
```

Функция помогает отправлять сообщения в указанный чат.

<table><thead><tr><th width="310.76171875">Параметры</th><th>Описание</th></tr></thead><tbody><tr><td><mark style="color:$danger;"><strong>!</strong></mark><strong> platform_id</strong></td><td><p><strong>ID чата в LINE.</strong> </p><p>Вы можете передать системную переменную <a href="/pages/6a223a707181a37791732e5688c4bc3f09ab91c0"><code>platform_id</code>.</a></p></td></tr><tr><td><strong>text</strong></td><td><p><strong>Текст сообщения.</strong> </p><p>Необязательный параметр, если <code>attachments</code> параметр указан.</p></td></tr><tr><td><strong>buttons</strong></td><td><p><strong>Массив кнопок в сообщении.</strong></p><p><a href="#an-array-of-buttons-in-the-message">Необязательный параметр.</a></p></td></tr><tr><td><strong>attachments</strong></td><td><p><strong>Массив вложений.</strong></p><p><a href="#an-array-of-attachments">Необязательный параметр.</a></p></td></tr><tr><td><strong>quote_token</strong></td><td><strong>Токен ответа для ответа на конкретное сообщение.</strong> Вы можете передать <code>line_quote_token</code> переменную.</td></tr><tr><td><strong>bot_group_id</strong></td><td><p><strong>ID группы бота.</strong></p><p>Можно указать, если нужно отправить сообщение от имени другого подключенного бота. Необязательный параметр.</p></td></tr></tbody></table>

### **Массив кнопок в сообщении**

Параметр buttons формируется также как кнопки в блоке воронки. Чтобы упростить формирование массива, можно в блоке воронки создать кнопки с помощью интерфейса и скопировать сформированные данные.

Шаг 1. Создайте кнопки в блоке.

<div data-with-frame="true"><figure><img src="/files/2e3e6f18572ea9bdfd5a90f3483bf214a50d190f" alt=""><figcaption></figcaption></figure></div>

Шаг 2. Скопируйте расширенные настройки кнопки.

<div data-with-frame="true"><figure><img src="/files/861391668dd98467e3c9faa08a221cb96445f9ee" alt=""><figcaption></figcaption></figure></div>

**Пример массива buttons:**

`[{"line":0,"index_in_line":0,"text":"Visit site","type":"inline","url":"`[`https://google.com","callback_link":false`](about:blank)`}]`

### **Массив вложений**

Параметр `attachments` является массивом словарей, которые определяют отправляемые вложения.&#x20;

Каждое вложение в массиве должно содержать тип вложения (`attachment_type`) и его URL (`attachment_url`).

Пример:

attach\_list = \[{"attachment\_type": "image", "attachment\_url": "[https://files.site.com/my\_image.jpg](https://files.mavibot.ai/uploads/message_files/ca31b6d2ff3c2eef9c86bb0cc820412057b0ca004bd6c0e402c8df793c42f17d.jpg)"}]

Возможные значения для `attachment_type`:

* image
* video
* audio


---

# 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/doc/ru/chatbot/messendzhery/line_chatbot/api.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.
