Skip to content

Commit

Permalink
module: ignore privilege requirement in privmsg
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpowa committed Jun 21, 2016
1 parent 4918f6a commit 6ae41c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sopel/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ def require_privilege(level, message=None):
def actual_decorator(function):
@functools.wraps(function)
def guarded(bot, trigger, *args, **kwargs):
# If this is a privmsg, ignore permissions
if trigger.is_privmsg:
return function(bot, trigger, *args, **kwargs)
channel_privs = bot.privileges[trigger.sender]
allowed = channel_privs.get(trigger.nick, 0) >= level
if not trigger.is_privmsg and not allowed:
Expand Down

0 comments on commit 6ae41c5

Please sign in to comment.