automatically reform schemas to have options with trailing args
This commit is contained in:
parent
09dae249ef
commit
81deb86730
@ -605,7 +605,13 @@ class ChatBot extends Daemon {
|
|||||||
// Skip if not a real command
|
// Skip if not a real command
|
||||||
if (registeredCommand.fn === null) continue;
|
if (registeredCommand.fn === null) continue;
|
||||||
|
|
||||||
for (const schema of registeredCommand.schemas) {
|
// Add auto-generated schemas with trailing args
|
||||||
|
const schemas = registeredCommand.schemas;
|
||||||
|
schemas.forEach((schema) => {
|
||||||
|
schemas.push([...schema.filter(commandArg => commandArg.name !== undefined), ...schema.filter(commandArg => commandArg.name === undefined)]);
|
||||||
|
});
|
||||||
|
|
||||||
|
for (const schema of schemas) {
|
||||||
// List of match args for command (remove input args/nulls)
|
// List of match args for command (remove input args/nulls)
|
||||||
const commandMatchArgs = schema
|
const commandMatchArgs = schema
|
||||||
.map(commandArg => this._commandMatchArgToGeneric(commandArg));
|
.map(commandArg => this._commandMatchArgToGeneric(commandArg));
|
||||||
|
Loading…
Reference in New Issue
Block a user