Builders for LINE action objects (used in templates, quick replies, imagemaps).
Ref: https://developers.line.biz/en/reference/messaging-api/#action-objects
Summary
Functions
Camera action — opens the camera screen.
Camera roll action — opens the photo library.
Clipboard action — copies clipboard_text (max 1000 chars) when tapped.
Datetime picker action. mode is :date | :time | :datetime.
Location action — opens the location screen.
Message action — sends text as the user when tapped.
Postback action — delivers data to your webhook as a postback event.
Rich menu switch action — switches to the rich menu with rich_menu_alias_id.
URI action — opens uri when tapped.
Functions
Camera action — opens the camera screen.
Ref: https://developers.line.biz/en/reference/messaging-api/#camera-action
iex> ExLine.Message.Action.camera("Camera")
%{type: "camera", label: "Camera"}
Camera roll action — opens the photo library.
Ref: https://developers.line.biz/en/reference/messaging-api/#camera-roll-action
iex> ExLine.Message.Action.camera_roll("Album")
%{type: "cameraRoll", label: "Album"}
Clipboard action — copies clipboard_text (max 1000 chars) when tapped.
Ref: https://developers.line.biz/en/reference/messaging-api/#clipboard-action
iex> ExLine.Message.Action.clipboard("Copy", "copied")
%{type: "clipboard", label: "Copy", clipboardText: "copied"}
Datetime picker action. mode is :date | :time | :datetime.
Options: :initial, :max, :min.
Ref: https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action
iex> ExLine.Message.Action.datetimepicker("Pick", "d", :datetime)
%{type: "datetimepicker", label: "Pick", data: "d", mode: "datetime"}
Location action — opens the location screen.
Ref: https://developers.line.biz/en/reference/messaging-api/#location-action
iex> ExLine.Message.Action.location("Location")
%{type: "location", label: "Location"}
Message action — sends text as the user when tapped.
Ref: https://developers.line.biz/en/reference/messaging-api/#message-action
iex> ExLine.Message.Action.message("Label", "sent text")
%{type: "message", label: "Label", text: "sent text"}
Postback action — delivers data to your webhook as a postback event.
Options: :display_text, :input_option, :fill_in_text.
Ref: https://developers.line.biz/en/reference/messaging-api/#postback-action
iex> ExLine.Message.Action.postback("Buy", "action=buy&id=1")
%{type: "postback", label: "Buy", data: "action=buy&id=1"}
iex> ExLine.Message.Action.postback("Buy", "action=buy", display_text: "Buying")
%{type: "postback", label: "Buy", data: "action=buy", displayText: "Buying"}
URI action — opens uri when tapped.
Ref: https://developers.line.biz/en/reference/messaging-api/#uri-action
iex> ExLine.Message.Action.uri("Open", "https://example.com")
%{type: "uri", label: "Open", uri: "https://example.com"}