Ledger Nano X - The secure hardware wallet
SHARE
TWEET

unmute.js

UndercoverNL May 21st, 2020 1,028 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2.  
  3. module.exports.run = async (client, message, args) => {
  4.  
  5.     if (!message.member.hasPermissions ('KICK_MEMBERS')) return message.channel.send("You do not have permission for this command!");
  6.     const mod = message.author;
  7.     let user = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
  8.     if (!user) return message.channel.send("Specify a valid user!")
  9.     if (!user.roles.find(`name`, "Muted")) return message.channel.send('this person is not muted!')
  10.     let muterole = message.guild.roles.find(`name`, "Muted");
  11.     if (!muterole) message.channel.send("Could not find the `Muted` role!")
  12.  
  13.     await (user.removeRole(muterole.id));
  14.            
  15.     let muteEmbed2 = new Discord.RichEmbed()
  16.     .setTitle(`You are unmuted on **${message.guild}**!`)
  17.     .setColor("#00ff00")
  18.     .setThumbnail(client.user.displayAvatarURL)
  19.     .addField("Unmuted by:", message.author)
  20.     user.send(muteEmbed2);
  21.  
  22.     return message.channel.send(`${user} is successfully unmuted!`)
  23.  
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top