summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins/autorejoin.rb
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-07-27 16:32:32 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-07-27 16:32:32 +0000
commit2a96c9198c1f6e13407d0999083f6ce5e0bc06fa (patch)
treeb3b9247d275d9b554665bc22884104d266d2e757 /lib/rbot/plugins/autorejoin.rb
parent21949774b91eaec6ecde4eaa8ad121e2c0a36b87 (diff)
move rbot into lib - still rearranging for packaging/installation
Diffstat (limited to 'lib/rbot/plugins/autorejoin.rb')
-rw-r--r--lib/rbot/plugins/autorejoin.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/rbot/plugins/autorejoin.rb b/lib/rbot/plugins/autorejoin.rb
new file mode 100644
index 00000000..aba46507
--- /dev/null
+++ b/lib/rbot/plugins/autorejoin.rb
@@ -0,0 +1,16 @@
+class AutoRejoinPlugin < Plugin
+ def help(plugin, topic="")
+ "performs an automatic rejoin if the bot is kicked from a channel"
+ end
+ def kick(m)
+ if m.address?
+ @bot.timer.add_once(10, m) {|m|
+ @bot.join m.channel
+ @bot.say m.channel, @bot.lang.get("insult") % m.sourcenick
+ }
+ end
+ end
+end
+
+plugin = AutoRejoinPlugin.new
+plugin.register("autorejoin")