text: const { Command } = require('discord.js-commando');
  const { MessageEmbed } = require('discord.js');
  
  module.exports = class KickCommand extends Command {
    constructor(client) {
      super(client, {
        name: 'kick',
        description: 'Kicks a tagged member.',
        aliases: ['throw'],
        memberName: 'kick',
        group: 'admin',
        guildOnly: true,
        userPermissions: ['MANAGE_MESSAGES', 'KICK_MEMBERS', 'BAN_MEMBERS'],
        clientPermissions: ['MANAGE_MESSAGES', 'KICK_MEMBERS', 'BAN_MEMBERS'],
        args: [
          {
            key: 'userToKick',
            prompt: 'Who do you want to kick?',
            type: 'string',
          },
          {
            key: 'reason',
            prompt: 'Why do you want to kick this user?',
            type: 'string',
          },
        ],
      });
    }
  
    run(message, { userToKick, reason }) {
      const user = message.mentions.members.first()
        || message.guild.members.fetch(userToKick);
  
      if (user === undefined) {
        message.channel.send('Please try again with a valid user');
        return;
      }
  
      user.kick(reason).then(() => {
        const kickEmbed = new MessageEmbed()
          .addField('Kicked:', userToKick)
          .addField('Reason:', reason)
          .setColor('#420626');
        message.say(kickEmbed);
      }).catch((e) => {
        message.say(`
          Something went wrong when trying to kick this user, 
          I probably do not have the permission to kick him.
        `.replace(/  +/g, ''));
        return console.error(e);
      });
    }
  };
  