Poll
- class Poll()
A poll attached to a message, including its choices, vote counts, expiration, and finalization state.
exported from
lib.weeble.dProperties
- Poll.allowMultiselect
type: readonly boolean
Indicates whether members can select multiple answers.
- Poll.answers
type: readonly { answerId: number; count: number; meVoted: boolean; text: string; }[]
Array of answer options with their vote counts.
- Poll.channelId
-
ID of the channel containing this poll, or
nullwhen the poll is not attached to a message.
- Poll.messageId
-
ID of the message containing this poll, or
nullwhen the poll is not attached to a message.
- Poll.results
type: readonly { answerCounts: { count: number; id: number; }[]; isFinalized: boolean; } | null
Aggregated results, or
nullwhen Discord omitted them.
Methods
-
async Poll.fetchVoters(answerId: number, options: { after?: string; limit?: number; }) Promise<
User[]> Fetch users who voted for one answer.
- Poll.getTotalVotes() number | null
Get the total number of votes cast across all answers.
- Returns:
The sum of votes, or
nullwhen Discord omitted poll results.