Polls
Gateway + CLI で投票を送信します。
サポートされているチャンネル
- WhatsApp(Webチャンネル)
- Discord
- 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)
Gateway 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>' (string, required)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'question'</code>' (string, required)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'options'</code>' (string[], required)
- '<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>' (string, required)
チャンネルの違い
- 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>'は複数選択にマッピングされます。
Teams投票はアダプティブカードとして表示され、ゲートウェイがオンラインのまま必要です
'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'~/.openclaw/msteams-polls.json'</code>'で投票を記録します。