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:
- Start a new project and drop this code into Program.cs
- Convert your password to an OAuth token which you can do here: https://twitchapps.com/tmi/
- ?
- 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. She also streams high production-value low ELO games on Twitch, and thinks bees are cool.
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 ?
Hi,
This has actually been fixed in the latest commit from Arteia! check it out.
Hi!
I’ve been trying to send commands to the chat, but still now working =(
what’s going on? any more information than ‘not working’? lol
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