“Perintah Mute Discord.js v12” Kode Jawaban

bisu semua orang di 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)
        }
     }
});

Perintah Mute 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

Jawaban yang mirip dengan “Perintah Mute Discord.js v12”

Pertanyaan yang mirip dengan “Perintah Mute Discord.js v12”

Lebih banyak jawaban terkait untuk “Perintah Mute Discord.js v12” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya