[eventsub] Update field naming for ad-break, use V1 event

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-12-12 15:59:03 +01:00
parent 300d28c46c
commit 091dac235b
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5
2 changed files with 4 additions and 2 deletions

View file

@ -51,13 +51,15 @@ type (
} }
EventSubEventAdBreakBegin struct { EventSubEventAdBreakBegin struct {
Duration int64 `json:"duration"` Duration int64 `json:"duration_seconds"`
Timestamp time.Time `json:"timestamp"` Timestamp time.Time `json:"timestamp"`
IsAutomatic bool `json:"is_automatic"` IsAutomatic bool `json:"is_automatic"`
BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserID string `json:"broadcaster_user_id"`
BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserLogin string `json:"broadcaster_user_login"`
BroadcasterUserName string `json:"broadcaster_user_name"` BroadcasterUserName string `json:"broadcaster_user_name"`
RequesterUserID string `json:"requester_user_id"` RequesterUserID string `json:"requester_user_id"`
RequesterUserLogin string `json:"requester_user_login"`
RequesterUserName string `json:"requester_user_name"`
} }
EventSubEventChannelPointCustomRewardRedemptionAdd struct { EventSubEventChannelPointCustomRewardRedemptionAdd struct {

View file

@ -114,7 +114,7 @@ func (t *twitchWatcher) getTopicRegistrations(userID string) []topicRegistration
return []topicRegistration{ return []topicRegistration{
{ {
Topic: twitch.EventSubEventTypeChannelAdBreakBegin, Topic: twitch.EventSubEventTypeChannelAdBreakBegin,
Version: twitch.EventSubTopicVersionBeta, Version: twitch.EventSubTopicVersion1,
Condition: twitch.EventSubCondition{BroadcasterUserID: userID}, Condition: twitch.EventSubCondition{BroadcasterUserID: userID},
RequiredScopes: []string{twitch.ScopeChannelReadAds}, RequiredScopes: []string{twitch.ScopeChannelReadAds},
Hook: t.handleEventSubChannelAdBreakBegin, Hook: t.handleEventSubChannelAdBreakBegin,