pajlada / go-twitch-pubsub

Twitch PubSub library for Go
MIT License
21 stars 9 forks source link

Added channel points topic support #7

Closed Aiuzu42 closed 2 years ago

Aiuzu42 commented 2 years ago

Added support to subscribe to a topic for the channel points redemption event. Example usage:

channelId := "aghagnaisgnas" //example target channel ID
oAuthToken := ""sasngassugngasg" //example oauth access token, requires channel:read:redemptions scope con target channel
pubsubClient := twitchpubsub.NewClient(twitchpubsub.DefaultHost)
pubsubClient.Listen(twitchpubsub.PointsEventTopic(channelId), oAuthToken)
pubsubClient.OnPointsEvent(onChannelPointsRedeemed)
go pubsubClient.Start()