[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 {
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 {

View file

@ -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,