summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/autorejoin.rb
blob: aba46507b20e6c68b3ef3e6eb1411f6d8c506fed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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")