diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-09-09 05:58:08 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-09-09 05:58:08 +0000 |
commit | 324d51450fcddd1355d4677effd42b4c0e2ded9e (patch) | |
tree | 9d0d89fe9fd0f2d9a1e6277ea53927c49f4567d3 /data/rbot | |
parent | 70351b15aadcce2e2f167952fbbaa96188916f26 (diff) |
Adapt opme plugin to new auth framework
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/opme.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/data/rbot/plugins/opme.rb b/data/rbot/plugins/opme.rb index 3df3d0d1..54f61b91 100644 --- a/data/rbot/plugins/opme.rb +++ b/data/rbot/plugins/opme.rb @@ -1,19 +1,25 @@ class OpMePlugin < Plugin def help(plugin, topic="") - return "opme <channel> => grant user ops in <channel>" + return "opme [<channel>] => grant user ops in <channel> (or in the current channel if no channel is specified)" end - def privmsg(m) - if(m.params) - channel = m.params - else - channel = m.channel + def opme(m, params) + channel = params[:chan] + unless channel + if m.private? + m.reply "you should tell me where you want me to op you" + return + else + channel = m.channel.to_s + end end target = m.sourcenick - m.okay + m.okay unless channel == m.channel.to_s @bot.sendq("MODE #{channel} +o #{target}") end end + plugin = OpMePlugin.new -plugin.register("opme") +plugin.map("opme [:chan]") +plugin.default_auth("*",false) |