twitchdev/twitch-cli

EventSub trigger sets `Twitch-Eventsub-Subscription-Type` to empty string

Closed this issue · 0 comments

Running twitch event trigger channel.channel_points_custom_reward_redemption.add -F http://localhost:8080/eventsub -s {secret}, will set the Twitch-Eventsub-Subscription-Type header to ''.

Running the command will execute with the following values:

args[0] = 'channel.channel_points_custom_reward_redemption.add'

Event: args[0],

p.Event = 'channel.channel_points_custom_reward_redemption.add', p.Transport = 'eventsub'
e, err := types.GetByTriggerAndTransport(p.Event, p.Transport)

e = channel_points_redemption::Event
Event: e.GetTopic(p.Transport, p.Event),

transport = 'eventsub', trigger = 'channel.channel_points_custom_reward_redemption.add' ⚠️ this isn't a key into the map
func (e Event) GetTopic(transport string, trigger string) string {
return triggerMapping[transport][trigger]
}

var triggerMapping = map[string]map[string]string{
models.TransportEventSub: {
"add-redemption": "channel.channel_points_custom_reward_redemption.add",
"update-redemption": "channel.channel_points_custom_reward_redemption.update",
},
}

p.Event = ''
req.Header.Set("Twitch-Eventsub-Subscription-Type", p.Event)