2026-01-06 04:43:35 +00:00
---
summary: "Poll sending via gateway + CLI"
read_when:
- Adding or modifying poll support
- Debugging poll sends from the CLI or gateway
---
# Polls
## Supported providers
- WhatsApp (web provider)
- Discord
2026-01-09 09:56:36 +01:00
- MS Teams (Adaptive Cards)
2026-01-06 04:43:35 +00:00
## CLI
```bash
# WhatsApp
2026-01-09 08:59:54 +01:00
clawdbot message poll --to +15555550123 \
2026-01-09 08:27:17 +01:00
--poll-question "Lunch today?" --poll-option "Yes" --poll-option "No" --poll-option "Maybe"
2026-01-09 08:59:54 +01:00
clawdbot message poll --to 123456789@g .us \
2026-01-09 08:27:17 +01:00
--poll-question "Meeting time?" --poll-option "10am" --poll-option "2pm" --poll-option "4pm" --poll-multi
2026-01-06 04:43:35 +00:00
# Discord
2026-01-09 08:59:54 +01:00
clawdbot message poll --provider discord --to channel:123456789 \
2026-01-09 08:27:17 +01:00
--poll-question "Snack?" --poll-option "Pizza" --poll-option "Sushi"
2026-01-09 08:59:54 +01:00
clawdbot message poll --provider discord --to channel:123456789 \
2026-01-09 08:27:17 +01:00
--poll-question "Plan?" --poll-option "A" --poll-option "B" --poll-duration-hours 48
2026-01-09 09:56:36 +01:00
# MS Teams
clawdbot message poll --provider msteams --to conversation:19:abc@thread .tacv2 \
--poll-question "Lunch?" --poll-option "Pizza" --poll-option "Sushi"
2026-01-06 04:43:35 +00:00
```
Options:
2026-01-09 10:05:33 +01:00
- `--provider` : `whatsapp` (default), `discord` , or `msteams`
2026-01-09 08:27:17 +01:00
- `--poll-multi` : allow selecting multiple options
- `--poll-duration-hours` : Discord-only (defaults to 24 when omitted)
2026-01-06 04:43:35 +00:00
## 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.
2026-01-09 09:56:36 +01:00
- MS Teams: Adaptive Card polls (Clawdbot-managed). No native poll API; `durationHours` is ignored.
2026-01-06 04:43:35 +00:00
2026-01-09 06:43:40 +01:00
## Agent tool (Message)
2026-01-09 08:27:17 +01:00
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.
2026-01-09 09:56:36 +01:00
Teams polls are rendered as Adaptive Cards and require the gateway to stay online
to record votes in `~/.clawdbot/msteams-polls.json` .