-
Notifications
You must be signed in to change notification settings - Fork 0
Chat Bot
Describe the structure of the Chatbot and how it works.
Chatbot manages Strimer's chat with games and voting. It can be divided into two main structures. Link chat to game.

Chat is basically using a twitch chat server. Connect to the chat server using tmijs.API. The information you need is a Chatbot account and an account token. Use this information to connect to the chat server. Bot's chatting is basically done by checking the viewer's chatting and responding. Parse the viewer's chat and make the appropriate response (from basic command to voting). At present, it contains only basic instructions.
Chatbot creates a server that connects to the chat server and also enables the connection of games (clients). For connections, use socket.io in nodejs. Check when client (game) is connected and prepare to receive voting information. When the voting information is complete, the chat server is informed of which voting has begun. After voting for a limited time, send the results back to the game. There are two main types of voting : basic voting and key word voting. Basic voting is a popular vote, with options. The game is forwarded to the player with the most votes of the options. Vote keywords are given the word to the client to inform the viewer that the keyword is typed each time.