“MUTE COMAND Discord.js v12” Respostas de código

silenciar todos em Call Discord.js

client.on('message', (message) => {
    if (message.content == '/muteAll') {
        let channel = message.member.voiceChannel;
        for (let member of channel.members) {
            member[1].setMute(true)
        }
     }
});

MUTE COMAND Discord.js v12

client.on("message", message => {
  if (message.content.startsWith(prefix + "mute")) {
    
    
    // Variables
    var muteRole = message.guild.roles.find(role => role.name.toLowerCase().includes("muted"));
    var muteChannel = message.guild.channels.find(channel => channel.name.includes("modlogs"));
    var muteUser = message.mentions.members.first();
    var muteReason = message.content.slice(prefix.length + 27);
    
    
    // Conditions for muting
    if (!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You don't have the permissions"); //the member has higher perms
    if (!muteUser) return message.channel.send("You have to mention a valid member");
    if (!muteChannel) return message.channel.send("There's no channel called modlogs");
    if (!muteRole) return message.channel.send("There's no role called muted");
    if (!message.guild.member(client.user.id).hasPermission("MANAGE_ROLES")) return message.channel.send("I Don't have permissions");
    if (!muteReason) muteReason = "No reason given";
    
    // Embed for details of mute
    var muteEmbed = new Discord.RichEmbed() 
    .setTitle("Mute")
    .addField("Muted user", muteUser)
    .addField("Reason", muteReason)
    .setFooter(`Muted by ${message.author.tag}`)
    .setTimestamp();
    
    //Mute
    muteUser.addRole(muteRole);
    message.channel.send(`${muteUser} has been muted`);
    muteChannel.send(muteEmbed);
    
  }
})
Blushing Baboon

Respostas semelhantes a “MUTE COMAND Discord.js v12”

Perguntas semelhantes a “MUTE COMAND Discord.js v12”

Mais respostas relacionadas para “MUTE COMAND Discord.js v12” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código