Group chats

LINE bots can interact with users in group chats using the Messaging API. This page describes how you can use your bot in a group chat.

Group chat types

LINE has two types of group chats, groups and rooms. The users of a group or room are called members.

Group

A group is a chat that users join by accepting an invitation from the user who created the chat or another member of the chat. LINE users can create groups with a specified name and invite their friends to join the group.

Room

A room is a chat among 3 or more users where the users can freely add other users to the chat. Unlike groups, rooms do not have specified names and do not require an invitation for users to join.

Note: A room is created locally on the client when a member of a one-on-one chat adds the third user to the chat. However, the room is not created on the LINE Platform until a user sends a message.

Receiving webhook events

The following webhook events are available for group chats. For more information, see Webhook event objects in the Messaging API reference.

Event type Description
Message event Indicates that the user sent a message. You can reply to this events.
Join event Indicates that your bot joined a group chat.
Leave event Indicates that a user deleted your bot from a group or that your bot left a group or room.
Postback event Indicates that the user performed a postback action. You can reply to this events.

Tip for using message events

Similarly to one-on-one chats, the LINE Platform sends a message event to the bot server when a user sends a message in a group chat that your bot has joined.

  • The message event object includes a source object with a value of group or room in the type property.
  • The user ID is included in the source object only if the user has agreed to the Official Accounts Terms of Use.

Example

"source": {
    "type": "group",
    "groupId": "Ca56f94637c...",
    "userId": "U4af4980629..."
    }

Sending a request to an endpoint

The following operations are specific to group chats. For more information, see Messaging API reference.

Tip for sending messages

Similarly to one-on-one chat, you can send reply messages and push messages to a group chat that your bot has joined.

When sending push messages, specify the group ID or room ID in the to property. The recipient ID is found in webhook event objects. Messages are displayed to all members of the group or room.

Note: You cannot send multicast messages in groups or rooms.