repost/run.rb

38 lines
760 B
Ruby
Raw Normal View History

#!env ruby
require 'rubygems'
require 'eventmachine'
require 'em-irc'
2013-05-29 18:55:52 +00:00
require_relative 'config'
require_relative '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
2013-05-29 18:55:52 +00:00
Config[:plugins].each do |plugin|
puts "Loading plugin #{plugin}"
eval File.read(File.dirname($0) + "/plugins/#{plugin}.rb")
end if not Config[:plugins].nil?
repost.run!