Project

zircon

0.01
No commit activity in last 3 years
No release in over 3 years
Zircon is a mineral belonging to the group of nesosilicates.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

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 }