Upvote Upvoted 18 Downvote Downvoted
How to Create a Twitch Chat Bot Using mIRC
posted in Off Topic
1
#1
12 Frags +

So let's say you want to create a chat bot for your stream, but you don't want to use something like Nightbot or Moobot for whatever reason (maybe you want your bot to have a custom name?) Well here's a tutorial on how to do that:

First we'll start off by creating a twitch account for your bot. This should be fairly simple, just go to Twitch.tv and click the "Sign Up" button on the homepage. Or if you're already logged in you can simply log out and then sign up.

http://i.imgur.com/ib1KUWD.png

I would recommend creating a seperate email for your bots twitch account for organization but using your current email is fine too.

Now that we have our twitch account set up and everything, we need to install a program called mIRC. mIRC is an IRC (internet relay chat) client that allows our bot to connect to the twitch chat. It's important to know that each Twitch chat channel is run on IRC. The mIRC client can be downloaded here: http://www.mirc.com/get.html

Once we have mIRC installed and set up we need to connect to the IRC server. Let's start by clicking the "File" button on the top left of the mIRC client and selecting "Select Server". You can also type Alt+E as a shortcut.

http://i.imgur.com/toQz24r.png

A new window should pop up and we should see a list of categories to the left. Expand the "Connect" category and click on "Servers". Next we want to hit the "Add" button and another window should pop up that looks something like this:

http://i.imgur.com/RW06ehk.png

We then want to fill in the text boxes. Next to "Description" we can just put our Twitch bots name. Next to "IRC Server:" we want to enter: irc.twitch.tv and the port should remain as "6667". It is not required that you put anything in the "Group" text box but also for organizational purposes we will add "Twitch.tv". What this does is it creates a folder named "Twitch.tv" so if we plan on running multiple bots we can store them in that folder. Finally, we need to enter our password. We can find our bots password by going to http://twitchapps.com/tmi/
and retrieving our "OAuth Password" simply by clicking "connect with twitch" and logging in. After logging in we should enter a page that looks like this:

http://i.imgur.com/S7fT4Nl.png

Copy and paste that key into the password text box, then hit OK. Go back onto your "Server List" window and click on your bots name then enter your bots username once again in both the "Alternative" and "Nickname" boxes and hit "Connect". This should connect you to the irc.twitch.tv server. Once we connect, we want to join your specific Twitch chats IRC channel. Just type "/join #<your twitch channels username>" in the irc.twitch.tv server window. And that's it you connected to your own channels chat!

http://i.imgur.com/WI4yR9Z.png

Okay so I have my bot connected to my streams chat but how do I make it respond to certain commands. For starters, mIRC has it's own scripting language. We can enter code through the script editor and the script editor can be accessed by clicking the button below:

http://i.imgur.com/MyryJCh.png

Once the button is clicked a script editor window should pop up. Click the "remote" tab on the editor. This is where most of the code will be entered. Let's start with a basic command:

on *:TEXT:!test:#: { msg $chan Your bot is working! }

What this line of code does is when someone enters the phrase "!test" in chat, the bot will respond with "Your bot is working!". This command is probably the most basic command that can be used in mIRC but it is also very useful. You can easily modify this by changing "!test" and "Your bot is working!". There is much more commands that can be used in mIRC however this is all I will cover in the tutorial. If you would like to learn more about the scripting language here are some resources you can use:

mIRC Help Forum: http://forums.mirc.com/ubbthreads.php/forums/3/1/mIRC_Help
Socket Tutorial: http://forum.swiftirc.net/viewtopic.php?t=4378
Variables Tutorial: http://en.wikichip.org/wiki/Variables_-_mIRC

Good luck! :>

So let's say you want to create a chat bot for your stream, but you don't want to use something like Nightbot or Moobot for whatever reason (maybe you want your bot to have a custom name?) Well here's a tutorial on how to do that:

First we'll start off by creating a twitch account for your bot. This should be fairly simple, just go to Twitch.tv and click the "Sign Up" button on the homepage. Or if you're already logged in you can simply log out and then sign up.

[img]http://i.imgur.com/ib1KUWD.png[/img]

I would recommend creating a seperate email for your bots twitch account for organization but using your current email is fine too.

Now that we have our twitch account set up and everything, we need to install a program called mIRC. mIRC is an IRC (internet relay chat) client that allows our bot to connect to the twitch chat. It's important to know that each Twitch chat channel is run on IRC. The mIRC client can be downloaded here: http://www.mirc.com/get.html

Once we have mIRC installed and set up we need to connect to the IRC server. Let's start by clicking the "File" button on the top left of the mIRC client and selecting "Select Server". You can also type Alt+E as a shortcut.

[img]http://i.imgur.com/toQz24r.png[/img]

A new window should pop up and we should see a list of categories to the left. Expand the "Connect" category and click on "Servers". Next we want to hit the "Add" button and another window should pop up that looks something like this:

[img]http://i.imgur.com/RW06ehk.png[/img]

