# Line

LINE continues to be one of the go‑to messaging apps in Asia, so adding it to MaviBot unlocks access to a massive user base. Here’s a simple step‑by‑step guide to get you from setup to your first messages.

<div data-with-frame="true"><figure><img src="/files/VsninuHcIX1uIc2PTbg6" alt="" width="188"><figcaption></figcaption></figure></div>

## **Connection**

To successfully set up the integration, you’ll need to complete a few required steps:

* **Business ID** — created in the [LINE Business Center](https://account.line.biz/login)
* **LINE Official Account** — created via the LINE Official Account Manager.

<div data-with-frame="true"><figure><img src="/files/XeLsmWk9HKpKPXALe7eZ" alt="" width="563"><figcaption></figcaption></figure></div>

* **Messenger API** — you’ll need to enable it in your Official Account settings.

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

After that, go to the Response settings section and make sure Webhooks are enabled — without this, LINE won’t be able to send events to MaviBot.

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

### Channel ID & Channel Secret

Go to the Messaging API section — this is where the two key parameters are located.

* **Channel ID**
* **Channel Secret**

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

**They’re required to connect your bot to MaviBot.**

### Connecting LINE to MaviBot

**Now let’s move on to connecting LINE to MaviBot:**

* Open the **Channels** section in MaviBot.
* Select **LINE**.
* Paste your **Channel ID** and **Channel Secret**.
* Click **Done**.

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

If the details are correct, the bot will connect instantly.

### Variables

**When a user messages your bot, MaviBot automatically stores key data in varibles:**

* **line\_source\_type** — can be one of three types: *user* (direct chat), *group* (group chat), *room* (legacy group chat type).
* **line\_quote\_token** — a token for replying to a specific message. MaviBot always stores the token from the latest incoming message. Can be used in [`line_send_message()`](/chatbot/messengers/line_chatbot/api.md).
* **line\_request** — the full webhook payload, saved when the `save_webhook` variable is enabled.
* **latitude**, **longitude** — coordinates, saved when the user sends a location.
* **line\_address** — a readable address, saved when the user shares a location.

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

These variables allow you to build flexible flows and deliver highly personalized responses.

## Which events LINE sends to MaviBot

Possible callbacks:

* **line\_follow** — the user added the bot as a friend / unblocked it
* **line\_sticker** — a sticker was sent
* **client\_unsubscribed** — the user blocked the bot
* **line\_join** — the bot was added to a group chat
* **line\_leave** — the bot left a group chat
* **line\_memberJoined** — a new member joined the group chat
* **line\_memberLeft** — a member left the group chat

Each event can be used for automation — greetings, triggers, and logging.

<div data-with-frame="true"><figure><img src="/files/sMCGPvd2xurArTfeGem1" alt="" width="563"><figcaption></figcaption></figure></div>

## **LINE attachments**&#x20;

LINE supports three media types:

* **images**
* **videos**
* **audio/voice messages**

<div data-with-frame="true"><figure><img src="/files/Ua3LHPKIwOx2QQWr753C" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="warning" %}

#### Please note!

LINE has a strict limit: you can send **no more than 5 objects at a time**.

* **Each attachment** counts as **one object**.
* **Message text** is also a separate object.
* **A button set** is another separate object.

So if you send **media + text + buttons**, keep the **5‑object limit** in mind.
{% endhint %}

<div data-with-frame="true"><figure><img src="/files/tgoF2Fz8ExHTGR0VLpzB" alt="" width="563"><figcaption></figcaption></figure></div>

## Action buttons

#### **Keyboard (quick replies)**&#x20;

Appear above the input field. Up to **13 buttons**.

<div data-with-frame="true"><figure><img src="/files/pYY7psjB6HjXWXSF79LA" alt="" width="375"><figcaption></figcaption></figure></div>

#### **Buttons in text**

Displayed below the message. Up to **4 buttons**, and the message text can contain up to **160 characters**.

<div data-with-frame="true"><figure><img src="/files/JFKzS3GOgnjIW5DidvDt" alt="" width="346"><figcaption></figcaption></figure></div>

{% hint style="success" %}

#### Please note!

**Available button types**

* **Default**
* **Callback button**
* **Request geolocation** *(keyboard only)*
  {% endhint %}

## **Connecting to a group**&#x20;

To allow your bot to be added to group chats, you need to enable this feature in the **LINE Official Account Manager**

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


---

# 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/chatbot/messengers/line_chatbot.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.
