TwitchLib / TwitchLib.PubSub

PubSub component of TwitchLib.
38 stars 52 forks source link

Add support for raid_cancel_v2 event #117

Closed pilky closed 1 year ago

pilky commented 1 year ago

Hi, this is a fix for issue #110 which I filed a while ago. I've tested in my own project and it seems to work just fine (fixing the issue of PubSub breaking when this event was trigged). I've modelled the event on the OnRaidGo event as they contain pretty much identical data in the actual message.

I've included the raw message Twitch sends below in case you want to reference it. Please let me know if there are any changes or improvements you'd need me to make

{"type":"MESSAGE","data":{"topic":"raid.23678658","message":"{\"type\":\"raid_cancel_v2\",\"raid\":{\"id\":\"1d1fed75-4015-41d3-80c7-6d390220f3f4\",\"creator_id\":\"23678658\",\"source_id\":\"23678658\",\"target_id\":\"835434545\",\"target_login\":\"ladyvignette\",\"target_display_name\":\"LadyVignette\",\"target_profile_image\":\"https://static-cdn.jtvnw.net/jtv_user_pictures/09ed28e3-d790-491c-92c6-cd619fd0ad85-profile_image-%s.png\",\"transition_jitter_seconds\":0,\"force_raid_now_seconds\":90,\"viewer_count\":6}}"}}
pilky commented 1 year ago

Should now be pointing to dev