We then want to fill in the text boxes. Next to "Description" we can just put our Twitch bots name. Next to "IRC Server:" we want to enter: irc.twitch.tv and the port should remain as "6667". It is not required that you put anything in the "Group" text box but also for organizational purposes we will add "Twitch.tv". What this does is it creates a folder named "Twitch.tv" so if we plan on running multiple bots we can store them in that folder. Finally, we need to enter our password. We can find our bots password by going to http://twitchapps.com/tmi/
and retrieving our "OAuth Password" simply by clicking "connect with twitch" and logging in. After logging in we should enter a page that looks like this:

[img]http://i.imgur.com/S7fT4Nl.png[/img]

Copy and paste that key into the password text box, then hit OK. Go back onto your "Server List" window and click on your bots name then enter your bots username once again in both the "Alternative" and "Nickname" boxes and hit "Connect". This should connect you to the irc.twitch.tv server. Once we connect, we want to join your specific Twitch chats IRC channel. Just type "/join #<your twitch channels username>" in the irc.twitch.tv server window. And that's it you connected to your own channels chat!

[img]http://i.imgur.com/WI4yR9Z.png[/img]

Okay so I have my bot connected to my streams chat but how do I make it respond to certain commands. For starters, mIRC has it's own scripting language. We can enter code through the script editor and the script editor can be accessed by clicking the button below:

[img]http://i.imgur.com/MyryJCh.png[/img]

Once the button is clicked a script editor window should pop up. Click the "remote" tab on the editor. This is where most of the code will be entered. Let's start with a basic command:

[code]on *:TEXT:!test:#: { msg $chan Your bot is working! }[/code]

What this line of code does is when someone enters the phrase "!test" in chat, the bot will respond with "Your bot is working!". This command is probably the most basic command that can be used in mIRC but it is also very useful. You can easily modify this by changing "!test" and "Your bot is working!". There is much more commands that can be used in mIRC however this is all I will cover in the tutorial. If you would like to learn more about the scripting language here are some resources you can use:

mIRC Help Forum: http://forums.mirc.com/ubbthreads.php/forums/3/1/mIRC_Help
Socket Tutorial: http://forum.swiftirc.net/viewtopic.php?t=4378
Variables Tutorial: http://en.wikichip.org/wiki/Variables_-_mIRC

Good luck! :>
2
#2
-6 Frags +

http://www.jibble.org/pircbot.php

http://www.jibble.org/pircbot.php
3
#3
6 Frags +
PapaSmurf323http://www.jibble.org/pircbot.php

I'm not sure why you linked this? There are obviously many different ways you can go about creating an IRC bot.

[quote=PapaSmurf323]http://www.jibble.org/pircbot.php[/quote]

I'm not sure why you linked this? There are obviously many different ways you can go about creating an IRC bot.
4
#4
-4 Frags +

This is a great tutorial for how to connect to twitch chat via an IRC client, but it stops short of explaining how to make your bot do anything beyond sending simple message to the channel. that's not very useful for a moderation bot which needs to send commands to ban or timeout people. Such commands simply don't work as directed in the mIRC help files. The twitch server refuses to recognize them.

This is a great tutorial for how to connect to twitch chat via an IRC client, but it stops short of explaining how to make your bot do anything beyond sending simple message to the channel. that's not very useful for a moderation bot which needs to send commands to ban or timeout people. Such commands simply don't work as directed in the mIRC help files. The twitch server refuses to recognize them.
5
#5
Tip of the Hats
1 Frags +
TeksuraThis is a great tutorial for how to connect to twitch chat via an IRC client, but it stops short of explaining how to make your bot do anything beyond sending simple message to the channel. that's not very useful for a moderation bot which needs to send commands to ban or timeout people. Such commands simply don't work as directed in the mIRC help files. The twitch server refuses to recognize them.

When connected via IRC, Twitch commands must be prefixed with a "." rather than a "/" (i.e., .timeout instead of /timeout). That may be your problem.

[quote=Teksura]This is a great tutorial for how to connect to twitch chat via an IRC client, but it stops short of explaining how to make your bot do anything beyond sending simple message to the channel. that's not very useful for a moderation bot which needs to send commands to ban or timeout people. Such commands simply don't work as directed in the mIRC help files. The twitch server refuses to recognize them.[/quote]

When connected via IRC, Twitch commands must be prefixed with a "." rather than a "/" (i.e., .timeout instead of /timeout). That may be your problem.
6
#6
1 Frags +
TeksuraThis is a great tutorial for how to connect to twitch chat via an IRC client, but it stops short of explaining how to make your bot do anything beyond sending simple message to the channel. that's not very useful for a moderation bot which needs to send commands to ban or timeout people. Such commands simply don't work as directed in the mIRC help files. The twitch server refuses to recognize them.

This might be useful for you if you're up to programming one yourself. https://github.com/cinchrb/cinch

[quote=Teksura]This is a great tutorial for how to connect to twitch chat via an IRC client, but it stops short of explaining how to make your bot do anything beyond sending simple message to the channel. that's not very useful for a moderation bot which needs to send commands to ban or timeout people. Such commands simply don't work as directed in the mIRC help files. The twitch server refuses to recognize them.[/quote]

This might be useful for you if you're up to programming one yourself. https://github.com/cinchrb/cinch
7
#7
-13 Frags +

can you do an updated version

can you do an updated version
8
#8
-14 Frags +

thank you <3

thank you <3
9
#9
-12 Frags +

i love u nulltf

i love u nulltf
Please sign in through STEAM to post a comment.