2023-05-05 16:32:29 +02:00
|
|
|
import { Parser, Command, OptionType } from '../build/esm/index.js';
|
|
|
|
|
2023-12-14 16:33:54 +01:00
|
|
|
// const command = new Command({
|
|
|
|
// name: 'create',
|
|
|
|
// options: [{
|
|
|
|
// name: 'registration-code',
|
|
|
|
// aliases: ['code'],
|
|
|
|
// type: OptionType.SUB_COMMAND,
|
|
|
|
// options: [{
|
|
|
|
// name: 'amount',
|
|
|
|
// flag: true,
|
|
|
|
// type: OptionType.INTEGER,
|
|
|
|
// defaultValue: 1,
|
|
|
|
// valueOptional: true,
|
|
|
|
// required: true
|
|
|
|
// }]
|
|
|
|
// }]
|
|
|
|
// });
|
2023-05-05 16:32:29 +02:00
|
|
|
const command = new Command({
|
2023-12-14 16:33:54 +01:00
|
|
|
name: 'botban',
|
|
|
|
options: [
|
|
|
|
{ name: 'users', type: OptionType.STRING, required: true },
|
|
|
|
{ name: 'service', choices: ['support', 'reports'], valueAsAlias: true, required: true }
|
|
|
|
]
|
2023-05-05 16:32:29 +02:00
|
|
|
});
|
|
|
|
const parser = new Parser({ commands: [command], prefix: '', debug: true });
|
|
|
|
parser.on('debug', console.log)
|
2023-12-14 16:33:54 +01:00
|
|
|
// console.log(await parser.parseMessage('create code -a 1'));
|
|
|
|
// console.log(await parser.parseMessage('create code --help'));
|
|
|
|
// // console.log(await parser.parseMessage('create --help'));
|
|
|
|
|
|
|
|
// console.log(await parser.parseMessage('create code'));
|
|
|
|
|
|
|
|
console.log(await parser.parseMessage('botban support dingus'));
|