Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 876 Bytes

File metadata and controls

35 lines (25 loc) · 876 Bytes

IRCSocket is an IRC wrapper around a TCPSocket. It implements all of the major commands laid out in RFC 2812. All these commands are available as instance methods of an IRCSocket Object.

API documentation is available here

irc = IRCSocket.new('irc.freenode.org')
irc.connect

if irc.connected?
  irc.nick "HulkHogan"
  irc.user "Hulk", 0, "*", "I am Hulk Hogan"

  while line = irc.read

    # Join a channel after MOTD
    if line.split[1] == '376'
      irc.join "#mychannel"
    end

    puts "Received: #{line}"
  end
end
gem install irc-socket

Or alternatively you can clone the Github repository

git clone https://github.com/injekt/irc-socket

I may have missed something in the RFC. Patches welcome.