JS chatbot documentation differentiation

Hello! I’m attempting to write a chat bot in javascript but am having some difficulties getting it to go live. When looking at the twitch documentation on the developers page the example is a bot written using tmi.js packages. [https://dev.twitch.tv/docs/irc/] However there is a github page for a chat bot that doesn’t use tmi.js and is written completely different. [https://github.com/twitchdev/chat-samples/tree/master/javascript] I’m wondering which method is better to follow, as I’m still very new to javascript.

Twitch Chat at it’s core is just IRC, and you can connect to it using a IRC/websocket library. If you want to do it all yourself and directly use websockets like the chat sample github project you linked then you’ll have to do everything yourself, including handling connection errors, responding to PING events etc… Using a library designed for Twitch chat will take care of most of the behind the scenes stuff for you.

As for tmi.js, it’s very outdated and barely maintained so most users have switched over to using https://github.com/twitch-apis/twitch-js which is a community updated version of the library and is very active.

1 Like

Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.