Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
IRC client library written in Pure Ruby
Ruby
Branch: master

v0.0.8

latest commit c4ca44eee4
@r7kamura authored
Failed to load latest commit information.
lib v0.0.8
spec
.gitignore
CHANGELOG.md
Gemfile
LICENSE
README.md Update README about password
Rakefile
zircon.gemspec

README.md

Zircon

IRC client library written in Pure Ruby.

Installation

$ gem install zircon

Example

require "zircon"

client = Zircon.new(
  :server   => "example.com",
  :port     => "6667",
  :channel  => "#chatroid",
  :username => "zircon",
  :password => "optional password",
)

client.on_privmsg do |message|
  client.privmsg "#chatroid", ":zircon!"
end

client.on_message do |message|
  puts "*** `on_message` responds with all received message ***"
  puts message.from
  puts message.to
  puts message.type
  puts message.body
end

client.run!

Features

IRC has following commands.

ADMIN   KICK    MOTD     QUIT     VERSION
AWAY    KNOCK   NAMES    RULES    VHOST
CREDITS LICENSE NICK     SETNAME  WATCH
CYCLE   LINKS   NOTICE   SILENCE  WHO
DALINFO LIST    PART     STATS    WHOIS
INVITE  LUSERS  PING     TIME     WHOWAS
ISON    MAP     PONG     TOPIC    USER
JOIN    MODE    PASS     USERHOST PRIVMSG

You can use sender and receiver methods for each commands.

# For example about PRIVMSG
# [sender - privmsg]
privmsg("#channel", ":Hello")

# [receiver - on_privmsg]
on_privmsg {|message| puts message.body }
Something went wrong with that request. Please try again.