Correctly check if we're in a channel command before checking if the current
hook is valid (commands.py)
This commit is contained in:
parent
c822a1afd6
commit
f25bfd0ae2
1 changed files with 2 additions and 6 deletions
|
@ -152,18 +152,14 @@ class Module(ModuleManager.BaseModule):
|
||||||
"'%s' is an alias of unknown command '%s'"
|
"'%s' is an alias of unknown command '%s'"
|
||||||
% (command.lower(), alias_of.lower()))
|
% (command.lower(), alias_of.lower()))
|
||||||
|
|
||||||
is_channel = False
|
is_channel = "channel" in event
|
||||||
if not is_channel and potential_hook.kwargs.get("channel_only"):
|
if not is_channel and potential_hook.kwargs.get("channel_only"):
|
||||||
continue
|
continue
|
||||||
if is_channel and potential_hook.kwargs.get("private_only"):
|
if is_channel and potential_hook.kwargs.get("private_only"):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
hook = potential_hook
|
hook = potential_hook
|
||||||
if "channel" in event:
|
target = event["user"] if not is_channel else event["channel"]
|
||||||
target = event["channel"]
|
|
||||||
is_channel = True
|
|
||||||
else:
|
|
||||||
target = event["user"]
|
|
||||||
|
|
||||||
if not hook:
|
if not hook:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue