LINE Rich Messages
This skill transforms the agent from a text-only bot into a professional LINE assistant with native UI capabilities.
Core Principle: Rich-UI 優先 (Low-Friction)
Typing on mobile is slow and error-prone. Always prioritize Rich UI elements to minimize the user's need to reply with text.
Quick Navigation
Detailed guides for each feature:
- 1. decision-matrix.md: Choose the best UI element for your scenario.
- directives.md: Syntax for interactive cards and bubbles.
- flex-templates.md: Raw JSON Templates for 100% reliable UI creation.
- markdown-to-flex.md: Auto-美化 tables and code blocks.
Best Practices
- - No file delivery: For security, this skill intentionally does not include any workflow for uploading/sharing files (e.g., Google Drive). If you need file delivery, implement it in a separate, tightly-scoped skill with explicit allowlists and safeguards.
- Guided Choices: If you ask a question with 2-4 fixed answers, always include
[[quick_replies: ...]]. - Structured Data: Use Markdown tables for any multi-point information (e.g., flight times, order items).
- Destructive Actions: Use
[[confirm: ...]] for actions like "Delete Memory" or "Cancel Project". - UX Limitation (Crucial): Text within Flex Messages (including Markdown tables and auto-converted replies) cannot be selected or copied by the user.
-
Rule: If the data is meant to be copied (e.g., SSH keys, IDs, URLs),
always send it as plain text without Markdown formatting or directives that trigger Flex conversion.
Security / Scope (Important)
- - This skill is documentation + templates for building a better LINE UX (Flex, buttons, quick replies).
- It does not ship credentials and does not automatically make external API calls.
- Anything that touches the network or third-party services must be explicitly requested by the user and only after the runtime is correctly configured.
Credentials / Setup Clarification
- - LINE: Sending messages is handled by your OpenClaw LINE channel/plugin setup. This skill does not require you to declare or embed
LINE_CHANNEL_ACCESS_TOKEN / LINE_CHANNEL_SECRET. - File delivery: Intentionally not included (removed for safety). Do not upload/share local files from an agent runtime.
🏆 終極解決方案:手工 Raw Flex (The Golden Path)
若系統標籤轉換失敗,請使用 手工構建 JSON。這是最穩定且能 100% 呈現自定義 UI 的方式。
穩定發送按鈕的 JSON 模板
將此 JSON 作為純文字發送,若系統支援自動偵測則會轉換;若不支援,請改走 OpenClaw 的 LINE plugin 正規發送路徑(或由管理員在已授權的環境中操作),避免在 skill 內容中引導直接
curl 呼叫外部 API。
CODEBLOCK0
LINE 富訊息
此技能將智能體從純文字機器人轉變為具備原生 UI 能力的專業 LINE 助手。
核心原則:富 UI 優先(低摩擦)
在手機上打字既慢又容易出錯。 始終優先使用富 UI 元素,以盡量減少用戶需要輸入文字回覆的需求。
快速導覽
各功能的詳細指南:
- 1. decision-matrix.md:為您的場景選擇最佳 UI 元素。
- directives.md:互動式卡片和氣泡的語法。
- flex-templates.md:原始 JSON 模板,用於 100% 可靠的 UI 創建。
- markdown-to-flex.md:自動美化表格和程式碼區塊。
最佳實踐
- - 不傳送檔案:為安全起見,此技能特意不包含任何上傳/分享檔案(例如 Google Drive)的工作流程。如果您需要檔案傳送功能,請在另一個獨立、範圍嚴謹的技能中實現,並附上明確的允許清單和安全防護措施。
- 引導式選擇:如果您提出一個有 2-4 個固定答案的問題,請務必包含 [[quick_replies: ...]]。
- 結構化數據:對於任何多點資訊(例如航班時間、訂單項目),請使用 Markdown 表格。
- 破壞性操作:對於「刪除記憶」或「取消專案」等操作,請使用 [[confirm: ...]]。
- UX 限制(關鍵):Flex 訊息中的文字(包括 Markdown 表格和自動轉換的回覆)無法被用戶選取或複製。
-
規則:如果數據是為了讓用戶複製(例如 SSH 金鑰、ID、URL),
請務必以純文字形式發送,不要使用 Markdown 格式或會觸發 Flex 轉換的指令。
安全性 / 範圍(重要)
- - 此技能是文件 + 模板,用於構建更好的 LINE UX(Flex、按鈕、快速回覆)。
- 它不提供憑證,也不會自動進行外部 API 呼叫。
- 任何涉及網路或第三方服務的操作,都必須由用戶明確請求,且僅在運行環境正確配置後才能執行。
憑證 / 設定說明
- - LINE:發送訊息由您的 OpenClaw LINE 頻道/插件設定處理。此技能不要求您聲明或嵌入 LINECHANNELACCESSTOKEN / LINECHANNEL_SECRET。
- 檔案傳送:特意不包含(為安全起見已移除)。請勿從智能體運行環境上傳/分享本地檔案。
🏆 終極解決方案:手工 Raw Flex(黃金路徑)
若系統標籤轉換失敗,請使用 手工構建 JSON。這是最穩定且能 100% 呈現自定義 UI 的方式。
穩定發送按鈕的 JSON 模板
將此 JSON 作為純文字發送,若系統支援自動偵測則會轉換;若不支援,請改走 OpenClaw 的 LINE plugin 正規發送路徑(或由管理員在已授權的環境中操作),避免在 skill 內容中引導直接 curl 呼叫外部 API。
json
{
type: bubble,
body: {
type: box,
layout: vertical,
contents: [
{ type: text, text: 標題, weight: bold, size: lg },
{ type: text, text: 內文描述, wrap: true },
{
type: button,
style: primary,
color: #1DB446,
action: {
type: message,
label: 按鈕文字,
text: 回傳指令
}
}
]
}
}