“Perintah tendangan JS Discord” Kode Jawaban

Discord.js menendang pengguna

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

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

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

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

Perintah tendangan JS Discord

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

Perintah tendangan JS Discord

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

Jawaban yang mirip dengan “Perintah tendangan JS Discord”

Pertanyaan yang mirip dengan “Perintah tendangan JS Discord”

Lebih banyak jawaban terkait untuk “Perintah tendangan JS Discord” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya