feat: Add V2 Hype Train EventSub events#361
Open
mphacker wants to merge 1 commit intotwitchdev:mainfrom
Open
Conversation
Add support for V2 Hype Train events (begin, progress, end) matching the current Twitch EventSub API. V2 adds type (regular/treasure/ golden_kappa), is_shared_train, shared_train_participants, and all_time_high_level/all_time_high_total fields for begin events. V2 removes last_contribution (replaced by top_contributions only). V1 events are preserved for backward compatibility but marked as removed in RemovedEvents() since Twitch no longer lists V1. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for V2 Hype Train EventSub events (channel.hype_train.begin, .progress, .end), matching the current Twitch EventSub API which has moved to version 2.
Changes
New V2 fields added:
type(string): regular, treasure, golden_kappa - the Hype Train variantis_shared_train(boolean): whether this is a shared Hype Trainshared_train_participants(array|null): list of broadcasters in a shared trainall_time_high_level/all_time_high_total(begin event only)V2 fields removed vs V1:
last_contributionremoved (onlytop_contributionsremains in V2)Files changed:
internal/models/hype_train.go- Added V2 model structsinternal/events/types/hype_train_v2/hype_train_event.go- New V2 event handlerinternal/events/types/hype_train_v2/hype_train_event_test.go- Tests for all triggersinternal/events/types/types.go- Registered V2, deprecated V1docs/event.md- Updated documentationDesign decisions
Testing