go-twitch/eventsub/events/polls.go

113 lines
2.9 KiB
Go

package events
import "time"
type Choice struct {
// ID for the choice.
ID string `json:"id"`
// Text displayed for the choice.
Title string `json:"title"`
// Number of votes received via Channel Points.
ChannelPointsVotes int `json:"channel_points_votes"`
// Total number of votes received for the choice across all methods of voting.
Votes int `json:"votes"`
}
type ChannelPointsVoting struct {
// Indicates if Channel Points can be used for voting.
IsEnabled bool `json:"is_enabled"`
// Number of Channel Points required to vote once with Channel Points.
AmountPerVote int `json:"amount_per_vote"`
}
type ChannelPollBeginEvent struct {
// ID of the poll.
ID string `json:"id"`
// The requested broadcaster ID.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The requested broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The requested broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// Question displayed for the poll.
Title string `json:"title"`
// An array of choices for the poll.
Choices []Choice `json:"choices"`
// The channel points voting settings for the poll.
ChannelPointsVoting ChannelPointsVoting `json:"channel_points_voting"`
// The time the poll started.
StartedAt time.Time `json:"started_at"`
// The time the poll will end.
EndsAt time.Time `json:"ends_at"`
}
type ChannelPollProgressEvent struct {
// ID of the poll.
ID string `json:"id"`
// The requested broadcaster ID.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The requested broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The requested broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// Question displayed for the poll.
Title string `json:"title"`
// An array of choices for the poll.
Choices []Choice `json:"choices"`
// The channel points voting settings for the poll.
ChannelPointsVoting ChannelPointsVoting `json:"channel_points_voting"`
// The time the poll started.
StartedAt time.Time `json:"started_at"`
// The time the poll will end.
EndsAt time.Time `json:"ends_at"`
}
type ChannelPollEndEvent struct {
// ID of the poll.
ID string `json:"id"`
// The requested broadcaster ID.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The requested broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The requested broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// Question displayed for the poll.
Title string `json:"title"`
// An array of choices for the poll.
Choices []Choice `json:"choices"`
// The channel points voting settings for the poll.
ChannelPointsVoting ChannelPointsVoting `json:"channel_points_voting"`
// The time the poll started.
StartedAt time.Time `json:"started_at"`
// The time the poll ended.
EndedAt time.Time `json:"ended_at"`
}