Skip to content

Commit

Permalink
Add halfop checking
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phantium committed Jul 7, 2014
1 parent 5944d85 commit 4d551ca
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions willie/modules/adminchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 == '':
Expand Down

0 comments on commit 4d551ca

Please sign in to comment.