summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-03-05 22:58:10 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-03-05 22:58:10 +0000
commit730bb7f4d6f0001cdda1946703c11cc5374d9907 (patch)
tree8c1e4094307097d9b0837494971faf4b0ee5b7fe
parentf30f9f04a197f8cabb58139628318a0b2f88c295 (diff)
autorejoin plugin: insult on rejoin now optional
-rw-r--r--data/rbot/plugins/autorejoin.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/data/rbot/plugins/autorejoin.rb b/data/rbot/plugins/autorejoin.rb
index 4b657274..a8d65958 100644
--- a/data/rbot/plugins/autorejoin.rb
+++ b/data/rbot/plugins/autorejoin.rb
@@ -1,18 +1,23 @@
class AutoRejoinPlugin < Plugin
+ BotConfig.register BotConfigBooleanValue.new('rejoin.insult',
+ :default => true,
+ :desc => "Determines if the bot will insult whoever kicked it, after rejoin")
+
def help(plugin, topic="")
"performs an automatic rejoin if the bot is kicked from a channel"
end
+
def kick(m)
if m.address?
r = rand(10)
if r > 0
@bot.timer.add_once(r, m) {|m|
@bot.join m.channel
- @bot.say m.channel, @bot.lang.get("insult") % m.sourcenick
+ @bot.say(m.channel, @bot.lang.get("insult") % m.sourcenick) if @bot.config['rejoin.insult']
}
else
@bot.join m.channel
- @bot.say m.channel, @bot.lang.get("insult") % m.sourcenick
+ @bot.say(m.channel, @bot.lang.get("insult") % m.sourcenick) if @bot.config['rejoin.insult']
end
end
end