Twitch chat bot 101 C#

How to build a twitch IRC chat bot in C#. — Watch live at



  • . 2 years ago

    Soo you are good in c#

  • TheLilcrash15 2 years ago

    mine stops fetching chat after about 5 minutes or so… Anyone know why this is or have an idea what im missing?

  • Damian Ryse 2 years ago

    oh my god! Please write good code! Never ever mix up the logical part with the UI part. That's a no-go!

  • RobbieW 2 years ago

    Is there a way to split the membership up, Like how do I get the result, or the string that it sends out with all of the members?

  • james Dudley 2 years ago

    can you make a second video explaining how to read the and use the information in ur code

  • Kingga 2 years ago

    The way I avoided the bot ban was using four variables (int maxTimer, currentTimer, maxMessage, currentMsgCount) and my timers interval was 1 second. Everytime the timer event was called I checked if (currentTimer > maxTimer) and if it was I would reset currentTimer and currentMsgCount back to zero and if it wasn't I would increment currentTimer by 1. Everytime I tried to send a message I checked with this condition statement "if (currentTimer < maxTimer && currentMsgCount < maxMessages)" and if it was true I would send the message and increment currentMsgCount by 1.

    Heres a pastebin of my IrcClient class if none of that made sense:

  • Kbalz Bar 2 years ago

    instead of timer, any way you can use the new async and awaits ? WriteLineAsync() ?

  • Daedric Johnson 2 years ago

    this is the shiit i love xd

  • John Fogarty 2 years ago


  • Ahmad Here 2 years ago

    Can I plz get some help..
    PASS:AUTH:something_something : UNKNOW COMMAND

  • DoubleVision 2 years ago

    Hey, I was wondering if there is a way to check if the bot is a moderator on a specific channel. I would like to authenticate this so that users cannot have the bot interact with chats that it is not moderator in. The Twitch api doesn't seem to have anything like this.

  • BobMathrotus 2 years ago

    Hey, is there a reason you're avoiding threads in this? I don't have much experience with them myself but from my understand they seem useful. Is it just so it's easier to understand for the viewers or is there a good technical reason I shouldn't use them?

  • Austin DeWitt 2 years ago

    Awesome vid! This is exactly what I was looking for!

  • Silent 2 years ago

    So if someone says something that isn't one of your commands will it be added to the que?

  • witless X 2 years ago

    In order to stay logged into the server, the IRC client must respond to a PING message. They are sent by the server every 5 minutes.

  • witless X 2 years ago

    still getting great stuff out of all three videos, thx fer the simple bare bones Queue and File.ReadAllText and it's just fun watching you flip around through code. The flow of how you code is a good learning tool: set this var here, but then we gotta wrap it in a check first, etc etc. Fun stuff!

  • borna314 2 years ago

    does this still work?

  • ItsMike 2 years ago

    So, I'm using a Listbox to add items for the user's messages, and after a few minutes it just stops doing anything. I've added a Console.WriteLine function for when it realises it's not connected (for the reconnect() function) and it doesn't log anything.
    When I look at the console, it says "The Thread has exited with code 0", so I'm guessing the program is just giving up after a few minutes? If so, do you guys know how to fix it?

  • Koromaru Da Demmono Doggo 2 years ago

    how do you make a point system

  • Jovan Topalovic 2 years ago

    Can you give us source code for the bot in c# visual studio?

  • egrregerg ergergergwe 2 years ago

    is the old one still working?.. there an error message at

    " string message = irc.readMessage();
    if (message.Contains("!hello")) <——

  • Sarp Aykent 2 years ago

    Do you have the solution from here, I dont want unity stuff thanks 🙂

  • nutella4eva 2 years ago

    At might be worth making an amendment just to note that the chat servers have moved to instead of As of the time of writing, only some channels (partnered channels I believe) have been migrated over, but every channel will be migrated over really soon.

  • WhiteWorlB 2 years ago

    hello, your videos are helping me a lot! i have a question though.
    $"{}". i get what i does but what is that $ sign? when i use that line it shows me an error ";expected"…-edit just found out its a C# 6.0 feature

  • DerpHi 2 years ago

    hey man! very helpfull for a beginner like me! i just have a question, i try to start the program, but starts talking about

    private void timer1_Tick_1(object sender, EventArgse)
    throw new NotImplementedException();

    in the Form1.Designer.cs file. Any tips on how to fix this?

  • Setavai 2 years ago

    Used this video as a guideline for my bot, and recently realized after approximately 10min40s it suddenly stops (* EDIT: Solved it after Sydth sent me a very helpful message explaining i need to send a PONG after they send me a PING *)
    love these video's, and enjoy lurking in your twitch channel and learning ALOT (didnt want to bring this issue up in your chat since you're working on other stuff and i wouldn't want to distract you and your viewers from that)

    and while im at it anyway, i've been wondering about something, i wanted to look at making my own twitch follower notification, like twitchalerts and so on, but i found the API's channel follower list only updates once every 5 minutes, and im curious if you knew how i can get this data in realtime, instead of several every 5 minutes at once

  • Nightmare Fuel 2 years ago

    Great video, but you've really got to kick your Var habit 🙂

Comments are closed.