support exported command spec types!
This commit is contained in:
parent
f827bdce7f
commit
ab892c33b5
1 changed files with 11 additions and 6 deletions
|
@ -44,12 +44,17 @@ class Module(ModuleManager.BaseModule):
|
||||||
value = simple_value
|
value = simple_value
|
||||||
n = simple_count
|
n = simple_count
|
||||||
error = argument_type.error()
|
error = argument_type.error()
|
||||||
elif argument_type.type in types.TYPES:
|
else:
|
||||||
func = types.TYPES[argument_type.type]
|
if argument_type.type in types.TYPES:
|
||||||
try:
|
func = types.TYPES[argument_type.type]
|
||||||
value, n = func(server, channel, user, args)
|
else:
|
||||||
except types.SpecTypeError as e:
|
func = self.exports.get_one("spec.%s" % argument_type.type)
|
||||||
error = e.message
|
|
||||||
|
if func:
|
||||||
|
try:
|
||||||
|
value, n = func(server, channel, user, args)
|
||||||
|
except types.SpecTypeError as e:
|
||||||
|
error = e.message
|
||||||
|
|
||||||
options.append([argument_type, value, n, error])
|
options.append([argument_type, value, n, error])
|
||||||
return options
|
return options
|
||||||
|
|
Loading…
Reference in a new issue