aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2020-01-28 01:32:27 +0000
committerGravatar jesopo2020-01-28 01:32:27 +0000
commit7241027ff7d400bdddbfcc620fcd2d397b471b89 (patch)
tree3a3a5ae84f8065bff5a5a6c961cf5134cec0fbfa
parentdate permissions module to use command spec args (diff)
signature
fix privateonly/channelonly - True or None, not True or False
-rw-r--r--src/core_modules/command_spec.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core_modules/command_spec.py b/src/core_modules/command_spec.py
index 9d6e8b90..d8ac84d4 100644
--- a/src/core_modules/command_spec.py
+++ b/src/core_modules/command_spec.py
@@ -89,13 +89,15 @@ class Module(ModuleManager.BaseModule):
value = server.get_user(args[0], create=True)
n = 1
elif argument_type.type == "channelonly":
- value = not channel == None
+ if channel:
+ value = True
n = 0
- error = "Command not valid in private message"
+ error = "Command not valid in PM"
elif argument_type.type == "privateonly":
- value = channel == None
+ if not channel:
+ value = True
n = 0
- error = "Command not valid in private message"
+ error = "Command not valid in-channel"
options.append([argument_type, value, n, error])
return options