1let member = message.mentions.members.first();
2if(!member) return message.reply("Please mention a valid member of this server");
3if(!member.kickable) return message.reply("I cannot kick this member!");
4
5member.kick(); //.kick(reason) if you would to put in the reason through arguments
1let member = message.mentions.members.first();
2if(!member) message.reply("Please mention a valid member of this server") return;
3if(!member.kickable) message.reply("This member is not kickable") return;
4// Now check if the user has the Kick Members Permission
5if(!member.hasPermission('KICK_MEMBERS') {
6 message.reply("You Can't kick anyone");
7 return;
8} else {
9 // Now If they do kick the user
10 member.kick();
11}
12// If this works please upvote!
1//start by defining discord.js
2const Discord = require('discord.js');
3
4//command handlers
5exports.run = async (client, message, args) => {
6 if (!message.member.hasPermission('KICK_MEMBERS')) return message.reply('You cannot kick members')
7
8 let member = message.mentions.members.first()
9 if (!member) return message.reply('Please specify a member for me to kick them')
10 let reason = let reason = args.slice(1).join(" ");
11 if (!reason) reason = 'No Reason Given';
12 if (!member.kickable) return message.reply('This member is not kickable')
13
14 member.kick(reason).catch(err => console.log(err));
15}