Compare commits

...

2 commits

Author SHA1 Message Date
0e4a963bc7
[eventsub] Fix: Twitch renamed field in adbreak_begin
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2024-03-25 22:23:31 +01:00
3f376cb2ce
[docs] Fix: Add missing documentation for adbreak_begin
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2024-03-25 22:13:13 +01:00
3 changed files with 13 additions and 2 deletions

View file

@ -2,6 +2,17 @@
title: "Available Events" title: "Available Events"
--- ---
## `adbreak_begin`
Ad-break has begun and ads are playing now in mentioned channel.
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?
- `started_at` - When did the ad-break start
## `ban` ## `ban`
Moderator action caused a user to be banned from chat. Moderator action caused a user to be banned from chat.

View file

@ -60,7 +60,7 @@ type (
// EventSubEventAdBreakBegin contains the payload for an AdBreak event // EventSubEventAdBreakBegin contains the payload for an AdBreak event
EventSubEventAdBreakBegin struct { EventSubEventAdBreakBegin struct {
Duration int64 `json:"duration_seconds"` Duration int64 `json:"duration_seconds"`
Timestamp time.Time `json:"timestamp"` StartedAt time.Time `json:"started_at"`
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"`

View file

@ -245,7 +245,7 @@ func (*twitchWatcher) handleEventSubChannelAdBreakBegin(m json.RawMessage) error
"channel": "#" + payload.BroadcasterUserLogin, "channel": "#" + payload.BroadcasterUserLogin,
"duration": payload.Duration, "duration": payload.Duration,
"is_automatic": payload.IsAutomatic, "is_automatic": payload.IsAutomatic,
"timestamp": payload.Timestamp, "started_at": payload.StartedAt,
}) })
log.WithFields(log.Fields(fields.Data())).Info("Ad-Break started") log.WithFields(log.Fields(fields.Data())).Info("Ad-Break started")