From 4d551ca984a7973901839f156bdffafea295fa33 Mon Sep 17 00:00:00 2001 From: phantium Date: Tue, 8 Jul 2014 00:15:45 +0200 Subject: [PATCH] Add halfop checking Changed as per Tyrope's suggestion to add halfop for allowed commands. Not sure if halfops can also quiet someone but from searching searching on google I found: Halfops have the ability to change the channel topic, and to kick/ban anyone from the channel who isn't an operator. --- willie/modules/adminchannel.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/willie/modules/adminchannel.py b/willie/modules/adminchannel.py index d6bfe06760..2cda4b5ffb 100644 --- a/willie/modules/adminchannel.py +++ b/willie/modules/adminchannel.py @@ -11,7 +11,7 @@ from __future__ import unicode_literals import re -from willie.module import commands, priority, OP +from willie.module import commands, priority, OP, HALFOP from willie.tools import Nick @@ -63,7 +63,7 @@ def voice(bot, trigger): """ if bot.privileges[trigger.sender][trigger.nick] < OP: return - if bot.privileges[trigger.sender][bot.nick] < OP: + if bot.privileges[trigger.sender][bot.nick] < HALFOP: return bot.reply("I'm not a channel operator!") nick = trigger.group(2) channel = trigger.sender @@ -80,7 +80,7 @@ def devoice(bot, trigger): """ if bot.privileges[trigger.sender][trigger.nick] < OP: return - if bot.privileges[trigger.sender][bot.nick] < OP: + if bot.privileges[trigger.sender][bot.nick] < HALFOP: return bot.reply("I'm not a channel operator!") nick = trigger.group(2) channel = trigger.sender @@ -97,7 +97,7 @@ def kick(bot, trigger): """ if bot.privileges[trigger.sender][trigger.nick] < OP: return - if bot.privileges[trigger.sender][bot.nick] < OP: + if bot.privileges[trigger.sender][bot.nick] < HALFOP: return bot.reply("I'm not a channel operator!") text = trigger.group().split() argc = len(text) @@ -149,7 +149,7 @@ def ban(bot, trigger): """ if bot.privileges[trigger.sender][trigger.nick] < OP: return - if bot.privileges[trigger.sender][bot.nick] < OP: + if bot.privileges[trigger.sender][bot.nick] < HALFOP: return bot.reply("I'm not a channel operator!") text = trigger.group().split() argc = len(text) @@ -177,7 +177,7 @@ def unban(bot, trigger): """ if bot.privileges[trigger.sender][trigger.nick] < OP: return - if bot.privileges[trigger.sender][bot.nick] < OP: + if bot.privileges[trigger.sender][bot.nick] < HALFOP: return bot.reply("I'm not a channel operator!") text = trigger.group().split() argc = len(text) @@ -263,7 +263,7 @@ def kickban(bot, trigger): """ if bot.privileges[trigger.sender][trigger.nick] < OP: return - if bot.privileges[trigger.sender][bot.nick] < OP: + if bot.privileges[trigger.sender][bot.nick] < HALFOP: return bot.reply("I'm not a channel operator!") text = trigger.group().split() argc = len(text) @@ -297,7 +297,7 @@ def topic(bot, trigger): purple, green, bold = '\x0306', '\x0310', '\x02' if bot.privileges[trigger.sender][trigger.nick] < OP: return - if bot.privileges[trigger.sender][bot.nick] < OP: + if bot.privileges[trigger.sender][bot.nick] < HALFOP: return bot.reply("I'm not a channel operator!") text = trigger.group(2) if text == '':