“Discord.js Command” Kod odpowiedzi

Discord.js Command

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 Command

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 Ban User

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 Command

//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

Odpowiedzi podobne do “Discord.js Command”

Pytania podobne do “Discord.js Command”

Więcej pokrewnych odpowiedzi na “Discord.js Command” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu