mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
It's minimist (again)
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user