Poll

@Serializable
data class Poll(val id: String, val broadcasterId: String, val broadcasterName: String, val broadcasterLogin: String, val title: String, val choices: List<PollChoice>, val bitsVotingEnabled: Boolean = false, val bitsPerVote: Int = 0, val channelPointsVotingEnabled: Boolean = false, val channelPointsPerVote: Int = 0, val status: PollStatus, val duration: Int, val startedAt: Instant? = null, val endedAt: Instant? = null)

Represents a poll from the Twitch Helix API.

See also

Constructors

Link copied to clipboard
constructor(id: String, broadcasterId: String, broadcasterName: String, broadcasterLogin: String, title: String, choices: List<PollChoice>, bitsVotingEnabled: Boolean = false, bitsPerVote: Int = 0, channelPointsVotingEnabled: Boolean = false, channelPointsPerVote: Int = 0, status: PollStatus, duration: Int, startedAt: Instant? = null, endedAt: Instant? = null)

Properties

Link copied to clipboard
@SerialName(value = "bits_per_vote")
val bitsPerVote: Int

not used; will be set to 0.

Link copied to clipboard
@SerialName(value = "bits_voting_enabled")
val bitsVotingEnabled: Boolean

not used; will be set to false.

Link copied to clipboard
@SerialName(value = "broadcaster_id")
val broadcasterId: String

an ID that identifies the broadcaster that created the poll.

Link copied to clipboard
@SerialName(value = "broadcaster_login")
val broadcasterLogin: String

the broadcaster's login name.

Link copied to clipboard
@SerialName(value = "broadcaster_name")
val broadcasterName: String

the broadcaster's display name.

Link copied to clipboard
@SerialName(value = "channel_points_per_vote")
val channelPointsPerVote: Int

the number of points the viewer must spend to cast one additional vote.

Link copied to clipboard
@SerialName(value = "channel_points_voting_enabled")
val channelPointsVotingEnabled: Boolean

a Boolean value that indicates whether viewers may cast additional votes using Channel Points.

Link copied to clipboard

a list of choices that viewers can choose from. The list will contain a minimum of two choices and up to a maximum of five choices.

Link copied to clipboard

the length of time (in seconds) that the poll will run for.

Link copied to clipboard
@SerialName(value = "ended_at")
val endedAt: Instant?

the UTC date and time (in RFC3339 format) of when the poll ended. If status is ACTIVE, this field is set to null.

Link copied to clipboard
val id: String

an ID that identifies the poll.

Link copied to clipboard
@SerialName(value = "started_at")
val startedAt: Instant?

the UTC date and time (in RFC3339 format) of when the poll began.

Link copied to clipboard

the poll's status: ACTIVE, COMPLETED, TERMINATED, ARCHIVED, MODERATED, or INVALID.

Link copied to clipboard

the question that viewers are voting on. For example, What game should I play next? The title may contain a maximum of 60 characters.