diff --git a/bundles/chatbot/daemons/chatbot.js b/bundles/chatbot/daemons/chatbot.js index 944a0ba..8b4859f 100644 --- a/bundles/chatbot/daemons/chatbot.js +++ b/bundles/chatbot/daemons/chatbot.js @@ -605,7 +605,13 @@ class ChatBot extends Daemon { // Skip if not a real command 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) const commandMatchArgs = schema .map(commandArg => this._commandMatchArgToGeneric(commandArg));