民意调查
通过网关 + CLI 发送轮询
支持的频道
- WhatsApp(网络渠道)
- 不和谐
- MS Teams(自适应卡)
命令行界面
openclaw message poll --target +15555550123 --poll-question "Lunch today?" --poll-option "Yes" --poll-option "No" --poll-option "Maybe" openclaw message poll --target [email protected] --poll-question "Meeting time?" --poll-option "10am" --poll-option "2pm" --poll-option "4pm" --poll-multi openclaw 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 openclaw message poll --channel msteams --target conversation:19:[email protected] --poll-question "Lunch?" --poll-option "Pizza" --poll-option "Sushi"
选项:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'--channel'</code>':'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'whatsapp'</code>'(默认)、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'discord'</code>' 或 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'msteams'</code>'
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'--poll-multi'</code>':允许选择多个选项
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'--poll-duration-hours'</code>':仅限 Discord(省略时默认为 24)
网关 RPC
方法:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'poll'</code>'
参数:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>'(字符串,必需)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'question'</code>' (字符串,必需)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'options'</code>' (字符串[],必需)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'maxSelections'</code>'(数字,可选)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'durationHours'</code>'(数字,可选)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'channel'</code>' (字符串,可选,默认值:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'whatsapp'</code>')
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'idempotencyKey'</code>' (字符串,必需)
渠道差异
- WhatsApp:2-12 个选项,'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'maxSelections'</code>' 必须在选项计数内,忽略 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'durationHours'</code>'。
- Discord:2-10 个选项,'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'durationHours'</code>' 限制为 1-768 小时(默认 24)。 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'maxSelections > 1'</code>' 启用多选; Discord 不支持严格的选择计数。
- MS Teams:自适应卡民意调查(OpenClaw 管理)。没有原生轮询 API; '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'durationHours'</code>' 被忽略。
代理工具(消息)
将 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'message'</code>' 工具与 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'poll'</code>' 操作结合使用('<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'pollQuestion'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'pollOption'</code>',可选 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'pollMulti'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'pollDurationHours'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'channel'</code>')。
注意:Discord 没有"精确选择 N"模式; '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'pollMulti'</code>' 映射到多选。
团队民意调查呈现为自适应卡,并要求网关保持在线
记录 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'~/.openclaw/msteams-polls.json'</code>' 中的投票。