Nostrum.Api.Poll (nostrum v0.11.0-dev)

View Source

Module for interacting with the Discord API's poll endpoints.

See: https://discord.com/developers/docs/resources/poll

Summary

Functions

Get voters for the provided answer on the poll attached to the provided message.

Expire (close voting on) a poll before the scheduled end time.

Functions

answer_voters(channel_id, message_id, answer_id, params \\ [])

(since 0.10.1)

Get voters for the provided answer on the poll attached to the provided message.

If successful, returns {:ok, users}. Otherwise, returns Nostrum.Api.error/0.

The optional params are after, the user ID to query after, absent by default, and limit, the max number of users to return, 1-100, 25 by default. Results are sorted by Discord user snowflake (ID) in ascending order.

expire(channel_id, message_id)

(since 0.10.1)

Expire (close voting on) a poll before the scheduled end time.

Returns the original message containing the poll.