go-twitch/eventsub/events/channel.go

817 lines
26 KiB
Go
Raw Permalink 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"
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 ChannelUnbanRequestCreateEvent struct {
// The ID of the unban request.
ID string `json:"id"`
// The broadcasters user ID for the channel the unban request was created for.
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"`
// User ID of user that is requesting to be unbanned.
UserID string `json:"user_id"`
// The users login name.
UserLogin string `json:"user_login"`
// The users display name.
UserName string `json:"user_name"`
// Message sent in the unban request.
Text string `json:"text"`
// The UTC timestamp (in RFC3339 format) of when the unban request was created.
CreatedAt time.Time `json:"created_at"`
}
type ChannelUnbanRequestResolveEvent struct {
// The ID of the unban request.
ID string `json:"id"`
// The broadcasters user ID for the channel the unban request was updated for.
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"`
// User ID of moderator who approved/denied the request.
ModeratorID string `json:"moderator_id"`
// The moderators login name
ModeratorLogin string `json:"moderator_login"`
// The moderators display name
ModeratorName string `json:"moderator_name"`
// User ID of user that requested to be unbanned.
UserID string `json:"user_id"`
// The users login name.
UserLogin string `json:"user_login"`
// The users display name.
UserName string `json:"user_name"`
// Resolution text supplied by the mod/broadcaster upon approval/denial of the request.
ResolutionText string `json:"resolution_text"`
// Dictates whether the unban request was approved or denied. Can be the following:
// approved, canceled, or denied
Status string `json:"status"`
}
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 ChannelModerateEvent struct {
// The ID of the broadcaster.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The login of the broadcaster.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The display name of the broadcaster.
BroadcasterUserName string `json:"broadcaster_user_name"`
// The ID of the moderator who performed the action.
ModeratorUserID string `json:"moderator_user_id"`
// The login of the moderator.
ModeratorUserLogin string `json:"moderator_user_login"`
// The display name of the moderator.
ModeratorUserName string `json:"moderator_user_name"`
// The type of action performed.
// Possible values are:
//
// ban, timeout, unban, untimeout, clear, emoteonly, emoteonlyoff, followers, followersoff,
// uniquechat, uniquechatoff, slow, slowoff, subscribers, subscribersoff, unraid, delete, unvip,
// vip, raid, add_blocked_term, add_permitted_term, remove_blocked_term, remove_permitted_term,
// mod, unmod, approve_unban_request, deny_unban_request
Action string `json:"action"`
// Optional. Metadata associated with the followers command.
Followers *struct {
// The length of time, in minutes, the the followers must have followed the boradcaster to participate in the chat room.
FollowDurationMinutes int `json:"follow_duration_minutes"`
} `json:"followers,omitempty"`
// Optional. Metadata associated with the slow command.
Slow *struct {
// The amount of time, in seconds, that users need to wait between sending messages.
WaitTimeSeconds int `json:"wait_time_seconds"`
} `json:"slow,omitempty"`
// Optional. Metadata associated with the vip command.
Vip *struct {
// The ID of the user gaining VIP status.
UserID string `json:"user_id"`
// The login of the user gaining VIP status.
UserLogin string `json:"user_login"`
// The display name of the user gaining VIP status.
UserName string `json:"user_name"`
} `json:"vip,omitempty"`
// Optional. Metadata associated with the unvip command.
Unvip *struct {
// The ID of the user losing VIP status.
UserID string `json:"user_id"`
// The login of the user losing VIP status.
UserLogin string `json:"user_login"`
// The display name of the user losing VIP status.
UserName string `json:"user_name"`
} `json:"unvip,omitempty"`
// Optional. Metadata associated with the mod command.
Mod *struct {
// The ID of the user gaining mod status.
UserID string `json:"user_id"`
// The login of the user gaining mod status.
UserLogin string `json:"user_login"`
// The display name of the user gaining mod status.
UserName string `json:"user_name"`
} `json:"mod,omitempty"`
// Optional. Metadata associated with the unmod command.
Unmod *struct {
// The ID of the user losing mod status.
UserID string `json:"user_id"`
// The login of the user losing mod status.
UserLogin string `json:"user_login"`
// The display name of the user losing mod status.
UserName string `json:"user_name"`
} `json:"unmod,omitempty"`
// Optional. Metadata associated with the ban command.
Ban *struct {
// The ID of the user being banned.
UserID string `json:"user_id"`
// The login of the user being banned.
UserLogin string `json:"user_login"`
// The display name of the user being banned.
UserName string `json:"user_name"`
// Optional. The reason given for the ban.
Reason *string `json:"reason"`
} `json:"ban,omitempty"`
// Optional. Metadata associated with the unban command.
Unban *struct {
// The ID of the user being unbanned.
UserID string `json:"user_id"`
// The login of the user being unbanned.
UserLogin string `json:"user_login"`
// The display name of the user being unbanned.
UserName string `json:"user_name"`
} `json:"unban,omitempty"`
// Optional. Metadata associated with the timeout command.
Timeout *struct {
// The ID of the user being timed out.
UserID string `json:"user_id"`
// The login of the user being timed out.
UserLogin string `json:"user_login"`
// The display name of the user being timed out.
UserName string `json:"user_name"`
// Optional. The reason given for the timeout.
Reason *string `json:"reason"`
// The time at which the timeout ends.
ExpiresAt time.Time `json:"expires_at"`
} `json:"timeout,omitempty"`
// Optional. Metadata associated with the untimeout command.
Untimeout *struct {
// The ID of the user being untimed out.
UserID string `json:"user_id"`
// The login of the user being untimed out.
UserLogin string `json:"user_login"`
// The display name of the user being untimed out.
UserName string `json:"user_name"`
} `json:"untimeout,omitempty"`
// Optional. Metadata associated with the raid command.
Raid *struct {
// The ID of the user being raided.
UserID string `json:"user_id"`
// The login of the user being raided.
UserLogin string `json:"user_login"`
// The display name of the user being raided.
UserName string `json:"user_name"`
// The viewer count.
ViewerCount int `json:"viewer_count"`
} `json:"raid,omitempty"`
// Optional. Metadata associated with the unraid command.
Unraid *struct {
// The ID of the user no longer being raided.
UserID string `json:"user_id"`
// The login of the user no longer being raided.
UserLogin string `json:"user_login"`
// The display name of the user no longer being raided.
UserName string `json:"user_name"`
} `json:"unraid,omitempty"`
// Optional. Metadata associated with the delete command.
Delete *struct {
// The ID of the user whose message is being deleted.
UserID string `json:"user_id"`
// The login of the user.
UserLogin string `json:"user_login"`
// The user name of the user.
UserName string `json:"user_name"`
// The ID of the message being deleted.
MessageID string `json:"message_id"`
// The message body of the message being deleted.
MessageBody string `json:"message_body"`
} `json:"delete,omitempty"`
// Optional. Metadata associated with the automod terms changes.
AutomodTerms *struct {
// Either “add” or “remove”.
Action string `json:"action"`
// Either “blocked” or “permitted”.
List string `json:"list"`
// Terms being added or removed.
Terms []string `json:"terms"`
// Whether the terms were added due to an Automod message approve/deny action.
FromAutomod bool `json:"from_automod"`
} `json:"automod_terms,omitempty"`
// Optional. Metadata associated with an unban request.
UnbanRequest *struct {
// Whether or not the unban request was approved or denied.
IsApproved bool `json:"is_approved"`
// The ID of the banned user.
UserID string `json:"user_id"`
// The login of the user.
UserLogin string `json:"user_login"`
// The user name of the user.
UserName string `json:"user_name"`
// The message included by the moderator explaining their approval or denial.
ModeratorMessage string `json:"moderator_message"`
} `json:"unban_request,omitempty"`
}
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"`
}
type ChannelSuspiciousUserMessageEvent struct {
// The ID of the channel where the treatment for a suspicious user was updated.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The display name of the channel where the treatment for a suspicious user was updated.
BroadcasterUserName string `json:"broadcaster_user_name"`
// The Login of the channel where the treatment for a suspicious user was updated.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The ID of the moderator that updated the treatment for a suspicious user.
ModeratorUserID string `json:"moderator_user_id"`
// The display name of the moderator that updated the treatment for a suspicious user.
ModeratorUserName string `json:"moderator_user_name"`
// The login of the moderator that updated the treatment for a suspicious user.
ModeratorUserLogin string `json:"moderator_user_login"`
// The ID of the suspicious user whose treatment was updated.
UserID string `json:"user_id"`
// The display name of the suspicious user whose treatment was updated.
UserName string `json:"user_name"`
// The login of the suspicious user whose treatment was updated.
UserLogin string `json:"user_login"`
// The status set for the suspicious user. Can be the following: “none”, “active_monitoring”, or “restricted”.
LowTrustStatus string `json:"low_trust_status"`
}
type ChannelSuspiciousUserUpdateEvent struct {
// The ID of the channel where the treatment for a suspicious user was updated.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The display name of the channel where the treatment for a suspicious user was updated.
BroadcasterUserName string `json:"broadcaster_user_name"`
// The Login of the channel where the treatment for a suspicious user was updated.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The user ID of the user that sent the message.
UserID string `json:"user_id"`
// The user name of the user that sent the message.
UserName string `json:"user_name"`
// The user login of the user that sent the message.
UserLogin string `json:"user_login"`
// The status set for the suspicious user. Can be the following: “none”, “active_monitoring”, or “restricted”.
LowTrustStatus string `json:"low_trust_status"`
// A list of channel IDs where the suspicious user is also banned.
SharedBanChannelIDs []string `json:"shared_ban_channel_ids"`
// User types (if any) that apply to the suspicious user, can be “manual”, “ban_evader_detector”, or “shared_channel_ban”.
Types []string `json:"types"`
// A ban evasion likelihood value (if any) that as been applied to the user automatically by Twitch, can be “unknown”, “possible”, or “likely”.
BanEvasionEvaluation string `json:"ban_evasion_evaluation"`
// The UUID that identifies the message.
MessageID string `json:"id"`
// The structured chat message.
Message struct {
// The chat message in plain text.
Text string `json:"text"`
// Ordered list of chat message fragments.
Fragments []struct {
// The type of message fragment. Possible values: -text -cheermote -emote
Type string `json:"type"`
// Message text in fragment.
Text string `json:"text"`
// Optional. Metadata pertaining to the cheermote.
Cheermote struct {
// The name portion of the Cheermote string that you use in chat to cheer Bits. The full Cheermote string is the concatenation of {prefix} + {number of Bits}.
Prefix string `json:"prefix"`
// The amount of bits cheered.
Bits string `json:"bits"`
// The tier level of the cheermote.
Tier string `json:"tier"`
} `json:"cheermote"`
// Optional. Metadata pertaining to the emote.
Emote struct {
// An ID that uniquely identifies this emote.
ID string `json:"id"`
// An ID that identifies the emote set that the emote belongs to.
EmoteSetID string `json:"emote_set_id"`
} `json:"emote"`
} `json:"fragments"`
} `json:"message"`
}
type ChannelVipAddEvent struct {
// The ID of the user who was added as a VIP.
UserID string `json:"user_id"`
// The login of the user who was added as a VIP.
UserLogin string `json:"user_login"`
// The display name of the user who was added as a VIP.
UserName string `json:"user_name"`
// The ID of the broadcaster.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The login of the broadcaster.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The display name of the broadcaster.
BroadcasterUserName string `json:"broadcaster_user_name"`
}
type ChannelVipRemoveEvent struct {
// The ID of the user who was removed as a VIP.
UserID string `json:"user_id"`
// The login of the user who was removed as a VIP.
UserLogin string `json:"user_login"`
// The display name of the user who was removed as a VIP.
UserName string `json:"user_name"`
// The ID of the broadcaster.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The login of the broadcaster.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The display name of the broadcaster.
BroadcasterUserName string `json:"broadcaster_user_name"`
}
// 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"`
}