투표

지원 채널

  • Telegram
  • WhatsApp (웹 채널)
  • 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 (기본값), telegram, discord, 또는 msteams
  • --poll-multi: 복수 선택 허용
  • --poll-duration-hours: Discord 전용 (생략 시 기본값 24)
  • --poll-duration-seconds: Telegram 전용 (5-600초)
  • --poll-anonymous / --poll-public: Telegram 전용 투표 가시성

Gateway RPC

메서드: poll

매개변수:

  • to (문자열, 필수)
  • question (문자열, 필수)
  • options (문자열 배열, 필수)
  • maxSelections (숫자, 선택 사항)
  • durationHours (숫자, 선택 사항)
  • durationSeconds (숫자, 선택 사항, Telegram 전용)
  • isAnonymous (불리언, 선택 사항, Telegram 전용)
  • channel (문자열, 선택 사항, 기본값: whatsapp)
  • idempotencyKey (문자열, 필수)

채널별 차이

  • 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 액션을 사용합니다 (to, pollQuestion, pollOption, 선택적 pollMulti, pollDurationHours, channel).

Telegram의 경우, 도구는 pollDurationSeconds, pollAnonymous, pollPublic도 허용합니다.

투표 생성에는 action: "poll"을 사용하세요. action: "send"와 함께 전달된 투표 필드는 거부됩니다.

참고: Discord에는 “정확히 N개 선택” 모드가 없습니다. pollMulti는 복수 선택으로 매핑됩니다. Teams 투표는 Adaptive Card로 렌더링되며, 투표를 기록하려면 게이트웨이가 ~/.openclaw/msteams-polls.json에 온라인 상태를 유지해야 합니다.