]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - data/rbot/plugins/opme.rb
Adapt opme plugin to new auth framework
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / opme.rb
1 class OpMePlugin < Plugin
2
3   def help(plugin, topic="")
4     return "opme [<channel>] => grant user ops in <channel> (or in the current channel if no channel is specified)"
5   end
6
7   def opme(m, params)
8     channel = params[:chan]
9     unless channel
10       if m.private?
11         m.reply "you should tell me where you want me to op you"
12         return
13       else
14         channel = m.channel.to_s
15       end
16     end
17     target = m.sourcenick
18     m.okay unless channel == m.channel.to_s
19     @bot.sendq("MODE #{channel} +o #{target}")
20   end
21 end
22
23 plugin = OpMePlugin.new
24 plugin.map("opme [:chan]")
25 plugin.default_auth("*",false)