From 0e4a963bc7a0980e1bc2827e3d4ce3591f590b59 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 25 Mar 2024 22:23:31 +0100 Subject: [PATCH] [eventsub] Fix: Twitch renamed field in `adbreak_begin` Signed-off-by: Knut Ahlers --- docs/content/configuration/events.md | 2 +- pkg/twitch/eventsub.go | 2 +- twitchWatcher.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/configuration/events.md b/docs/content/configuration/events.md index d808faa..d8f5da7 100644 --- a/docs/content/configuration/events.md +++ b/docs/content/configuration/events.md @@ -11,7 +11,7 @@ Fields: - `channel` - The channel the event occurred in - `duration` - Duration of the ads in seconds - `is_automatic` - Were the ads started by the ad-manager? -- `timestamp` - When did the ad-break start +- `started_at` - When did the ad-break start ## `ban` diff --git a/pkg/twitch/eventsub.go b/pkg/twitch/eventsub.go index 690bf92..9e614c8 100644 --- a/pkg/twitch/eventsub.go +++ b/pkg/twitch/eventsub.go @@ -60,7 +60,7 @@ type ( // EventSubEventAdBreakBegin contains the payload for an AdBreak event EventSubEventAdBreakBegin struct { Duration int64 `json:"duration_seconds"` - Timestamp time.Time `json:"timestamp"` + StartedAt time.Time `json:"started_at"` IsAutomatic bool `json:"is_automatic"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` diff --git a/twitchWatcher.go b/twitchWatcher.go index 016f4d3..44ca537 100644 --- a/twitchWatcher.go +++ b/twitchWatcher.go @@ -245,7 +245,7 @@ func (*twitchWatcher) handleEventSubChannelAdBreakBegin(m json.RawMessage) error "channel": "#" + payload.BroadcasterUserLogin, "duration": payload.Duration, "is_automatic": payload.IsAutomatic, - "timestamp": payload.Timestamp, + "started_at": payload.StartedAt, }) log.WithFields(log.Fields(fields.Data())).Info("Ad-Break started")