Skip to content

Commit

Permalink
fix: split event ids
Browse files Browse the repository at this point in the history
  • Loading branch information
SputNikPlop authored Apr 10, 2024
1 parent 96fac28 commit e35b269
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/events/trigger/trigger_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ type TriggerParameters struct {
GameID string
Tier string
Timestamp string
EventID string // Also serves as subscription ID. See https://github.com/twitchdev/twitch-cli/issues/184
EventID string
EventMessageID string
CharityCurrentValue int
CharityTargetValue int
ClientID string
Expand Down Expand Up @@ -98,8 +99,8 @@ func Fire(p TriggerParameters) (string, error) {
"Valid values are 1000, 2000 or 3000")
}

if p.EventID == "" {
p.EventID = util.RandomGUID()
if p.EventMessageID == "" {
p.EventMessageID = util.RandomGUID()
}

if p.Timestamp == "" {
Expand Down Expand Up @@ -194,6 +195,7 @@ https://dev.twitch.tv/docs/eventsub/handling-webhook-events#processing-an-event`
Secret: p.Secret,
ForwardAddress: p.ForwardAddress,
Event: topic,
EventMessageID: p.EventMessageID,
Type: messageType,
SubscriptionVersion: e.SubscriptionVersion(),
})
Expand Down

0 comments on commit e35b269

Please sign in to comment.