showing results for - "mute command discord js v12"
Estelle
05 Sep 2016
1if(command === "unban"){
2    if(!msg.member.hasPermission("BAN_MEMBERS")) {
3      return msg.channel.send(`**${msg.author.username}**, You do not have perms to unban someone`)
4    }
5    
6    if(!msg.guild.me.hasPermission("BAN_MEMBERS")) {
7      return msg.channel.send(`**${msg.author.username}**, I do not have perms to unban someone`)
8    }
9    
10    let userID = args[0]
11      msg.guild.fetchBans().then(bans=> {
12      if(bans.size == 0) return 
13      let bUser = bans.find(b => b.user.id == userID)
14      if(!bUser) return
15      msg.guild.members.unban(bUser.user)
16})
17    
18  ;}
Clementine
08 May 2020
1client.on('message', (message) => {
2    if (message.content == '/muteAll') {
3        let channel = message.member.voiceChannel;
4        for (let member of channel.members) {
5            member[1].setMute(true)
6        }
7     }
8});
9
Olivia
16 Feb 2016
1const Discord = require('discord.js')
2
3exports.run = async (client, message, args) => {
4  if (!message.member.hasPermission('MUTE_MEMBERS')) return message.reply('You cannot use this command');
5  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');
6  
7  //Variables
8  var muteRole = message.guild.roles.find(r => r.name === 'YOUR_MUTE_ROLE_NAME');
9  var memberRole = message.guild.roles.find(r => r.name === 'YOUR_MAIN_MEMBER_ROLE');
10  
11  //let
12  let member = message.mentions.members.first();
13  let reason = args.slice(1).join(' ');
14  if (!reason) reason = 'No Reason Given';
15  
16  message.member.roles.add(muteRole);
17  message.member.roles.remove(memberRole);
18  
19  var muteEmbed = new Discord.MessageEmbed()
20   .setColor('RED')
21   .setTitle('${member} has been muted for ${reason}');
22  
23  message.channel.send(muteEmbed).catch(err => console.log(err));
24}
Lilian
29 Jun 2016
1const Discord = require('discord.js');
2const client = new Discord.Client();
3const prefix = "!";
4const token = ""; // Fill in your token
5
6client.on("message", msg => {
7  msg.content.startsWith(prefix + "mute") {
8    
9    
10    // Variables
11    var muteRole = msg.guild.roles.find(role => role.name.toLowerCase().includes("muted"));
12    var muteChannel = msg.guild.channels.find(channel => channel.name.includes("modlogs"));
13    var muteUser = msg.mentions.members.first();
14    var muteReason = msg.content.slice(prefix.length + 27);
15    
16    
17    // Conditions
18    if (!msg.member.hasPermission("MANAGE_MESSAGES")) return msg.channel.send("You don't have the permissions");
19    if (!muteUser) return msg.channel.send("You have to mention a valid member");
20    if (!muteChannel) return msg.channel.send("There's no channel called modlogs");
21    if (!muteRole) return msg.channel.send("There's no role called muted");
22    if (!msg.guild.member(client.user.id).hasPermission("MANAGE_ROLES")) return msg.channel.send("I Don't have permissions");
23    if (!muteReason) muteReason = "No reason given";
24    
25    // Embed
26    var muteEmbed = new Discord.RichEmbed() 
27    .setTitle("Mute")
28    .addField("Muted user", muteUser)
29    .addField("Reason", muteReason)
30    .setFooter(`Muted by ${msg.author.tag}`)
31    .setTimestamp();
32    
33    //Mute
34    muteUser.addRole(muteRole);
35    msg.channel.send(`${muteUser} has been muted`);
36    muteChannel.send(muteEmbed);
37    
38  }
39})
Kyler
22 Aug 2016
1
2client.on('message', message => {
3    if (message.content.startsWith(prefix + 'unmute')) {
4        if (message.member.hasPermission('MANAGE_ROLES')) {
5            const role = message.guild.roles.cache.find(role => role.name === 'Muted');
6            const member = message.mentions.members.first();
7            member.roles.remove(role);
8            message.channel.send(member + ' Has Been Unmuted');
9
10        } else {
11            message.channel.send("Please Mention Who To Unute")
12        }
13    }
14})
Anthony
27 Jun 2019
1client.on("message", message => {
2  if (message.content.startsWith(prefix + "mute")) {
3    
4    
5    // Variables
6    var muteRole = message.guild.roles.find(role => role.name.toLowerCase().includes("muted"));
7    var muteChannel = message.guild.channels.find(channel => channel.name.includes("modlogs"));
8    var muteUser = message.mentions.members.first();
9    var muteReason = message.content.slice(prefix.length + 27);
10    
11    
12    // Conditions for muting
13    if (!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You don't have the permissions"); //the member has higher perms
14    if (!muteUser) return message.channel.send("You have to mention a valid member");
15    if (!muteChannel) return message.channel.send("There's no channel called modlogs");
16    if (!muteRole) return message.channel.send("There's no role called muted");
17    if (!message.guild.member(client.user.id).hasPermission("MANAGE_ROLES")) return message.channel.send("I Don't have permissions");
18    if (!muteReason) muteReason = "No reason given";
19    
20    // Embed for details of mute
21    var muteEmbed = new Discord.RichEmbed() 
22    .setTitle("Mute")
23    .addField("Muted user", muteUser)
24    .addField("Reason", muteReason)
25    .setFooter(`Muted by ${message.author.tag}`)
26    .setTimestamp();
27    
28    //Mute
29    muteUser.addRole(muteRole);
30    message.channel.send(`${muteUser} has been muted`);
31    muteChannel.send(muteEmbed);
32    
33  }
34})
queries leading to this page
mute bot discord jsmute command discord js idmusic bot discord js mute commanddiscord js mute allmute all members discord jshow to make a unban command discord jsmute member discord jsdiscord bot mute user jshow to mute a user in discord jsmute npm discord jsmute command for discord jscommande de mute discord jsdiscord js v12 unban commandservermute discord jsdiscord js mute voicevoice mute all bot discordunban discord jsdiscord js mute someonediscord js mute commandunban command discord jsmute discord jsmute someone discord jsmute command discord jshow to mute in a vc discord jshow to mute users discord jsdiscordjs mute commanddiscord js mute selfdiscord js copy message v12mute when swear discord jsmute someone in a channel not server discord jsunbanban discord jsdiscord js mute commadnmute discord jstemporary mute command discordjsunbn code v12unban user by id discord js v11unban code discored jsdiscord source code to mute a member from argsserver mute discord jsunban discord js v12mute command discord js v12 with databsediscord js guide mutediscordjs how to make message silenthow to mute members discord js commanddiscordjs mute everyone in a channelunban with id discord jsmute command and with ms and reason in discord jsdiscord js unban v12how to use mute someone discord jsdiscord js user is muted 3fadd a mute command to bot discord jsunban all discord jsmute discord bot jsserver mute someone in discord jsmute command discord codehow to mute everyone on a voice channel discord jshow to make mute command discord jscode unban command discord jshow to make a mute command discordjsdiscord js on unbanhow to mute someone in discord jshow to make discord js mute everyone in callmute bot discord jdiscord js mute unmute commandhow to make a simple unban command in discord jsvoice bot mute discord jsmute discord by id discord jsvoice mute discord botunban discord jsdiscord js how to mute a usermute member discord jsdiscord js voice muteban unban discord jstemp mute command discord jsdiscord js mute in chat codediscord js long muteservermute discord jshow to server mute someone on discord jsdiscord js mute command code 2020how to mute someone on voice chat in discord jsdiscord bot how to mute usernamediscord js how to mute someonediscord mute channel for alldiscord js mute botdiscord js mute systemcreate mute command discord jsjs discord mute botdiscordjs timed mutemute member through discord jsmute user discord jsmute voice discord jsdiscord js v12 how to unbanadd mute role discord jsdiscord mute jsdiscord js v12 mute commanddiscord js mutescreate mute role discord jsdiscord js unban commandmute all users in voice channel discord jshow to mute someone discord bot jshow to unban discord jsdiscord js unban command v12mute script bot discordunban code in discord jsdiscord js bot mute itselfmute command discord js voicediscord mute members discord jshow to create a hashtag to mute everyone in discorddiscord js mutediscord js v12 unbanmute user in voicechannel discord js v12discord js server mute someonemute command with time discord js 12mute member command discord js v12how to make a unban command discord js v12mute all members discorddiscord js mute role autodiscord unban command discordjsmute user in voicechannel discord jshow to mute channel in discord jsunban command discord js v11mute command discord jsdiscord js make mute rolediscord js is user muteddiscord js v12 unban command with idmute system discord jssimple unban command discord js v12discord js mute a userdiscord js user mute updatediscordjs temporary mute commandcomando mute discordhow to make temp mute command discord jsmute command discord js 2020voice mute discord jsvoice mute bot discord jsunban all discord js mute 40user discord jsjs discord bot mutemute user discord jsdiscord js unbanvkick discord js v12timed mute command discord jsunban command discord js v13how to make a reason for unban command discord jsmute someone on discord discord jsdiscord bot javascript mute commandhow to mute someone in discord jsdiscord js mute commmandehow to mute someone in discord 2cjshow to mute members discord jsdiscord js unban command v13mute and reasons command discord jsdiscord js how do i mute a userdiscord js 12 mute commanddiscord mic mute botdiscord js how to mute players in voice channeldiscord js guide mute 2funmutemute command discordjscodegreeper discord js mutecodelyon discord js mutemute discord discord jsdiscord javascript mute userdiscord js mute a user in voice channeldiscord js unbanhow to make a mute command in discord jsdiscord js muteunban command discord js v12discord js mute codehow to make unban command discord jsmute everyone in channel discord jsunban command discord js 12discord js server mute checkhow to server mute a user in voicechannel discord jsmute command discord js dbdiscord js mute user in vcmute all in voice channel discordjsunban command in discord jshow to unban in discord jsdiscord js mute scripthow to mute everyone in a discord channelhow to mute someone on discord discord jsmute command for discord js botmute command discord 2fjsmute in vocal chat discord jsdiscord js mute by idhow to mute everyone in a discord channel using discord jsdiscord js how to show mutes and warns i oncehow to mute a user discord nodejsmute role discord jsget a voice channel and mute all members discord jsunban ocmmand discord js v12discord js voice chat server mute memberdiscord js mute command handdlerdiscord js v12 un ban commandhow to mute discord jsmute everyone except bots discord jshow to mute everyone in discord voice channeldiscord js mute command v11discord js temp mute commandhow to make an unban command discord js v13voice mute discord jsdiscord mute personmute discord js v12mute and unmute command discord js create mute role if not mademute command with embedded messages discord jsdiscord mute commandhow to make a mute command discord jsmute discord channel discord jsdiscord js mute code copydiscord js mute system with timestimed mute with reason command discord js examplehow to server mute a member on discord jsmute bot discord jsdiscordjs mute comamndunban code v12 discordjsdiscord js ban v12get a voice channel and mute all members discord js v12unban user discord js v12timed mute with reason command discord jsdiscord js unmute bot voicediscord js muting someone in a text channelsnipe command discord js v12discord js mute command examplediscord js v12 unban commandbasic unban command discord js v12mute the bot discord jsmute all members of a voice channel discord jsmute ms discord jsunban command discord jsmute in discord jshow to mute discordmuting voice channel with a botmute reason discord jsdiscord mute command codediscord bot mute all in channelserver mute command discord jsdiscord js mute command v12discord js server mute memberdiscord js 2c chat mute commandhow to mute a bot discord jsdiscord js mute someone in just one channelmute command discord js without mute role iddiscord mute bot v12discord js how to mute userunban command discord js v13discord js mute membercommand unban discord jsdiscord ban v12 codediscord js muterolediscord js unban wont workhow to make a mute command in discord js v13mute discords jsdiscord js mute people in vocal chatdiscord js unban commandmute code discord jsunban code discord jsserver mute discord discord jsmute and unmute discord jskick and ban 12v discord jsdiscord js mute and tempmutehow to mute server for everyonediscord js mtempmute and mutemute discord js mshow to mute some discord jstimed mute using ms command discord jsdiscord js unban command githubdiscord js validate unban user iddiscord bot with mute commandmute command discord js v12how to mute discord jshow to voice mute somebody discord bot discordjsdiscord js temp mutediscord js server mutediscord js mute usermute and unmute command discord jshow to mute someone discord jsdiscord mute everyone in a channeldiscord js mute commanddiscord js mute membersscript mute discord jsmute person who sent message discord jsmute member discord jsdiscord js mute in chat code copyhow to server mute someone in discord with discord jsmute command discord js v12