summaryrefslogtreecommitdiff
path: root/data/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-02-10 08:46:45 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-02-10 08:46:45 +0000
commit934fe86fcbc9e7e7409ed1657114f977be240fb8 (patch)
tree96c682135a925edfceefea143579563781b71202 /data/rbot
parent1d6478e8f22053749038bf660d34da10791f5c80 (diff)
op plugin: add half-op commands (hop). Also, previous contribution was miscredited: submitter was Kamu
Diffstat (limited to 'data/rbot')
-rw-r--r--data/rbot/plugins/op.rb26
1 files changed, 26 insertions, 0 deletions
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)