Sha256: 79bcb5765100f0c21f148ceffd6906163e9cef3590a9d523f3626724adbd735e

Contents?: true

Size: 594 Bytes

Versions: 1

Compression:

Stored size: 594 Bytes

Contents

#!/usr/bin/env ruby
# vim:encoding=UTF-8:

$LOAD_PATH << "lib"
$LOAD_PATH << "../lib"

require "rubygems"
require "net/irc"

require "pp"

require 'celluloid/io'

class EchoBot < Net::IRC::Client
  include Celluloid::IO
  def initialize(addr,port,opt)
    opt[:tcp_socket] = Celluloid::IO::TCPSocket
    super
    start
  end

  def on_rpl_welcome(m)
    post JOIN, "#demo"
    super
  end

  def on_privmsg(m)
    post NOTICE, m[0], m[1]
  end
end


supervisor = EchoBot.supervise_as :echo_bot, "188.40.141.208", "6667", {
  :nick => "foo",
  :user => "foo",
  :real => "foobartest",
}

sleep

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
net-irc2-0.0.13 examples/echo_bot_celluloid.rb