Compare commits
29 commits
master
...
configurat
Author | SHA1 | Date | |
---|---|---|---|
|
2f0518a7f0 | ||
|
e1ad4ad3d5 | ||
|
d68fc1a8df | ||
|
cdcd0985e6 | ||
|
dad51df229 | ||
|
b98bae59de | ||
|
890cfbc18e | ||
|
d4a1dbf7d5 | ||
|
70d0cf8e7e | ||
|
ba8bbb6c97 | ||
|
09b03ddb5c | ||
|
06b011f715 | ||
|
711b7adfbc | ||
|
6c868ce15d | ||
|
b74aa04cff | ||
|
953f73edd2 | ||
|
fd8108e0e5 | ||
|
f2b7c280ed | ||
|
9ff54e0a06 | ||
|
fa8ee9d02e | ||
|
137e0eb0a8 | ||
|
11a9042c56 | ||
|
52c1a888cf | ||
|
ef6c54e0c1 | ||
|
1bc794e9f9 | ||
|
50ce39da5c | ||
|
d5d6f7f12a | ||
|
196d57ffd7 | ||
|
7e32bc2419 |
17 changed files with 116 additions and 61 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
config.rb
|
config.rb
|
||||||
|
config/
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
*~
|
*~
|
||||||
|
|
|
@ -5,11 +5,7 @@ class Repost
|
||||||
attr_accessor :commands
|
attr_accessor :commands
|
||||||
|
|
||||||
def register_command(keyword, &code)
|
def register_command(keyword, &code)
|
||||||
begin
|
access_level = Config.lookup("commands::#{keyword}::access_level", 0)
|
||||||
access_level = Config[:commands][keyword.to_sym][:access_level].nil? ? 5 : Config[keyword.to_sym][:access_level]
|
|
||||||
rescue NoMethodError
|
|
||||||
access_level = 5
|
|
||||||
end
|
|
||||||
|
|
||||||
self.commands = [] if self.commands.nil?
|
self.commands = [] if self.commands.nil?
|
||||||
self.commands << {
|
self.commands << {
|
||||||
|
@ -39,14 +35,14 @@ end
|
||||||
|
|
||||||
Client.load_commands
|
Client.load_commands
|
||||||
|
|
||||||
Client.register_trigger("PRIVMSG") { |msg|
|
Client.register_trigger("PRIVMSG", "commands") { |msg|
|
||||||
# who sent the message
|
# who sent the message
|
||||||
src_nick = msg[:prefix].split('!').first
|
src_nick = msg[:prefix].split('!').first
|
||||||
# what was it
|
# what was it
|
||||||
message = msg[:params][1]
|
message = msg[:params][1]
|
||||||
|
|
||||||
# Was the message sent directly to us...
|
# Was the message sent directly to us...
|
||||||
if msg[:params][0] == Config[:client][:nick] then
|
if msg[:params][0] == Config.lookup("client::nick", "repost", msg[:scope]) then
|
||||||
target = src_nick
|
target = src_nick
|
||||||
reply_prefix = ""
|
reply_prefix = ""
|
||||||
# or to a channel (probably)
|
# or to a channel (probably)
|
||||||
|
@ -58,7 +54,7 @@ Client.register_trigger("PRIVMSG") { |msg|
|
||||||
# Did the message contain our nick with ":" "completion character"?
|
# Did the message contain our nick with ":" "completion character"?
|
||||||
# If so, use the second word as a command and everything else as arguments
|
# If so, use the second word as a command and everything else as arguments
|
||||||
# array
|
# array
|
||||||
if message.split.first == Config[:client][:nick] + ":" then
|
if message.split.first == Config.lookup("client::nick", "repost", msg[:scope]) + ":" then
|
||||||
command = message.split[1]
|
command = message.split[1]
|
||||||
arguments = message.split[2..-1]
|
arguments = message.split[2..-1]
|
||||||
else
|
else
|
||||||
|
@ -80,8 +76,9 @@ Client.register_trigger("PRIVMSG") { |msg|
|
||||||
# command call
|
# command call
|
||||||
Client.commands.each do |cmd|
|
Client.commands.each do |cmd|
|
||||||
# couldn't inline the if into second argument of Client.privmsg() call
|
# couldn't inline the if into second argument of Client.privmsg() call
|
||||||
if command.downcase == cmd[:keyword] then
|
if command.downcase == cmd[:keyword] and
|
||||||
next if cmd[:access_level] > Client.access_level(msg[:prefix], target)
|
cmd[:access_level] <= Config.lookup("access_level", 0, msg[:scope]) and
|
||||||
|
not Config.lookup("commands::disabled", [], msg[:scope]).include? cmd[:keyword] then
|
||||||
retval = cmd[:code].call(arguments)
|
retval = cmd[:code].call(arguments)
|
||||||
# if the command returned a String, we want to show it
|
# if the command returned a String, we want to show it
|
||||||
Client.privmsg(target, reply_prefix + retval) if retval.instance_of? String
|
Client.privmsg(target, reply_prefix + retval) if retval.instance_of? String
|
||||||
|
|
|
@ -6,7 +6,7 @@ Client.register_command("at") { |args|
|
||||||
now = []
|
now = []
|
||||||
recently = []
|
recently = []
|
||||||
r_msg = ""
|
r_msg = ""
|
||||||
h = JSON.parse(Net::HTTP.get(URI(Config[:commands][:at][:url])))
|
h = JSON.parse(Net::HTTP.get(URI(Config.lookup("commands::at::url"))))
|
||||||
h["users"].each { |u|
|
h["users"].each { |u|
|
||||||
if (Time.now.to_i - u["timestamp"]) > 600 then
|
if (Time.now.to_i - u["timestamp"]) > 600 then
|
||||||
recently << u["login"]
|
recently << u["login"]
|
||||||
|
@ -15,10 +15,11 @@ Client.register_command("at") { |args|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
r_msg += "now: #{now.join(' ')}#{Config[:commands][:at][:separator]} " if not now.empty?
|
r_msg += "now: #{now.join(' ')}#{Config.lookup("commands::at::separator")} " if not now.empty?
|
||||||
r_msg += "recently: #{recently.join(' ')}#{Config[:commands][:at][:separator]} " if not recently.empty?
|
r_msg += "recently: #{recently.join(' ')}#{Config.lookup("commands::at::separator")} " if not recently.empty?
|
||||||
r_msg += Config[:commands][:at][:empty] if now.empty? and recently.empty?
|
r_msg += Config.lookup("commands::at::empty") if now.empty? and recently.empty?
|
||||||
r_msg += "unknown: #{h["unknown"]}#{Config[:commands][:at][:separator]} " if h["unknown"] > 0
|
r_msg += Config.lookup("commands::at::nettops") if h["kektops"] > 0
|
||||||
|
r_msg += "unknown: #{h["unknown"]}#{Config.lookup("commands::at::separator")} " if h["unknown"] > 0
|
||||||
|
|
||||||
r_msg
|
r_msg
|
||||||
}
|
}
|
||||||
|
|
7
plugins/commands/bonjour.rb
Normal file
7
plugins/commands/bonjour.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
require 'net/http'
|
||||||
|
require 'nokogiri'
|
||||||
|
|
||||||
|
Client.register_command("bonjour") { |args|
|
||||||
|
link = Config.lookup("commands::bonjour::url") + String(rand(1..2370))
|
||||||
|
Config.lookup("commands::bonjour::message") + Nokogiri::HTML(Net::HTTP.get(URI(link))).xpath('//div[@class="photo post"]//img/@src').inner_text
|
||||||
|
}
|
|
@ -4,7 +4,7 @@ require 'nokogiri'
|
||||||
Client.register_command("cycki") { |args|
|
Client.register_command("cycki") { |args|
|
||||||
link = ""
|
link = ""
|
||||||
begin
|
begin
|
||||||
link = Nokogiri::HTML(Net::HTTP.get(URI(Config[:commands][:cycki][:url]))).xpath('//img/@src').inner_text.gsub("_preview", "")
|
link = Nokogiri::HTML(Net::HTTP.get(URI(Config.lookup("commands::cycki::url")))).xpath('//img/@src').inner_text.gsub("_preview", "")
|
||||||
end while link !~ /http/
|
end while link !~ /http/
|
||||||
Config[:commands][:cycki][:message] + link
|
Config.lookup("commands::cycki::message") + link
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,9 @@ require 'nokogiri'
|
||||||
|
|
||||||
Client.register_command("bug") { |args|
|
Client.register_command("bug") { |args|
|
||||||
if args[0] =~ /^[0-9]+$/ then
|
if args[0] =~ /^[0-9]+$/ then
|
||||||
doc = Nokogiri::HTML(Net::HTTP.get(URI(Config[:commands][:bug][:url] + args[0])))
|
doc = Nokogiri::HTML(Net::HTTP.get(URI(Config.lookup("commands::bug::url") + args[0])))
|
||||||
[Config[:commands][:bug][:url] + args[0], doc.title().delete!('\n'),
|
[
|
||||||
|
Config.lookup("commands::bug::url") + args[0], doc.title().delete!('\n'),
|
||||||
doc.xpath('//span[@id="static_bug_status"]').inner_text.split,
|
doc.xpath('//span[@id="static_bug_status"]').inner_text.split,
|
||||||
doc.xpath('//td[@id="field_container_product"]').inner_text,
|
doc.xpath('//td[@id="field_container_product"]').inner_text,
|
||||||
].join('; ')
|
].join('; ')
|
||||||
|
|
|
@ -2,20 +2,20 @@ Client.register_command("jan") { |args|
|
||||||
if not args[0].nil? then
|
if not args[0].nil? then
|
||||||
if args[0].force_encoding("UTF-8") =~ /ł$/ then
|
if args[0].force_encoding("UTF-8") =~ /ł$/ then
|
||||||
predicate = args[0]
|
predicate = args[0]
|
||||||
object = File.readlines(Config[:commands][:jan][:object]).sample.strip
|
object = File.readlines(Config.lookup("commands::jan::objects")).sample.strip
|
||||||
else
|
else
|
||||||
predicate = File.readlines(Config[:commands][:jan][:predicates]).sample.strip
|
predicate = File.readlines(Config.lookup("commands::jan::predicates")).sample.strip
|
||||||
object = args[0]
|
object = args[0]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
object = File.readlines(Config[:commands][:jan][:object]).sample.strip
|
object = File.readlines(Config.lookup("commands::jan::objects")).sample.strip
|
||||||
predicate = File.readlines(Config[:commands][:jan][:predicates]).sample.strip
|
predicate = File.readlines(Config.lookup("commands::jan::predicates")).sample.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
[
|
[
|
||||||
Config[:commands][:jan][:subject],
|
Config.lookup("commands::jan::subject"),
|
||||||
predicate,
|
predicate,
|
||||||
Config[:commands][:jan][:attribute],
|
Config.lookup("commands::jan::attribute"),
|
||||||
object
|
object
|
||||||
].join " "
|
].join " "
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'net/http'
|
||||||
require 'uri'
|
require 'uri'
|
||||||
|
|
||||||
Client.register_command("kotki") { |args|
|
Client.register_command("kotki") { |args|
|
||||||
url = URI.parse(Config[:commands][:kotki][:url])
|
url = URI.parse(Config.lookup("commands::kotki::url"))
|
||||||
|
|
||||||
req = Net::HTTP::Get.new(url.path)
|
req = Net::HTTP::Get.new(url.path)
|
||||||
response = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
|
response = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
Client.register_command("papież") { |args|
|
Client.register_command("papież") { |args|
|
||||||
Config[:commands][:papiez][:noun] + " " +
|
Config.lookup("commands::papiez::noun") + " " +
|
||||||
File.readlines(Config[:commands][:papiez][:adjectives]).sample
|
File.readlines(Config.lookup("commands::papiez::adjectives")).sample
|
||||||
}
|
}
|
||||||
Client.register_command("papiez") { |args|
|
Client.register_command("papiez") { |args|
|
||||||
Config[:commands][:papiez][:noun] + " " +
|
Config.lookup("commands::papiez::noun") + " " +
|
||||||
File.readlines(Config[:commands][:papiez][:adjectives]).sample
|
File.readlines(Config.lookup("commands::papiez::adjectives")).sample
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,6 @@ require 'net/http'
|
||||||
require 'nokogiri'
|
require 'nokogiri'
|
||||||
|
|
||||||
Client.register_command("sjp") { |args|
|
Client.register_command("sjp") { |args|
|
||||||
doc = Nokogiri::HTML(Net::HTTP.get(URI(Config[:commands][:sjp][:url] + args[0])))
|
doc = Nokogiri::HTML(Net::HTTP.get(URI(Config.lookup("commands::sjp::url") + args[0])))
|
||||||
doc.xpath('//ul[@id="listahasel"]/li/div/div').inner_text
|
doc.xpath('//ul[@id="listahasel"]/li/div/div').inner_text
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
include EventMachine::IRC::Commands
|
include EventMachine::IRC::Commands
|
||||||
|
|
||||||
Client.register_trigger("PRIVMSG") { |msg|
|
Client.register_trigger("PRIVMSG", "eval") { |msg|
|
||||||
message = msg[:params][1]
|
message = msg[:params][1]
|
||||||
destination = msg[:params][0]
|
destination = if msg[:params][0] == Config.lookup("client::nick", "repost", msg[:scope]) then
|
||||||
|
msg[:prefix].split("!").first
|
||||||
|
else
|
||||||
|
msg[:params][0]
|
||||||
|
end
|
||||||
|
|
||||||
if message[0..5] == ":eval " then
|
if message[0..5] == ":eval " then
|
||||||
if Config[:eval][:owners].include?(msg[:prefix]) then
|
if Config.lookup("eval::owners", [], msg[:scope]).include?(msg[:scope]["person"]) then
|
||||||
code = message[6..-1]
|
code = message[6..-1]
|
||||||
begin
|
begin
|
||||||
retval = proc {
|
retval = proc {
|
||||||
|
@ -19,7 +23,7 @@ Client.register_trigger("PRIVMSG") { |msg|
|
||||||
puts e.backtrace
|
puts e.backtrace
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Client.privmsg(destination, Config[:eval][:denied])
|
Client.privmsg(destination, Config.lookup("commands::eval::denied", "go away!", msg[:scope]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
5
plugins/invite.rb
Normal file
5
plugins/invite.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
include EventMachine::IRC::Commands
|
||||||
|
|
||||||
|
Client.register_trigger("INVITE", "invite") { |msg|
|
||||||
|
Client.send_data "JOIN #{msg[:params][1]}"
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
include EventMachine::IRC::Commands
|
include EventMachine::IRC::Commands
|
||||||
|
|
||||||
Client.register_trigger("PRIVMSG") { |msg|
|
Client.register_trigger("PRIVMSG", "mikrofalowka") { |msg|
|
||||||
nick = msg[:prefix].split('!').first
|
nick = msg[:prefix].split('!').first
|
||||||
destination = msg[:params][0]
|
destination = msg[:params][0]
|
||||||
Client.privmsg(destination, "#{nick}: napraw mikrofalowke") if nick.match /[Bb].[Rr][Tt]/
|
Client.privmsg(destination, "#{nick}: napraw mikrofalowke") if nick.match(/[Bb].[Rr][Tt]/)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
require 'pp'
|
||||||
|
|
||||||
include EventMachine::IRC::Commands
|
include EventMachine::IRC::Commands
|
||||||
|
|
||||||
Client.register_trigger("PRIVMSG") { |msg|
|
Client.register_trigger("PRIVMSG", "pretty_print") { |msg|
|
||||||
p msg
|
puts Time.now.to_s + msg.pretty_inspect
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,18 @@ require 'open-uri'
|
||||||
require 'digest/md5'
|
require 'digest/md5'
|
||||||
require 'data_mapper'
|
require 'data_mapper'
|
||||||
require 'nokogiri'
|
require 'nokogiri'
|
||||||
|
require 'dm-postgres-adapter'
|
||||||
|
|
||||||
include EventMachine::IRC::Commands
|
include EventMachine::IRC::Commands
|
||||||
|
|
||||||
DataMapper.setup(:default, Config[:scrape][:db])
|
DataMapper.setup(:default, Config.lookup("plugins::scrape::db", "", nil))
|
||||||
|
|
||||||
module Scrape
|
module Scrape
|
||||||
def self.download(uri)
|
def self.download(uri)
|
||||||
ext = "." + uri.sub(/.*[.]([^.]*)/, '\1') if uri.match(/[^.]+[.][^.]+/)
|
ext = "." + uri.sub(/.*[.]([^.]*)/, '\1') if uri.match(/[^.]+[.][^.]+/)
|
||||||
content = open(uri).read
|
content = open(uri).read
|
||||||
md5 = Digest::MD5.hexdigest(content)
|
md5 = Digest::MD5.hexdigest(content)
|
||||||
File.open(Config[:scrape][:basepath] + md5 + ext, 'w') do |file|
|
File.open(Config.lookup("plugins::scrape::basepath", "", nil) + md5 + ext, 'w') do |file|
|
||||||
file.write(content)
|
file.write(content)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ end
|
||||||
|
|
||||||
DataMapper.auto_upgrade!
|
DataMapper.auto_upgrade!
|
||||||
|
|
||||||
Client.register_trigger("PRIVMSG") do |msg|
|
Client.register_trigger("PRIVMSG", "scrape") do |msg|
|
||||||
titles = []
|
titles = []
|
||||||
return 0 if msg[:params][1].nil?
|
return 0 if msg[:params][1].nil?
|
||||||
msg[:params][1].split.each do |word|
|
msg[:params][1].split.each do |word|
|
||||||
|
@ -60,5 +61,5 @@ Client.register_trigger("PRIVMSG") do |msg|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Client.privmsg(msg[:params][0], Config[:scrape][:title_prefix] + titles.join(' ')) if not titles.count == 0
|
Client.privmsg(msg[:params][0], Config.lookup("plugins::scrape::title_prefix", "→ ", msg[:scope]) + titles.join(' ')) if not titles.count == 0
|
||||||
end
|
end
|
||||||
|
|
31
repost.rb
31
repost.rb
|
@ -1,10 +1,23 @@
|
||||||
class Repost < EventMachine::IRC::Client
|
class Repost < EventMachine::IRC::Client
|
||||||
|
|
||||||
attr_accessor :triggers
|
attr_accessor :triggers, :network
|
||||||
|
|
||||||
def dispatch_raw_message(message = {})
|
def dispatch_raw_message(message = {})
|
||||||
return if Config[:ignore].include?(message[:prefix])
|
message[:scope] = {
|
||||||
|
"network" => @network,
|
||||||
|
"target" => message[:params][0],
|
||||||
|
}
|
||||||
|
|
||||||
|
message[:scope]["person"] = if message[:prefix] then
|
||||||
|
message[:prefix].split("/").last
|
||||||
|
else
|
||||||
|
message[:prefix]
|
||||||
|
end
|
||||||
|
|
||||||
|
return if Config.lookup("ignore", [], message[:scope]).include? message[:prefix]
|
||||||
self.triggers.each do |trigger|
|
self.triggers.each do |trigger|
|
||||||
|
Config.lookup("plugins::disabled", [], message[:scope]).include? trigger[:name]
|
||||||
|
|
||||||
# Having per-command lists of blocks of code to call would be
|
# Having per-command lists of blocks of code to call would be
|
||||||
# faster, but it's not a problem for now. Might refactor this loop
|
# faster, but it's not a problem for now. Might refactor this loop
|
||||||
# and register_trigger() method if it comes to that.
|
# and register_trigger() method if it comes to that.
|
||||||
|
@ -19,22 +32,18 @@ class Repost < EventMachine::IRC::Client
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def register_trigger(command, &code)
|
def register_trigger(command, name, &code)
|
||||||
# Append a Hash containing the command it should be called at and the
|
# Append a Hash containing the command it should be called at and the
|
||||||
# and the code.
|
# and the code.
|
||||||
self.triggers << {:command => command, :code => code}
|
self.triggers << {:command => command, :code => code, :name => name}
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_plugins
|
def load_plugins(scope = { "network" => @network })
|
||||||
self.triggers = []
|
self.triggers = []
|
||||||
Config[:plugins].each do |plugin|
|
Config.lookup("plugins::list", [], scope).each do |plugin|
|
||||||
puts "Loading plugin #{plugin}"
|
puts "Loading plugin #{plugin}"
|
||||||
load File.dirname($0) + '/plugins/' + plugin + '.rb'
|
load File.dirname($0) + '/plugins/' + plugin + '.rb'
|
||||||
end if not Config[:plugins].nil?
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def load_config(file = "config.rb")
|
|
||||||
load File.dirname($0) + "/" + file
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
41
run.rb
41
run.rb
|
@ -5,24 +5,49 @@ require 'rubygems'
|
||||||
require 'eventmachine'
|
require 'eventmachine'
|
||||||
require 'em-irc'
|
require 'em-irc'
|
||||||
require 'logger'
|
require 'logger'
|
||||||
# Our config file is just a single Hash, nothing too fancy.
|
require 'hiera'
|
||||||
require_relative 'config'
|
require 'deep_merge'
|
||||||
require_relative 'repost'
|
require_relative 'repost'
|
||||||
|
|
||||||
|
hiera_configuration = {
|
||||||
|
backends: "yaml",
|
||||||
|
merge_behavior: "deeper",
|
||||||
|
yaml: {
|
||||||
|
datadir: File.join(File.dirname(__FILE__), "config"),
|
||||||
|
},
|
||||||
|
hierarchy: [
|
||||||
|
'%{network}/%{target}/%{person}',
|
||||||
|
'%{network}/%{person}',
|
||||||
|
'%{network}/%{target}',
|
||||||
|
'%{network}',
|
||||||
|
'common',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConfigSource < Hiera
|
||||||
|
def lookup key, default="", scope=nil, *stuff
|
||||||
|
super
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Config = ConfigSource.new(config: hiera_configuration)
|
||||||
|
|
||||||
# Will have to change it to a normal EM loop if/when i'll want to make a usable
|
# Will have to change it to a normal EM loop if/when i'll want to make a usable
|
||||||
# local console for the bot.
|
# local console for the bot.
|
||||||
Client = Repost.new do
|
Client = Repost.new do
|
||||||
|
|
||||||
host Config[:server][:host]
|
scope = { "network" => "freenode" }
|
||||||
port Config[:server][:port]
|
|
||||||
|
host Config.lookup("server::host", "", scope)
|
||||||
|
port Config.lookup("server::port", "", scope)
|
||||||
|
|
||||||
on :connect do
|
on :connect do
|
||||||
puts "connected! changing nick to #{Config[:client][:nick]}"
|
puts "connected! changing nick to #{Config.lookup("client::nick")}"
|
||||||
nick Config[:client][:nick]
|
nick Config.lookup("client::nick")
|
||||||
end
|
end
|
||||||
|
|
||||||
on :nick do
|
on :nick do
|
||||||
Config[:client][:channels].each do |channel|
|
Config.lookup("channels", [], scope).each do |channel|
|
||||||
puts "joining #{channel}"
|
puts "joining #{channel}"
|
||||||
join channel
|
join channel
|
||||||
end
|
end
|
||||||
|
@ -42,4 +67,6 @@ end
|
||||||
# to do anything.
|
# to do anything.
|
||||||
Client.load_plugins
|
Client.load_plugins
|
||||||
|
|
||||||
|
Client.network = "freenode"
|
||||||
|
|
||||||
Client.run!
|
Client.run!
|
||||||
|
|
Loading…
Reference in a new issue