Twitch interaction

So I wanted to write a module to make twitch interact with in-game events:

Example:
The roblox server launches a vote in a twitch stream, after the vote ends the vote results is returned to the roblox server.

Also:
When a viewer say !play and an object spawns in the roblox game

How would I do that? I am not asking for a whole code just for ideas or small code snippets if they are important.

2 Likes

httpservice?

Well I was thinking about that but Twitch uses IRC for messages in chat

well i cant help you as i dont use twitch and i dont know anything about twitch

Thanks anyway, if you know anything how to have events triggered by API ect tell me

In general, you would need to have external server for it, as Roblox doesn’t support IRC.

So let me explain it better:

You would need to code an some webserver, which would have some endpoints: CreateVoteRequest, ReturnVoteResult, ReturnChatRequests

So Roblox Server sends to CreateVoteRequest data with question and variants.

After vote ends, external server checks for vote results by using Twitch API and then waits for Roblox server to access it, also same thing could be happen with chat messages, just checking messages, which matches to it and wait roblox server.

You can use loop check every few seconds for it on script.

In general, it’s not that easy work to do, if you don’t know another programming languages as Node.JS, Python and etc.

So I can wish only good luck with that.

It’s what I can tell by my knowledge.

2 Likes

I believe twitch uses WebSockets for their chat, so you would have to use an intermediate server.

If you want to keep it simple, you can create an express app with node.js, and tell the viewers to go on an URL to vote. You can use the long-polling technique to return the values to the Roblox server.

1 Like