“Commande Discord JS Kick” Réponses codées

Discord.js Kick Utilisateur

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

Commande de Discord.js Ban

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

Commande de coup de pied simple 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

Commande de Discord.js Ban

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

Commande Discord JS Kick

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

Commande Discord JS Kick

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

Réponses similaires à “Commande Discord JS Kick”

Questions similaires à “Commande Discord JS Kick”

Plus de réponses similaires à “Commande Discord JS Kick” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code