diff options
| author | 2020-01-26 02:51:18 +0000 | |
|---|---|---|
| committer | 2020-01-26 02:51:18 +0000 | |
| commit | 73ad5c5c1b4fad852678b4597e18bd5d5dc6de55 (patch) | |
| tree | df3194c54d477ff161cf272d81430c6392c95800 /src | |
| parent | add rchannel spec arg to !access (diff) | |
| signature | ||
add `nuser` spec arg type; to get a user, new or not
Diffstat (limited to 'src')
| -rw-r--r-- | src/core_modules/command_spec.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core_modules/command_spec.py b/src/core_modules/command_spec.py index 62cbefeb..cd61ab96 100644 --- a/src/core_modules/command_spec.py +++ b/src/core_modules/command_spec.py @@ -78,11 +78,15 @@ class Module(ModuleManager.BaseModule): error = "No such user" else: error = "No user provided" - elif argument_type.type == "ouser" and args: - if server.has_user_id(args[0]): - value = server.get_user(args[0]) + elif argument_type.type == "ouser": + if args and server.has_user_id(args[0]): + value = server.get_user(args[0], create=True) n = 1 error = "Unknown nickname" + elif argument_type.type == "nuser": + if args: + value = server.get_user(args[0], create=True) + n = 1 options.append([argument_type, value, n, error]) return options |
