2023-05-05 16:32:29 +02:00
|
|
|
// import { Parser, Command, CommandOption, OptionType } from '../build/esm'
|
|
|
|
const {Parser, Command, CommandOption, OptionType} = require('../build/cjs')
|
2022-07-29 22:22:29 +02:00
|
|
|
|
|
|
|
const opt = new CommandOption({
|
|
|
|
name: 'text',
|
|
|
|
type: OptionType.STRING
|
|
|
|
});
|
|
|
|
class TestCommand extends Command {
|
|
|
|
constructor() {
|
|
|
|
super({
|
|
|
|
name: 'test',
|
|
|
|
options: [opt]
|
|
|
|
})
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const parser = new Parser({
|
|
|
|
commands: [new TestCommand()],
|
|
|
|
resolver: null
|
|
|
|
});
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
const parsed = await parser.parseMessage('test message.author')
|
2023-02-12 17:08:52 +01:00
|
|
|
// console.log(parsed)
|
2022-07-29 22:22:29 +02:00
|
|
|
})();
|
2023-02-12 16:20:05 +01:00
|
|
|
|
|
|
|
test('', () => {
|
|
|
|
|
|
|
|
})
|