Twitch ChatBot base in C# .NET

Twitch Chat Is Not IRC, It Just Looks Like It.  Don’t Use IRC Libraries.  Roll Your Own.  Trust Me On This.

If (can code), and want a bot you can run on your PC and customize to your liking, here’s how to do it.  This was written in an afternoon in C# .NET using Visual Studio 2015.

Some steps:

  1. Start a new project and drop this code into Program.cs
  2. Convert your password to an OAuth token which you can do here: https://twitchapps.com/tmi/
  3. ?
  4. Profit

https://github.com/chhopsky/twitchat

Now go, create!  You can make bots that do stuff based on things happening on your computer or wherever or oh god the possibilities

For more streaming tips, analysis, and memes that aren’t really funny, follow @chhopsky on twitter.  He also streams high production-value low ELO games on Twitch, and thinks bees are cool.

5 thoughts on “Twitch ChatBot base in C# .NET

  1. I cant get the idea, we need to use windows forms for

    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);

    But you just entered code before opening form, we are just codding like console app but we are not. One more question, bot isn’t sending anything to channel do you have any idea why stream.Write(announce, 0, announce.Length); dont work ?

          1. I’ve tried this code today and announce indeed doesn’t work. Twitch sends back “unknown command”. What fixed it for me was changing announcestring declaration to this:
            string announcestring = “PRIVMSG #” + channel + ” :BOT ENABLED\r\n”;
            note the absence of username, ‘#’ before the channel and ‘:’ before the message.
            Overall a nice piece of code to get going. Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *