Files
clawdbot/docs/automation/poll.md
2026-01-09 08:30:24 +01:00

1.8 KiB

summary, read_when
summary read_when
Poll sending via gateway + CLI
Adding or modifying poll support
Debugging poll sends from the CLI or gateway

Polls

Supported providers

  • WhatsApp (web provider)
  • Discord

CLI

# WhatsApp
clawdbot message --action poll --to +15555550123 \
  --poll-question "Lunch today?" --poll-option "Yes" --poll-option "No" --poll-option "Maybe"
clawdbot message --action poll --to 123456789@g.us \
  --poll-question "Meeting time?" --poll-option "10am" --poll-option "2pm" --poll-option "4pm" --poll-multi

# Discord
clawdbot message --action poll --provider discord --to channel:123456789 \
  --poll-question "Snack?" --poll-option "Pizza" --poll-option "Sushi"
clawdbot message --action poll --provider discord --to channel:123456789 \
  --poll-question "Plan?" --poll-option "A" --poll-option "B" --poll-duration-hours 48

Options:

  • --provider: whatsapp (default) or discord
  • --poll-multi: allow selecting multiple options
  • --poll-duration-hours: Discord-only (defaults to 24 when omitted)

Gateway RPC

Method: poll

Params:

  • to (string, required)
  • question (string, required)
  • options (string[], required)
  • maxSelections (number, optional)
  • durationHours (number, optional)
  • provider (string, optional, default: whatsapp)
  • idempotencyKey (string, required)

Provider differences

  • WhatsApp: 2-12 options, maxSelections must be within option count, ignores durationHours.
  • Discord: 2-10 options, durationHours clamped to 1-768 hours (default 24). maxSelections > 1 enables multi-select; Discord does not support a strict selection count.

Agent tool (Message)

Use the message tool with poll action (to, pollQuestion, pollOption, optional pollMulti, pollDurationHours, provider).

Note: Discord has no “pick exactly N” mode; pollMulti maps to multi-select.