投票

対応チャネル

  • Telegram
  • WhatsApp(Web チャネル)
  • Discord
  • MS Teams(Adaptive Cards)

CLI

# Telegram
openclaw 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

# WhatsApp
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

# Discord
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

# MS Teams
openclaw message poll --channel msteams --target conversation:19:[email protected] \
  --poll-question "Lunch?" --poll-option "Pizza" --poll-option "Sushi"

オプション:

  • --channel: whatsapp(デフォルト)、telegramdiscordmsteams
  • --poll-multi: 複数選択を許可
  • --poll-duration-hours: Discord 専用(省略時はデフォルト 24)
  • --poll-duration-seconds: Telegram 専用(5〜600 秒)
  • --poll-anonymous / --poll-public: Telegram 専用の投票可視性設定

Gateway RPC

メソッド: poll

パラメータ:

  • to(string、必須)
  • question(string、必須)
  • options(string[]、必須)
  • maxSelections(number、オプション)
  • durationHours(number、オプション)
  • durationSeconds(number、オプション、Telegram 専用)
  • isAnonymous(boolean、オプション、Telegram 専用)
  • channel(string、オプション、デフォルト: whatsapp
  • idempotencyKey(string、必須)

チャネルごとの違い

  • Telegram: 2〜10 個の選択肢。threadId または :topic: ターゲットによるフォーラムトピックをサポート。durationHours の代わりに durationSeconds を使用し、5〜600 秒に制限。匿名投票と公開投票をサポート。
  • WhatsApp: 2〜12 個の選択肢。maxSelections は選択肢の数以内。durationHours は無視。
  • Discord: 2〜10 個の選択肢。durationHours は 1〜768 時間に制限(デフォルト 24)。maxSelections > 1 で複数選択が有効に。Discord は厳密な選択数制限をサポートしていません。
  • MS Teams: Adaptive Card による投票(OpenClaw 管理)。ネイティブの投票 API はなし。durationHours は無視。

エージェントツール(Message)

message ツールを poll アクション(topollQuestionpollOption、オプションの pollMultipollDurationHourschannel)で使用します。

Telegram では pollDurationSecondspollAnonymouspollPublic も指定可能です。

投票作成には action: "poll" を使用してください。action: "send" で投票フィールドを渡すと拒否されます。

注意: Discord には「ちょうど N 個選択」モードはありません。pollMulti は複数選択にマッピングされます。 Teams の投票は Adaptive Card としてレンダリングされ、投票結果を ~/.openclaw/msteams-polls.json に記録するには Gateway がオンラインである必要があります。