Ultra Light IRC RFC Doc by Phoenixx (with the aid of telnet, and sockets logging) This document was made to help show folk how it is the IRC software they use communicates with thier IRC server. It details a list of basic commands, and the connection sequence. If you ever plan on trying to make an IRC client, or need to use IRC on a machine with nothing but telnet installed, or are simply curious this is the document for you. This document consists of the following sections: Connection sequence General commands A typical IRC session log A typical IRC session log (explaining each line) Note: All the following commands can be tested using telnet (available on most major operating systems) -------------------- Connection sequence. -------------------- Connecting to an IRC server usually consists of between two and three steps. Basically the IRC server needs to know your Nickname, and what to put in your user info. Connect to port 6667 (or any other port dedicated to irc) Once connected (Usually signified by a flashing cursor) you need to tell the server what nickname you wish to use. To do that type: NICK Nickname Next, SOME servers will ask you for a PING reply, (AustnetD does DalnetD doesn't) The server will boot you off in about 30 seconds unless you reply. If your on a server that doesn't do this, you can skip this step. Typically the server will send something like: PING :356783 (the number is random) Simply respond by typing: PONG :356783 Next, (this can be typed before or after the "PONG" unless no "PONG" is required) the user needs to enter their user info, most of this information is ignored and looked up elsewhere, but is still included for IRC client compatability, and it still uses the Name section in your WHOIS information. The user info is broken up into 4 sections: Email address, Hostname, IP number, and users name, or any other information. An example is below: USER identHere "hostname.com" "127.0.0.1" :About me/realname (just typing "USER a "b" "c" :d" would work on most servers if your in a hurry) Thats the connect sequence. Simple isn't it? right about now you will be getting a screen full of badly formatted text about the server your connecting to. ----------------- General Commands: ----------------- Here is a list of the main IRC RFC commands, some with their normal IRC client equivalent in brackets (). All "" characters below are ctrl-a. In many of the following you can substitute #channel with a user nickname instead. In many cases you can send to multiple destinations by seperating with a "," eg. PRIVMSG #channel1,user1,#channel2 :BLAH! To join a channel (/join #channel key) JOIN #channel :key To leave a channel (/part #channel reason) PART #channel :reason To send a message (/msg #channel Message) PRIVMSG #channel :Message To use an action (/me action here, or /describe #channel action here) PRIVMSG #channel :ACTION action here To send a notice (/notice #channel your notice here) NOTICE #channel :your notice here To see who a user is (/whois Username) WHOIS :Username To display all users matching a particular criteria (/who Nick_*hostmast_or_#channel) WHO :Nick_*hostmask_or_#channel To list the users in a channel, or all users in IRC (/names #channel) NAMES :#channel To list channels (/list) LIST To change nickname (/nick newnick_here) NICK :newnick_here To change a channel mode (/mode #channel +o user) mode #channel :+o user To kick a user out of a channel (/kick #channel user reason) KICK #channel user :reason To quit IRC (/quit reason) QUIT :Reason To send a play sound request (/sound sound.wav description) PRIVMSG #channel :SOUND sound.wav [description] To send some form of ctcp (/ctcp somectcp boo) PRIVMSG #channel :somectcp boo To send some form of ctcp reply NOTICE #channel :somectcp boo To ping a user, there are 2 ways, typically a "ctcp" is used Although you can use the IRC server to get you a reply, rarely is this used. A ping works in 2 stages, a user sends a ping request to a user or channel, typically with a random letter/number sequence to identify a unique ping reply Then that user replies with either an internally calculated (or generated) reply, or it simply sends a ping reply using the ping identifyer, and the person who requested it calculates the time based on how long it took from sending the request to receiving a reply To send a ping request (using ctcp) PRIVMSG user :PING 12345 To reply to a ping request (using ctcp, and letting the sender do the calculation) NOTICE user :PING 12345 To reply to a ping request (using ctcp, and using your own calculation, with various example replies) NOTICE user :PING 1 secs NOTICE user :PING 1 seconds NOTICE user :PING 1 mins NOTICE user :PING 1 minutes NOTICE user :PING 1 hours NOTICE user :PING 1 days NOTICE user :PING Go away evil pinger The following commands work, but for some reason or another they are not implemented by most IRC clients. I am not sure how accurate these are. To send a ping request (using the server) To ping a particular server PING pingID :irc.server.com To just ping the default server PING pingID The server will reply eventually, and if you count the seconds to the reply, this will tell you how lagged that server/user is. Many servers offer many other unique commands, for a list type HELP --------------------------------------- A typical IRC connection session log (Showing examples of various commands): --------------------------------------- Userhost:2167-to-Server:6667- **Connect** Userhost:2167-to-Server:6667- NICK CoolNickname Userhost:2167-to-Server:6667- USER JohnS "MyHost.com" "127.0.0.1" :John Smith Server:6667-to-Userhost:2167- PING :2eea0548 Userhost:2167-to-Server:6667- PONG :2eea0548 Userhost:2167-to-Server:6667- MODE CoolNickname +i Userhost:2167-to-Server:6667- ISON myPal Server:6667-to-Userhost:2167- PING :127.0.0.1 Userhost:2167-to-Server:6667- PONG :127.0.0.1 Userhost:2167-to-Server:6667- JOIN #MyChannel Userhost:2167-to-Server:6667- MODE #MyChannel Userhost:2167-to-Server:6667- MODE #MyChannel +nt Userhost:2167-to-Server:6667- PRIVMSG #MyChannel :Hello? Userhost:2167-to-Server:6667- PRIVMSG CoolNickname :PING 933417978 Server:6667-to-Userhost:2167- :CoolNickname!JohnS@127.0.0.1 PRIVMSG CoolNickname :PING 933417978 Userhost:2167-to-Server:6667- NOTICE CoolNickname :PING 933417978 Server:6667-to-Userhost:2167- :CoolNickname!JohnS@127.0.0.1 NOTICE CoolNickname :PING 933417978 Userhost:2167-to-Server:6667- PRIVMSG #MyChannel :SOUND yawn.wav [yawns] Userhost:2167-to-Server:6667- PRIVMSG #MyChannel :ACTION is bored Userhost:2167-to-Server:6667- MODE #MyChannel :-o CoolNickname Userhost:2167-to-Server:6667- PART #MyChannel :Goodbye! Userhost:2167-to-Server:6667- QUIT :I'm quiting! Userhost:2167-to-Server:6667- **Closed by client** ------------------------------------- A typical IRC connection session log (Showing what each command is doing): ------------------------------------- Userhost:2167-to-Server:6667- **Connect** Setting User Nickname Userhost:2167-to-Server:6667- NICK CoolNickname Setting User Information Userhost:2167-to-Server:6667- USER JohnS "MyHost.com" "127.0.0.1" :John Smith Server issues a command to see if its actually a live connection Server:6667-to-Userhost:2167- PING :2eea0548 User replies with the correct response Userhost:2167-to-Server:6667- PONG :2eea0548 User sets themself mode +i Userhost:2167-to-Server:6667- MODE CoolNickname +i User checks to see if their Friend is in IRC Userhost:2167-to-Server:6667- ISON myPal Server sends a periodic Ping to the user Server:6667-to-Userhost:2167- PING :127.0.0.1 User replies to periodic Ping Userhost:2167-to-Server:6667- PONG :127.0.0.1 User joins their channel Userhost:2167-to-Server:6667- JOIN #MyChannel User checks channel modes (most irc clients do this to correctly display the current channel modes) Userhost:2167-to-Server:6667- MODE #MyChannel User changes the channel modes to +nt Userhost:2167-to-Server:6667- MODE #MyChannel +nt Users says "hello" in their channel Userhost:2167-to-Server:6667- PRIVMSG #MyChannel :Hello? User ctcp pings them self Userhost:2167-to-Server:6667- PRIVMSG CoolNickname :PING 933417978 Server forwards the ping to the destination Server:6667-to-Userhost:2167- :CoolNickname!JohnS@127.0.0.1 PRIVMSG CoolNickname :PING 933417978 User replies to ping Userhost:2167-to-Server:6667- NOTICE CoolNickname :PING 933417978 User gets the ping reply, and displays the time it took Server:6667-to-Userhost:2167- :CoolNickname!JohnS@127.0.0.1 NOTICE CoolNickname :PING 933417978 User plays a ctcp sound, using the optional description Userhost:2167-to-Server:6667- PRIVMSG #MyChannel :SOUND yawn.wav [yawns] User does an action, typically using a /me or /action or /describe Userhost:2167-to-Server:6667- PRIVMSG #MyChannel :ACTION is bored User de-ops themself Userhost:2167-to-Server:6667- MODE #MyChannel :-o CoolNickname User leaves the channel Userhost:2167-to-Server:6667- PART #MyChannel :Goodbye! User Quits from irc Userhost:2167-to-Server:6667- QUIT :I'm quiting! Userhost:2167-to-Server:6667- **Closed by client**