Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- module.exports.run = async (client, message, args) => {
- if (!message.member.hasPermissions ('KICK_MEMBERS')) return message.channel.send("You do not have permission for this command!");
- const mod = message.author;
- let user = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
- if (!user) return message.channel.send("Specify a valid user!")
- if (!user.roles.find(`name`, "Muted")) return message.channel.send('this person is not muted!')
- let muterole = message.guild.roles.find(`name`, "Muted");
- if (!muterole) message.channel.send("Could not find the `Muted` role!")
- await (user.removeRole(muterole.id));
- let muteEmbed2 = new Discord.RichEmbed()
- .setTitle(`You are unmuted on **${message.guild}**!`)
- .setColor("#00ff00")
- .setThumbnail(client.user.displayAvatarURL)
- .addField("Unmuted by:", message.author)
- user.send(muteEmbed2);
- return message.channel.send(`${user} is successfully unmuted!`)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement