repost/run.rb

35 lines
632 B
Ruby
Raw Normal View History

#!env ruby
require 'rubygems'
require 'eventmachine'
require 'em-irc'
require './config'
require './repost'
repost = Repost.new do
host Config[:server][:host]
port Config[:server][:port]
on :connect do
puts "connected! changing nick to #{Config[:client][:nick]}"
nick Config[:client][:nick]
end
on :nick do
Config[:client][:channels].each do |channel|
puts "joining #{channel}"
join channel
end
end
on :raw do |message|
self.dispatch_raw_message message
end
end
#repost.register_trigger("PRIVMSG") { |msg| p msg }
repost.run!