“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 запретить команду

//This is the command but you need the kcik command

if (message.content.startsWith("d!kick")) {if (message.member.hasPermission("KICK_MEMBERS")) {
let member = message.mentions.members.first()
if (!member) message.channel.send("Please mention someone")
  else {member.kick().then(mem => {message.channel.send(`Kicked ${mem.user.username}!`)
})}} else {message.reply("You don't have the permission to do that...")}}  if (message.content.startsWith('d!ban')) {if(message.member.hasPermission("BAN_MEMBERS")) {const user = message.mentions.users.first(); if (user) {const member = message.guild.member(user);if (member) {
member

            		

Javascript answers related to “Discord.js ban command”


Javascript queries related to “Discord.js ban command”




Browse Javascript Answers by Framework


More “Kinda” Related Javascript Answers View All Javascript Answers »

Sore Serval

Ответы похожие на “Discord.js запретить команду”

Вопросы похожие на “Discord.js запретить команду”

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

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

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