galactic-bot/structure/client/components/commands/utility/Arguments.js

63 lines
1.8 KiB
JavaScript
Raw Normal View History

const { stripIndents } = require('common-tags');
const { Command } = require('../../../../interfaces/');
class PingCommand extends Command {
constructor(client) {
super(client, {
name: 'arguments',
module: 'utility',
aliases: ['args', 'arg', 'argument'],
arguments: [
{
name: 'apple',
type: 'BOOLEAN',
types: ['VERBAL', 'FLAG'],
default: true
},
{
name: 'banana',
aliases: ['bans', 'bananas'],
type: 'INTEGER',
types: ['FLAG', 'VERBAL'],
min: 0,
max: 10,
required: true
},
{
name: 'carrot',
aliases: ['cars', 'carrots'],
type: 'VOICECHANNEL',
types: ['FLAG', 'VERBAL'],
infinite: true,
default: 'test'
},
{
name: 'format',
type: 'STRING',
types: ['VERBAL', 'FLAG'],
options: [ 'webp', 'png', 'jpeg', 'jpg', 'gif' ],
required: true
}
],
restricted: true,
archivable: false
});
this.client = client;
}
async execute(message, { args, params }) {
console.log(args);
await message.respond(stripIndents`**arguments:** ${Object.values(args).map((a) => `${a.name}: ${a.value}`)
.join(' | ')}
**words:** ${params.join(', ')}`, { emoji: 'success' });
}
}
module.exports = PingCommand;