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

67 lines
1.8 KiB
JavaScript
Raw Normal View History

const { stripIndents } = require('common-tags');
const { Command } = require('../../../../interfaces/');
2020-06-04 19:59:09 +02:00
class ArgumentsCommand extends Command {
constructor(client) {
super(client, {
name: 'arguments',
module: 'utility',
aliases: ['args', 'arg', 'argument'],
arguments: [
{
name: 'users',
aliases: ['user'],
type: 'MEMBER',
types: ['FLAG'],
required: true,
infinite: true
},
{
name: 'text',
aliases: ['content'],
type: 'STRING',
types: ['FLAG'],
required: true
},
{
name: 'bots',
aliases: ['bot'],
type: 'BOOLEAN',
2020-06-04 19:59:09 +02:00
types: ['FLAG'],
default: true
},
{
name: 'attachments',
aliases: ['images'],
type: 'BOOLEAN',
types: ['FLAG'],
default: true
},
{
name: 'silent',
type: 'BOOLEAN',
types: ['FLAG'],
default: true
}
],
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' });
}
}
2020-06-04 19:59:09 +02:00
module.exports = ArgumentsCommand;