eventsub

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AutomodHoldReasonAutomod     = "automod"
	AutomodHoldReasonBlockedTerm = "blocked_term"
)

Variables

View Source
var (
	ErrConnectionUnused = errors.New("connection is unused as subscription time limit exceeded")
	ErrReconnectTimeout = errors.New("reconnect grace time expired")
)
View Source
var ErrInvalidWebhookSecret = errors.New("webhook secret is not valid")

ErrInvalidWebhookSecret indicates that your webhook secret doesn't match with Twitch's webhook secret requirements.

See note section: https://dev.twitch.tv/docs/eventsub/handling-webhook-events/#verifying-the-event-message.

View Source
var ErrUndefinedEventType = errors.New("undefined event type")

ErrUndefinedEventType indicates that eventsub sent an event that is not defined in the library, and the user has not set a callback handler for undefined events.

Functions

This section is empty.

Types

type Automod

type Automod struct {
	Category   string               `json:"category"`
	Level      AutomodSeverityLevel `json:"level"`
	Boundaries []AutomodBoundary    `json:"boundaries"`
}

type AutomodBoundary

type AutomodBoundary struct {
	StartPosition int `json:"start_position"`
	EndPosition   int `json:"end_position"`
}

type AutomodHoldReason

type AutomodHoldReason string

type AutomodMessageHoldCondition

type AutomodMessageHoldCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster (channel).
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
}

type AutomodMessageHoldEvent

type AutomodMessageHoldEvent struct {
	// The ID of the broadcaster specified in the request.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The login of the broadcaster specified in the request.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The username of the broadcaster specified in the request.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The message sender’s user ID.
	UserId string `json:"user_id"`
	// The message sender’s login name.
	UserLogin string `json:"user_login"`
	// The message sender’s display name.
	UserName string `json:"user_name"`
	// The ID of the message that was flagged by automod.
	MessageId string `json:"message_id"`
	// The body of the message.
	Message AutomodMessageHoldEventMessage `json:"message"`
	// The category of the message.
	Category string `json:"category"`
	// The level of severity.
	Level AutomodSeverityLevel `json:"level"`
	// The timestamp of when automod saved the message.
	HeldAt Timestamp `json:"held_at"`
}

type AutomodMessageHoldEventMessage

type AutomodMessageHoldEventMessage struct {
	Text      string                                   `json:"text"`
	Fragments []AutomodMessageHoldEventMessageFragment `json:"fragments"`
}

type AutomodMessageHoldEventMessageEmote

type AutomodMessageHoldEventMessageEmote struct {
	Id         string `json:"id"`
	EmoteSetId string `json:"emote_set_id"`
}

type AutomodMessageHoldEventMessageEmoteV2

type AutomodMessageHoldEventMessageEmoteV2 struct {
	Id         string `json:"id"`
	EmoteSetId string `json:"emote_set_id"`
}

type AutomodMessageHoldEventMessageFragment

type AutomodMessageHoldEventMessageFragment struct {
	Text      string                               `json:"text"`
	Emote     *AutomodMessageHoldEventMessageEmote `json:"emote,omitempty"`
	Cheermote *Cheermote                           `json:"cheermote,omitempty"`
}

type AutomodMessageHoldEventMessageFragmentV2

type AutomodMessageHoldEventMessageFragmentV2 struct {
	Type      MessageFragmentType                    `json:"type"`
	Text      string                                 `json:"text"`
	Emote     *AutomodMessageHoldEventMessageEmoteV2 `json:"emote,omitempty"`
	Cheermote *Cheermote                             `json:"cheermote,omitempty"`
}

type AutomodMessageHoldEventMessageV2

type AutomodMessageHoldEventMessageV2 struct {
	Text      string                                     `json:"text"`
	Fragments []AutomodMessageHoldEventMessageFragmentV2 `json:"fragments"`
}

type AutomodMessageHoldEventV2

type AutomodMessageHoldEventV2 struct {
	// The ID of the broadcaster specified in the request.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The login of the broadcaster specified in the request.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The username of the broadcaster specified in the request.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The message sender’s user ID.
	UserId string `json:"user_id"`
	// The message sender’s login name.
	UserLogin string `json:"user_login"`
	// The message sender’s display name.
	UserName string `json:"user_name"`
	// The ID of the message that was flagged by automod.
	MessageId string `json:"message_id"`
	// The body of the message.
	Message AutomodMessageHoldEventMessageV2 `json:"message"`
	// The timestamp of when automod saved the message.
	HeldAt Timestamp `json:"held_at"`
	// The reason why automod hold this message.
	Reason AutomodHoldReason `json:"reason"`
	// Optional. If the message was caught by automod, this will be populated.
	Automod *Automod `json:"automod,omitempty"`
	// Optional. If the message was caught due to a blocked term, this will be populated.
	BlockedTerm *BlockedTerm `json:"blocked_term,omitempty"`
}

type AutomodMessageStatus

type AutomodMessageStatus string
const (
	AutomodMessageStatusApproved AutomodMessageStatus = "approved"
	AutomodMessageStatusDenied   AutomodMessageStatus = "denied"
	AutomodMessageStatusExpired  AutomodMessageStatus = "expired"
)

type AutomodMessageUpdateCondition

type AutomodMessageUpdateCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster (channel), maximum 1.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
}

type AutomodMessageUpdateEvent

type AutomodMessageUpdateEvent struct {
	// The ID of the broadcaster specified in the request.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The login of the broadcaster specified in the request.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The username of the broadcaster specified in the request.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The message sender’s user ID.
	UserId string `json:"user_id"`
	// The message sender’s login name.
	UserLogin string `json:"user_login"`
	// The message sender’s display name.
	UserName string `json:"user_name"`
	// The ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
	// The moderator’s username.
	ModeratorUserName string `json:"moderator_user_name"`
	// The login of the moderator.
	ModeratorUserLogin string `json:"moderator_user_login"`
	// The ID of the message that was flagged by automod.
	MessageId string `json:"message_id"`
	// The body of the message.
	Message AutomodMessageUpdateEventMessage `json:"message"`
	// The category of the message.
	Category string `json:"category"`
	// The level of severity.
	Level AutomodSeverityLevel `json:"level"`
	// The message’s status.
	Status AutomodMessageStatus `json:"status"`
	// The timestamp of when automod saved the message.
	HeldAt Timestamp `json:"held_at"`
}

type AutomodMessageUpdateEventMessage

type AutomodMessageUpdateEventMessage struct {
	Text      string                                     `json:"text"`
	Fragments []AutomodMessageUpdateEventMessageFragment `json:"fragments"`
}

type AutomodMessageUpdateEventMessageEmote

type AutomodMessageUpdateEventMessageEmote struct {
	Id         string `json:"id"`
	EmoteSetId string `json:"emote_set_id"`
}

type AutomodMessageUpdateEventMessageEmoteV2

type AutomodMessageUpdateEventMessageEmoteV2 struct {
	Id         string `json:"id"`
	EmoteSetId string `json:"emote_set_id"`
}

type AutomodMessageUpdateEventMessageFragment

type AutomodMessageUpdateEventMessageFragment struct {
	Text      string                                 `json:"text"`
	Emote     *AutomodMessageUpdateEventMessageEmote `json:"emote,omitempty"`
	Cheermote *Cheermote                             `json:"cheermote,omitempty"`
}

type AutomodMessageUpdateEventMessageFragmentV2

type AutomodMessageUpdateEventMessageFragmentV2 struct {
	Type      MessageFragmentType                      `json:"type"`
	Text      string                                   `json:"text"`
	Emote     *AutomodMessageUpdateEventMessageEmoteV2 `json:"emote,omitempty"`
	Cheermote *Cheermote                               `json:"cheermote,omitempty"`
}

type AutomodMessageUpdateEventMessageV2

type AutomodMessageUpdateEventMessageV2 struct {
	Text      string                                       `json:"text"`
	Fragments []AutomodMessageUpdateEventMessageFragmentV2 `json:"fragments"`
}

type AutomodMessageUpdateEventV2

type AutomodMessageUpdateEventV2 struct {
	// The ID of the broadcaster specified in the request.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The login of the broadcaster specified in the request.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The username of the broadcaster specified in the request.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The message sender’s user ID.
	UserId string `json:"user_id"`
	// The message sender’s login name.
	UserLogin string `json:"user_login"`
	// The message sender’s display name.
	UserName string `json:"user_name"`
	// The ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
	// The moderator’s username.
	ModeratorUserName string `json:"moderator_user_name"`
	// The login of the moderator.
	ModeratorUserLogin string `json:"moderator_user_login"`
	// The ID of the message that was flagged by automod.
	MessageId string `json:"message_id"`
	// The body of the message.
	Message AutomodMessageUpdateEventMessageV2 `json:"message"`
	// The message’s status.
	Status AutomodMessageStatus `json:"status"`
	// The timestamp of when automod saved the message.
	HeldAt Timestamp `json:"held_at"`
	// The reason why automod hold this message.
	Reason AutomodHoldReason `json:"reason"`
	// Optional. If the message was caught by automod, this will be populated.
	Automod *Automod `json:"automod,omitempty"`
	// Optional. If the message was caught due to a blocked term, this will be populated.
	BlockedTerm *BlockedTerm `json:"blocked_term,omitempty"`
}

type AutomodSettingsUpdateCondition

type AutomodSettingsUpdateCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster (channel), maximum 1.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
}

type AutomodSettingsUpdateEvent

type AutomodSettingsUpdateEvent struct {
	// The ID of the broadcaster specified in the request.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The login of the broadcaster specified in the request.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The username of the broadcaster specified in the request.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
	// The moderator’s username.
	ModeratorUserName string `json:"moderator_user_name"`
	// The login of the moderator.
	ModeratorUserLogin string `json:"moderator_user_login"`
	// The Automod level for hostility involving name-calling or insults.
	Bullying int `json:"bullying"`
	// The default AutoMod level for the broadcaster.
	// This field is empty if the broadcaster has set one or more of the individual settings.
	OverallLevel int `json:"overall_level,omitempty"`
	// The Automod level for discrimination against disability.
	Disability int `json:"disability"`
	// The Automod level for racial discrimination.
	RaceEthnicityOrReligion int `json:"race_ethnicity_or_religion"`
	// Misogyny is an Automod level for discrimination against women.
	Misogyny int `json:"misogyny"`
	// The AutoMod level for discrimination based on sexuality, sex, or gender.
	SexualitySexOrGender int `json:"sexuality_sex_or_gender"`
	// The Automod level for hostility involving aggression.
	Aggression int `json:"aggression"`
	// The Automod level for sexual content.
	SexBasedTerms int `json:"sex_based_terms"`
	// The Automod level for profanity.
	Swearing int `json:"swearing"`
}

type AutomodSeverityLevel

type AutomodSeverityLevel int
const (
	AutomodSeverityFirst AutomodSeverityLevel = iota + 1
	AutomodSeveritySecond
	AutomodSeverityThird
	AutomodSeverityFourth
)

type AutomodTermsAction

type AutomodTermsAction string
const (
	AutomodTermsAddPermitted    AutomodTermsAction = "add_permitted"
	AutomodTermsRemovePermitted AutomodTermsAction = "remove_permitted"
	AutomodTermsAddBlocked      AutomodTermsAction = "add_blocked"
	AutomodTermsRemoveBlocked   AutomodTermsAction = "remove_blocked"
)

type AutomodTermsUpdateCondition

type AutomodTermsUpdateCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster (channel), maximum 1.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
}

type AutomodTermsUpdateEvent

type AutomodTermsUpdateEvent struct {
	// The ID of the broadcaster specified in the request.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The login of the broadcaster specified in the request.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The username of the broadcaster specified in the request.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
	// The moderator’s username.
	ModeratorUserName string `json:"moderator_user_name"`
	// The login of the moderator.
	ModeratorUserLogin string `json:"moderator_user_login"`
	// The status change applied to the terms.
	Action AutomodTermsAction `json:"action"`
	// Indicates whether this term was added due to an Automod message approve/deny action.
	FromAutomod bool `json:"from_automod"`
	// The list of terms that had a status change.
	Terms []string `json:"terms"`
}

type Badge

type Badge struct {
	Id    string `json:"id"`
	SetId string `json:"set_id"`
	Info  string `json:"info"`
}

type BitsPowerUpType

type BitsPowerUpType string
const (
	BitsPowerUpMessageEffect    BitsPowerUpType = "message_effect"
	BitsPowerUpCelebration      BitsPowerUpType = "celebration"
	BitsPowerUpGigantifyAnEmote BitsPowerUpType = "gigantify_an_emote"
)

type BitsUseType

type BitsUseType string
const (
	BitsUseCheer   BitsUseType = "cheer"
	BitsUsePowerUp BitsUseType = "power_up"
)

type BlockedTerm

type BlockedTerm struct {
	TermsFound []Term `json:"terms_found"`
}

type ChannelAdBreakBeginCondition

type ChannelAdBreakBeginCondition struct {
	Condition
	// BroadcasterId is an id of the broadcaster that you want to get channel ad break begin notifications for, maximum 1.
	BroadcasterId string `json:"broadcaster_user_id"`
}

type ChannelAdBreakBeginEvent

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 TimestampUTC `json:"started_at"`
	// Indicates if the ad was automatically scheduled via Ads Manager.
	IsAutomatic bool `json:"is_automatic"`
	// The broadcaster’s user ID for the channel the ad was run on.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s user login for the channel the ad was run on.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s 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 ChannelBanCondition

type ChannelBanCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get ban notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelBanEvent

type ChannelBanEvent struct {
	// The user ID for the user who was banned on the specified channel.
	UserId string `json:"user_id"`
	// The user login for the user who was banned on the specified channel.
	UserLogin string `json:"user_login"`
	// The user display name for the user who was banned 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 ban.
	ModeratorUserID string `json:"moderator_user_id"`
	// The user login of the issuer of the ban.
	ModeratorUserLogin string `json:"moderator_user_login"`
	// The username of the issuer of the ban.
	ModeratorUserName string `json:"moderator_user_name"`
	// The reason behind the ban.
	Reason string `json:"reason"`
	// Will be not presented if permanent ban. If it is a timeout, this field shows when the timeout will end.
	EndsAt *TimestampUTC `json:"ends_at,omitempty"`
	// Indicates whether the ban is permanent (true) or a timeout (false). If true, ends_at will be not presented.
	IsPermanent bool `json:"is_permanent"`
}

type ChannelBitsUseCondition

type ChannelBitsUseCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel broadcaster, maximum 1.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelBitsUseEvent

type ChannelBitsUseEvent struct {
	// The user ID of the channel where the bits were redeemed.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The login of the channel where the bits were used.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The display name of the channel where the bits were used.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The user ID of the redeeming user.
	UserId string `json:"user_id"`
	// The login name of the redeeming user.
	UserLogin string `json:"user_login"`
	// The display name of the redeeming user.
	UserName string `json:"user_name"`
	// The number if bits used.
	Bits int `json:"bits"`
	// The type of bits usage.
	Type BitsUseType `json:"type"`
	// Optional. An object that contains the user message and emote information needed to recreate the message.
	Message *ChannelBitsUseEventMessage `json:"message,omitempty"`
	// Optional. Data about Power-up.
	PowerUp *PowerUp `json:"power_up,omitempty"`
}

type ChannelBitsUseEventMessage

type ChannelBitsUseEventMessage struct {
	Text      string                               `json:"text"`
	Fragments []ChannelBitsUseEventMessageFragment `json:"fragments"`
}

type ChannelBitsUseEventMessageEmote

type ChannelBitsUseEventMessageEmote struct {
	Id         string        `json:"id"`
	EmoteSetId string        `json:"emote_set_id"`
	OwnerId    string        `json:"owner_id"`
	Format     []EmoteFormat `json:"format"`
}

type ChannelBitsUseEventMessageFragment

type ChannelBitsUseEventMessageFragment struct {
	Type      MessageFragmentType              `json:"type"`
	Text      string                           `json:"text"`
	Emote     *ChannelBitsUseEventMessageEmote `json:"emote,omitempty"`
	Cheermote *Cheermote                       `json:"cheermote,omitempty"`
}

type ChannelChatClearCondition

type ChannelChatClearCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive chat clear events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// UserId is a user ID to read chat as.
	UserId string `json:"user_id"`
}

type ChannelChatClearEvent

type ChannelChatClearEvent struct {
	// The broadcaster’s user ID.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s user login.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s user display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
}

type ChannelChatClearUserMessagesCondition

type ChannelChatClearUserMessagesCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive chat clear user messages events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// UserId is a user ID to read chat as.
	UserId string `json:"user_id"`
}

