[eventsub] Fix: Twitch renamed field in adbreak_begin

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-03-25 22:23:31 +01:00
parent 3f376cb2ce
commit 0e4a963bc7
Signed by: luzifer
SSH Key Fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E
3 changed files with 3 additions and 3 deletions

View File

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

View File

@ -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"`

View File

@ -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")