
Once you’re done with that you’re ready to get an OAuth token. You just setup an account like any other twitch account. Unless you want your main account talking as a bot it’s good practice to have an account specifically for it. This is a good time to create a new Twitch account if you haven’t already. An OAuth token is basically a password that Twitch gives you to authenticate with their APIs. So what password should you be using here? Well if we check Twitch’s IRC guide you’ll see they say to use an OAuth token. You might find other Twitch IRC libraries using the USER command but it is not necessary.Īs the specification says, we just need to send a PASS command followed by a NICK command, so PASS secretpasswordhere NICK simple_irc_bot_name We’re looking for the PASS and NICK commands. What we’re looking for is in Section 4.1 Connection Registration. Don’t worry it’s not very complicated, and luckily in the context of Twitch bots most of these commands are not used or are not needed.


Whenever you have a question about how to do “X” in IRC, you should look at the IRC specification. That would send a message in the chat of /twitchnamehere, but before you can just send messages like this you need to tell Twitch who you are, basically you need to login. For example sending a message is as simple as writing PRIVMSG #twitchchannelname :message goes here! This is a simple protocol that uses plain text messages as commands. They use Internet Relay Chat Protocol(IRC) to communicate with Twitch’s servers. Ultimately I’ve realized that for something simple like a Twitch bot a library isn’t necessary.

Using a library is great for getting things started but I’ve found that I usually run into issues with the library later on. I’ve written a few Twitch bots and I’ve almost always used whatever library comes up first in a Google search. Writing a Twitch Bot From Scratch in C# (.NET Core)
