add nuser spec arg type; to get a user, new or not

This commit is contained in:
jesopo 2020-01-26 02:51:18 +00:00
parent 6c510d2332
commit 73ad5c5c1b

View file

@ -78,11 +78,15 @@ class Module(ModuleManager.BaseModule):
error = "No such user" error = "No such user"
else: else:
error = "No user provided" error = "No user provided"
elif argument_type.type == "ouser" and args: elif argument_type.type == "ouser":
if server.has_user_id(args[0]): if args and server.has_user_id(args[0]):
value = server.get_user(args[0]) value = server.get_user(args[0], create=True)
n = 1 n = 1
error = "Unknown nickname" 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]) options.append([argument_type, value, n, error])
return options return options