27 lines
803 B
Go
27 lines
803 B
Go
package twitch
|
|
|
|
// EventSub is the wire format of incoming payloads from Twitch EventSub.
|
|
type EventSub[Event any] struct {
|
|
// Subscription is fields relating to the EventSub subscription itself.
|
|
Subscription Subscription `json:"subscription"`
|
|
// Event is the event payload.
|
|
Event Event `json:"event"`
|
|
// Challenge is payload for verification challenges.
|
|
Challenge string `json:"challenge"`
|
|
}
|
|
|
|
// Subscription is the fields of an EventSub subscription
|
|
// which are relevant to Kaiyan.
|
|
type Subscription struct {
|
|
// Status is the subscription status.
|
|
// For revocation messages, this holds the reason for revocation.
|
|
Status string `json:"status"`
|
|
}
|
|
|
|
// EventSub message types.
|
|
const (
|
|
Notification = "notification"
|
|
Verification = "webhook_callback_verification"
|
|
Revocation = "revocation"
|
|
)
|