type ChannelChatClearUserMessagesEvent

type ChannelChatClearUserMessagesEvent struct {
	// The broadcaster’s user ID.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s user login.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s user display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The ID of the user that was banned or put in a timeout. All of their messages are deleted.
	TargetUserId string `json:"target_user_id"`
	// The user login of the user that was banned or put in a timeout.
	TargetUserLogin string `json:"target_user_login"`
	// The username of the user that was banned or put in a timeout.
	TargetUserName string `json:"target_user_name"`
}

type ChannelChatMessageCondition

type ChannelChatMessageCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive chat message events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// UserId is a user ID to read chat as.
	UserId string `json:"user_id"`
}

type ChannelChatMessageDeleteCondition

type ChannelChatMessageDeleteCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive chat message delete events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// UserId is a user ID to read chat as.
	UserId string `json:"user_id"`
}

type ChannelChatMessageDeleteEvent

type ChannelChatMessageDeleteEvent struct {
	// The broadcaster user ID.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The broadcaster login.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The ID of the user whose message was deleted.
	TargetUserId string `json:"target_user_id"`
	// The username of the user whose message was deleted.
	TargetUserName string `json:"target_user_name"`
	// The user login of the user whose message was deleted.
	TargetUserLogin string `json:"target_user_login"`
	// A UUID that identifies the message that was removed.
	MessageId string `json:"message_id"`
}

type ChannelChatMessageEvent

type ChannelChatMessageEvent struct {
	// The broadcaster’s user ID.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s user login.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s user display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The user ID of the user that sent the message.
	ChatterUserId string `json:"chatter_user_id"`
	// The username of the user that sent the message.
	ChatterUserName string `json:"chatter_user_login"`
	// The user login of the user that sent the message.
	ChatterUserLogin string `json:"chatter_user_name"`
	// A UUID that identifies the message.
	MessageId string `json:"message_id"`
	// The structured chat message.
	Message ChannelChatMessageEventMessage `json:"message"`
	// The type of message.
	Type MessageType `json:"message_type"`
	// List of chat badges.
	Badges []Badge `json:"badges"`
	// Optional. Metadata if this message is a cheer.
	Cheer *Cheer `json:"cheer,omitempty"`
	// The color of the user’s name in the chat room.
	// This is a hexadecimal RGB color code in the form, #<RGB>.
	// This tag may be empty if it is never set.
	Color string `json:"color"`
	// Optional. Metadata if this message is a reply.
	Reply *Reply `json:"reply,omitempty"`
	// ChannelPointsCustomRewardId is an ID of a channel points custom reward that was redeemed.
	ChannelPointsCustomRewardId string `json:"channel_points_custom_reward_id,omitempty"`
	// Optional. The broadcaster user ID of the channel the message was sent from.
	// Not presented when the message happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceBroadcasterUserId string `json:"source_broadcaster_user_id,omitempty"`
	// Optional. The username of the broadcaster of the channel the message was sent from.
	// Not presented when the message happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceBroadcasterUserName string `json:"source_broadcaster_user_name,omitempty"`
	// Optional. The login of the broadcaster of the channel the message was sent from.
	// Not presented when the message happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceBroadcasterUserLogin string `json:"source_broadcaster_user_login,omitempty"`
	// Optional. The UUID that identifies the source message from the channel the message was sent from.
	// Not presented when the message happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceMessageId string `json:"source_message_id,omitempty"`
	// Optional. The list of chat badges for the chatter in the channel the message was sent from.
	// Not presented when the message happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceBadges []Badge `json:"source_badges,omitempty"`
	// Optional. Determines if a message delivered during a shared chat session is only sent to the source channel.
	// Has no effect if the message is not sent during a shared chat session.
	IsSourceOnly *bool `json:"is_source_only,omitempty"`
}

type ChannelChatMessageEventMessage

type ChannelChatMessageEventMessage struct {
	Text      string                                   `json:"text"`
	Fragments []ChannelChatMessageEventMessageFragment `json:"fragments"`
}

type ChannelChatMessageEventMessageEmote

type ChannelChatMessageEventMessageEmote struct {
	Id         string        `json:"id"`
	EmoteSetId string        `json:"emote_set_id"`
	OwnerId    string        `json:"owner_id"`
	Format     []EmoteFormat `json:"format"`
}

type ChannelChatMessageEventMessageFragment

type ChannelChatMessageEventMessageFragment struct {
	Type      MessageFragmentType                  `json:"type"`
	Text      string                               `json:"text"`
	Emote     *ChannelChatMessageEventMessageEmote `json:"emote,omitempty"`
	Cheermote *Cheermote                           `json:"cheermote,omitempty"`
	Mention   *Mention                             `json:"mention"`
}

type ChannelChatNotificationCondition

type ChannelChatNotificationCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive chat notification events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// UserId is a user ID to read chat as.
	UserId string `json:"user_id"`
}

type ChannelChatNotificationEvent

type ChannelChatNotificationEvent struct {
	// The broadcaster user ID.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The broadcaster login.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// Optional. The broadcaster user ID of the channel the message was sent from.
	// Not presented when the message notification happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceBroadcasterUserId string `json:"source_broadcaster_user_id,omitempty"`
	// Optional. The username of the broadcaster of the channel the message was sent from.
	// Not presented when the message notification happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceBroadcasterUserName string `json:"source_broadcaster_user_name,omitempty"`
	// Optional. The login of the broadcaster of the channel the message was sent from
	// Not presented when the message notification happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceBroadcasterUserLogin string `json:"source_broadcaster_user_login,omitempty"`
	// Optional. The UUID that identifies the source message from the channel the message was sent from.
	// Not presented when the message happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceMessageId string `json:"source_message_id,omitempty"`
	// Optional. The list of chat badges for the chatter in the channel the message was sent from.
	// Not presented when the message happens in the same channel as the broadcaster.
	// Presented when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.
	SourceBadges []ChatNotificationEventBadge `json:"source_badges,omitempty"`
	// The user ID of the user that sent the message.
	ChatterUserId string `json:"chatter_user_id"`
	// The username of the user that sent the message.
	ChatterUserName string `json:"chatter_user_name"`
	// The user login of the user that sent the message.
	ChatterUserLogin string `json:"chatter_user_login"`
	// Whether the chatter is anonymous or not.
	ChatterIsAnonymous bool `json:"chatter_is_anonymous"`
	// The color of the user’s name in the chat room.
	Color string `json:"color"`
	// List of chat badges.
	Badges []ChatNotificationEventBadge `json:"badges"`
	// The message Twitch shows in the chat room for this notice.
	SystemMessage string `json:"system_message"`
	// A UUID that identifies the message.
	MessageId string `json:"message_id"`
	// The structured chat message
	Message ChatNotificationEventMessage `json:"message"`
	// The type of notice.
	NoticeType ChatNotificationEventNoticeType `json:"notice_type"`
	// Information about the sub event. Not presented if notice_type is not sub.
	Sub *ChatNotificationEventSubEvent `json:"sub,omitempty"`
	// Information about the re-sub event. Not presented if notice_type is not re-sub.
	ReSub *ChatNotificationEventReSubEvent `json:"resub,omitempty"`
	// Information about the gift sub event. Not presented if notice_type is not sub_gift.
	SubGift *ChatNotificationEventSubGiftEvent `json:"sub_gift,omitempty"`
	// Information about the community gift sub event. Not presented if notice_type is not community_sub_gift.
	CommunitySubGift *ChatNotificationEventCommunitySubGiftEvent `json:"community_sub_gift,omitempty"`
	// Information about the community gift paid upgrade event. Not presented if notice_type is not gift_paid_upgrade.
	GiftPaidUpgrade *ChatNotificationEventGiftPaidUpgradeEvent `json:"gift_paid_upgrade,omitempty"`
	// Information about the Prime gift paid upgrade event. Not presented if notice_type is not prime_paid_upgrade.
	PrimePaidUpgrade *ChatNotificationEventGiftPaidUpgradeEvent `json:"prime_paid_upgrade,omitempty"`
	// Information about the raid event. Not presented if notice_type is not raid.
	Raid *ChatNotificationEventRaidEvent `json:"raid,omitempty"`
	// Returns an empty payload if notice_type is un-raid, otherwise returns null.
	UnRaid *ChatNotificationEventUnRaidEvent `json:"unraid,omitempty"`
	// Information about the pay it forward event. Not presented if notice_type is not pay_it_forward.
	PayItForward *ChatNotificationEventPayItForwardEvent `json:"pay_it_forward,omitempty"`
	// Information about the announcement event. Not presented if notice_type is not announcement.
	Announcement *ChatNotificationEventAnnouncementEvent `json:"announcement,omitempty"`
	// Information about the charity donation event. Not presented if notice_type is not charity_donation.
	CharityDonation *ChatNotificationEventCharityDonationEvent `json:"charity_donation,omitempty"`
	// Information about the bits badge tier event. Not presented if notice_type is not bits_badge_tier.
	BitsBadgeTier *ChatNotificationEventBitsBadgeTierEvent `json:"bits_badge_tier,omitempty"`
	// Information about the shared_chat_sub event.
	// Not presented if notice_type is not shared_chat_sub.
	// This field has the same information as the sub-field but for a notice that happened for a channel in a shared chat
	// session other than the broadcaster in the subscription condition.
	SharedChatSub *ChatNotificationEventSubEvent `json:"shared_chat_sub,omitempty"`
	// Information about the shared_chat_resub event.
	// Not presented if notice_type is not shared_chat_resub.
	// This field has the same information as the re-sub field but for a notice that happened for a channel in a shared chat
	// session other than the broadcaster in the subscription condition.
	SharedChatReSub *ChatNotificationEventReSubEvent `json:"shared_chat_resub,omitempty"`
	// Information about the shared_chat_sub_gift event.
	// Not presented if notice_type is not shared_chat_sub_gift.
	// This field has the same information as the chat_sub_gift field but for a notice that happened for a channel in a
	// shared chat session other than the broadcaster in the subscription condition.
	SharedChatSubGift *ChatNotificationEventSubGiftEvent `json:"shared_chat_sub_gift,omitempty"`
	// Information about the shared_chat_community_sub_gift event.
	// Not presented if notice_type is not shared_chat_community_sub_gift.
	// This field has the same information as the community_sub_gift field but for a notice that happened for a channel
	// in a shared chat session other than the broadcaster in the subscription condition.
	SharedChatCommunitySubGift *ChatNotificationEventCommunitySubGiftEvent `json:"shared_chat_community_sub_gift,omitempty"`
	// Information about the shared_chat_gift_paid_upgrade event.
	// Not presented if notice_type is not shared_chat_gift_paid_upgrade.
	// This field has the same information as the gift_paid_upgrade field but for a notice that happened for a channel
	// in a shared chat session other than the broadcaster in the subscription condition.
	SharedChatGiftPaidUpgrade *ChatNotificationEventGiftPaidUpgradeEvent `json:"shared_chat_gift_paid_upgrade,omitempty"`
	// Information about the shared_chat_chat_prime_paid_upgrade event.
	// Not presented if notice_type is not shared_chat_prime_paid_upgrade.
	// This field has the same information as the prime_paid_upgrade field but for a notice that happened for a channel
	// in a shared chat session other than the broadcaster in the subscription condition.
	SharedChatPrimePaidUpgrade *ChatNotificationEventGiftPaidUpgradeEvent `json:"shared_chat_prime_paid_upgrade,omitempty"`
	// Information about the shared_chat_pay_it_forward event.
	// Not presented if notice_type is not shared_chat_pay_it_forward.
	// This field has the same information as the pay_it_forward field but for a notice that happened for a channel in a shared
	// chat session other than the broadcaster in the subscription condition.
	SharedChatPayItForward *ChatNotificationEventPayItForwardEvent `json:"shared_chat_pay_it_forward,omitempty"`
	// Information about the shared_chat_raid event.
	// Not presented if notice_type is not shared_chat_raid.
	// This field has the same information as the raid field but for a notice that happened for a channel in a shared chat
	// session other than the broadcaster in the subscription condition.
	SharedChatRaid *ChatNotificationEventRaidEvent `json:"shared_chat_raid,omitempty"`
	// Information about the shared_chat_announcement event.
	// Not presented if notice_type is not shared_chat_announcement.
	// This field has the same information as the announcement field but for a notice that happened for a channel in a shared
	// chat session other than the broadcaster in the subscription condition.
	SharedChatAnnouncement *ChatNotificationEventAnnouncementEvent `json:"shared_chat_announcement,omitempty"`
}

type ChannelChatSettingsUpdateCondition

type ChannelChatSettingsUpdateCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive chat settings update events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// UserId is a user ID to read chat as.
	UserId string `json:"user_id"`
}

type ChannelChatUserMessageHoldCondition

type ChannelChatUserMessageHoldCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive chat message events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// UserId is a user ID to read chat as.
	UserId string `json:"user_id"`
}

type ChannelChatUserMessageUpdateCondition

type ChannelChatUserMessageUpdateCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive chat message events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// UserId is a user ID to read chat as.
	UserId string `json:"user_id"`
}

type ChannelCheerCondition

type ChannelCheerCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get cheer notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelFollowCondition

type ChannelFollowCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get follow notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is an ID of the moderator of the channel you want to get follow notifications for.
	// If you have authorization from the broadcaster rather than a moderator, specify the broadcaster’s user ID here.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelFollowEvent

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 broadcaster’s user ID.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s user login.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s user display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// Timestamp of when the follow occurred.
	FollowedAt Timestamp `json:"followed_at"`
}

type ChannelGuestStarGuestUpdateCondition

type ChannelGuestStarGuestUpdateCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel hosting the guest star session.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator or broadcaster of the specified channel.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelGuestStarSessionBeginCondition

type ChannelGuestStarSessionBeginCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel hosting the guest star session.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator or broadcaster of the specified channel.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelGuestStarSessionEndCondition

type ChannelGuestStarSessionEndCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel hosting the guest star session.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator or broadcaster of the specified channel.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelGuestStarSettingsUpdateCondition

type ChannelGuestStarSettingsUpdateCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel hosting the guest star session.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator or broadcaster of the specified channel.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelModerateCondition

type ChannelModerateCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelModerateV2Condition

type ChannelModerateV2Condition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelModeratorAddCondition

type ChannelModeratorAddCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get moderator addition notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelModeratorAddEvent

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 ChannelModeratorRemoveCondition

type ChannelModeratorRemoveCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get moderator removal notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelModeratorRemoveEvent

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 ChannelPointsAutomaticRewardEventReward

type ChannelPointsAutomaticRewardEventReward struct {
	// The type of reward.
	Type ChannelPointsAutomaticRewardEventRewardType `json:"type"`
	// The reward cost.
	Cost int
	// Optional. Emote that was unlocked.
	UnlockedEmote *ChannelPointsAutomaticRewardEventRewardUnlockedEmote `json:"unlocked_emote,omitempty"`
}

type ChannelPointsAutomaticRewardEventRewardEmoteV2

type ChannelPointsAutomaticRewardEventRewardEmoteV2 struct {
	// The emote ID.
	Id string `json:"id"`
	// The human-readable emote token.
	Name string `json:"name"`
}

type ChannelPointsAutomaticRewardEventRewardMessage

type ChannelPointsAutomaticRewardEventRewardMessage struct {
	// The text of the 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 []MessageEmote `json:"emotes,omitempty"`
}

type ChannelPointsAutomaticRewardEventRewardMessageFragmentTypeV2

type ChannelPointsAutomaticRewardEventRewardMessageFragmentTypeV2 string
const (
	ChannelPointsAutomaticRewardEventRewardMessageFragmentTypeV2Text  ChannelPointsAutomaticRewardEventRewardMessageFragmentTypeV2 = "text"
	ChannelPointsAutomaticRewardEventRewardMessageFragmentTypeV2Emote ChannelPointsAutomaticRewardEventRewardMessageFragmentTypeV2 = "emote"
)

type ChannelPointsAutomaticRewardEventRewardMessageFragmentV2

type ChannelPointsAutomaticRewardEventRewardMessageFragmentV2 struct {
	// The message text in fragment.
	Text string `json:"text"`
	// The type of message fragment.
	Type ChannelPointsAutomaticRewardEventRewardMessageFragmentTypeV2 `json:"type"`
	// Optional. The metadata pertaining to the emote.
	Emote *ChannelPointsAutomaticRewardEventRewardMessageFragmentV2Emote `json:"emote,omitempty"`
}

type ChannelPointsAutomaticRewardEventRewardMessageFragmentV2Emote

