投票
- Telegram
- WhatsApp (網頁頻道)
- Discord
- Microsoft Teams (Adaptive Cards)
# Telegramopenclaw message poll --channel telegram --target 123456789 \ --poll-question "Ship it?" --poll-option "Yes" --poll-option "No"openclaw message poll --channel telegram --target -1001234567890:topic:42 \ --poll-question "Pick a time" --poll-option "10am" --poll-option "2pm" \ --poll-duration-seconds 300
# WhatsAppopenclaw message poll --target +15555550123 \ --poll-question "Lunch today?" --poll-option "Yes" --poll-option "No" --poll-option "Maybe" --poll-question "Meeting time?" --poll-option "10am" --poll-option "2pm" --poll-option "4pm" --poll-multi
# Discordopenclaw message poll --channel discord --target channel:123456789 \ --poll-question "Snack?" --poll-option "Pizza" --poll-option "Sushi"openclaw message poll --channel discord --target channel:123456789 \ --poll-question "Plan?" --poll-option "A" --poll-option "B" --poll-duration-hours 48
# Microsoft Teams --poll-question "Lunch?" --poll-option "Pizza" --poll-option "Sushi"選項:
--channel:whatsapp(預設)、telegram、discord或msteams--poll-multi:允許選擇多個選項--poll-duration-hours:僅限 Discord (省略時預設為 24)--poll-duration-seconds:僅限 Telegram (5-600 秒)--poll-anonymous/--poll-public:僅限 Telegram 的投票可見性
Gateway RPC
Section titled “Gateway RPC”方法: poll
參數:
to(字串,必填)question(字串,必填)options(字串陣列,必填)maxSelections(數字,選填)durationHours(數字,選填)durationSeconds(數字,選填,僅限 Telegram)isAnonymous(布林值,選填,僅限 Telegram)channel(字串,選填,預設:whatsapp)idempotencyKey(字串,必填)
- Telegram:2-10 個選項。透過
threadId或:topic:目標支援論壇主題。使用durationSeconds而非durationHours,限制為 5-600 秒。支援匿名和公開投票。 - WhatsApp:2-12 個選項,
maxSelections必須在選項數量範圍內,忽略durationHours。 - Discord:2-10 個選項,
durationHours限制在 1-768 小時 (預設 24)。maxSelections > 1啟用多選;Discord 不支援嚴格的選取計數。 - Microsoft Teams:Adaptive Card 投票 (由 OpenClaw 管理)。無原生投票 API;
durationHours會被忽略。
Agent 工具 (訊息)
Section titled “Agent 工具 (訊息)”使用 message 工具配合 poll 動作(to、pollQuestion、pollOption、可選的 pollMulti、pollDurationHours、channel)。
對於 Telegram,該工具也接受 pollDurationSeconds、pollAnonymous 和 pollPublic。
使用 action: "poll" 來建立投票。透過 action: "send" 傳遞的投票欄位會被拒絕。
注意:Discord 沒有「精確選擇 N 個」模式;pollMulti 對應到多選。
Teams 投票呈現為 Adaptive Cards,並且需要閘道保持線上以便在 ~/.openclaw/msteams-polls.json 中記錄投票。