go-twitch/eventsub/events/channel.go

378 lines
12 KiB
Go
Raw Permalink Normal View History

2024-03-05 12:14:18 -05:00
package events
import "time"
type ChannelAdBreakBeginEvent struct {
// Length in seconds of the mid-roll ad break requested
DurationSeconds int `json:"duration_seconds"`
// The UTC timestamp of when the ad break began, in RFC3339 format. Note that there is potential delay between this event, when the streamer requested the ad break, and when the viewers will see ads.
StartedAt string `json:"started_at"`
// Indicates if the ad was automatically scheduled via Ads Manager
IsAutomatic bool `json:"is_automatic"`
// The broadcasters user ID for the channel the ad was run on.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The broadcasters user login for the channel the ad was run on.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The broadcasters user display name for the channel the ad was run on.
BroadcasterUserName string `json:"broadcaster_user_name"`
// The ID of the user that requested the ad. For automatic ads, this will be the ID of the broadcaster.
RequesterUserID string `json:"requester_user_id"`
// The login of the user that requested the ad.
RequesterUserLogin string `json:"requester_user_login"`
// The display name of the user that requested the ad.
RequesterUserName string `json:"requester_user_name"`
}
type ChannelSubscribeEvent struct {
// The user ID for the user who subscribed to the specified channel.
UserID string `json:"user_id"`
// The user login for the user who subscribed to the specified channel.
UserLogin string `json:"user_login"`
// The user display name for the user who subscribed to the specified channel.
UserName string `json:"user_name"`
// 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 tier of the subscription. Valid values are 1000, 2000, and 3000.
Tier string `json:"tier"`
// Whether the subscription is a gift.
IsGift bool `json:"is_gift"`
}
type ChannelCheerEvent struct {
// Whether the user cheered anonymously or not.
IsAnonymous bool `json:"is_anonymous"`
// The user ID for the user who cheered on the specified channel. This is null if is_anonymous is true.
UserID *string `json:"user_id"`
// The user login for the user who cheered on the specified channel. This is null if is_anonymous is true.
UserLogin *string `json:"user_login"`
// The user display name for the user who cheered on the specified channel. This is null if is_anonymous is true.
UserName *string `json:"user_name"`
// 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 message sent with the cheer.
Message string `json:"message"`
// The number of bits cheered.
Bits int `json:"bits"`
}
type ChannelUpdateEvent struct {
// The broadcasters user ID.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The broadcasters user login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The broadcasters user display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// The channels stream title.
Title string `json:"title"`
// The channels broadcast language.
Language string `json:"language"`
// The channels category ID.
CategoryID string `json:"category_id"`
// The category name.
CategoryName string `json:"category_name"`
// Array of content classification label IDs currently applied on the Channel.
// To retrieve a list of all possible IDs, use the Get Content Classification Labels API endpoint.
ContentClassificationLabels []string `json:"content_classification_labels"`
}
type ChannelUnbanEvent struct {
// The user ID for the user who was unbanned on the specified channel.
UserID string `json:"user_id"`
// The user login for the user who was unbanned on the specified channel.
UserLogin string `json:"user_login"`
// The user display name for the user who was unbanned on the specified channel.
UserName string `json:"user_name"`
// 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 user ID of the issuer of the unban.
ModeratorUserID string `json:"moderator_user_id"`
// The user login of the issuer of the unban.
ModeratorUserLogin string `json:"moderator_user_login"`
// The user name of the issuer of the unban.
ModeratorUserName string `json:"moderator_user_name"`
}
type ChannelFollowEvent struct {
// The user ID for the user now following the specified channel.
UserID string `json:"user_id"`
// The user login for the user now following the specified channel.
UserLogin string `json:"user_login"`
// The user display name for the user now following the specified channel.
UserName string `json:"user_name"`
// 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"`
// RFC3339 timestamp of when the follow occurred.
FollowedAt time.Time `json:"followed_at"`
}
type ChannelRaidEvent struct {
// The broadcaster ID that created the raid.
FromBroadcasterUserID string `json:"from_broadcaster_user_id"`
// The broadcaster login that created the raid.
FromBroadcasterUserLogin string `json:"from_broadcaster_user_login"`
// The broadcaster display name that created the raid.
FromBroadcasterUserName string `json:"from_broadcaster_user_name"`
// The broadcaster ID that received the raid.
ToBroadcasterUserID string `json:"to_broadcaster_user_id"`
// The broadcaster login that received the raid.
ToBroadcasterUserLogin string `json:"to_broadcaster_user_login"`
// The broadcaster display name that received the raid.
ToBroadcasterUserName string `json:"to_broadcaster_user_name"`
// The number of viewers in the raid.
Viewers int `json:"viewers"`
}
type ChannelModeratorAddEvent struct {
// 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 user ID of the new moderator.
UserID string `json:"user_id"`
// The user login of the new moderator.
UserLogin string `json:"user_login"`
// The display name of the new moderator.
UserName string `json:"user_name"`
}
type ChannelModeratorRemoveEvent struct {
// 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 user ID of the removed moderator.
UserID string `json:"user_id"`
// The user login of the removed moderator.
UserLogin string `json:"user_login"`
// The display name of the removed moderator.
UserName string `json:"user_name"`
}
type ChannelSubscriptionEndEvent struct {
// The user ID for the user whose subscription ended.
UserId string `json:"user_id"`
// The user login for the user whose subscription ended.
UserLogin string `json:"user_login"`
// The user display name for the user whose subscription ended.
UserName string `json:"user_name"`
// The broadcaster user ID.
BroadcasterUserId string `json:"broadcaster_user_id"`
// The broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// The tier of the subscription that ended. Valid values are 1000, 2000, and 3000.
Tier string `json:"tier"`
// Whether the subscription was a gift.
IsGift bool `json:"is_gift"`
}
type ChannelSubscriptionGiftEvent struct {
// The user ID of the user who sent the subscription gift. Set to null if it was an anonymous subscription gift.
UserId *string `json:"user_id"`
// The user login of the user who sent the gift. Set to null if it was an anonymous subscription gift.
UserLogin *string `json:"user_login"`
// The user display name of the user who sent the gift. Set to null if it was an anonymous subscription gift.
UserName *string `json:"user_name"`
// The broadcaster user ID.
BroadcasterUserId string `json:"broadcaster_user_id"`
// The broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// The number of subscriptions in the subscription gift.
Total int `json:"total"`
// The tier of subscriptions in the subscription gift.
Tier string `json:"tier"`
// The number of subscriptions gifted by this user in the channel.
// This value is null for anonymous gifts or if the gifter has opted out of sharing this information.
CumulativeTotal *int `json:"cumulative_total"`
// Whether the subscription gift was anonymous.
IsAnonymous bool `json:"is_anonymous"`
}
type Emote struct {
// The index of where the Emote starts in the text.
Begin int `json:"begin"`
// The index of where the Emote ends in the text.
End int `json:"end"`
// The emote ID.
Id string `json:"id"`
}
type Message struct {
// The text of the resubscription chat message.
Text string `json:"text"`
// An array that includes the emote ID and start and end positions for where the emote appears in the text.
Emotes []Emote `json:"emotes"`
}
type ChannelSubscriptionMessageEvent struct {
// The user ID of the user who sent a resubscription chat message.
UserId string `json:"user_id"`
// The user login of the user who sent a resubscription chat message.
UserLogin string `json:"user_login"`
// The user display name of the user who sent a resubscription chat message.
UserName string `json:"user_name"`
// The broadcaster user ID.
BroadcasterUserId string `json:"broadcaster_user_id"`
// The broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// The tier of the users subscription.
Tier string `json:"tier"`
// An object that contains the resubscription message and emote information needed to recreate the message.
Message Message `json:"message"`
// The total number of months the user has been subscribed to the channel.
CumulativeMonths int `json:"cumulative_months"`
// The number of consecutive months the users current subscription has been active.
// This value is null if the user has opted out of sharing this information.
StreakMonths *int `json:"streak_months"`
// The month duration of the subscription.
DurationMonths int `json:"duration_months"`
}
// Defines the Shield Mode data that you receive when the channel.shield_mode.begin and channel.shield_mode.end events occur.
type ShieldModeEvent struct {
// An ID that identifies the broadcaster whose Shield Mode status was updated.
BroadcasterUserId string `json:"broadcaster_user_id"`
// The broadcasters login name.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The broadcasters display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// An ID that identifies the moderator that updated the Shield Modes status. If the broadcaster updated the status, this ID will be the same as broadcaster_user_id.
ModeratorUserId string `json:"moderator_user_id"`
// The moderators login name.
ModeratorUserLogin string `json:"moderator_user_login"`
// The moderators display name.
ModeratorUserName string `json:"moderator_user_name"`
// The UTC timestamp (in RFC3339 format) of when the moderator activated Shield Mode.
// The object includes this field only for channel.shield_mode.begin events.
StartedAt time.Time `json:"started_at"`
// The UTC timestamp (in RFC3339 format) of when the moderator deactivated Shield Mode.
// The object includes this field only for channel.shield_mode.end events.
EndedAt time.Time `json:"ended_at"`
}