galactic-bot/structure/client/components/commands/utility/Arguments.js
Navy d6a0f99601 A lot of shit
Co-authored-by: nolan <noooolaaaan@gmail.com>
2020-04-17 18:23:13 +03:00

50 lines
1.5 KiB
JavaScript

const { stripIndents } = require('common-tags');
const { Command, Argument } = require('../../../../interfaces/');
class PingCommand extends Command {
constructor(client) {
super(client, {
name: 'arguments',
module: 'utility',
description: "Tests the argument parsing of the command handler.",
aliases: ['args', 'arg', 'argument'],
arguments: [
new Argument(client, {
name: 'apple',
type: 'BOOLEAN',
types: ['VERBAL', 'FLAG'],
default: true
}),
new Argument(client, {
name: 'banana',
aliases: ['bans', 'bananas'],
type: 'INTEGER',
types: ['FLAG', 'VERBAL'],
default: 0
}),
new Argument(client, {
name: 'carrot',
aliases: ['cars', 'carrots'],
type: 'STRING',
required: true,
types: ['FLAG', 'VERBAL']
})
]
});
this.client = client;
}
async execute(message, { args, params }) {
await message.respond(stripIndents`**arguments:** ${Object.values(args).map(a=>`${a.name}: ${a.value}`).join(' | ')}
**words:** ${params.join(', ')}`, { emoji: 'success' });
}
}
module.exports = PingCommand;