mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
Fix arg parsing for flags
This commit is contained in:
@@ -42,7 +42,7 @@ module.exports = class CommandDispatcher {
|
|||||||
}
|
}
|
||||||
const content = msg.content.replace(this.commandPattern, '').trim();
|
const content = msg.content.replace(this.commandPattern, '').trim();
|
||||||
const result = (content.match(argRegex) || []).map(m => m.replace(argRegex, '$1$2'));
|
const result = (content.match(argRegex) || []).map(m => m.replace(argRegex, '$1$2'));
|
||||||
const parsed = minimist(result);
|
const parsed = minimist(result, { boolean: true });
|
||||||
const finalResult = { flags: parsed };
|
const finalResult = { flags: parsed };
|
||||||
for (let i = 0; i < command.args.length; i++) {
|
for (let i = 0; i < command.args.length; i++) {
|
||||||
const arg = command.args[i];
|
const arg = command.args[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user