aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-01-30 11:37:47 +0000
committerGravatar jesopo2019-01-30 11:37:47 +0000
commitf25bfd0ae2dc6c5f971721b1d18ae63732691379 (patch)
tree3db560b9437fb77bfa186f2a4574e129ca9ae6e2 /modules
parentCheck min_args before we check if a user has permission (commands.py) (diff)
signature
Correctly check if we're in a channel command before checking if the current
hook is valid (commands.py)
Diffstat (limited to 'modules')
-rw-r--r--modules/commands.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/commands.py b/modules/commands.py
index 84f78fe7..5c6ab118 100644
--- a/modules/commands.py
+++ b/modules/commands.py
@@ -152,18 +152,14 @@ class Module(ModuleManager.BaseModule):
"'%s' is an alias of unknown command '%s'"
% (command.lower(), alias_of.lower()))
- is_channel = False
+ is_channel = "channel" in event
if not is_channel and potential_hook.kwargs.get("channel_only"):
continue
if is_channel and potential_hook.kwargs.get("private_only"):
continue
hook = potential_hook
- if "channel" in event:
- target = event["channel"]
- is_channel = True
- else:
- target = event["user"]
+ target = event["user"] if not is_channel else event["channel"]
if not hook:
return