I’m not sure if this is the correct area to post in, but I have a question I’ve been trying to figure out. I have an application that supports Twitch, but it needs to listen to multiple channels and return commands to the correct client page.
It seems as though a bot system may be the best way to do this, but that may also be outdated thinking. The application will have a dedicated html/Javascript landing page, and could potentially support a Node socket.io server to help the link as well.
What is the best method to listen for ! commands that are supplied by a list in the application, per channel?
Thank you, that’s what I was planning on but not quite sure. A lot has changed since I built my first bot, and that was only for a single dedicated channel. This new bot won’t be as chatty, and will have to listen on channels it’s invited to only, while forwarding the commands to the correct sockets. I am playing with the TMI.js Twitch Bot base in Node to create it.
Pubsub is for listening to specific events (ie, Cheers, Subs, Commerce, and Whispers), not general chat. Your best option is to use an IRC library, there’s several designed specifically for Twitch for a variety of languages, and just listening to chat seeing if the messages contain your command.
Thanks, yeah. That’s the intention so far. Like said, I found and have been playing with the TMI.js library. Makes it a lot simpler then writing your own bot in C#.
TMI.js is a great start for basic stuff, but unfortunately has fallen far behind on updates for the new features (such as gifted subs). Personally I’ve started using Twitch-js https://github.com/marcandrews/twitch-js for my Node app, very similar to TMI.js but much more up to date. If all you need is reading/responding to chat messages though, they’ll do that job equally well.
Thanks, I’ll take a look at that as well. It’s early enough that I have no problem switching libraries if needed. I have noticed some disconnection issues with TMI.js, despite it already having .ping replies.