From 091dac235b67631802975a629897b39b0f3bb665 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 12 Dec 2023 15:59:03 +0100 Subject: [PATCH] [eventsub] Update field naming for ad-break, use V1 event Signed-off-by: Knut Ahlers --- pkg/twitch/eventsub.go | 4 +++- twitchWatcher.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/twitch/eventsub.go b/pkg/twitch/eventsub.go index 52b5706..75cbfa8 100644 --- a/pkg/twitch/eventsub.go +++ b/pkg/twitch/eventsub.go @@ -51,13 +51,15 @@ type ( } EventSubEventAdBreakBegin struct { - Duration int64 `json:"duration"` + Duration int64 `json:"duration_seconds"` Timestamp time.Time `json:"timestamp"` IsAutomatic bool `json:"is_automatic"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` RequesterUserID string `json:"requester_user_id"` + RequesterUserLogin string `json:"requester_user_login"` + RequesterUserName string `json:"requester_user_name"` } EventSubEventChannelPointCustomRewardRedemptionAdd struct { diff --git a/twitchWatcher.go b/twitchWatcher.go index 24043e9..2644f89 100644 --- a/twitchWatcher.go +++ b/twitchWatcher.go @@ -114,7 +114,7 @@ func (t *twitchWatcher) getTopicRegistrations(userID string) []topicRegistration return []topicRegistration{ { Topic: twitch.EventSubEventTypeChannelAdBreakBegin, - Version: twitch.EventSubTopicVersionBeta, + Version: twitch.EventSubTopicVersion1, Condition: twitch.EventSubCondition{BroadcasterUserID: userID}, RequiredScopes: []string{twitch.ScopeChannelReadAds}, Hook: t.handleEventSubChannelAdBreakBegin,