I've tried to figure out why many of the engineers I know still use IRC even though it's such old technology. I've tried it but don't totally understand it. Since I'm learning to code, it's time to also learn IRC.
IRC stands for Internet Relay Chat. You can read the Wikipedia definition, but that really doesn't tell you much about why or how people use it in world that also has IM clients, Twitter, SMS, iMessage, and all the other ways that we have today to connect. Honestly I don't totally know why either but it's time to dive in and find out! I asked on Twitter if it's still something people find useful,
and the general consensus seems to be yes.
Since I'm learning Ruby, the example channel I'll join is the
#ruby-lang room on freenode.net. Here's the address:
But how do I actually use that? And after I'm in there what is ok, and what is verboten?
Reading the address
irc://denotes that it's an IRC connection as opposed to the http that you see when getting a web page.
irc.freenode.netis the server, as you'd guess.
ruby-langis the specific room or 'channel' that you are joining as it's called in IRC.
There are lots of options. Dedicated clients like Colloquy and Limechat, or irssi on the command line, and it's also possible to use IRC inside of other chat clients like Adium. For even more simplicity, there are browser extensions for Chrome and Firefox that will let you connect to IRC in your browser. irssi is good but it can be hard to install. If you just want to get up and running Adium is a good choice because you can also use it with so many other chat services.
Joining a room
For this example we'll join the
##new2ruby channel that is quite active as of this writing.
- Download Adium if you don't already have it
- File > Add Account > IRC
- Nickname: Enter your name on the server
- Hostname: irc.freenode.net
- Click 'Options'
- Here you will enter any rooms you want to join automatically
- After opening Colloquy click 'Connect'
- Enter irc.freenode.net as the Chat Server and Connect
- Before joining the ##new2ruby room we might as well look around to see what else is happening on the server. Click the down arrow to see a list of all the rooms. After you're connected click 'Join Room'. I'm going to join a couple rooms to see how conversations work.
That's it! You can see what people are talking about and participate as well. Rooms often have a code of conduct or set of rules that you will see open entering the channel or in the topic at the top of the room. It's always a good idea to read these to understand the community that you are participating in.
Next up, what are the commands.
This is the part I've always been confused about. You enter IRC commands in the same place that you post messages except that instead of just entering "Hi there" you begin the line with a slash and type the command with it's arguments. Beginning the message with a slash indicates that it is a command and it will not be sent to the room. If it is a
/msg command it will be sent to the person you're messaging. Common commands are:
/helpwill usually give you a list of command options
/msg <nick> (message)to start a private chat with someone in the room. Ex. '/msg barry345 Hi Barry how's Lavon?'
/ignore <nick>- ignore the person with that nick in all rooms on the server. They will not be able to /msg you.
/whois <nick>Opens an info window for nick.
/awaylets you set your status to away.
/topicChannels will often have a message at the top of the room called the topic. This command lets you reset that.
Registering on the IRC server
You don't have to register with a password on most IRC servers. If you don't you can just login with a nickname temporarily. But to be a part of the community I think you need a regular account that is yours and which people can recognize you by so it's time to register.
One of the things that always seemed weird to me about IRC is that to register, change my password or anything about my account I have to enter my password in the same place I send messages to the group. So I wanted to make sure I know what I'm doing before accidentally sending my password to 300+ people. To prevent the possibility of this, we'll open up a chat with the NickServ bot that manages accounts. This way, even if something does go wrong it won't be sent to everyone. In the message input enter,
/msg NickServThis should open a private chat with the bot.
- In the private chat enter
/msg NickServ REGISTER password firstname.lastname@example.org password and email are your password and email.
This is messaging the Nickname Server bot directly, telling it that you want to REGISTER using the password and email provided. After registering you can also enter the command
/msg NickServ SET ENFORCE ON to make sure no one can use your nick unless they login.
Starting a channel on the Freenode IRC server
Since this is a way to chat with people. Having a list of commands is nice it's just not the same as actually using it. If you'd like to try setting up your own room to try it with a few friends on Freenode. Freenode is mainly a network for people involved in open source software but there are also some random rooms. To get started, open a message session with the ChanServ bot by typing
/msg ChanServ Now that you're messaging the bot directly follow these instructions from BotBot.me. The BotBot instructions are about how to setup an invite only room which requires people to register. Really I'd like people to be able to try it with me with a low barrier to entry so I'm going to skip that step. I created the channel and set it up using these commands:
/msg ChanServ REGISTER ##your-room-name
/msg ChanServ SET ##your-room-name GUARD ON
/msg Chanserv SET ##your-room-name MLOCK +s
And now you're setup!
Now that the room is setup you can invite people to it by giving them the address:
irc://irc.freenode.net/your-room-name Try changing the topic, /msg, /query, maybe even /ignore to see what happens.
To make the barrier to entry as low as possible, you can have a friend join in 3 steps by:
- Installing CIRC in Chrome.
- After opening the extension connect to freenode with this command,
- Then join the room with the password by entering:
/join ##your-room-name password
Even easier channel setup
There are a few companies out there that basically let you embed an IRC chatroom in a webpage. Kiwiirc is one of them that will let you do this for free. From their embed page you can get a link that will open IRC in the browser, or even get embed code to let you just embed an IRC chatroom on your own site. They have an interesting note about using it with projects "You can now link your GitHub project to your own IRC channel (or create one on freenode!) by embedding a button within your readme.md file. This can be generated using the form to the right and selecting the GitHub logo."
Speaking of bots
If you start playing with it, one of the really fun and powerful things about IRC is the ability to have bots that report on things or reply to comments automatically. People have been writing IRC bots for years so there are lots to choose from that do everything from report site errors to post gifs.
If you want to try building a IRC bot there is a Ruby framework called Cinch that I'll be trying in the near future.
There are a lot of modern alternatives to IRC that are less quirky and easier to understand (Slack!) but it's still a technology worth having some familiarity with.