Skip to content

Commit 731ce2c

Browse files
authored
fix: split event and subscription id
1 parent 83b47aa commit 731ce2c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmd/events.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var (
3131
toUser string
3232
giftUser string
3333
eventID string
34+
eventMessageID string
3435
secret string
3536
eventStatus string
3637
subscriptionStatus string
@@ -166,7 +167,8 @@ func init() {
166167
triggerCmd.Flags().StringVarP(&description, "description", "d", "", "Title the stream should be updated with.")
167168
triggerCmd.Flags().StringVarP(&gameID, "game-id", "G", "", "Sets the game/category ID for applicable events.")
168169
triggerCmd.Flags().StringVarP(&tier, "tier", "", "", "Sets the subscription tier. Valid values are 1000, 2000, and 3000.")
169-
triggerCmd.Flags().StringVarP(&eventID, "subscription-id", "u", "", "Manually set the subscription/event ID of the event itself.") // TODO: This description will need to change with https://github.com/twitchdev/twitch-cli/issues/184
170+
triggerCmd.Flags().StringVarP(&eventID, "subscription-id", "u", "", "Manually set the subscription/event ID of the event itself.")
171+
triggerCmd.Flags().StringVarP(&eventMessageID, "event-id", "I", "", "Manually set the Twitch-Eventsub-Message-Id header value for the event.")
170172
triggerCmd.Flags().StringVar(&timestamp, "timestamp", "", "Sets the timestamp to be used in payloads and headers. Must be in RFC3339Nano format.")
171173
triggerCmd.Flags().IntVar(&charityCurrentValue, "charity-current-value", 0, "Only used for \"charity-*\" events. Manually set the current dollar value for charity events.")
172174
triggerCmd.Flags().IntVar(&charityTargetValue, "charity-target-value", 1500000, "Only used for \"charity-*\" events. Manually set the target dollar value for charity events.")
@@ -188,7 +190,8 @@ func init() {
188190
verifyCmd.Flags().StringVarP(&transport, "transport", "T", "webhook", fmt.Sprintf("Preferred transport method for event. Defaults to EventSub.\nSupported values: %s", events.ValidTransports()))
189191
verifyCmd.Flags().StringVarP(&secret, "secret", "s", "", "Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC and must be 10-100 characters in length.")
190192
verifyCmd.Flags().StringVar(&timestamp, "timestamp", "", "Sets the timestamp to be used in payloads and headers. Must be in RFC3339Nano format.")
191-
verifyCmd.Flags().StringVarP(&eventID, "subscription-id", "u", "", "Manually set the subscription/event ID of the event itself.") // TODO: This description will need to change with https://github.com/twitchdev/twitch-cli/issues/184
193+
verifyCmd.Flags().StringVarP(&eventID, "subscription-id", "u", "", "Manually set the subscription/event ID of the event itself.")
194+
verifyCmd.Flags().StringVarP(&eventMessageID, "event-id", "I", "", "Manually set the Twitch-Eventsub-Message-Id header value for the event.")
192195
verifyCmd.Flags().StringVarP(&version, "version", "v", "", "Chooses the EventSub version used for a specific event. Not required for most events.")
193196
verifyCmd.Flags().BoolVarP(&noConfig, "no-config", "D", false, "Disables the use of the configuration, if it exists.")
194197
verifyCmd.Flags().StringVarP(&toUser, "broadcaster", "b", "", "User ID of the broadcaster for the verification event.")
@@ -248,6 +251,7 @@ func triggerCmdRun(cmd *cobra.Command, args []string) error {
248251
res, err := trigger.Fire(trigger.TriggerParameters{
249252
Event: args[0],
250253
EventID: eventID,
254+
EventMessageID: eventMessageID,
251255
Transport: transport,
252256
ForwardAddress: forwardAddress,
253257
FromUser: fromUser,
@@ -277,6 +281,7 @@ func triggerCmdRun(cmd *cobra.Command, args []string) error {
277281
return err
278282
}
279283

284+
fmt.Println("PEOS")
280285
fmt.Println(res)
281286
}
282287

@@ -368,6 +373,7 @@ https://dev.twitch.tv/docs/eventsub/handling-webhook-events#processing-an-event`
368373
Secret: secret,
369374
Timestamp: timestamp,
370375
EventID: eventID,
376+
EventMessageID: eventMessageID,
371377
BroadcasterUserID: toUser,
372378
Version: version,
373379
})

0 commit comments

Comments
 (0)