v0.5.0

LINE Messages

Last updated


This page covers the two ways core/line sends text, reply token and push, and how incoming text and media messages are handled.

Reply with the reply token


A non-empty return from your handler is sent with ReplyMessage(event.ReplyToken, NewTextMessage(reply)). Reply messages are free, but each token works once and only shortly after the event, so the automatic reply uses it up. To send more than one message, return "" and call the SDK yourself through in.Raw and in.ReplyToken, or push.

Push to a target


  1. _, err := bot.Send(ctx, in.GroupID, "Build finished")

Send(ctx, to, text) calls PushMessage to one user, group, or room ID and returns the SDK's *linebot.BasicResponse. An empty to returns to is required. Push messages count against your LINE plan's message quota. Pick the target from Input: UserID for a one-to-one chat, GroupID or RoomID for a group or room.

Incoming message types


MessageTypePopulated fieldsTypical handling
textMessageID, TextReturn a reply
image, video, audioMessageIDbot.Save(ctx, in.MessageID, dir)
fileMessageID, FileNameSave, then rename using FileName if you need the original name

Stickers, locations, follow/unfollow, postbacks, and all other event types are ignored. Group and room messages reach the handler without a mention check.

Not provided


The LINE package has no input prompts, select menus, status messages, delete, or file upload. These depend on callbacks or message edits that the other platforms offer and that this package does not wrap.

中文