From 934fe86fcbc9e7e7409ed1657114f977be240fb8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 10 Feb 2007 08:46:45 +0000 Subject: op plugin: add half-op commands (hop). Also, previous contribution was miscredited: submitter was Kamu --- data/rbot/plugins/op.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'data/rbot/plugins') diff --git a/data/rbot/plugins/op.rb b/data/rbot/plugins/op.rb index 217f9c2f..6967122f 100644 --- a/data/rbot/plugins/op.rb +++ b/data/rbot/plugins/op.rb @@ -26,6 +26,28 @@ class OpPlugin < Plugin deop(m, params) end + def hop(m, params) + channel = params[:channel] + user = params[:user] + do_mode(m, channel, user, "+h") + end + + def hopme(m, params) + params[:user] = m.sourcenick + op(m, params) + end + + def dehop(m, params) + channel = params[:channel] + user = params[:user] + do_mode(m, channel, user, "-h") + end + + def dehopme(m, params) + params[:user] = m.sourcenick + deop(m, params) + end + def do_mode(m, channel, user, mode) unless channel if m.private? @@ -58,5 +80,9 @@ plugin.map("op [:user] [:channel]") plugin.map("opme [:channel]") # For backwards compatibility with 0.9.10 plugin.map("deop [:user] [:channel]") plugin.map("deopme [:channel]") # For backwards compatibility with 0.9.10 +plugin.map("hop [:user] [:channel]") +plugin.map("hopme [:channel]") +plugin.map("dehop [:user] [:channel]") +plugin.map("dehopme [:channel]") plugin.default_auth("*",false) -- cgit v1.2.3