From 1bf7503c6ce53bc32cf3139e05cdfa54e9c61d5b Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 7 Jan 2009 21:25:04 +0100 Subject: autorejoin: work on password-protected channels too --- data/rbot/plugins/autorejoin.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'data/rbot') diff --git a/data/rbot/plugins/autorejoin.rb b/data/rbot/plugins/autorejoin.rb index 14a2f29c..330404cd 100644 --- a/data/rbot/plugins/autorejoin.rb +++ b/data/rbot/plugins/autorejoin.rb @@ -8,15 +8,17 @@ class AutoRejoinPlugin < Plugin end def kick(m) + password = m.channel.mode[:k].value + if m.address? r = rand(10) if r > 0 @bot.timer.add_once(r) { - @bot.join m.channel + @bot.join m.channel, password @bot.say(m.channel, @bot.lang.get("insult") % m.sourcenick) if @bot.config['rejoin.insult'] } else - @bot.join m.channel + @bot.join m.channel, password @bot.say(m.channel, @bot.lang.get("insult") % m.sourcenick) if @bot.config['rejoin.insult'] end end -- cgit v1.2.3