type ChannelPointsAutomaticRewardEventRewardMessageFragmentV2Emote struct {
	// The ID that uniquely identifies this emote.
	Id string `json:"id"`
}

type ChannelPointsAutomaticRewardEventRewardMessageV2

type ChannelPointsAutomaticRewardEventRewardMessageV2 struct {
	// The chat message in plain text.
	Text string `json:"text"`
	// The ordered list of chat message fragments.
	Fragments []ChannelPointsAutomaticRewardEventRewardMessageFragmentV2 `json:"fragments,omitempty"`
}

type ChannelPointsAutomaticRewardEventRewardType

type ChannelPointsAutomaticRewardEventRewardType string
const (
	ChannelPointsAutomaticRewardEventRewardTypeSingleMessageBypassSubMode   ChannelPointsAutomaticRewardEventRewardType = "single_message_bypass_sub_mode"
	ChannelPointsAutomaticRewardEventRewardTypeSendHighlightedMessage       ChannelPointsAutomaticRewardEventRewardType = "send_highlighted_message"
	ChannelPointsAutomaticRewardEventRewardTypeRandomSubEmoteUnlock         ChannelPointsAutomaticRewardEventRewardType = "random_sub_emote_unlock"
	ChannelPointsAutomaticRewardEventRewardTypeChosenSubEmoteUnlock         ChannelPointsAutomaticRewardEventRewardType = "chosen_sub_emote_unlock"
	ChannelPointsAutomaticRewardEventRewardTypeChosenModifiedSubEmoteUnlock ChannelPointsAutomaticRewardEventRewardType = "chosen_modified_sub_emote_unlock"
	ChannelPointsAutomaticRewardEventRewardTypeMessageEffect                ChannelPointsAutomaticRewardEventRewardType = "message_effect"
	ChannelPointsAutomaticRewardEventRewardTypeGigantifyAnEmote             ChannelPointsAutomaticRewardEventRewardType = "gigantify_an_emote"
	ChannelPointsAutomaticRewardEventRewardTypeCelebration                  ChannelPointsAutomaticRewardEventRewardType = "celebration"
)

type ChannelPointsAutomaticRewardEventRewardTypeV2

type ChannelPointsAutomaticRewardEventRewardTypeV2 string
const (
	ChannelPointsAutomaticRewardEventRewardTypeV2SingleMessageBypassSubMode   ChannelPointsAutomaticRewardEventRewardTypeV2 = "single_message_bypass_sub_mode"
	ChannelPointsAutomaticRewardEventRewardTypeV2SendHighlightedMessage       ChannelPointsAutomaticRewardEventRewardTypeV2 = "send_highlighted_message"
	ChannelPointsAutomaticRewardEventRewardTypeV2RandomSubEmoteUnlock         ChannelPointsAutomaticRewardEventRewardTypeV2 = "random_sub_emote_unlock"
	ChannelPointsAutomaticRewardEventRewardTypeV2ChosenSubEmoteUnlock         ChannelPointsAutomaticRewardEventRewardTypeV2 = "chosen_sub_emote_unlock"
	ChannelPointsAutomaticRewardEventRewardTypeV2ChosenModifiedSubEmoteUnlock ChannelPointsAutomaticRewardEventRewardTypeV2 = "chosen_modified_sub_emote_unlock"
)

func (ChannelPointsAutomaticRewardEventRewardTypeV2) String

type ChannelPointsAutomaticRewardEventRewardUnlockedEmote

type ChannelPointsAutomaticRewardEventRewardUnlockedEmote struct {
	// The emote ID.
	Id string `json:"id"`
	// The human-readable emote token.
	Name string `json:"name"`
}

type ChannelPointsAutomaticRewardEventRewardV2

type ChannelPointsAutomaticRewardEventRewardV2 struct {
	// The type of reward.
	Type ChannelPointsAutomaticRewardEventRewardTypeV2 `json:"type"`
	// Number of channel points used.
	ChannelPoints int `json:"channel_points"`
	// Optional. Emote associated with the reward.
	Emote *ChannelPointsAutomaticRewardEventRewardEmoteV2 `json:"emote"`
}

type ChannelPointsAutomaticRewardRedemptionAddCondition

type ChannelPointsAutomaticRewardRedemptionAddCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to receive channel points reward add notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPointsAutomaticRewardRedemptionAddEvent

type ChannelPointsAutomaticRewardRedemptionAddEvent struct {
	// The ID of the channel where the reward was redeemed.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The login of the channel where the reward was redeemed.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The display name of the channel where the reward was redeemed.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The ID of the redeeming user.
	UserId string `json:"user_id"`
	// The login of the redeeming user.
	UserLogin string `json:"user_login"`
	// The display name of the redeeming user.
	UserName string `json:"user_name"`
	// The ID of the Redemption.
	Id string `json:"id"`
	// An object that contains the reward information.
	Reward ChannelPointsAutomaticRewardEventReward `json:"reward"`
	// An object that contains the user message and emote information needed to recreate the message.
	Message ChannelPointsAutomaticRewardEventRewardMessage `json:"message"`
	// Optional. A string that the user entered if the reward requires to be input.
	UserInput string `json:"user_input,omitempty"`
	// The UTC date and time (in RFC3339 format) of when the reward was
	RedeemedAt TimestampUTC `json:"redeemed_at"`
}

type ChannelPointsAutomaticRewardRedemptionAddEventV2

type ChannelPointsAutomaticRewardRedemptionAddEventV2 struct {
	// The ID of the channel where the reward was redeemed.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The login of the channel where the reward was redeemed.
	BroadcasterUserLogin string `json:"broadcaster_user~_login"`
	// The display name of the channel where the reward was redeemed.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The ID of the redeeming user.
	UserId string `json:"user_id"`
	// The login of the redeeming user.
	UserLogin string `json:"user_login"`
	// The display name of the redeeming user.
	UserName string `json:"user_name"`
	// The ID of the Redemption.
	Id string `json:"id"`
	// An object that contains the reward information.
	Reward ChannelPointsAutomaticRewardEventRewardV2 `json:"reward"`
	// An object that contains the user message and emote information needed to recreate the message.
	Message ChannelPointsAutomaticRewardEventRewardMessageV2 `json:"message"`
	// The UTC date and time (in RFC3339 format) of when the reward was redeemed.
	RedeemedAt TimestampUTC `json:"redeemed_at"`
}

type ChannelPointsAutomaticRewardRedemptionAddV2Condition

type ChannelPointsAutomaticRewardRedemptionAddV2Condition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to receive channel points reward add notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPointsCustomEventReward

type ChannelPointsCustomEventReward struct {
	// The reward identifier.
	Id string `json:"id"`
	// The reward name.
	Title string `json:"title"`
	// The reward cost.
	Cost int `json:"cost"`
	// The reward description.
	Prompt string `json:"prompt"`
}

type ChannelPointsCustomRewardAddCondition

type ChannelPointsCustomRewardAddCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to receive channel points custom reward add notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPointsCustomRewardAddEvent

type ChannelPointsCustomRewardAddEvent struct {
	// The reward identifier.
	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"`
	// Is the reward currently enabled. If false, the reward won’t show up to viewers.
	IsEnabled bool `json:"is_enabled"`
	// Is the reward currently paused. If true, viewers can’t redeem.
	IsPaused bool `json:"is_paused"`
	// Is the reward currently in stock. If false, viewers can’t redeem.
	IsInStock bool `json:"is_in_stock"`
	// The reward title.
	Title string `json:"title"`
	// The reward cost.
	Cost int `json:"cost"`
	// The reward description.
	Prompt string `json:"prompt"`
	// Does the viewer need to enter information when redeeming the reward.
	IsUserInputRequired bool `json:"is_user_input_required"`
	// Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.
	ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"`
	// Whether a maximum per stream is enabled and what the maximum is.
	MaxPerStream ChannelPointsRewardEventMaxPerStream `json:"max_per_stream"`
	// Whether a maximum per user per stream is enabled and what the maximum is.
	MaxPerUserPerStream ChannelPointsRewardEventMaxPerUserPerStream `json:"max_per_user_per_stream"`
	// Custom background color for the reward. Format: Hex with # prefix. Example: #FA1ED2.
	BackgroundColor string `json:"background_color"`
	// Set of custom images of 1x, 2x and 4x sizes for the reward. Can be Not presented if no images have been uploaded.
	Image *ChannelPointsRewardEventImage `json:"image,omitempty"`
	// Set of default images of 1x, 2x and 4x sizes for the reward.
	DefaultImage ChannelPointsRewardEventImage `json:"default_image"`
	// Whether a cooldown is enabled and what the cooldown is in seconds.
	GlobalCooldown ChannelPointsRewardEventGlobalCooldown `json:"global_cooldown"`
	// Timestamp of the cooldown expiration. Not presented if the reward isn’t on cooldown.
	CooldownExpiresAt *TimestampUTC `json:"cooldown_expires_at,omitempty"`
	// The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit.
	// Not presented if the broadcasters stream isn’t live or max_per_stream isn’t enabled.
	RedemptionsRedeemedCurrentStream int `json:"redemptions_redeemed_current_stream"`
}

type ChannelPointsCustomRewardRedemptionAddCondition

type ChannelPointsCustomRewardRedemptionAddCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to receive channel points custom reward redemption add notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// RewardId is a reward id to only receive notifications for a specific reward, optional.
	RewardId string `json:"reward_id,omitempty"`
}

type ChannelPointsCustomRewardRedemptionAddEvent

type ChannelPointsCustomRewardRedemptionAddEvent struct {
	// The redemption identifier.
	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"`
	// User ID of the user that redeemed the reward.
	UserId string `json:"user_id"`
	// Login of the user that redeemed the reward.
	UserLogin string `json:"user_login"`
	// Display name of the user that redeemed the reward.
	UserName string `json:"user_name"`
	// The user input provided. Empty string if not provided.
	UserInput string `json:"user_input"`
	// Defaults to CustomRewardRedemptionStatusUnfulfilled.
	Status CustomRewardRedemptionStatus `json:"status"`
	// Basic information about the reward that was redeemed, at the time it was redeemed.
	Reward ChannelPointsCustomEventReward `json:"reward"`
	// RFC3339 timestamp of when the reward was redeemed.
	RedeemedAt TimestampUTC `json:"redeemed_at"`
}

type ChannelPointsCustomRewardRedemptionUpdateCondition

type ChannelPointsCustomRewardRedemptionUpdateCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to receive channel points custom reward redemption update notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// RewardId is a reward id to only receive notifications for a specific reward, optional.
	RewardId string `json:"reward_id,omitempty"`
}

type ChannelPointsCustomRewardRedemptionUpdateEvent

type ChannelPointsCustomRewardRedemptionUpdateEvent struct {
	// The redemption identifier.
	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"`
	// User ID of the user that redeemed the reward.
	UserId string `json:"user_id"`
	// Login of the user that redeemed the reward.
	UserLogin string `json:"user_login"`
	// Display name of the user that redeemed the reward.
	UserName string `json:"user_name"`
	// The user input provided. Empty string if not provided.
	UserInput string `json:"user_input"`
	// Will be fulfilled or canceled.
	Status CustomRewardRedemptionStatus `json:"status"`
	// Basic information about the reward that was redeemed, at the time it was redeemed.
	Reward ChannelPointsCustomEventReward `json:"reward"`
	// RFC3339 timestamp of when the reward was redeemed.
	RedeemedAt TimestampUTC `json:"redeemed_at"`
}

type ChannelPointsCustomRewardRemoveCondition

type ChannelPointsCustomRewardRemoveCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to receive channel points custom reward remove notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// RewardId is a reward id to only receive notifications for a specific reward, optional.
	RewardId string `json:"reward_id,omitempty"`
}

type ChannelPointsCustomRewardRemoveEvent

type ChannelPointsCustomRewardRemoveEvent struct {
	// The reward identifier.
	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"`
	// Is the reward currently enabled. If false, the reward won’t show up to viewers.
	IsEnabled bool `json:"is_enabled"`
	// Is the reward currently paused. If true, viewers can’t redeem.
	IsPaused bool `json:"is_paused"`
	// Is the reward currently in stock. If false, viewers can’t redeem.
	IsInStock bool `json:"is_in_stock"`
	// The reward title.
	Title string `json:"title"`
	// The reward cost.
	Cost int `json:"cost"`
	// The reward description.
	Prompt string `json:"prompt"`
	// Does the viewer need to enter information when redeeming the reward.
	IsUserInputRequired bool `json:"is_user_input_required"`
	// Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.
	ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"`
	// Whether a maximum per stream is enabled and what the maximum is.
	MaxPerStream ChannelPointsRewardEventMaxPerStream `json:"max_per_stream"`
	// Whether a maximum per user per stream is enabled and what the maximum is.
	MaxPerUserPerStream ChannelPointsRewardEventMaxPerUserPerStream `json:"max_per_user_per_stream"`
	// Custom background color for the reward. Format: Hex with # prefix. Example: #FA1ED2.
	BackgroundColor string `json:"background_color"`
	// Set of custom images of 1x, 2x and 4x sizes for the reward. Not presented if no images have been uploaded.
	Image *ChannelPointsRewardEventImage `json:"image,omitempty"`
	// Set of default images of 1x, 2x and 4x sizes for the reward.
	DefaultImage ChannelPointsRewardEventImage `json:"default_image"`
	// Whether a cooldown is enabled and what the cooldown is in seconds.
	GlobalCooldown ChannelPointsRewardEventGlobalCooldown `json:"global_cooldown"`
	// Timestamp of the cooldown expiration. Not presented if the reward isn’t on cooldown.
	CooldownExpiresAt *TimestampUTC `json:"cooldown_expires_at,omitempty"`
	// The number of redemptions redeemed during the current live stream.
	// Counts against the max_per_stream limit.
	// Not presented if the broadcasters stream isn’t live or max_per_stream isn’t enabled.
	RedemptionsRedeemedCurrentStream int `json:"redemptions_redeemed_current_stream,omitempty"`
}

type ChannelPointsCustomRewardUpdateCondition

type ChannelPointsCustomRewardUpdateCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to receive channel points custom reward update notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// RewardId is a reward id to only receive notifications for a specific reward, optional.
	RewardId string `json:"reward_id,omitempty"`
}

type ChannelPointsCustomRewardUpdateEvent

type ChannelPointsCustomRewardUpdateEvent struct {
	// The reward identifier.
	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"`
	// Is the reward currently enabled. If false, the reward won’t show up to viewers.
	IsEnabled bool `json:"is_enabled"`
	// Is the reward currently paused. If true, viewers can’t redeem.
	IsPaused bool `json:"is_paused"`
	// Is the reward currently in stock. If false, viewers can’t redeem.
	IsInStock bool `json:"is_in_stock"`
	// The reward title.
	Title string `json:"title"`
	// The reward cost.
	Cost int `json:"cost"`
	// The reward description.
	Prompt string `json:"prompt"`
	// Does the viewer need to enter information when redeeming the reward.
	IsUserInputRequired bool `json:"is_user_input_required"`
	// Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.
	ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"`
	// Whether a maximum per stream is enabled and what the maximum is.
	MaxPerStream ChannelPointsRewardEventMaxPerStream `json:"max_per_stream"`
	// Whether a maximum per user per stream is enabled and what the maximum is.
	MaxPerUserPerStream ChannelPointsRewardEventMaxPerUserPerStream `json:"max_per_user_per_stream"`
	// Custom background color for the reward. Format: Hex with # prefix. Example: #FA1ED2.
	BackgroundColor string `json:"background_color"`
	// Set of custom images of 1x, 2x and 4x sizes for the reward. Can be Not presented if no images have been uploaded.
	Image *ChannelPointsRewardEventImage `json:"image,omitempty"`
	// Set of default images of 1x, 2x and 4x sizes for the reward.
	DefaultImage ChannelPointsRewardEventImage `json:"default_image"`
	// Whether a cooldown is enabled and what the cooldown is in seconds.
	GlobalCooldown ChannelPointsRewardEventGlobalCooldown `json:"global_cooldown"`
	// Timestamp of the cooldown expiration. Not presented if the reward isn’t on cooldown.
	CooldownExpiresAt *TimestampUTC `json:"cooldown_expires_at,omitempty"`
	// The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit.
	// Not presented if the broadcasters stream isn’t live or max_per_stream isn’t enabled.
	RedemptionsRedeemedCurrentStream int `json:"redemptions_redeemed_current_stream,omitempty"`
}

type ChannelPointsRewardEventGlobalCooldown

type ChannelPointsRewardEventGlobalCooldown struct {
	// Is the setting enabled.
	IsEnabled bool `json:"is_enabled"`
	// The global cooldown in seconds.
	Seconds int `json:"seconds"`
}

