📌  相关文章
📜  discord js kick 命令 - Javascript 代码示例

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

代码示例5
const target = message.mentions.members.first()
        if (!target) {
            const embed1 = new Discord.MessageEmbed()
            .setColor(commonjson.failcolor)
            .setTitle("Error")
            .setDescription("User does not exist in this server")
            message.channel.send(embed1);
            return
        }


            target.kick('not cool man')
            .then(async(target) => {
                
                const embed2 = new Discord.MessageEmbed()
                .setColor(commonjson.defaultolor)
                .setTitle(`Kicked!`)
                .setDescription(`You've kicked ${target.DisplayName} successfully`)
                message.channel.send(embed2);
                
            }).catch(() => {
                // Failmessage
            });