It's minimist (again)

This commit is contained in:
Dragon Fire
2024-04-29 02:22:27 -04:00
parent 9eb1202641
commit 57897377c8
2 changed files with 1 additions and 3 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ module.exports = class CommandDispatcher {
}
const content = msg.content.replace(this.commandPattern, '').trim();
const result = (content.match(argRegex) || []).map(m => m.replace(argRegex, '$1$2'));
const parsed = minimist(result, { boolean: true });
const parsed = minimist(result, { boolean: true, string: '_' });
const finalResult = { flags: parsed };
for (let i = 0; i < command.args.length; i++) {
const arg = command.args[i];
-2
View File
@@ -9,12 +9,10 @@ module.exports = class UserArgumentType extends ArgumentType {
const matches = val.match(/^(?:<@!?)?([0-9]+)>?$/);
if (matches) {
try {
console.log(matches);
const user = await msg.client.users.fetch(matches[1]);
if (!user) return false;
return true;
} catch (err) {
console.error(err);
return false;
}
}