Class representing a poll. A poll instance can be created using sendbirdChat.poll.create() with PollCreateParams and updated using groupChannel.updatePoll() with PollUpdateParams class. A poll can be attached to a message using UserMessageCreateParams.pollId.

Hierarchy

  • default
    • Poll

Properties

allowMultipleVotes: boolean = false

True if this poll allows multiple votes, false otherwise. (default: false)

allowUserSuggestion: boolean = false

True if this poll allows user suggestion, false otherwise. (default: false)

closeAt: number = -1

Timestamp at which the poll has closed or will close. (second precision) If poll closing time is not specified, this value will be -1.

createdAt: number = 0

Timestamp at which the poll is created.

createdBy: null | string = null

User ID of the poll creator. null if the creator account is removed.

data: null | PollData = null

An additional json data to accompany the poll.

id: number = 0

A unique identifier for this poll.

messageId: number = 0

An ID of the message that contains this poll.

options: PollOption[] = []

Options for this poll.

status: PollStatus = PollStatus.CLOSED

Indicates whether this poll is PollStatus.OPEN, or PollStatus.CLOSED

title: null | string = null

Title of the poll.

updatedAt: number = 0

Timestamp at which the poll is updated.

votedPollOptionIds: number[] = []

Contains optionIds which the current user voted on. If the current user has not voted, this list will be empty.

voterCount: number = -1

Total voter count.

Methods

  • Parameters

    Returns boolean

    Applies poll update event to this user message's poll.

  • Parameters

    Returns boolean

    Applies poll vote event to this user message's poll.

  • Returns object

    Serializes the Poll instance. The instance can be restored by sendbirdChat.poll.buildPollFromSerializedData().