1 year ago

Oki I got the backend for the Twitch Overlay Outfit Switching done :3

I will explain exactly how it works in the Article owO

Note that I will not be going into how to set up any of the Initial Websocket stuff,,


ok so we subscribe to channel.poll.end (to get a websocket notification of the poll results)

by sending a request to

https://api.twitch.tv/helix/eventsub/subscriptions

with the data looking something like this,,

image.png

and we also have to put channel:manage:polls in our websocket authorization scopes :3

now when someone redeems this Reward:

image.png

we send a request to https://api.twitch.tv/helix/polls

with the data looking something like this:

{"broadcaster_id":"123456","title":"Streaming next Tuesday. Which time works best for you?","choices":[{"title":"9AM"},{"title":"10AM"},{"title":"7PM"},{"title":"8PM"},{"title":"9PM"}],"duration":300}

(directly taken from twitch's documentation)

the headers are ofc as always

["Authorization: Bearer 'token'", "Client-id: 'clientid'", "Content-Type: application/json"]

all of that STARTS a poll,, since we subscribed to the channel.poll.end websocket notification, we just have to wait for that, which is under "metadata" / "subscription_type" in the response.

which is well,, gonna be "channel.poll.end" on the end of a poll... then we just do this...

image.png

which basically just puts the results INDIVIDUALLY into an array and then uses a custom sort algorithm on it (from most to least)

then we take the first result voteresult[0] which gives us something like [amount_of_votes, "Choice Name"]

then we get [1] on that, to get the name :3 and that's all uwu



3 comments

Loading...

Next up

The combat system is already being implemented and there are also some advances with the environment (WIP)

#gamedev #indiedev #godot

We’re excited to announce that we’re working on a new game, a 3D metroidvania with a Low Poly Pixel Art style. Stay tuned for more updates!!!

#gamedev #indiedev #pixelart

Zombie in action! #GameDev #Art #PixelArt

Heya! I wanted to show some gameplay progress i made so far. I hope you like it ^^

Back in my art school days I used to ride the 710 COPSA line from Parque Del Plata to Montevideo almost everyday. This is the Marcopolo Viaggio G4 Mercedes Benz model from the late 80s, one of the older bus models that was running on the line.

Update 2.627

New challenges & new effects!

a drawing I did because I was bored😪. But I love how it turned out.😊

Some time ago, we posted a screenshot of the Mexico level. A curiosity about it is that, like some other scenarios of the game, it was inspired by a real landscape, The Basaltic Prisms of Santa María Regla. It is one of the natural wonders of the country!

The Authority decided to investigate the Basement and leads to recovering classified documents Fun fact: The building has 928 doors and not 1000 doors. #horror