Creating your own Twitch chat bot using mIRC

If you're bored or limited by the possibilities of other pre-made Twitch chat bots and want to make your own one, you will be amazed how much you've been missing the whole time. The freedom of scripting and options in mIRC (Program especially created for chat bots) is just overwhelming and in most cases your scripting knowledge will be the only limitation of your bot but this is why this guide was created.


  1. To start off, you will need the program itself which can be downloaded either from the official site or mirrors provided there for free - http://www.mirc.co.uk/get.html                                                          

  2. You will also need another Twitch account to link the bot to. You can name it whatever you want but I would advise adding the "bot" bit at the end so people will know that it's a bot and not a real person chatting. For example "HorusBot".                                                                                                      

  3. When you will successfully install mIRC, launch it and you should get a popup screen which looks like that on the picture. In the "Nickname" box write your bot's account username you created in step 2 and leave all the other boxes blank.                                                                                                     

  4. On the left side of the popup there is a category box, expand "Connect" and click on "Servers" sub-page. You should see a list of original servers available to use but we want to connect to Twitch so click the "Add" Button on the right and a popup should come up like shown on the picture. In description write what you want to call the connection, in my case I just named it like my bot. In the IRC box you will need to exactly put the "irc.twitch.tv" address, leave the port as "6667" and the "Group" box blank. (If the port is blocked by the modem you will need to portforward or contact your internet owner)                                                                                                                           

  5. In the password box you will need to enter your bot account's OAuth key so navigate to this site - http://twitchapps.com/tmi/ and click "Connect with Twitch" button.                                                    

  6. Then copy the whole code provided in the box that starts with "oauth:" and paste it into the "Password" box from step 4, click add, double click on the server you have just added and click ok.   

  7. Now you have successfully set up your bot for use, joining channels and scripting that will be explained in further guides covering different areas. The only thing left to do is to click the connect button that has a lightning icon as shown on the picture connecting your bot to the Twitch server.          



To learn how to use your bot that includes connecting to channels and actually scripting it's behaviour, check out my next guides that are categorised on the right side of the screen.

I hope this guide helped you to set up your own Twitch chat bot using mIRC and if you have any further questions feel free to contact me by e-mail or directly on twitch - "HorusMod".

