Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,52 @@ Send a text message to a contact or group.
- "Send 'Hello!' to +1234567890"
- "Message the team group saying 'Meeting at 3pm'"

#### `send_poll`

Send a poll to a contact or group.

**Parameters:**

- `recipient` (required): Phone number or group JID
- `name` (required): Poll question / title
- `options` (required): List of 2-12 answer options
- `selectable_option_count` (optional): Max options each voter can pick. `1` (default) for single-choice, `len(options)` for multi-select.

**Natural Language Examples:**

- "Send a poll to the team asking 'Lunch?' with options pizza, salad, sushi"

#### `vote_poll`

Cast (or clear) a vote on an existing poll. The poll must already be in the bridge's local store — i.e. you sent it via `send_poll`, or the bridge was running when it arrived from another participant.

**Parameters:**

- `poll_message_id` (required): Message ID of the original poll creation message (returned by `send_poll`, or visible via `list_polls`).
- `poll_chat_jid` (required): Chat JID where the poll lives.
- `selected_options` (required): List of option names to vote for (must be a subset of the poll's options). Pass `[]` to clear a previous vote.

#### `list_polls`

List polls captured by the bridge, newest first.

**Parameters:**

- `chat_jid` (optional): Filter to a single chat.
- `limit` (optional): Max polls to return (default `20`).
- `page` (optional): Zero-indexed page for pagination.

#### `get_poll_results`

Aggregate vote counts for a single poll.

**Parameters:**

- `poll_message_id` (required)
- `poll_chat_jid` (required)

Returns a `poll` block, an `options` array (each with `name`, `vote_count`, `voters`), and `total_voters`. **Note:** only votes received while the bridge was running are decryptable — whatsmeow needs the per-poll secret stored when the original creation message is processed live, so polls created before the bridge started will list correctly via `list_polls` but their votes won't be recoverable.

#### `send_file`

Send a media file (image, video, document).
Expand Down
Loading