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

59 lines
1.7 KiB
JavaScript

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'],
default: 0
},
{
name: 'carrot',
aliases: ['cars', 'carrots'],
type: 'CHANNEL',
required: true,
types: ['FLAG', 'VERBAL'],
infinite: true
},
{
name: 'format',
type: 'STRING',
types: ['VERBAL', 'FLAG'],
options: [ 'webp', 'png', 'jpeg', 'jpg', 'gif' ],
default: 'webp'
}
],
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;