Skip to main content

Poll

@discordeno/bot


Documentation / @discordeno/bot / Poll

Interface: Poll

Defined in: packages/bot/src/transformers/types.ts:1325

Properties

allowMultiselect

allowMultiselect: boolean

Defined in: packages/bot/src/transformers/types.ts:1338

Whether a user can select multiple answers


answers

answers: PollAnswer[]

Defined in: packages/bot/src/transformers/types.ts:1329

Each of the answers available in the poll. There is a maximum of 10 answers per poll.


expiry

expiry: null | number

Defined in: packages/bot/src/transformers/types.ts:1336

The time when the poll ends.

Remarks

expiry is marked as nullable to support non-expiring polls in the future, but all polls have an expiry currently.


layoutType

layoutType: Default

Defined in: packages/bot/src/transformers/types.ts:1340

The layout type of the poll


question

question: PollMedia

Defined in: packages/bot/src/transformers/types.ts:1327

The question of the poll. Only text is supported.


results?

optional results: PollResult

Defined in: packages/bot/src/transformers/types.ts:1348

The results of the poll

Remarks

This value will not be sent by discord under specific conditions where they don't fetch them on their backend. When this value is missing it should be interpreted as "Unknown results" and not as "No results" The results may not be totally accurate while the poll has not ended. When it ends discord will re-calculate all the results and set is_finalized to true