text: // Dependencies
  const Command = require('../../structures/Command.js');
  
  /**
   * Unmute command
   * @extends {Command}
  */
  class Unmute extends Command {
  	/**
   	 * @param {Client} client The instantiating client
   	 * @param {CommandData} data The data for the command
  	*/
  	constructor(bot) {
  		super(bot, {
  			name:  'unmute',
  			guildOnly: true,
  			dirname: __dirname,
  			aliases: ['un-mute'],
  			userPermissions: ['MUTE_MEMBERS'],
  			botPermissions: [ 'SEND_MESSAGES', 'EMBED_LINKS', 'MUTE_MEMBERS', 'MANAGE_ROLES'],
  			description: 'Unmute a user.',
  			usage: 'unmute <user>',
  			cooldown: 2000,
  			examples: ['unmute username'],
  		});
  	}
  
  	/**
   	 * Function for recieving message.
   	 * @param {bot} bot The instantiating client
   	 * @param {message} message The message that ran the command
   	 * @param {settings} settings The settings of the channel the command ran in
   	 * @readonly
  	*/
  	async run(bot, message, settings) {
  		// Delete message
  		if (settings.ModerationClearToggle && message.deletable) message.delete();
  
  		// Find user
  		const members = await message.getMember();
  
  		// Get the channel the member is in
  		const channel = message.guild.channels.cache.get(members[0].voice.channelID);
  		if (channel) {
  			// Make sure bot can deafen members
  			if (!channel.permissionsFor(bot.user).has('MUTE_MEMBERS')) {
  				bot.logger.error(`Missing permission: \`MUTE_MEMBERS\` in [${message.guild.id}].`);
  				return message.channel.error('misc:MISSING_PERMISSION', { PERMISSIONS: message.translate('permissions:MUTE_MEMBERS') }).then(m => m.timedDelete({ timeout: 10000 }));
  			}
  		}
  
  		// Remove mutedRole from user
  		try {
  			const muteRole = message.guild.roles.cache.get(settings.MutedRole);
  			members[0].roles.remove(muteRole);
  
  			// delete muted member from database
  			await message.guild.updateGuild({ MutedMembers: settings.MutedMembers.filter(user => user != members[0].user.id) });
  			settings.MutedMembers.filter(user => user != members[0].user.id);
  
  			// if in a VC unmute them
  			if (members[0].voice.channelID) await members[0].voice.setMute(false);
  
  			message.channel.success('moderation/unmute:SUCCESS', { USER: members[0].user }).then(m => m.timedDelete({ timeout: 3000 }));
  		} catch (err) {
  			if (message.deletable) message.delete();
  			bot.logger.error(`Command: '${this.help.name}' has error: ${err.message}.`);
  			message.channel.error('misc:ERROR_MESSAGE', { ERROR: err.message }).then(m => m.timedDelete({ timeout: 5000 }));
  		}
  	}
  }
  
  module.exports = Unmute;
  