“Discord.js запрет” Ответ

Discord.js запретить команду

if (msg.member.hasPermission("BAN_MEMBERS")) {
    if (msg.members.mentions.first()) {
        try {
            msg.members.mentions.first().ban();
        } catch {
            msg.reply("I do not have permissions to ban" + msg.members.mentions.first());
        }
    } else {
        msg.reply("You do not have permissions to ban" + msg.members.mentions.first());
    }
}
Fair Ferret

Discord.js запретить команду

if (msg.member.hasPermission("KICK_MEMBERS")) {
    if (msg.members.mentions.first()) {
        try {
            msg.members.mentions.first().kick();
        } catch {
            msg.reply("I do not have permissions to kick " + msg.members.mentions.first());
        }
    } else {
        msg.reply("You do not have permissions to kick " + msg.members.mentions.first());
    }
}
Fair Ferret

Discord.js запретить пользователь

let member = message.mentions.members.first();
if(!member) return message.reply("Please mention a valid member of this server");
if(!member.bannable) return message.reply("I cannot ban this member!");

member.ban(); //.ban(reason) if you would to put in the reason through arguments
HeyItsDeveloperRhys

Discord.js запрет

code: //https://github.com/NekoYasuii/discord-template-with-slash/blob/master/src/commands/moderation/ban.js
Prickly Panda

Ответы похожие на “Discord.js запрет”

Вопросы похожие на “Discord.js запрет”

Больше похожих ответов на “Discord.js запрет” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования