Programming a simple IRC (Internet-Relay-Chat) Client
Asked Answered
C

5

11

I started using IRC at a young age, and I have always been fascinated with it. As a language exercise, I was thinking about programming a simple IRC client in Ruby with Shoes as a graphical front-end. My question to you, kind-sirs, what do I need to become familiar with to start on this great adventure (besides shoes and Ruby of course)? I imagine there is some-sort of specification on IRC Protocol. Any pointers?

Contort answered 23/8, 2008 at 15:49 Comment(0)
U
32

An earlier post mentioned RFC1459. While it is a very good introduction to IRC, it has actually been superseded by RFCs 2810-2813. Here is a more complete list of documentation you need to program anything IRC-related:

Unopened answered 10/5, 2009 at 6:22 Comment(5)
Note that RFC2810-RFC2813 are written my IRCnet alone (after the great split). IRCnet is basically the only major network that supports ! channels. 005 parsing and understanding each token is.. hard. Different networks support other channel modes (like q, a and h as owner, admin and halfop)Desiree
005 parsing is not that complicated, actually. New tokens are not added often (even less so in the future now that IRCv3 is getting adopted), and parsing current ones is rather straightforward: github.com/cinchrb/cinch/blob/master/lib/cinch/isupport.rbUnopened
You don't parse all the tokens. You just parse a handful tokens, but not all.Desiree
E.g. you don't look for the CNOTICE or CPRIVMSG tokens.Desiree
If you look closely, you'll see that the code there only has special cases for a few tokens, and assumes all other tokens are booleans (e.g CNOTICE or CPRIVMSG) or string values if they contain '=' (e.g. SOMETHING=foobar). So it supports any future tokens of those types. In fact, any special parsing of complex token values (like the value in CHANMODES=b,k,l,imnpstr) is just there for convenience. In the unlikely event that a new kind of token like that were added and the library didn't parse it specially yet, the user would still be able to access the value as a string.Unopened
S
10

The IRC Specification is laid out in RFC 1459

http://www.irchelp.org/irchelp/rfc/rfc.html

Sassafras answered 23/8, 2008 at 15:49 Comment(0)
S
7

I found this gem on Wikipedia. Sounds intimidating.

It's actually not.

Telnet onto an IRC Server and witness the simplicity of the protocol first hand. The hardest part is the handshake, after that its very simple.

Sassafras answered 23/8, 2008 at 15:59 Comment(1)
+1 - I have chatted on IRC via telnet (only for the geek points)Allocate
C
2

I once implemented a client and a server with 2 more guys (as part of a course).
I can tell you that the RFC you were already linked to is great.
I'd also try simply sniffing a connection with an existing client to see for yourself how stuff work.

Conversant answered 23/8, 2008 at 19:24 Comment(0)
V
0

Not exactly an answer to your question, but it may be helpful. If you are using Ruby, I have found the Autumn Leaves project to be a great way to build an IRC bot using Ruby:

http://github.com/RISCfuture/autumn/tree/master

It is pretty much the Jibble of the Ruby world.

Vickivickie answered 9/2, 2009 at 1:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.