32 comments:

  1. so i typed hi into my chat in mIRC and a new folder called "query 1" was made with a sub file "jtv" and in the sub file it said "historyend Rikashi151". What do i do?

    ReplyDelete
    Replies
    1. Hey there,

      Sorry for the late reply. This should be in the next part of my tutorial but I'm overwhelmed with my study and don't really have the time to do it at the moment.

      You need to connect to a channel now;
      1) Click on favourites and select Add.
      2) Write the channel name with a hash-tag on the front in the Channel box. (Eg. #riotgames)
      3) Check join on connect and click add.
      4) Click ok on the favourites box and all should be working now.

      Hope this helped!

      Regards.

      Delete
    2. Thank you so much dude! :D

      Delete
    3. That did not work for me at all. I logged into my own chat using mIRC and typed and nothing appeared and what I typed in my chat on Twitch didn't appear either.

      Delete
  2. thanks this was really usefull

    ReplyDelete
  3. Is there any way to make my bot detect phrases within the body of a message as a command? Like, if the phrase happens to be mid sentence?

    ReplyDelete
  4. Yes, you can easily make that by going into tools - address book - highlight - add.

    There you can chose how it should work, what colour the text should be highlighted in etc. You can even set sound alerts.

    ReplyDelete
    Replies
    1. Well, I've highlighted the phrase. However, I still don't know how to make the bot accept it as input for a command. I'm trying to make the bot respond if anyone asks "what skin" anywhere in their message. So, if the bot sees something like, "What skin are you using?" or "Streamer, what skin is that?" the bot would know to respond with a specific phrase.

      Delete
    2. I want it to reply to someone saying 'Hi' on twitch, But twitch chat doesn't show on IRC but I can see chat I type on IRC in twitch, I have followed your guide to the dot, I have setup the highlight and enabled highlights, Just IRC doesn't show the Twitch typed chat.

      Delete
  5. Hey you are probably busy but how would you make a custom script doing so when someone says something in chat the bot will reply?

    ReplyDelete
  6. @Michael Davis, Try this for a specific phrase response:

    Go to tools - scripts editor - remote tab. There you can start adding coding.

    Now, paste this there:
    on *:TEXT:PHRASEHERE:#: { msg $chan YOUR MESSAGE }

    In "PHRASEHERE" you can add one passage triggering the message, and in "YOUR MESSAGE" the response users get.

    If you want the message to be triggered by multiple passages, just copy and paste the whole script and edit the "PHRASEHERE" on the additionals.

    Save everything and you should be done.

    Example:

    on *:TEXT:Pizza:#: { msg $chan That's super tasty! }
    on *:TEXT:Hamburger:#: { msg $chan That's super tasty! }
    on *:TEXT:Cheese:#: { msg $chan That's super tasty! }

    The bot will write this message; "That's super tasty!" into your chat if someone says exactly "Pizza", "Hamburger" or "Cheese". Keep in mind that these are not keywords.

    ReplyDelete
  7. @Brohman Brohster, the above technique should be what you are looking for.

    ReplyDelete
    Replies
    1. How would I add commands like timeout and ignore mods?

      Delete
    2. What I mean is again, Timeouts and also, how would I do the @user@ thing from nightbot?

      Delete
  8. @Michael Davis

    Use this:
    on *:TEXT:!Suicide:#: { msg $chan /timeout $nick }

    When a user writes !suicide (or anything you want, just replace it), he gets a timeout. You can edit the "/timeout" bit with other commands and add time if needed.

    ReplyDelete
  9. And how would I do for instance

    (Nightbot exact command)
    !splat (touser ie name) = @user@ has splatted @touser@ with sticky goop!

    How would I do @touser@

    ReplyDelete
  10. I'm not really sure, I think this would require some pretty advanced coding. Didn't use mIRC for a while now.

    Have a look on this site and see what you can find - http://hawkee.com/mirc/scripts/

    ReplyDelete
    Replies
    1. I asked and they just responded with look at the help, And I have, and there is nothing to help on there. :/ so you don't know how I could use someone elses name so for instance !hi = Hello

      Delete
    2. By the way, Merry christmas.

      Delete
  11. Merry Christmas to you too. :)

    ReplyDelete
  12. And no, I'm afraid not. I have never used such scripting. Sorry.

    ReplyDelete
    Replies
    1. How would I do a multiline command here is what I am going for

      on *:TEXT:Kappa:#: { msg $chan /timeout $nick 1
      }
      on *:TEXT:Kappa:#: { msg $chan Now now, I don't like that emoticon
      }

      Delete
    2. on *:TEXT:Kappa:#: {
      msg $chan /timeout $nick 1
      msg $chan Now now, I don't like that emoticon
      }

      Delete
    3. on *:TEXT:Kappa:#: {
      msg $chan /timeout $nick 1
      msg $chan Now now, I don't like that emoticon
      }

      Delete
  13. Ok so I am setting up my bot for the first time. I am trying to connect to the twitch server and it throws a CAP error. What am I doing wrong?

    ReplyDelete
    Replies
    1. Nevermind I switched to a different irc client and it worked.

      Delete
  14. I Tested it, liked it, bought the full version, it didnt work, the jtv file deleted and wont come back and boy if you dont help my i am already well passed pissed off!

    ReplyDelete
  15. Hi, I've got 2 questions if you still respond to comments here. I'm not sure if you're going to see this, but I'm using a simple on *:TEXT:Hi:#: { msg $chan Hello $nick how are you? } However, it only responds if the message is exactly "Hi" If he continues his message after hi it doesn't respond, any way to do that? And my second question is how do I enter a timer for messages that the bot sends out like Moobot does?
    on *:TEXT:#: { /timer 1 5 msg $chan Like my facebook! } doesn't seem to work, am I putting the timer in the wrong location? Thanks a lot.

    ReplyDelete
    Replies
    1. By adding a * before and/or after the text string that you want to be the trigger, for example --- *.TEXT:*Hello:#: { --- will allow any words before Hello with Hello being the last word. Same applies the other way around --- *:TEXT:Hello*:#: { --- where it will look for Hello as the first word and anything folowing. By placing the * before and after --- *:TEXT:*Hello*:#: { --- will look for Hello anywhere in the sentence. Hope this helps.

      Delete
  16. So I want to connect multiple twitch accounts and then type a word or sentence and then have all the accounts chat that word or sentence at the same time. Is that possible?

    ReplyDelete
  17. The vacation offers on offer are : deemed as a selection of one particular chosen furthermore low cost throughout. These kinds rentals are commonly proudly located at features who definitely are accented through fine-looking shores selling crystal-clear waters, contingency the Pacific Ocean. hotels packages https://twitchviral.com/

    ReplyDelete