forked from Galactic/galactic-bot
51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
const { stripIndents } = require('common-tags');
|
|
|
|
const { Command, Argument } = require('../../../../interfaces/');
|
|
|
|
class PingCommand extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
name: 'arguments',
|
|
module: 'utility',
|
|
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']
|
|
})
|
|
],
|
|
restricted: true,
|
|
archivable: false
|
|
});
|
|
|
|
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; |