“Discord JS Kick Command” Ответ

Discord.js Kick User

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

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

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

Simple Kick Command Discord.js v12

ban someone discord jsJavascript By Lime on Jun 21 2020
if (!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send("Invalid Permissions")
let User = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0])
if (!User) return message.channel.send("Invalid User")
if (User.hasPermission("BAN_MEMBERS")) return message.reply("Invalid Permissions")
let banReason = args.join(" ").slice(22);
if (!banReason) {
  banReason = "None"
}

User.ban({reason: banReason})
Terrible Teira

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 Kick Command

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
            });
Stupid Sardine

Discord JS Kick Command

const { SlashCommandBuilder } = require('@discordjs/builders');
const { Permissions } = require('discord.js');

module.exports = {
	data: new SlashCommandBuilder()
		.setName('kick')
		.setDescription('kicks mentioned user')
		.addUserOption((option) =>
			option
				.setName('target')
				.setDescription('user you want to kick')
				.setRequired(true),
		),
	async execute(interaction) {
		if (interaction.member?.permissions.has(Permissions.FLAGS.KICK_MEMBERS)) {
			const user = interaction.options.getMember('target');
			if (interaction.member == user) {
				await interaction.reply('you can\'t kick yourself');
			}
			else {
				user.kick();
				await interaction.reply(`kicked user ${user}`);
			}
		}
		else {
			await interaction.reply('you do not have permission to kick');
		}

	},
};
// desgined to be in a folder for commands and saved as kick.js
luke whipp

Ответы похожие на “Discord JS Kick Command”

Вопросы похожие на “Discord JS Kick Command”

Больше похожих ответов на “Discord JS Kick Command” по JavaScript

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

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