[Plugins/Command] Awful hack to allow setting type of args

Oh boy, here I go evaling user-defined strings again
This commit is contained in:
Derek 2022-03-26 04:06:17 -04:00
parent 238aa24a23
commit b69e808763

View file

@ -114,6 +114,8 @@ class CommandPlugin(PluginBase):
cmd = Command(name, help, aliases=aliases)
for argnode in [node for node in _children if node.name == 'arg']:
if argnode.props.get('type'):
argnode.props['type'] = eval(argnode.props['type'])
cmd.add_arg(*argnode.args, **argnode.props)
self.commands[name] = (cmd, actionnode, display)