type ChannelPointsRewardEventImage

type ChannelPointsRewardEventImage struct {
	// URL for the image at 1x size.
	URL1x string `json:"url_1x"`
	// URL for the image at 2x size.
	URL2x string `json:"url_2x"`
	// URL for the image at 4x size.
	URL4x string `json:"url_4x"`
}

type ChannelPointsRewardEventMaxPerStream

type ChannelPointsRewardEventMaxPerStream struct {
	// Is the setting enabled.
	IsEnabled bool `json:"is_enabled"`
	// The max per stream limit.
	Value int `json:"value"`
}

type ChannelPointsRewardEventMaxPerUserPerStream

type ChannelPointsRewardEventMaxPerUserPerStream struct {
	// Is the setting enabled.
	IsEnabled bool `json:"is_enabled"`
	// The max per user per stream limit.
	Value int `json:"value"`
}

type ChannelPollBeginCondition

type ChannelPollBeginCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel for which “poll begin” notifications will be received.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPollBeginEvent

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 []ChannelPollEventChoice `json:"choices"`
	// The bits voting settings for the poll.
	BitsVoting ChannelPollEventBitsVoting `json:"bits_voting"`
	// The voting settings for the poll.
	ChannelPointsVoting ChannelPollEventChannelPointsVoting `json:"channel_points_voting"`
	// The time the poll started.
	StartedAt TimestampUTC `json:"started_at"`
	// The time the poll will end.
	EndsAt TimestampUTC `json:"ends_at"`
}

type ChannelPollEndCondition

type ChannelPollEndCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel for which “poll end” notifications will be received.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPollEndEvent

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. Includes vote counts.
	Choices []ChannelPollEventChoice `json:"choices"`
	// The bits voting settings for the poll.
	BitsVoting ChannelPollEventBitsVoting `json:"bits_voting"`
	// The voting settings for the poll.
	ChannelPointsVoting ChannelPollEventChannelPointsVoting `json:"channel_points_voting"`
	// The status of the poll.
	Status ChannelPollEndEventStatus `json:"status"`
	// The time the poll started.
	StartedAt TimestampUTC `json:"started_at"`
	// The time the poll ended.
	EndedAt TimestampUTC `json:"ended_at"`
}

type ChannelPollEndEventStatus

type ChannelPollEndEventStatus string
const (
	ChannelPollEndEventStatusCompleted  ChannelPollEndEventStatus = "completed"
	ChannelPollEndEventStatusArchived   ChannelPollEndEventStatus = "archived"
	ChannelPollEndEventStatusTerminated ChannelPollEndEventStatus = "terminated"
)

func (ChannelPollEndEventStatus) String

func (c ChannelPollEndEventStatus) String() string

type ChannelPollEventBitsVoting

type ChannelPollEventBitsVoting struct {
	// Indicates if Bits can be used for voting.
	IsEnabled bool `json:"is_enabled"`
	// Number of Bits required to vote once with Bits.
	AmountPerVote int `json:"amount_per_vote"`
}

type ChannelPollEventChannelPointsVoting

type ChannelPollEventChannelPointsVoting 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 ChannelPollEventChoice

type ChannelPollEventChoice struct {
	// ID for the choice.
	Id string `json:"id"`
	// Text displayed for the choice.
	Title string `json:"title"`
	// Number of votes received via Bits.
	BitsVotes int `json:"bits_votes"`
	// 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 ChannelPollProgressCondition

type ChannelPollProgressCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel for which “poll progress” notifications will be received.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPollProgressEvent

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. Includes vote counts.
	Choices []ChannelPollEventChoice `json:"choices"`
	// The bits voting settings for the poll.
	BitsVoting ChannelPollEventBitsVoting `json:"bits_voting"`
	// The voting settings for the poll.
	ChannelPointsVoting ChannelPollEventChannelPointsVoting `json:"channel_points_voting"`
	// The time the poll started.
	StartedAt TimestampUTC `json:"started_at"`
	// The time the poll will end.
	EndsAt TimestampUTC `json:"ends_at"`
}

type ChannelPredictionBeginCondition

type ChannelPredictionBeginCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel for which “prediction begin” notifications will be received.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPredictionBeginEvent

type ChannelPredictionBeginEvent struct {
	// The prediction 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"`
	// Title for the prediction.
	Title string `json:"title"`
	// An array of outcomes for the prediction.
	Outcomes []ChannelPredictionEventOutcome `json:"outcomes"`
	// The time the prediction started.
	StartedAt TimestampUTC `json:"started_at"`
	// The time the prediction will automatically lock.
	LocksAt TimestampUTC `json:"locks_at"`
}

type ChannelPredictionEndCondition

type ChannelPredictionEndCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel for which “prediction end” notifications will be received.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPredictionEndEvent

type ChannelPredictionEndEvent struct {
	// The prediction 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"`
	// Title for the prediction.
	Title string `json:"title"`
	// ID of the winning outcome.
	WinningOutcomeId string `json:"winning_outcome_id"`
	// An array of outcomes for the prediction. Includes ChannelPredictionEventOutcome.TopPredictors.
	Outcomes []ChannelPredictionEventOutcome `json:"outcomes"`
	// The status of the prediction.
	Status ChannelPredictionEndEventStatus `json:"status"`
	// The time the prediction started.
	StartedAt TimestampUTC `json:"started_at"`
	// The time the prediction ended.
	EndedAt TimestampUTC `json:"ended_at"`
}

type ChannelPredictionEndEventStatus

type ChannelPredictionEndEventStatus string
const (
	ChannelPredictionEndStatusResolved ChannelPredictionEndEventStatus = "resolved"
	ChannelPredictionEndStatusCanceled ChannelPredictionEndEventStatus = "canceled"
)

type ChannelPredictionEventOutcome

type ChannelPredictionEventOutcome struct {
	// The outcome ID.
	Id string `json:"id"`
	// The outcome title.
	Title string `json:"title"`
	// The color for the outcome. Valid values are pink and blue.
	Color string `json:"color"`
	// The number of users who used Channel Points on this outcome.
	Users int `json:"users"`
	// The total number of Channel Points used on this outcome.
	ChannelPoints int `json:"channel_points"`
	// An array of users who used the most Channel Points on this outcome.
	TopPredictors []ChannelPredictionEventOutcomeTopPredictor `json:"top_predictors"`
}

type ChannelPredictionEventOutcomeTopPredictor

type ChannelPredictionEventOutcomeTopPredictor struct {
	// The ID of the user.
	UserId string `json:"user_id"`
	// The login of the user.
	UserLogin string `json:"user_login"`
	// The display name of the user.
	UserName string `json:"user_name"`
	// The number of Channel Points won.
	// This value is always null in the event payload for Prediction progress and Prediction lock.
	// This value is 0 if the outcome did not win or if the Prediction was canceled and Channel Points were refunded.
	ChannelPointsWon int `json:"channel_points_won"`
	// The number of Channel Points used to participate in the Prediction.
	ChannelPointsUsed int `json:"channel_points_used"`
}

type ChannelPredictionLockCondition

type ChannelPredictionLockCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel for which “prediction lock” notifications will be received.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPredictionLockEvent

type ChannelPredictionLockEvent struct {
	// The prediction 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"`
	// Title for the Channel Points Prediction.
	Title string `json:"title"`
	// An array of outcomes for the prediction. Includes ChannelPredictionEventOutcome.TopPredictors.
	Outcomes []ChannelPredictionEventOutcome `json:"outcomes"`
	// The time the prediction started.
	StartedAt TimestampUTC `json:"started_at"`
	// The time the prediction was locked.
	LockedAt TimestampUTC `json:"locked_at"`
}

type ChannelPredictionProgressCondition

type ChannelPredictionProgressCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID of the channel for which “prediction progress” notifications will be received.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelPredictionProgressEvent

type ChannelPredictionProgressEvent struct {
	// The prediction 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"`
	// Title for the Channel Points Prediction.
	Title string `json:"title"`
	// An array of outcomes for the prediction. Includes ChannelPredictionEventOutcome.TopPredictors.
	Outcomes []ChannelPredictionEventOutcome `json:"outcomes"`
	// The time the Channel prediction started.
	StartedAt TimestampUTC `json:"started_at"`
	// The time the Channel prediction will automatically lock.
	LocksAt TimestampUTC `json:"locks_at"`
}

type ChannelRaidCondition

type ChannelRaidCondition struct {
	Condition
	// FromBroadcasterUserId is a broadcaster user ID that created the channel raid you want to get notifications for.
	// Use this parameter if you want to know when a specific broadcaster raids another broadcaster. The channel raid
	// condition must include either from_broadcaster_user_id or to_broadcaster_user_id.
	FromBroadcasterUserId string `json:"from_broadcaster_user_id"`
	// ToBroadcasterUserId is a broadcaster user ID that received the channel raid you want to get notifications for.
	// Use this parameter if you want to know when a specific broadcaster is raided by another broadcaster. The channel
	// raid condition must include either from_broadcaster_user_id or to_broadcaster_user_id.
	ToBroadcasterUserId string `json:"to_broadcaster_user_id"`
}

type ChannelRaidEvent

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 ChannelSharedChatSessionBeginCondition

type ChannelSharedChatSessionBeginCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive shared chat session begin events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelSharedChatSessionEndCondition

type ChannelSharedChatSessionEndCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive shared chat session end events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelSharedChatSessionUpdateCondition

type ChannelSharedChatSessionUpdateCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the channel to receive shared chat session update events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelSubscribeCondition

type ChannelSubscribeCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get subscribe notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelSubscribeEvent

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.
	Tier SubscriptionTier `json:"tier"`
	// Whether the subscription is a gift.
	IsGift bool `json:"is_gift"`
}

type ChannelSubscriptionEndCondition

type ChannelSubscriptionEndCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get subscription end notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelSubscriptionEndEvent

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.
	Tier SubscriptionTier `json:"tier"`
	// Whether the subscription was a gift.
	IsGift bool `json:"is_gift"`
}

type ChannelSubscriptionGiftCondition

type ChannelSubscriptionGiftCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get subscription gift notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelSubscriptionGiftEvent

type ChannelSubscriptionGiftEvent struct {
	// The user ID of the user who sent the subscription gift. Not presented if it was an anonymous subscription gift.
	UserId string `json:"user_id,omitempty"`
	// The user login of the user who sent the gift. Not presented if it was an anonymous subscription gift.
	UserLogin string `json:"user_login,omitempty"`
	// The user display name of the user who sent the gift. Not presented if it was an anonymous subscription gift.
	UserName string `json:"user_name,omitempty"`
	// 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.
	// Not presented for anonymous gifts or if the gifter has opted out of sharing this information.
	CumulativeTotal int `json:"cumulative_total,omitempty"`
	// Whether the subscription gift was anonymous.
	IsAnonymous bool `json:"is_anonymous"`
}

type ChannelSubscriptionMessageCondition

type ChannelSubscriptionMessageCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get resubscription chat message notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelSubscriptionMessageEvent

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 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 user’s subscription.
	Tier SubscriptionTier `json:"tier"`
	// An object that contains the resubscription message and emote information needed to recreate the message.
	Message ChannelSubscriptionMessageEventMessage `json:"message"`
	// The total number of months the user has been subscribed to the channel.
	CumulativeTotal int `json:"cumulative_total"`
	// The number of consecutive months the user’s current subscription has been active.
	// This value is not presented if the user has opted out of sharing this information.
	StreakMonths int `json:"streak_months,omitempty"`
	// The month duration of the subscription.
	DurationMonths int `json:"duration_months"`
}

type ChannelSubscriptionMessageEventMessage

type ChannelSubscriptionMessageEventMessage 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 []MessageEmote `json:"emotes,omitempty"`
}

type ChannelSuspiciousUserMessageCondition

