discord.js mute command
const Discord = require('discord.js')
exports.run = async (client, message, args) => {
if (!message.member.hasPermission('MUTE_MEMBERS')) return message.reply('You cannot use this command');
if (!message.guild.me.hasPermission('MANAGE_ROLES')) return message.reply('I cannot use this command as i dont have the \`MANAGE_ROLES\` Permission on my role');
//Variables
var muteRole = message.guild.roles.find(r => r.name === 'YOUR_MUTE_ROLE_NAME');
var memberRole = message.guild.roles.find(r => r.name === 'YOUR_MAIN_MEMBER_ROLE');
//let
let member = message.mentions.members.first();
let reason = args.slice(1).join(' ');
if (!reason) reason = 'No Reason Given';
message.member.roles.add(muteRole);
message.member.roles.remove(memberRole);
var muteEmbed = new Discord.MessageEmbed()
.setColor('RED')
.setTitle('${member} has been muted for ${reason}');
message.channel.send(muteEmbed).catch(err => console.log(err));
}