📜  discord.js 静音脚本 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:19.481000             🧑  作者: Mango

代码示例1
client.on('message', message => {
    if(message.content.startsWith(prefix + 'mute')){
         if(message.member.hasPermission('MANAGE_ROLES')) {
             const role = message.guild.roles.cache.find(role => role.name === 'Muted');
                 const member = message.mentions.members.first();
                     member.roles.add(role); 
                     message.channel.send(member + ' Has Been Muted');

            } else {
                 message.channel.send("Please Mention Who To Mute")
             }     
        }
})