type ChannelSuspiciousUserMessageCondition struct {
	Condition
	// BroadcasterUserId is an ID of the channel to receive chat message events for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is an ID of a user that has permission to moderate the broadcaster’s channel and has granted your
	// app permission to subscribe to this subscription type.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelSuspiciousUserUpdateCondition

type ChannelSuspiciousUserUpdateCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster you want to get chat unban request notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is an ID of a user that has permission to moderate the broadcaster’s channel and has granted your
	// app permission to subscribe to this subscription type.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelUnbanCondition

type ChannelUnbanCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get unban notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelUnbanEvent

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 ChannelUnbanRequestCreateCondition

type ChannelUnbanRequestCreateCondition struct {
	Condition
	// BroadcasterUserId is an ID of the broadcaster you want to get chat unban request notifications for, maximum 1.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is an ID of the user that has permission to moderate the broadcaster’s channel and has granted
	// your app permission to subscribe to this subscription type.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelUnbanRequestCreateEvent

type ChannelUnbanRequestCreateEvent struct {
	// The ID of the unban request.
	Id string `json:"id"`
	// The broadcaster’s user ID for the channel the unban request was created for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s login name.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// User ID of user that is requesting to be unbanned.
	UserId string `json:"user_id"`
	// The user’s login name.
	UserLogin string `json:"user_login"`
	// The user’s 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 TimestampUTC `json:"created_at"`
}

type ChannelUnbanRequestResolveCondition

type ChannelUnbanRequestResolveCondition struct {
	Condition
	// BroadcasterUserId is an ID of the broadcaster you want to get unban request resolution notifications for, maximum 1.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is an ID of the user that has permission to moderate the broadcaster’s channel and has granted
	// your app permission to subscribe to this subscription type.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelUnbanRequestResolveEvent

type ChannelUnbanRequestResolveEvent struct {
	// The ID of the unban request.
	Id string `json:"id"`
	// The broadcaster’s user ID for the channel the unban request was created for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s login name.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// Optional. User ID of moderator who approved/denied the request.
	ModeratorUserId string `json:"moderator_user_id,omitempty"`
	// Optional. The moderator’s login name
	ModeratorUserLogin string `json:"moderator_user_login,omitempty"`
	// Optional. The moderator’s display name
	ModeratorUserName string `json:"moderator_user_name,omitempty"`
	// User ID of user that requested to be unbanned.
	UserId string `json:"user_id"`
	// 	The user’s login name.
	UserLogin string `json:"user_login"`
	// The user’s display name.
	UserName string `json:"user_name"`
	// Optional. Resolution text supplied by the mod/broadcaster upon approval/denial of the request.
	ResolutionText string `json:"resolution_text,omitempty"`
	// Dictates whether the unban request was approved or denied.
	Status ChannelUnbanRequestResolveEventStatus `json:"status"`
}

type ChannelUnbanRequestResolveEventStatus

type ChannelUnbanRequestResolveEventStatus string
const (
	ChannelUnbanRequestResolveEventStatusApproved ChannelUnbanRequestResolveEventStatus = "approved"
	ChannelUnbanRequestResolveEventStatusCanceled ChannelUnbanRequestResolveEventStatus = "canceled"
	ChannelUnbanRequestResolveEventStatusDenied   ChannelUnbanRequestResolveEventStatus = "denied"
)

func (ChannelUnbanRequestResolveEventStatus) String

type ChannelUpdateCondition

type ChannelUpdateCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID for the channel you want to get updates for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelUpdateEvent

type ChannelUpdateEvent struct {
	// The broadcaster’s user ID.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s user login.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s user display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The channel’s stream title.
	Title string `json:"title"`
	// The channel’s broadcast language.
	Language string `json:"language"`
	// The channel’s category ID.
	CategoryId string `json:"category_id"`
	// The category name.
	CategoryName string `json:"category_name"`
	// 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 ChannelVIPAddCondition

type ChannelVIPAddCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster (channel), maximum 1.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelVIPRemoveCondition

type ChannelVIPRemoveCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster (channel), maximum 1.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type ChannelVipAddEvent

type ChannelVipAddEvent struct {
	// The user ID of the user that was added as a VIP.
	UserId string `json:"user_id"`
	// The user login of the user that was added as a VIP.
	UserLogin string `json:"user_login"`
	// The user display name of the user that was added as a VIP.
	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"`
}

type ChannelVipRemoveEvent

type ChannelVipRemoveEvent struct {
	// The user ID of the user that was removed as a VIP.
	UserId string `json:"user_id"`
	// The user login of the user that was removed as a VIP.
	UserLogin string `json:"user_login"`
	// The user display name of the user that was removed as a VIP.
	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"`
}

type ChannelWarningAcknowledgeCondition

type ChannelWarningAcknowledgeCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChannelWarningSendCondition

type ChannelWarningSendCondition struct {
	Condition
	// BroadcasterUserId is a user ID of the broadcaster.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a user ID of the moderator.
	ModeratorUserId string `json:"moderator_user_id"`
}

type ChatNotificationEventAnnouncementEvent

type ChatNotificationEventAnnouncementEvent struct {
	// Color of the announcement.
	Color string `json:"color"`
}

type ChatNotificationEventBadge

type ChatNotificationEventBadge struct {
	// An ID that identifies this set of chat badges. For example, Bits or Subscriber.
	SetId string `json:"set_id"`
	// An ID that identifies this version of the badge.
	// The ID can be any value.
	// For example, for Bits, the ID is the Bits tier level, but for World of Warcraft, it could be Alliance or Horde.
	Id string `json:"id"`
	// Contains metadata related to the chat badges in the badges tag.
	// Currently, this tag contains metadata only for subscriber badges, to indicate the number of months the user has been a subscriber.
	Info string `json:"info"`
}

type ChatNotificationEventBitsBadgeTierEvent

type ChatNotificationEventBitsBadgeTierEvent struct {
	// The tier of the Bits badge the user just earned. For example, 100, 1000, or 10000.
	Tier int `json:"tier"`
}

ChatNotificationEventBitsBadgeTierEvent represents information about the bits badge tier event.

type ChatNotificationEventCharityDonationEvent

type ChatNotificationEventCharityDonationEvent struct {
	// Name of the charity.
	CharityName string `json:"charity_name"`
	// An object that contains the amount of money that the user paid.
	Amount ChatNotificationEventCharityDonationEventDonationAmount `json:"amount"`
}

type ChatNotificationEventCharityDonationEventDonationAmount

type ChatNotificationEventCharityDonationEventDonationAmount struct {
	// The monetary amount. The amount is specified in the currency’s minor unit.
	// For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550.
	Value int `json:"value"`
	// The number of decimal places used by the currency.
	// For example, USD uses two decimal places.
	DecimalPlaces int `json:"decimal_places"`
	// The ISO-4217 three-letter currency code that identifies the type of currency in value.
	Currency string `json:"currency"`
}

type ChatNotificationEventCommunitySubGiftEvent

type ChatNotificationEventCommunitySubGiftEvent struct {
	// The ID of the associated community gift.
	Id string `json:"id"`
	// Number of subscriptions being gifted.
	Total int `json:"total"`
	// The type of subscription plan being used.
	SubTier SubscriptionTier `json:"sub_tier"`
	// Optional. The amount of gifts the gifter has given in this channel. Not presented if anonymous.
	CumulativeTotal int `json:"cumulative_total,omitempty"`
}

type ChatNotificationEventGiftPaidUpgradeEvent

type ChatNotificationEventGiftPaidUpgradeEvent struct {
	// Whether the gift was given anonymously.
	GifterIsAnonymous bool `json:"gifter_is_anonymous"`
	// Optional. The user ID of the user who gifted the subscription. Not presented if anonymous.
	GifterUserId string `json:"gifter_user_id,omitempty"`
	// Optional. The username of the user who gifted the subscription. Not presented if anonymous.
	GifterUserName string `json:"gifter_user_name,omitempty"`
	// Optional. The user login of the user who gifted the subscription. Not presented if anonymous.
	GifterUserLogin string `json:"gifter_user_login,omitempty"`
}

type ChatNotificationEventMessage

type ChatNotificationEventMessage struct {
	// The chat message in plain text.
	Text string `json:"text"`
	// Ordered list of chat message fragments.
	Fragments []ChatNotificationEventMessageFragment `json:"fragments"`
}

type ChatNotificationEventMessageFragment

type ChatNotificationEventMessageFragment struct {
	// The type of message fragment.
	Type MessageFragmentType `json:"type"`
	// Message text in fragment
	Text string `json:"text"`
	// Optional. Metadata pertaining to the cheermote.
	Cheermote *ChatNotificationEventMessageFragmentCheermote `json:"cheermote,omitempty"`
	// Optional. Metadata pertaining to the emote.
	Emote *ChatNotificationEventMessageFragmentEmote `json:"emote,omitempty"`
	// Optional. Metadata pertaining to the mention.
	Mention *ChatNotificationEventMessageFragmentMention `json:"mention,omitempty"`
}

type ChatNotificationEventMessageFragmentCheermote

type ChatNotificationEventMessageFragmentCheermote struct {
	// The name portion of the ChatNotificationMessageFragmentCheermote string that you use in chat to cheer Bits.
	// The full ChatNotificationMessageFragmentCheermote string is the concatenation of {prefix} + {number of Bits}.
	// For example, if the prefix is “Cheer” and you want to cheer 100 Bits, the full ChatNotificationMessageFragmentCheermote
	// string is Cheer100. When the ChatNotificationMessageFragmentCheermote string is entered in chat, Twitch converts it to
	// the image associated with the Bits tier that was cheered.
	Prefix string `json:"prefix"`
	// The amount of bits cheered.
	Bits int `json:"bits"`
	// The tier level of the cheermote.
	Tier int `json:"tier"`
}

type ChatNotificationEventMessageFragmentEmote

type ChatNotificationEventMessageFragmentEmote 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"`
	// The ID of the broadcaster who owns the emote.
	OwnerId string `json:"owner_id"`
	// The formats that the emote is available in.
	// For example, if the emote is available only as a static PNG, the array contains only EmoteFormatStatic, but if the
	// emote is available as a static PNG and an animated GIF, the array contains EmoteFormatStatic and EmoteFormatAnimated.
	Format []EmoteFormat `json:"format"`
}

type ChatNotificationEventMessageFragmentMention

type ChatNotificationEventMessageFragmentMention struct {
	// The user ID of the mentioned user.
	UserId string `json:"user_id"`
	// The username of the mentioned user.
	UserName string `json:"user_name"`
	// The user login of the mentioned user.
	UserLogin string `json:"user_login"`
}

type ChatNotificationEventNoticeType

type ChatNotificationEventNoticeType string
const (
	ChatNotificationEventNoticeTypeSub                        ChatNotificationEventNoticeType = "sub"
	ChatNotificationEventNoticeTypeReSub                      ChatNotificationEventNoticeType = "resub"
	ChatNotificationEventNoticeTypeSubGift                    ChatNotificationEventNoticeType = "sub_gift"
	ChatNotificationEventNoticeTypeCommunitySubGift           ChatNotificationEventNoticeType = "community_sub_gift"
	ChatNotificationEventNoticeTypeGiftPaidUpgrade            ChatNotificationEventNoticeType = "gift_paid_upgrade"
	ChatNotificationEventNoticeTypePrimePaidUpgrade           ChatNotificationEventNoticeType = "prime_paid_upgrade"
	ChatNotificationEventNoticeTypeRaid                       ChatNotificationEventNoticeType = "raid"
	ChatNotificationEventNoticeTypeUnRaid                     ChatNotificationEventNoticeType = "unraid"
	ChatNotificationEventNoticeTypePayItForward               ChatNotificationEventNoticeType = "pay_it_forward"
	ChatNotificationEventNoticeTypeAnnouncement               ChatNotificationEventNoticeType = "announcement"
	ChatNotificationEventNoticeTypeBitsBadgeTier              ChatNotificationEventNoticeType = "bits_badge_tier"
	ChatNotificationEventNoticeTypeCharityDonation            ChatNotificationEventNoticeType = "charity_donation"
	ChatNotificationEventNoticeTypeSharedChatSub              ChatNotificationEventNoticeType = "shared_chat_sub"
	ChatNotificationEventNoticeTypeSharedChatReSub            ChatNotificationEventNoticeType = "shared_chat_resub"
	ChatNotificationEventNoticeTypeSharedChatSubGift          ChatNotificationEventNoticeType = "shared_chat_sub_gift"
	ChatNotificationEventNoticeTypeSharedChatCommunitySubGift ChatNotificationEventNoticeType = "shared_chat_community_sub_gift"
	ChatNotificationEventNoticeTypeSharedChatGiftPaidUpgrade  ChatNotificationEventNoticeType = "shared_chat_gift_paid_upgrade"
	ChatNotificationEventNoticeTypeSharedChatPrimePaidUpgrade ChatNotificationEventNoticeType = "shared_chat_prime_paid_upgrade"
	ChatNotificationEventNoticeTypeSharedChatRaid             ChatNotificationEventNoticeType = "shared_chat_raid"
	ChatNotificationEventNoticeTypeSharedChatPayItForward     ChatNotificationEventNoticeType = "shared_chat_pay_it_forward"
	ChatNotificationEventNoticeTypeSharedChatAnnouncement     ChatNotificationEventNoticeType = "shared_chat_announcement"
)

func (ChatNotificationEventNoticeType) String

type ChatNotificationEventPayItForwardEvent

type ChatNotificationEventPayItForwardEvent struct {
	// Whether the gift was given anonymously.
	GifterIsAnonymous bool `json:"gifter_is_anonymous"`
	// Optional. The user ID of the user who gifted the subscription. Not presented if anonymous.
	GifterUserId string `json:"gifter_user_id,omitempty"`
	// Optional. The username of the user who gifted the subscription. Not presented if anonymous.
	GifterUserName string `json:"gifter_user_name,omitempty"`
	// Optional. The user login of the user who gifted the subscription. Not presented if anonymous.
	GifterUserLogin string `json:"gifter_user_login,omitempty"`
}

type ChatNotificationEventRaidEvent

type ChatNotificationEventRaidEvent struct {
	// The user ID of the broadcaster raiding this channel.
	UserId string `json:"user_id"`
	// The username of the broadcaster raiding this channel.
	UserName string `json:"user_name"`
	// The login name of the broadcaster raiding this channel.
	UserLogin string `json:"user_login"`
	// The number of viewers raiding this channel from the broadcaster’s channel.
	ViewerCount int `json:"viewer_count"`
	// Profile image URL of the broadcaster raiding this channel.
	ProfileImageURL string `json:"profile_image_url"`
}

ChatNotificationEventRaidEvent represents information about the raid event.

type ChatNotificationEventReSubEvent

type ChatNotificationEventReSubEvent struct {
	// The total number of months the user has subscribed.
	CumulativeMonths int `json:"cumulative_months"`
	// The number of months the subscription is for.
	DurationMonths int `json:"duration_months"`
	// Optional. The number of consecutive months the user has subscribed.
	StreakMonths int `json:"streak_months,omitempty"`
	// The type of subscription plan being used.
	SubTier SubscriptionTier `json:"sub_tier"`
	// Indicates if the re-sub was obtained through Amazon Prime.
	IsPrime bool `json:"is_prime"`
	// Whether the re-sub was a result of a gift or not.
	IsGift bool `json:"is_gift"`
	// Optional. Whether the gift was anonymous or not.
	GifterIsAnonymous bool `json:"gifter_is_anonymous,omitempty"`
	// Optional. The user ID of the subscription gifter. Not presented if anonymous.
	GifterUserId string `json:"gifter_user_id,omitempty"`
	// Optional. The username of the subscription gifter. Not presented if anonymous.
	GifterUserName string `json:"gifter_user_name,omitempty"`
	// Optional. The user login of the subscription gifter. Not presented if anonymous.
	GifterUserLogin string `json:"gifter_user_login,omitempty"`
}

type ChatNotificationEventSubEvent

type ChatNotificationEventSubEvent struct {
	// The type of subscription plan being used.
	SubTier SubscriptionTier `json:"sub_tier"`
	// Indicates if the subscription was obtained through Amazon Prime.
	IsPrime bool `json:"is_prime"`
	// The number of months the subscription is for.
	DurationMonths int `json:"duration_months"`
}

type ChatNotificationEventSubGiftEvent

type ChatNotificationEventSubGiftEvent struct {
	// The number of months the subscription is for.
	DurationMonths int `json:"duration_months"`
	// Optional. The amount of gifts the gifter has given in this channel. Not presented if anonymous.
	CumulativeTotal int `json:"cumulative_total,omitempty"`
	// The user ID of the subscription gift recipient.
	RecipientUserId string `json:"recipient_user_id"`
	// The username of the subscription gift recipient.
	RecipientUserName string `json:"recipient_user_name"`
	// The user login of the subscription gift recipient.
	RecipientUserLogin string `json:"recipient_user_login"`
	// The type of subscription plan being used.
	SubTier SubscriptionTier `json:"sub_tier"`
	// Optional. The ID of the associated community gift. Not presented if not associated with a community gift.
	CommunityGiftId string `json:"community_gift_id,omitempty"`
}

type ChatNotificationEventUnRaidEvent

type ChatNotificationEventUnRaidEvent struct{}

type Cheer

type Cheer struct {
	Bits int `json:"bits"`
}

type Cheermote

type Cheermote struct {
	Prefix string `json:"prefix"`
	Bits   int    `json:"bits"`
	Tier   int    `json:"tier"`
}

type Condition

type Condition interface {
	// contains filtered or unexported methods
}

Condition is a marker for condition.

type ConduitShardDisabledCondition

type ConduitShardDisabledCondition struct {
	Condition
	// ClientId is your application’s client id. The provided client_id must match the client ID in the application access token.
	ClientId string `json:"broadcaster_user_id"`
	// ModeratorUserId is a conduit ID to receive events for. If omitted, events for all of this client’s conduits are sent.
	ConduitId string `json:"moderator_user_id"`
}

type ConduitShardDisabledEvent

type ConduitShardDisabledEvent struct {
	// The ID of the conduit.
	ConduitId string `json:"conduit_id"`
	// The ID of the disabled shard.
	ShardId string `json:"shard_id"`
	// The new status of the transport.
	Status string `json:"status"`
	// The disabled transport.
	Transport ConduitShardDisabledEventTransport `json:"transport"`
}

type ConduitShardDisabledEventTransport

type ConduitShardDisabledEventTransport struct {
	// Method websocket or webhook
	Method string `json:"method"`
	// Optional. Webhook callback URL. Empty if method is set to websocket.
	Callback string `json:"callback,omitempty"`
	// Optional. WebSocket session ID. Empty if  method is set to webhook.
	SessionId string `json:"session_id,omitempty"`
	// Optional. Time that the WebSocket session connected. Empty if method is set to webhook.
	ConnectedAt *TimestampUTC `json:"connected_at,omitempty"`
	// Optional. Time that the WebSocket session disconnected. Empty if method is set to webhook.
	DisconnectAt *TimestampUTC `json:"disconnected_at,omitempty"`
}

type ConduitTransport

type ConduitTransport struct {
	Transport
	Method    string `json:"method"`
	ConduitId string `json:"conduit_id"`
}

type CustomRewardRedemptionStatus

type CustomRewardRedemptionStatus string
const (
	CustomRewardRedemptionStatusUnknown     CustomRewardRedemptionStatus = "unknown"
	CustomRewardRedemptionStatusUnfulfilled CustomRewardRedemptionStatus = "unfulfilled"
	CustomRewardRedemptionStatusFulfilled   CustomRewardRedemptionStatus = "fulfilled"
	CustomRewardRedemptionStatusCanceled    CustomRewardRedemptionStatus = "canceled"
)

type DropEntitlementGrantCondition

type DropEntitlementGrantCondition struct {
	Condition
	// OrganizationId is an organization ID of the organization that owns the game on the developer portal.
	OrganizationId string `json:"organization_id"`
	// CategoryId is a category (or game) ID of the game for which entitlement notifications will be received.
	CategoryId string `json:"category_id"`
	// CampaignId is a campaign ID for a specific campaign for which entitlement notifications will be received.
	CampaignId string `json:"campaign_id"`
}

type EmoteFormat

type EmoteFormat string
const (
	EmoteFormatAnimated EmoteFormat = "animated"
	EmoteFormatStatic   EmoteFormat = "static"
)

type EventSub

type EventSub struct {
	// contains filtered or unexported fields
}

EventSub is a Twitch eventsub module.

Reference: https://dev.twitch.tv/docs/eventsub.

func New

func New(options ...Option) EventSub

func (*EventSub) Webhook

func (es *EventSub) Webhook(secret []byte, verifySignature bool) (*Webhook, error)

Webhook returns new eventsub Webhook handler that implements http.Handler.

func (*EventSub) Websocket

func (es *EventSub) Websocket(options ...WebsocketOption) *Websocket

Websocket returns new eventsub Websocket client.

type EventType

type EventType string

EventType is a type of EventSub event.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types

const (
	EventTypeAutomodMessageUpdate                      EventType = "automod.message.update"
	EventTypeAutomodMessageHold                        EventType = "automod.message.hold"
	EventTypeAutomodSettingsUpdate                     EventType = "automod.settings.update"
	EventTypeAutomodTermsUpdate                        EventType = "automod.terms.update"
	EventTypeChannelBitsUse                            EventType = "channel.bits.use"
	EventTypeChannelUpdate                             EventType = "channel.update"
	EventTypeChannelFollow                             EventType = "channel.follow"
	EventTypeChannelAdBreakBegin                       EventType = "channel.ad_break.begin"
	EventTypeChannelChatClear                          EventType = "channel.chat.clear"
	EventTypeChannelChatClearUserMessages              EventType = "channel.chat.clear_user_messages"
	EventTypeChannelChatMessage                        EventType = "channel.chat.message"
	EventTypeConduitShardDisabled                      EventType = "conduit.shard.disabled"
	EventTypeChannelBan                                EventType = "channel.ban"
	EventTypeChannelUnban                              EventType = "channel.unban"
	EventTypeChannelChatNotification                   EventType = "channel.chat.notification"
	EventTypeChannelModeratorAdd                       EventType = "channel.moderator.add"
	EventTypeChannelModeratorRemove                    EventType = "channel.moderator.remove"
	EventTypeChannelPollBegin                          EventType = "channel.poll.begin"
	EventTypeChannelPollProgress                       EventType = "channel.poll.progress"
	EventTypeChannelPollEnd                            EventType = "channel.poll.end"
	EventTypeChannelPredictionBegin                    EventType = "channel.prediction.begin"
	EventTypeChannelPredictionProgress                 EventType = "channel.prediction.progress"
	EventTypeChannelPredictionLock                     EventType = "channel.prediction.lock"
	EventTypeChannelPredictionEnd                      EventType = "channel.prediction.end"
	EventTypeChannelRaid                               EventType = "channel.raid"
	EventTypeChannelPointsCustomRewardRedemptionAdd    EventType = "channel.channel_points_custom_reward_redemption.add"
	EventTypeChannelPointsCustomRewardRedemptionUpdate EventType = "channel.channel_points_custom_reward_redemption.update"
	EventTypeChannelPointsAutomaticRewardRedemptionAdd EventType = "channel.channel_points_automatic_reward_redemption.add"
	EventTypeUserAuthorizationRevoke                   EventType = "user.authorization.revoke"
	EventTypeChannelPointsRewardAdd                    EventType = "channel.channel_points_custom_reward.add"
	EventTypeChannelPointsRewardUpdate                 EventType = "channel.channel_points_custom_reward.update"
	EventTypeChannelPointsRewardRemove                 EventType = "channel.channel_points_custom_reward.remove"
	EventTypeStreamOffline                             EventType = "stream.offline"
	EventTypeStreamOnline                              EventType = "stream.online"
	EventTypeChannelSubscribe                          EventType = "channel.subscribe"
	EventTypeChannelSubscriptionEnd                    EventType = "channel.subscription.end"
	EventTypeChannelSubscriptionMessage                EventType = "channel.subscription.message"
	EventTypeChannelSubscriptionGift                   EventType = "channel.subscription.gift"
	EventTypeChannelUnbanRequestCreate                 EventType = "channel.unban_request.create"
	EventTypeChannelUnbanRequestResolve                EventType = "channel.unban_request.resolve"
	EventTypeUserUpdate                                EventType = "user.update"
	EventTypeChannelVipAdd                             EventType = "channel.vip.add"
	EventTypeChannelVipRemove                          EventType = "channel.vip.remove"
	EventTypeChannelMessageDelete                      EventType = "channel.chat.message_delete"
)

func (EventType) String

func (et EventType) String() string

type ExtensionBitsTransactionCreateCondition

type ExtensionBitsTransactionCreateCondition struct {
	Condition
	// ExtensionClientId is a client ID of the extension.
	ExtensionClientId string `json:"extension_client_id"`
}

type GoalsCondition

type GoalsCondition struct {
	Condition
	// BroadcasterUserId is an ID of the broadcaster to get notified about. The ID must match the user_id in the OAuth access token.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type Handler

type Handler[Event any, Metadata any] func(Event, Metadata)

Handler is a handler for generic event.

type HypeTrainBeginCondition

type HypeTrainBeginCondition struct {
	Condition
	// BroadcasterUserId is an ID of the broadcaster that you want to get hype train begin notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type HypeTrainEndCondition

type HypeTrainEndCondition struct {
	Condition
	// BroadcasterUserId is an ID of the broadcaster that you want to get hype train end notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type HypeTrainProgressCondition

type HypeTrainProgressCondition struct {
	Condition
	// BroadcasterUserId is an ID of the broadcaster that you want to get hype train progress notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type Mention

type Mention struct {
	UserId    string `json:"user_id"`
	UserName  string `json:"user_name"`
	UserLogin string `json:"user_login"`
}

type MessageEmote

type MessageEmote struct {
	// The emote ID.
	Id string `json:"id"`
	// 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"`
}

type MessageFragmentType

type MessageFragmentType string
const (
	MessageFragmentText      MessageFragmentType = "text"
	MessageFragmentEmote     MessageFragmentType = "emote"
	MessageFragmentCheermote MessageFragmentType = "cheermote"
	MessageFragmentMention   MessageFragmentType = "mention"
)

type MessageType

type MessageType string
const (
	MessageText                     MessageType = "text"
	MessageChannelPointsHighlighted MessageType = "channel_points_highlighted"
	MessageChannelPointsSubOnly     MessageType = "channel_points_sub_only"
	MessageUserIntro                MessageType = "user_intro"
	MessagePowerUpsMessageEffect    MessageType = "power_ups_message_effect"
	MessagePowerUpsGigantifiedEmote MessageType = "power_ups_gigantified_emote"
)

type Option

type Option func(*EventSub)

Option is an optional setting for EventSub.

func WithEventTracker

func WithEventTracker(eventTracker eventtracker.EventTracker) Option

WithEventTracker sets tracker for events to prevent duplicate events.

If this option is not set, events will not be tracked as there is no default value.

func WithUnmarshal

func WithUnmarshal(unmarshal json.UnMarshaller) Option

WithUnmarshal sets JSON un-marshaller that will be used as default un-marshaller.

Default value is a standard library un-marshaller.

type PowerUp

type PowerUp struct {
	Type            BitsPowerUpType `json:"type"`
	Emote           *RewardEmote    `json:"emote,omitempty"`
	MessageEffectId string          `json:"message_effect_id,omitempty"`
}

type RawEvent

type RawEvent struct {
	Subscription []byte
	Event        []byte
}

RawEvent is an event with raw payload that is not depends on the underlying transport.

type Reply

type Reply struct {
	ParentMessageId   string `json:"parent_message_id"`
	ParentMessageBody string `json:"parent_message_body"`
	ParentUserId      string `json:"parent_user_id"`
	ParentUserName    string `json:"parent_user_name"`
	ParentUserLogin   string `json:"parent_user_login"`
	ThreadMessageId   string `json:"thread_message_id"`
	ThreadUserId      string `json:"thread_user_id"`
	ThreadUserName    string `json:"thread_user_name"`
	ThreadUserLogin   string `json:"thread_user_login"`
}

type RewardEmote

type RewardEmote struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type StreamOfflineCondition

type StreamOfflineCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID you want to get stream offline notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type StreamOfflineEvent

type StreamOfflineEvent struct {
	// The broadcaster’s user id.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s user login.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s user display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
}

type StreamOnlineCondition

type StreamOnlineCondition struct {
	Condition
	// BroadcasterUserId is a broadcaster user ID you want to get stream online notifications for.
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type StreamOnlineEvent

type StreamOnlineEvent struct {
	// The id of the stream.
	Id string `json:"id"`
	// The broadcaster’s user id.
	BroadcasterUserId string `json:"broadcaster_user_id"`
	// The broadcaster’s user login.
	BroadcasterUserLogin string `json:"broadcaster_user_login"`
	// The broadcaster’s user display name.
	BroadcasterUserName string `json:"broadcaster_user_name"`
	// The stream type.
	Type StreamType `json:"type"`
	// The timestamp at which the stream went online at.
	StartedAt TimestampUTC `json:"started_at"`
}

type StreamType

type StreamType string
const (
	StreamTypeLive       StreamType = "live"
	StreamTypePlaylist   StreamType = "playlist"
	StreamTypeWatchParty StreamType = "watch_party"
	StreamTypePremiere   StreamType = "premiere"
	StreamTypeRerun      StreamType = "rerun"
)

func (StreamType) String

func (s StreamType) String() string

type Subscription

type Subscription[C Condition, T Transport] struct {
	Id        string       `json:"id"`
	Status    string       `json:"status"`
	Type      string       `json:"type"`
	Version   string       `json:"version"`
	Cost      int          `json:"cost"`
	Condition C            `json:"condition"`
	Transport T            `json:"transport"`
	CreatedAt TimestampUTC `json:"created_at"`
}

type SubscriptionTier

type SubscriptionTier string
const (
	SubscriptionTierOne   SubscriptionTier = "1000"
	SubscriptionTierTwo   SubscriptionTier = "2000"
	SubscriptionTierThree SubscriptionTier = "3000"
)

type Term

type Term struct {
	TermId                    string          `json:"term_id"`
	Boundary                  AutomodBoundary `json:"boundary"`
	OwnerBroadcasterUserId    string          `json:"owner_broadcaster_user_id"`
	OwnerBroadcasterUserLogin string          `json:"owner_broadcaster_user_login"`
	OwnerBroadcasterUserName  string          `json:"owner_broadcaster_user_name"`
}

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp is a time.Time wrapper to handle timestamps in RFC3339 format in nanoseconds.

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(payload []byte) error

type TimestampUTC

type TimestampUTC struct {
	time.Time
}

TimestampUTC is a time.Time wrapper to handle timestamps in RFC3339 format in nanoseconds with UTC location set.

func (*TimestampUTC) UnmarshalJSON

func (tu *TimestampUTC) UnmarshalJSON(payload []byte) error

type Transport

type Transport interface {
	// contains filtered or unexported methods
}

Transport is a marker for transport.

type UserAuthorizationGrantCondition

type UserAuthorizationGrantCondition struct {
	Condition
	// ClientId is your application’s client id. The provided client_id must match the client id in the application access token.
	ClientId string `json:"client_id"`
}

type UserAuthorizationRevokeCondition

type UserAuthorizationRevokeCondition struct {
	Condition
	// ClientId is your application’s client id. The provided client_id must match the client id in the application access token.
	ClientId string `json:"client_id"`
}

type UserAuthorizationRevokeEvent

type UserAuthorizationRevokeEvent struct {
	// The client_id of the application with revoked user access.
	ClientId string `json:"client_id"`
	// The user id for the user who has revoked authorization for your client id.
	UserId string `json:"user_id"`
	// The user login for the user who has revoked authorization for your client id. Not presented if the user no longer exists.
	UserLogin string `json:"user_login,omitempty"`
	// The user display name for the user who has revoked authorization for your client id. Not presented if the user no longer exists.
	UserName string `json:"user_name,omitempty"`
}

type UserUpdateCondition

type UserUpdateCondition struct {
	Condition
	// UserId is a user ID for the user you want update notifications for.
	UserId string `json:"user_id"`
}

type UserUpdateEvent

type UserUpdateEvent struct {
	// The user’s user id.
	UserId string `json:"user_id"`
	// The user’s user login.
	UserLogin string `json:"user_login"`
	// The user’s user display name.
	UserName string `json:"user_name"`
	// The user’s email.
	// Only included if you have the user:read:email scope for the user.
	Email string `json:"email,omitempty"`
	// Determines whether Twitch has verified the user’s email address.
	// Is true if Twitch has verified the email address; otherwise, false.
	// Ignore this field if the email field contains an empty string.
	EmailVerified bool `json:"email_verified"`
	// The user’s description.
	Description string `json:"description"`
}

type Webhook

type Webhook struct {
	// contains filtered or unexported fields
}

Webhook is an EventSub webhook HTTP handler.

func (*Webhook) OnAutomodMessageHold

func (c *Webhook) OnAutomodMessageHold(onAutomodMessageHold Handler[AutomodMessageHoldEvent, Metadata])

OnAutomodMessageHold invokes when message is caught by automod for review.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodmessagehold.

func (*Webhook) OnAutomodMessageHoldV2

func (c *Webhook) OnAutomodMessageHoldV2(onAutomodMessageHoldV2 Handler[AutomodMessageHoldEventV2, Metadata])

OnAutomodMessageHoldV2 invokes when message is caught by automod for review. Only public blocked terms trigger notifications, not private ones.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodmessagehold-v2.

func (*Webhook) OnAutomodMessageUpdate

func (c *Webhook) OnAutomodMessageUpdate(onAutomodMessageUpdate Handler[AutomodMessageUpdateEvent, Metadata])

OnAutomodMessageUpdate invokes when a message in the automod queue had its status changed.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodmessageupdate.

func (*Webhook) OnAutomodMessageUpdateV2

func (c *Webhook) OnAutomodMessageUpdateV2(onAutomodMessageUpdateV2 Handler[AutomodMessageUpdateEventV2, Metadata])

OnAutomodMessageUpdateV2 invokes when a message in the automod queue had its status changed. Only public blocked terms trigger notifications, not private ones.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodmessageupdate-v2.

func (*Webhook) OnAutomodSettingsUpdate

func (c *Webhook) OnAutomodSettingsUpdate(onAutomodSettingsUpdate Handler[AutomodSettingsUpdateEvent, Metadata])

OnAutomodSettingsUpdate invokes when a broadcaster’s automod settings are updated.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodsettingsupdate.

func (*Webhook) OnAutomodTermsUpdate

func (c *Webhook) OnAutomodTermsUpdate(onAutomodTermsUpdate Handler[AutomodTermsUpdateEvent, Metadata])

OnAutomodTermsUpdate invokes when a broadcaster’s automod terms are updated. Changes to private terms are not sent.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodtermsupdate.

func (*Webhook) OnChannelAdBreakBegin

func (c *Webhook) OnChannelAdBreakBegin(onChannelAdBreakBegin Handler[ChannelAdBreakBeginEvent, Metadata])

OnChannelAdBreakBegin invokes when a user runs a midroll commercial break, either manually or automatically via ads manager.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelad_breakbegin.

func (*Webhook) OnChannelBan

func (c *Webhook) OnChannelBan(onChannelBan Handler[ChannelBanEvent, Metadata])

OnChannelBan invokes when a user is banned from a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelban.

func (*Webhook) OnChannelBitsUse

func (c *Webhook) OnChannelBitsUse(onChannelBitsUse Handler[ChannelBitsUseEvent, Metadata])

OnChannelBitsUse invokes when bits are used on a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelbitsuse.

func (*Webhook) OnChannelChatClear

func (c *Webhook) OnChannelChatClear(onChannelChatClear Handler[ChannelChatClearEvent, Metadata])

OnChannelChatClear invokes when a moderator or bot clears all messages from the chat room.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatclear.

func (*Webhook) OnChannelChatClearUserMessages

func (c *Webhook) OnChannelChatClearUserMessages(onChannelChatClearUserMessages Handler[ChannelChatClearUserMessagesEvent, Metadata])

OnChannelChatClearUserMessages invokes when a moderator or bot clears all messages for a specific user.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatclear_user_messages.

func (*Webhook) OnChannelChatMessage

func (c *Webhook) OnChannelChatMessage(onChannelChatMessage Handler[ChannelChatMessageEvent, Metadata])

OnChannelChatMessage invokes when any user sends a message to a channel’s chat room.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatmessage.

func (*Webhook) OnChannelChatMessageDelete

func (c *Webhook) OnChannelChatMessageDelete(onChannelChatMessageDelete Handler[ChannelChatMessageDeleteEvent, Metadata])

OnChannelChatMessageDelete invokes when a user deletes a message in a channel's chat room.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatmessage_delete.

func (*Webhook) OnChannelChatNotification

func (c *Webhook) OnChannelChatNotification(onChannelChatNotification Handler[ChannelChatNotificationEvent, Metadata])

OnChannelChatNotification invokes when a user sends a chat notification to a channel’s chat room.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatnotification.

func (*Webhook) OnChannelFollow

func (c *Webhook) OnChannelFollow(onChannelFollow Handler[ChannelFollowEvent, Metadata])

OnChannelFollow invokes when a specified channel receives a follow.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelfollow

func (*Webhook) OnChannelModeratorAdd

func (c *Webhook) OnChannelModeratorAdd(onChannelModeratorAdd Handler[ChannelModeratorAddEvent, Metadata])

OnChannelModeratorAdd invokes when a user is added as a moderator to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelmoderatoradd.

func (*Webhook) OnChannelModeratorRemove

func (c *Webhook) OnChannelModeratorRemove(onChannelModeratorRemove Handler[ChannelModeratorRemoveEvent, Metadata])

OnChannelModeratorRemove invokes when a user is removed as a moderator from a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelmoderatorremove.

func (*Webhook) OnChannelPointsAutomaticRewardRedemptionAdd

func (c *Webhook) OnChannelPointsAutomaticRewardRedemptionAdd(onChannelPointsAutomaticRewardRedemptionAdd Handler[ChannelPointsAutomaticRewardRedemptionAddEvent, Metadata])

OnChannelPointsAutomaticRewardRedemptionAdd invokes when a user redeems an automatic channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_automatic_reward_redemptionadd.

func (*Webhook) OnChannelPointsAutomaticRewardRedemptionAddV2

func (c *Webhook) OnChannelPointsAutomaticRewardRedemptionAddV2(onChannelPointsAutomaticRewardRedemptionAddV2 Handler[ChannelPointsAutomaticRewardRedemptionAddEventV2, Metadata])

OnChannelPointsAutomaticRewardRedemptionAddV2 invokes when a user redeems an automatic channel points reward. Only public rewards trigger notifications, not private ones.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_automatic_reward_redemptionadd-v2.

func (*Webhook) OnChannelPointsCustomRewardAdd

func (c *Webhook) OnChannelPointsCustomRewardAdd(onChannelPointsCustomRewardAdd Handler[ChannelPointsCustomRewardAddEvent, Metadata])

OnChannelPointsCustomRewardAdd invokes when a broadcaster adds a custom channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_rewardadd.

func (*Webhook) OnChannelPointsCustomRewardRedemptionAdd

func (c *Webhook) OnChannelPointsCustomRewardRedemptionAdd(onChannelPointsCustomRewardRedemptionAdd Handler[ChannelPointsCustomRewardRedemptionAddEvent, Metadata])

OnChannelPointsCustomRewardRedemptionAdd invokes when a user redeems a custom channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_custom_reward_redemptionadd.

func (*Webhook) OnChannelPointsCustomRewardRedemptionUpdate

func (c *Webhook) OnChannelPointsCustomRewardRedemptionUpdate(onChannelPointsCustomRewardRedemptionUpdate Handler[ChannelPointsCustomRewardRedemptionUpdateEvent, Metadata])

OnChannelPointsCustomRewardRedemptionUpdate invokes when a user updates a custom channel points reward redemption.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_custom_reward_redemptionupdate.

func (*Webhook) OnChannelPointsCustomRewardRemove

func (c *Webhook) OnChannelPointsCustomRewardRemove(onChannelPointsCustomRewardRemove Handler[ChannelPointsCustomRewardRemoveEvent, Metadata])

OnChannelPointsCustomRewardRemove invokes when a broadcaster removes a custom channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_rewardremove.

func (*Webhook) OnChannelPointsCustomRewardUpdate

func (c *Webhook) OnChannelPointsCustomRewardUpdate(onChannelPointsCustomRewardUpdate Handler[ChannelPointsCustomRewardUpdateEvent, Metadata])

OnChannelPointsCustomRewardUpdate invokes when a broadcaster updates a custom channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_rewardupdate.

func (*Webhook) OnChannelPollBegin

func (c *Webhook) OnChannelPollBegin(onChannelPollBegin Handler[ChannelPollBeginEvent, Metadata])

OnChannelPollBegin invokes when a broadcaster starts a poll in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpollbegin.

func (*Webhook) OnChannelPollEnd

func (c *Webhook) OnChannelPollEnd(onChannelPollEnd Handler[ChannelPollEndEvent, Metadata])

OnChannelPollEnd invokes when a broadcaster ends a poll in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpollend.

func (*Webhook) OnChannelPollProgress

func (c *Webhook) OnChannelPollProgress(onChannelPollProgress Handler[ChannelPollProgressEvent, Metadata])

OnChannelPollProgress invokes when a broadcaster updates a poll in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpollprogress.

func (*Webhook) OnChannelPredictionBegin

func (c *Webhook) OnChannelPredictionBegin(onChannelPredictionBegin Handler[ChannelPredictionBeginEvent, Metadata])

OnChannelPredictionBegin invokes when a broadcaster starts a prediction in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpredictionbegin.

func (*Webhook) OnChannelPredictionEnd

func (c *Webhook) OnChannelPredictionEnd(onChannelPredictionEnd Handler[ChannelPredictionEndEvent, Metadata])

OnChannelPredictionEnd invokes when a broadcaster ends a prediction in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpredictionend.

func (*Webhook) OnChannelPredictionLock

func (c *Webhook) OnChannelPredictionLock(onChannelPredictionLock Handler[ChannelPredictionLockEvent, Metadata])

OnChannelPredictionLock invokes when a broadcaster locks a prediction in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpredictionlock.

func (*Webhook) OnChannelPredictionProgress

func (c *Webhook) OnChannelPredictionProgress(onChannelPredictionProgress Handler[ChannelPredictionProgressEvent, Metadata])

OnChannelPredictionProgress invokes when a broadcaster updates a prediction in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpredictionprogress.

func (*Webhook) OnChannelRaid

func (c *Webhook) OnChannelRaid(onChannelRaid Handler[ChannelRaidEvent, Metadata])

OnChannelRaid invokes when a channel raids another channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelraid.

func (*Webhook) OnChannelSubscribe

func (c *Webhook) OnChannelSubscribe(onChannelSubscribe Handler[ChannelSubscribeEvent, Metadata])

OnChannelSubscribe invokes when a user subscribes to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelsubscribe.

func (*Webhook) OnChannelSubscriptionEnd

func (c *Webhook) OnChannelSubscriptionEnd(onChannelSubscriptionEnd Handler[ChannelSubscriptionEndEvent, Metadata])

OnChannelSubscriptionEnd invokes when a user’s subscription to a channel ends.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelsubscriptionend.

func (*Webhook) OnChannelSubscriptionGift

func (c *Webhook) OnChannelSubscriptionGift(onChannelSubscriptionGift Handler[ChannelSubscriptionGiftEvent, Metadata])

OnChannelSubscriptionGift invokes when a user gifts a subscription to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelsubscriptiongift.

func (*Webhook) OnChannelSubscriptionMessage

func (c *Webhook) OnChannelSubscriptionMessage(onChannelSubscriptionMessage Handler[ChannelSubscriptionMessageEvent, Metadata])

OnChannelSubscriptionMessage invokes when a user sends a subscription message to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelsubscriptionmessage.

func (*Webhook) OnChannelUnban

func (c *Webhook) OnChannelUnban(onChannelUnban Handler[ChannelUnbanEvent, Metadata])

OnChannelUnban sends a notification when a viewer is unbanned from the specified channel.

https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelunban.

func (*Webhook) OnChannelUnbanRequestCreate

func (c *Webhook) OnChannelUnbanRequestCreate(onChannelUnbanRequestCreate Handler[ChannelUnbanRequestCreateEvent, Metadata])

OnChannelUnbanRequestCreate invokes when a user creates an unban request for a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelunbanrequestcreate.

func (*Webhook) OnChannelUnbanRequestResolve

func (c *Webhook) OnChannelUnbanRequestResolve(onChannelUnbanRequestResolve Handler[ChannelUnbanRequestResolveEvent, Metadata])

OnChannelUnbanRequestResolve invokes when a user resolves an unban request for a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelunbanrequestresolve.

func (*Webhook) OnChannelUpdate

func (c *Webhook) OnChannelUpdate(onChannelUpdate Handler[ChannelUpdateEvent, Metadata])

OnChannelUpdate invokes when a broadcaster updates the category, title, content classification labels, or broadcast language for their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelupdate.

func (*Webhook) OnChannelVipAdd

func (c *Webhook) OnChannelVipAdd(onChannelVipAdd Handler[ChannelVipAddEvent, Metadata])

OnChannelVipAdd invokes when a user is added as a VIP to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelvipadd.

func (*Webhook) OnChannelVipRemove

func (c *Webhook) OnChannelVipRemove(onChannelVipRemove Handler[ChannelVipRemoveEvent, Metadata])

OnChannelVipRemove invokes when a user is removed as a VIP from a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelvipremove.

func (*Webhook) OnConduitShardDisabled

func (c *Webhook) OnConduitShardDisabled(onConduitShardDisabled Handler[ConduitShardDisabledEvent, Metadata])

OnConduitShardDisabled invokes when any shard of conduit becomes disabled.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#conduitsharddisabled.

func (*Webhook) OnDuplicate

func (c *Webhook) OnDuplicate(onDuplicate func(Metadata))

OnDuplicate invokes when duplicate message is caught (this is not necessarily an event).

func (*Webhook) OnRevocation

func (wh *Webhook) OnRevocation(onRevocation func(WebhookRevocationNotification))

OnRevocation invokes when webhook subscription revocation notification is caught.

Reference: https://dev.twitch.tv/docs/eventsub/handling-webhook-events/#revoking-your-subscription.

func (*Webhook) OnStreamOffline

func (c *Webhook) OnStreamOffline(onStreamOffline Handler[StreamOfflineEvent, Metadata])

OnStreamOffline invokes when a channel goes offline.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#streamoffline.

func (*Webhook) OnStreamOnline

func (c *Webhook) OnStreamOnline(onStreamOnline Handler[StreamOnlineEvent, Metadata])

OnStreamOnline invokes when a channel goes online.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#streamonline.

func (*Webhook) OnUndefinedEvent

func (c *Webhook) OnUndefinedEvent(onUndefinedEvent func(RawEvent, Metadata))

OnUndefinedEvent invokes when event with type that is not defined in library is caught.

If this callback handler is set then ErrUndefinedEventType error will not be returned from event callback runner.

func (*Webhook) OnUserAuthorizationRevoke

func (c *Webhook) OnUserAuthorizationRevoke(onUserAuthorizationRevoke Handler[UserAuthorizationRevokeEvent, Metadata])

OnUserAuthorizationRevoke invokes when a user revokes authorization for an application.

Note: This subscription type is only supported by webhooks, and cannot be used with websockets.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#userauthorizationrevoke.

func (*Webhook) OnUserUpdate

func (c *Webhook) OnUserUpdate(onUserUpdate Handler[UserUpdateEvent, Metadata])

OnUserUpdate invokes when a user updates their profile information.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#userupdate.

func (*Webhook) OnVerification

func (wh *Webhook) OnVerification(onVerification func(WebhookCallbackVerificationNotification))

OnVerification invokes when webhook verification notification is caught.

Reference: https://dev.twitch.tv/docs/eventsub/handling-webhook-events/#verifying-the-event-message.

func (*Webhook) ServeHTTP

func (wh *Webhook) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WebhookCallbackVerificationNotification

type WebhookCallbackVerificationNotification struct {
	Challenge    string                                                       `json:"challenge"`
	Subscription Subscription[WebhookNotificationCondition, WebhookTransport] `json:"subscription"`
}

type WebhookNotificationCondition

type WebhookNotificationCondition struct {
	Condition
	BroadcasterUserId string `json:"broadcaster_user_id"`
}

type WebhookNotificationMetadata

type WebhookNotificationMetadata struct {
	MessageId           string
	MessageRetry        int
	MessageType         string
	MessageSignature    string
	MessageTimestamp    TimestampUTC
	SubscriptionType    EventType
	SubscriptionVersion string
}

type WebhookRevocationNotification

type WebhookRevocationNotification struct {
	Subscription Subscription[WebhookNotificationCondition, WebhookTransport] `json:"subscription"`
}

type WebhookTransport

type WebhookTransport struct {
	Transport
	Method   string `json:"method"`
	Callback string `json:"callback"`
}

type Websocket

type Websocket struct {
	// contains filtered or unexported fields
}

Websocket is an EventSub websocket client.

func (*Websocket) Connect

func (ws *Websocket) Connect(ctx context.Context) error

func (*Websocket) Disconnect

func (ws *Websocket) Disconnect() error

func (*Websocket) OnAutomodMessageHold

func (c *Websocket) OnAutomodMessageHold(onAutomodMessageHold Handler[AutomodMessageHoldEvent, Metadata])

OnAutomodMessageHold invokes when message is caught by automod for review.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodmessagehold.

func (*Websocket) OnAutomodMessageHoldV2

func (c *Websocket) OnAutomodMessageHoldV2(onAutomodMessageHoldV2 Handler[AutomodMessageHoldEventV2, Metadata])

OnAutomodMessageHoldV2 invokes when message is caught by automod for review. Only public blocked terms trigger notifications, not private ones.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodmessagehold-v2.

func (*Websocket) OnAutomodMessageUpdate

func (c *Websocket) OnAutomodMessageUpdate(onAutomodMessageUpdate Handler[AutomodMessageUpdateEvent, Metadata])

OnAutomodMessageUpdate invokes when a message in the automod queue had its status changed.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodmessageupdate.

func (*Websocket) OnAutomodMessageUpdateV2

func (c *Websocket) OnAutomodMessageUpdateV2(onAutomodMessageUpdateV2 Handler[AutomodMessageUpdateEventV2, Metadata])

OnAutomodMessageUpdateV2 invokes when a message in the automod queue had its status changed. Only public blocked terms trigger notifications, not private ones.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodmessageupdate-v2.

func (*Websocket) OnAutomodSettingsUpdate

func (c *Websocket) OnAutomodSettingsUpdate(onAutomodSettingsUpdate Handler[AutomodSettingsUpdateEvent, Metadata])

OnAutomodSettingsUpdate invokes when a broadcaster’s automod settings are updated.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodsettingsupdate.

func (*Websocket) OnAutomodTermsUpdate

func (c *Websocket) OnAutomodTermsUpdate(onAutomodTermsUpdate Handler[AutomodTermsUpdateEvent, Metadata])

OnAutomodTermsUpdate invokes when a broadcaster’s automod terms are updated. Changes to private terms are not sent.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#automodtermsupdate.

func (*Websocket) OnChannelAdBreakBegin

func (c *Websocket) OnChannelAdBreakBegin(onChannelAdBreakBegin Handler[ChannelAdBreakBeginEvent, Metadata])

OnChannelAdBreakBegin invokes when a user runs a midroll commercial break, either manually or automatically via ads manager.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelad_breakbegin.

func (*Websocket) OnChannelBan

func (c *Websocket) OnChannelBan(onChannelBan Handler[ChannelBanEvent, Metadata])

OnChannelBan invokes when a user is banned from a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelban.

func (*Websocket) OnChannelBitsUse

func (c *Websocket) OnChannelBitsUse(onChannelBitsUse Handler[ChannelBitsUseEvent, Metadata])

OnChannelBitsUse invokes when bits are used on a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelbitsuse.

func (*Websocket) OnChannelChatClear

func (c *Websocket) OnChannelChatClear(onChannelChatClear Handler[ChannelChatClearEvent, Metadata])

OnChannelChatClear invokes when a moderator or bot clears all messages from the chat room.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatclear.

func (*Websocket) OnChannelChatClearUserMessages

func (c *Websocket) OnChannelChatClearUserMessages(onChannelChatClearUserMessages Handler[ChannelChatClearUserMessagesEvent, Metadata])

OnChannelChatClearUserMessages invokes when a moderator or bot clears all messages for a specific user.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatclear_user_messages.

func (*Websocket) OnChannelChatMessage

func (c *Websocket) OnChannelChatMessage(onChannelChatMessage Handler[ChannelChatMessageEvent, Metadata])

OnChannelChatMessage invokes when any user sends a message to a channel’s chat room.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatmessage.

func (*Websocket) OnChannelChatMessageDelete

func (c *Websocket) OnChannelChatMessageDelete(onChannelChatMessageDelete Handler[ChannelChatMessageDeleteEvent, Metadata])

OnChannelChatMessageDelete invokes when a user deletes a message in a channel's chat room.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatmessage_delete.

func (*Websocket) OnChannelChatNotification

func (c *Websocket) OnChannelChatNotification(onChannelChatNotification Handler[ChannelChatNotificationEvent, Metadata])

OnChannelChatNotification invokes when a user sends a chat notification to a channel’s chat room.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatnotification.

func (*Websocket) OnChannelFollow

func (c *Websocket) OnChannelFollow(onChannelFollow Handler[ChannelFollowEvent, Metadata])

OnChannelFollow invokes when a specified channel receives a follow.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelfollow

func (*Websocket) OnChannelModeratorAdd

func (c *Websocket) OnChannelModeratorAdd(onChannelModeratorAdd Handler[ChannelModeratorAddEvent, Metadata])

OnChannelModeratorAdd invokes when a user is added as a moderator to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelmoderatoradd.

func (*Websocket) OnChannelModeratorRemove

func (c *Websocket) OnChannelModeratorRemove(onChannelModeratorRemove Handler[ChannelModeratorRemoveEvent, Metadata])

OnChannelModeratorRemove invokes when a user is removed as a moderator from a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelmoderatorremove.

func (*Websocket) OnChannelPointsAutomaticRewardRedemptionAdd

func (c *Websocket) OnChannelPointsAutomaticRewardRedemptionAdd(onChannelPointsAutomaticRewardRedemptionAdd Handler[ChannelPointsAutomaticRewardRedemptionAddEvent, Metadata])

OnChannelPointsAutomaticRewardRedemptionAdd invokes when a user redeems an automatic channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_automatic_reward_redemptionadd.

func (*Websocket) OnChannelPointsAutomaticRewardRedemptionAddV2

func (c *Websocket) OnChannelPointsAutomaticRewardRedemptionAddV2(onChannelPointsAutomaticRewardRedemptionAddV2 Handler[ChannelPointsAutomaticRewardRedemptionAddEventV2, Metadata])

OnChannelPointsAutomaticRewardRedemptionAddV2 invokes when a user redeems an automatic channel points reward. Only public rewards trigger notifications, not private ones.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_automatic_reward_redemptionadd-v2.

func (*Websocket) OnChannelPointsCustomRewardAdd

func (c *Websocket) OnChannelPointsCustomRewardAdd(onChannelPointsCustomRewardAdd Handler[ChannelPointsCustomRewardAddEvent, Metadata])

OnChannelPointsCustomRewardAdd invokes when a broadcaster adds a custom channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_rewardadd.

func (*Websocket) OnChannelPointsCustomRewardRedemptionAdd

func (c *Websocket) OnChannelPointsCustomRewardRedemptionAdd(onChannelPointsCustomRewardRedemptionAdd Handler[ChannelPointsCustomRewardRedemptionAddEvent, Metadata])

OnChannelPointsCustomRewardRedemptionAdd invokes when a user redeems a custom channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_custom_reward_redemptionadd.

func (*Websocket) OnChannelPointsCustomRewardRedemptionUpdate

func (c *Websocket) OnChannelPointsCustomRewardRedemptionUpdate(onChannelPointsCustomRewardRedemptionUpdate Handler[ChannelPointsCustomRewardRedemptionUpdateEvent, Metadata])

OnChannelPointsCustomRewardRedemptionUpdate invokes when a user updates a custom channel points reward redemption.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_custom_reward_redemptionupdate.

func (*Websocket) OnChannelPointsCustomRewardRemove

func (c *Websocket) OnChannelPointsCustomRewardRemove(onChannelPointsCustomRewardRemove Handler[ChannelPointsCustomRewardRemoveEvent, Metadata])

OnChannelPointsCustomRewardRemove invokes when a broadcaster removes a custom channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_rewardremove.

func (*Websocket) OnChannelPointsCustomRewardUpdate

func (c *Websocket) OnChannelPointsCustomRewardUpdate(onChannelPointsCustomRewardUpdate Handler[ChannelPointsCustomRewardUpdateEvent, Metadata])

OnChannelPointsCustomRewardUpdate invokes when a broadcaster updates a custom channel points reward.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchannel_points_rewardupdate.

func (*Websocket) OnChannelPollBegin

func (c *Websocket) OnChannelPollBegin(onChannelPollBegin Handler[ChannelPollBeginEvent, Metadata])

OnChannelPollBegin invokes when a broadcaster starts a poll in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpollbegin.

func (*Websocket) OnChannelPollEnd

func (c *Websocket) OnChannelPollEnd(onChannelPollEnd Handler[ChannelPollEndEvent, Metadata])

OnChannelPollEnd invokes when a broadcaster ends a poll in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpollend.

func (*Websocket) OnChannelPollProgress

func (c *Websocket) OnChannelPollProgress(onChannelPollProgress Handler[ChannelPollProgressEvent, Metadata])

OnChannelPollProgress invokes when a broadcaster updates a poll in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpollprogress.

func (*Websocket) OnChannelPredictionBegin

func (c *Websocket) OnChannelPredictionBegin(onChannelPredictionBegin Handler[ChannelPredictionBeginEvent, Metadata])

OnChannelPredictionBegin invokes when a broadcaster starts a prediction in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpredictionbegin.

func (*Websocket) OnChannelPredictionEnd

func (c *Websocket) OnChannelPredictionEnd(onChannelPredictionEnd Handler[ChannelPredictionEndEvent, Metadata])

OnChannelPredictionEnd invokes when a broadcaster ends a prediction in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpredictionend.

func (*Websocket) OnChannelPredictionLock

func (c *Websocket) OnChannelPredictionLock(onChannelPredictionLock Handler[ChannelPredictionLockEvent, Metadata])

OnChannelPredictionLock invokes when a broadcaster locks a prediction in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpredictionlock.

func (*Websocket) OnChannelPredictionProgress

func (c *Websocket) OnChannelPredictionProgress(onChannelPredictionProgress Handler[ChannelPredictionProgressEvent, Metadata])

OnChannelPredictionProgress invokes when a broadcaster updates a prediction in their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelpredictionprogress.

func (*Websocket) OnChannelRaid

func (c *Websocket) OnChannelRaid(onChannelRaid Handler[ChannelRaidEvent, Metadata])

OnChannelRaid invokes when a channel raids another channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelraid.

func (*Websocket) OnChannelSubscribe

func (c *Websocket) OnChannelSubscribe(onChannelSubscribe Handler[ChannelSubscribeEvent, Metadata])

OnChannelSubscribe invokes when a user subscribes to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelsubscribe.

func (*Websocket) OnChannelSubscriptionEnd

func (c *Websocket) OnChannelSubscriptionEnd(onChannelSubscriptionEnd Handler[ChannelSubscriptionEndEvent, Metadata])

OnChannelSubscriptionEnd invokes when a user’s subscription to a channel ends.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelsubscriptionend.

func (*Websocket) OnChannelSubscriptionGift

func (c *Websocket) OnChannelSubscriptionGift(onChannelSubscriptionGift Handler[ChannelSubscriptionGiftEvent, Metadata])

OnChannelSubscriptionGift invokes when a user gifts a subscription to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelsubscriptiongift.

func (*Websocket) OnChannelSubscriptionMessage

func (c *Websocket) OnChannelSubscriptionMessage(onChannelSubscriptionMessage Handler[ChannelSubscriptionMessageEvent, Metadata])

OnChannelSubscriptionMessage invokes when a user sends a subscription message to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelsubscriptionmessage.

func (*Websocket) OnChannelUnban

func (c *Websocket) OnChannelUnban(onChannelUnban Handler[ChannelUnbanEvent, Metadata])

OnChannelUnban sends a notification when a viewer is unbanned from the specified channel.

https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelunban.

func (*Websocket) OnChannelUnbanRequestCreate

func (c *Websocket) OnChannelUnbanRequestCreate(onChannelUnbanRequestCreate Handler[ChannelUnbanRequestCreateEvent, Metadata])

OnChannelUnbanRequestCreate invokes when a user creates an unban request for a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelunbanrequestcreate.

func (*Websocket) OnChannelUnbanRequestResolve

func (c *Websocket) OnChannelUnbanRequestResolve(onChannelUnbanRequestResolve Handler[ChannelUnbanRequestResolveEvent, Metadata])

OnChannelUnbanRequestResolve invokes when a user resolves an unban request for a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelunbanrequestresolve.

func (*Websocket) OnChannelUpdate

func (c *Websocket) OnChannelUpdate(onChannelUpdate Handler[ChannelUpdateEvent, Metadata])

OnChannelUpdate invokes when a broadcaster updates the category, title, content classification labels, or broadcast language for their channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelupdate.

func (*Websocket) OnChannelVipAdd

func (c *Websocket) OnChannelVipAdd(onChannelVipAdd Handler[ChannelVipAddEvent, Metadata])

OnChannelVipAdd invokes when a user is added as a VIP to a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelvipadd.

func (*Websocket) OnChannelVipRemove

func (c *Websocket) OnChannelVipRemove(onChannelVipRemove Handler[ChannelVipRemoveEvent, Metadata])

OnChannelVipRemove invokes when a user is removed as a VIP from a channel.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelvipremove.

func (*Websocket) OnConduitShardDisabled

func (c *Websocket) OnConduitShardDisabled(onConduitShardDisabled Handler[ConduitShardDisabledEvent, Metadata])

OnConduitShardDisabled invokes when any shard of conduit becomes disabled.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#conduitsharddisabled.

func (*Websocket) OnDisconnect

func (ws *Websocket) OnDisconnect(onDisconnect func())

OnDisconnect invokes when client instance is being disconnected from eventsub server.

func (*Websocket) OnDuplicate

func (c *Websocket) OnDuplicate(onDuplicate func(Metadata))

OnDuplicate invokes when duplicate message is caught (this is not necessarily an event).

func (*Websocket) OnKeepalive

func (ws *Websocket) OnKeepalive(onKeepalive func(WebsocketKeepaliveMessage))

OnKeepalive invokes when eventsub sends keepalive message which indicates that the websocket connection is healthy.

Reference: https://dev.twitch.tv/docs/eventsub/handling-websocket-events/#keepalive-message.

func (*Websocket) OnPing

func (ws *Websocket) OnPing(onPing func())

OnPing invokes when eventsub sends websocket ping frame (ping-pong cycle).

Reference: https://dev.twitch.tv/docs/eventsub/handling-websocket-events/#ping-message.

func (*Websocket) OnReconnect

func (ws *Websocket) OnReconnect(onReconnect func(WebsocketReconnectMessage))

OnReconnect invokes when eventsub sends reconnect message which indicates that the edge server that the client is connected to needs to be swapped.

Reference: https://dev.twitch.tv/docs/eventsub/handling-websocket-events/#reconnect-message.

func (*Websocket) OnReconnectError

func (ws *Websocket) OnReconnectError(onReconnectError func(error))

OnReconnectError invokes when reconnection failed and error is returned.

func (*Websocket) OnStreamOffline

func (c *Websocket) OnStreamOffline(onStreamOffline Handler[StreamOfflineEvent, Metadata])

OnStreamOffline invokes when a channel goes offline.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#streamoffline.

func (*Websocket) OnStreamOnline

func (c *Websocket) OnStreamOnline(onStreamOnline Handler[StreamOnlineEvent, Metadata])

OnStreamOnline invokes when a channel goes online.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#streamonline.

func (*Websocket) OnUndefinedEvent

func (c *Websocket) OnUndefinedEvent(onUndefinedEvent func(RawEvent, Metadata))

OnUndefinedEvent invokes when event with type that is not defined in library is caught.

If this callback handler is set then ErrUndefinedEventType error will not be returned from event callback runner.

func (*Websocket) OnUserAuthorizationRevoke

func (c *Websocket) OnUserAuthorizationRevoke(onUserAuthorizationRevoke Handler[UserAuthorizationRevokeEvent, Metadata])

OnUserAuthorizationRevoke invokes when a user revokes authorization for an application.

Note: This subscription type is only supported by webhooks, and cannot be used with websockets.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#userauthorizationrevoke.

func (*Websocket) OnUserUpdate

func (c *Websocket) OnUserUpdate(onUserUpdate Handler[UserUpdateEvent, Metadata])

OnUserUpdate invokes when a user updates their profile information.

Reference: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#userupdate.

func (*Websocket) OnWelcome

func (ws *Websocket) OnWelcome(onWelcome func(WebsocketWelcomeMessage))

OnWelcome invokes when eventsub sends welcome message to let you subscribe to events.

Reference: https://dev.twitch.tv/docs/eventsub/handling-websocket-events/#welcome-message.

type WebsocketKeepaliveMetadata

type WebsocketKeepaliveMetadata struct {
	MessageId        string       `json:"message_id"`
	MessageType      string       `json:"message_type"`
	MessageTimestamp TimestampUTC `json:"message_timestamp"`
}

type WebsocketKeepalivePayload

type WebsocketKeepalivePayload struct{}

type WebsocketMessage

type WebsocketMessage[Metadata, Payload any] struct {
	Metadata Metadata `json:"metadata"`
	Payload  Payload  `json:"payload"`
}

type WebsocketNotificationMessage

type WebsocketNotificationMessage[Event any, C Condition] struct {
	WebsocketMessage[WebsocketNotificationMetadata, WebsocketNotificationPayload[C]]
	Event Event `json:"event"`
}

type WebsocketNotificationMetadata

type WebsocketNotificationMetadata struct {
	MessageId           string       `json:"message_id"`
	MessageType         string       `json:"message_type"`
	MessageTimestamp    TimestampUTC `json:"message_timestamp"`
	SubscriptionType    EventType    `json:"subscription_type"`
	SubscriptionVersion string       `json:"subscription_version"`
}

type WebsocketNotificationPayload

type WebsocketNotificationPayload[C Condition] struct {
	Subscription Subscription[C, WebsocketTransport] `json:"subscription"`
}

type WebsocketOption

type WebsocketOption func(*Websocket)

WebsocketOption is an optional setting for Websocket.

func WebsocketWithClient

func WebsocketWithClient(client *http.Client) WebsocketOption

WebsocketWithClient sets HTTP client that will be used to connect to the eventsub websocket server.

Default value is http.DefaultClient.

func WebsocketWithKeepalive

func WebsocketWithKeepalive(seconds uint) WebsocketOption

WebsocketWithKeepalive sets timeout in seconds for Twitch to send keepalive messages to ensure that connection to server is healthy. See https://dev.twitch.tv/docs/eventsub/handling-websocket-events/#keepalive-message for more information on keepalive timeout.

Default value is 600 (Twitch's default keepalive timeout).

func WebsocketWithNoRetry

func WebsocketWithNoRetry() WebsocketOption

WebsocketWithNoRetry specifies that Websocket will not do retries when connecting to the eventsub server fails. Usually you don't want to use this option.

Default retry attempts number is 5.

func WebsocketWithRetryAttempts

func WebsocketWithRetryAttempts(attempts uint) WebsocketOption

WebsocketWithRetryAttempts sets number of retry attempts to perform when connecting to the eventsub server fails.

Default value is 5.

func WebsocketWithRetryDelay

func WebsocketWithRetryDelay(delay time.Duration) WebsocketOption

WebsocketWithRetryDelay sets delay between retries when connecting to the eventsub server fails.

Default value is 1 second.

func WebsocketWithServerURL

func WebsocketWithServerURL(serverURL string) WebsocketOption

WebsocketWithServerURL sets the URL that will be used as the URL address of the websocket eventsub server to which the client will connect. It's helpful when you want to test your Websocket client with custom server and therefore need to set a custom URL. See https://dev.twitch.tv/docs/cli/websocket-event-command for more information on how to test Websocket client.

Default value is "wss://eventsub.wss.twitch.tv/ws".

type WebsocketReconnectMetadata

type WebsocketReconnectMetadata struct {
	MessageId        string       `json:"message_id"`
	MessageType      string       `json:"message_type"`
	MessageTimestamp TimestampUTC `json:"message_timestamp"`
}

type WebsocketReconnectPayload

type WebsocketReconnectPayload struct {
	Session WebsocketSession `json:"session"`
}

type WebsocketRevocationMetadata

type WebsocketRevocationMetadata struct {
	MessageId           string       `json:"message_id"`
	MessageType         string       `json:"message_type"`
	MessageTimestamp    TimestampUTC `json:"message_timestamp"`
	SubscriptionType    string       `json:"subscription_type"`
	SubscriptionVersion string       `json:"subscription_version"`
}

type WebsocketRevocationPayload

type WebsocketRevocationPayload[C Condition] struct {
	Subscription Subscription[C, WebsocketTransport] `json:"subscription"`
}

type WebsocketSession

type WebsocketSession struct {
	Id                      string       `json:"id"`
	Status                  string       `json:"status"`
	KeepaliveTimeoutSeconds int          `json:"keepalive_timeout_seconds"`
	ReconnectURL            string       `json:"reconnect_url"`
	ConnectedAt             TimestampUTC `json:"connected_at"`
}

type WebsocketTransport

type WebsocketTransport struct {
	Transport
	Method    string `json:"method"`
	SessionId string `json:"session_id"`
}

type WebsocketWelcomeMetadata

type WebsocketWelcomeMetadata struct {
	MessageId        string       `json:"message_id"`
	MessageType      string       `json:"message_type"`
	MessageTimestamp TimestampUTC `json:"message_timestamp"`
}

type WebsocketWelcomePayload

type WebsocketWelcomePayload struct {
	Session WebsocketSession `json:"session"`
}

type WhisperReceivedCondition

type WhisperReceivedCondition struct {
	Condition
	// UserId is a user_id of the person receiving whispers
	UserId string `json:"user_id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL