tcpbot changes lol
This commit is contained in:
parent
ce60b01c59
commit
d7104bf05c
@ -162,7 +162,13 @@ module Util
|
|||||||
def initialize(host)
|
def initialize(host)
|
||||||
@bot = Cinch::Bot.new do
|
@bot = Cinch::Bot.new do
|
||||||
configure do |c|
|
configure do |c|
|
||||||
c.server = host
|
hostname, port = host.split(/:/)
|
||||||
|
if(port.nil?)
|
||||||
|
port=6667
|
||||||
|
end
|
||||||
|
c.server = hostname
|
||||||
|
c.port = port
|
||||||
|
c.ssl.use = port==6697
|
||||||
mong = Util.instance
|
mong = Util.instance
|
||||||
conf = mong.getCollection("extendobot","config");
|
conf = mong.getCollection("extendobot","config");
|
||||||
name = mong.hton(host)
|
name = mong.hton(host)
|
||||||
@ -173,6 +179,8 @@ module Util
|
|||||||
if(pass.to_a[0])
|
if(pass.to_a[0])
|
||||||
passwd = pass.to_a[0]["val"]
|
passwd = pass.to_a[0]["val"]
|
||||||
end
|
end
|
||||||
|
c.sasl.username=c.nick
|
||||||
|
c.sasl.password=passwd
|
||||||
|
|
||||||
chans = mong.getCollection("chans","channels")
|
chans = mong.getCollection("chans","channels")
|
||||||
cList = chans.find({'autojoin' => true, 'server' => name}).collect { |x|
|
cList = chans.find({'autojoin' => true, 'server' => name}).collect { |x|
|
||||||
@ -193,6 +201,7 @@ module Util
|
|||||||
p m
|
p m
|
||||||
Timer(5, {:shots => 4}) { m.bot.join(m.channel) }
|
Timer(5, {:shots => 4}) { m.bot.join(m.channel) }
|
||||||
end
|
end
|
||||||
|
/*
|
||||||
if(passwd != nil)
|
if(passwd != nil)
|
||||||
c.plugins.plugins.push(Cinch::Plugins::Identify)
|
c.plugins.plugins.push(Cinch::Plugins::Identify)
|
||||||
c.plugins.options[Cinch::Plugins::Identify] = {
|
c.plugins.options[Cinch::Plugins::Identify] = {
|
||||||
@ -201,6 +210,7 @@ module Util
|
|||||||
:password => passwd
|
:password => passwd
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
*/
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user