mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-14 02:52:42 +00:00
[eventsub] Update field naming for ad-break, use V1 event
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
300d28c46c
commit
091dac235b
2 changed files with 4 additions and 2 deletions
|
@ -51,13 +51,15 @@ type (
|
||||||
}
|
}
|
||||||
|
|
||||||
EventSubEventAdBreakBegin struct {
|
EventSubEventAdBreakBegin struct {
|
||||||
Duration int64 `json:"duration"`
|
Duration int64 `json:"duration_seconds"`
|
||||||
Timestamp time.Time `json:"timestamp"`
|
Timestamp time.Time `json:"timestamp"`
|
||||||
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"`
|
||||||
BroadcasterUserName string `json:"broadcaster_user_name"`
|
BroadcasterUserName string `json:"broadcaster_user_name"`
|
||||||
RequesterUserID string `json:"requester_user_id"`
|
RequesterUserID string `json:"requester_user_id"`
|
||||||
|
RequesterUserLogin string `json:"requester_user_login"`
|
||||||
|
RequesterUserName string `json:"requester_user_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
EventSubEventChannelPointCustomRewardRedemptionAdd struct {
|
EventSubEventChannelPointCustomRewardRedemptionAdd struct {
|
||||||
|
|
|
@ -114,7 +114,7 @@ func (t *twitchWatcher) getTopicRegistrations(userID string) []topicRegistration
|
||||||
return []topicRegistration{
|
return []topicRegistration{
|
||||||
{
|
{
|
||||||
Topic: twitch.EventSubEventTypeChannelAdBreakBegin,
|
Topic: twitch.EventSubEventTypeChannelAdBreakBegin,
|
||||||
Version: twitch.EventSubTopicVersionBeta,
|
Version: twitch.EventSubTopicVersion1,
|
||||||
Condition: twitch.EventSubCondition{BroadcasterUserID: userID},
|
Condition: twitch.EventSubCondition{BroadcasterUserID: userID},
|
||||||
RequiredScopes: []string{twitch.ScopeChannelReadAds},
|
RequiredScopes: []string{twitch.ScopeChannelReadAds},
|
||||||
Hook: t.handleEventSubChannelAdBreakBegin,
|
Hook: t.handleEventSubChannelAdBreakBegin,
|
||||||
|
|
Loading…
Reference in a new issue