go-twitch/eventsub/events/hypetrains.go

165 lines
5.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package events
import "time"
// The top contributor for a contribution type.
// For example, the top contributor using BITS (by aggregate) or the top contributor using subscriptions (by count).
type TopContribution struct {
// The user ID of the contributor.
UserId string `json:"user_id"`
// The user login of the contributor.
UserLogin string `json:"user_login"`
// The user display name of the contributor.
UserName string `json:"user_name"`
// The contribution method used. Possible values are:
//
// bits — Cheering with Bits.
//
// subscription — Subscription activity like subscribing or gifting subscriptions.
//
// other — Covers other contribution methods not listed.
Type string `json:"type"`
// The amount of the contribution.
// If type is bits, total represents the amount of Bits used.
// If type is subscription, total is 500, 1000, or 2500 to represent tier 1, 2, or 3 subscriptions, respectively.
Total int `json:"total"`
}
// The most recent contribution towards the Hype Trains goal.
type LastContribution struct {
// The user ID of the user that made the contribution.
UserId string `json:"user_id"`
// The user login of the user that made the contribution.
UserLogin string `json:"user_login"`
// The user display name of the user that made the contribution.
UserName string `json:"user_name"`
// The contribution method used. Possible values are:
//
// bits — Cheering with Bits.
//
// subscription — Subscription activity like subscribing or gifting subscriptions.
//
// other — Covers other contribution methods not listed.
Type string `json:"type"`
// The amount of the contribution.
// If type is bits, total represents the amount of Bits used.
// If type is subscription, total is 500, 1000, or 2500 to represent tier 1, 2, or 3 subscriptions, respectively.
Total int `json:"total"`
}
type HypeTrainBeginEvent struct {
// The Hype Train ID.
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"`
// Total points contributed to the Hype Train.
Total int `json:"total"`
// The number of points contributed to the Hype Train at the current level.
Progress int `json:"progress"`
// The number of points required to reach the next level.
Goal int `json:"goal"`
// The contributors with the most points contributed.
TopContributions []TopContribution `json:"top_contributions"`
// The most recent contribution.
LastContribution LastContribution `json:"last_contribution"`
// The starting level of the Hype Train.
Level int `json:"level"`
// The time when the Hype Train started.
StartedAt time.Time `json:"started_at"`
// The time when the Hype Train expires. The expiration is extended when the Hype Train reaches a new level.
ExpiresAt time.Time `json:"expires_at"`
}
type HypeTrainProgressEvent struct {
// The Hype Train ID.
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"`
// The current level of the Hype Train.
Level int `json:"level"`
// Total points contributed to the Hype Train.
Total int `json:"total"`
// The number of points contributed to the Hype Train at the current level.
Progress int `json:"progress"`
// The number of points required to reach the next level.
Goal int `json:"goal"`
// The contributors with the most points contributed.
TopContributions []TopContribution `json:"top_contributions"`
// The most recent contribution.
LastContribution LastContribution `json:"last_contribution"`
// The time when the Hype Train started.
StartedAt time.Time `json:"started_at"`
// The time when the Hype Train expires. The expiration is extended when the Hype Train reaches a new level.
ExpiresAt time.Time `json:"expires_at"`
}
type HypeTrainEndEvent struct {
// The Hype Train ID.
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"`
// The final level of the Hype Train.
Level int `json:"level"`
// Total points contributed to the Hype Train.
Total int `json:"total"`
// The contributors with the most points contributed.
TopContributions []TopContribution `json:"top_contributions"`
// The time when the Hype Train started.
StartedAt time.Time `json:"started_at"`
// The time when the Hype Train ended.
EndedAt time.Time `json:"ended_at"`
// The time when the Hype Train cooldown ends so that the next Hype Train can start.
CooldownEndsAt time.Time `json:"cooldown_ends_at"`
}