discord.js how to kick a 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

3.83
6
Errotian 115 points

                                    let member = message.mentions.members.first();
if(!member) message.reply("Please mention a valid member of this server") return;
if(!member.kickable) message.reply("This member is not kickable") return;
// Now check if the user has the Kick Members Permission
if(!member.hasPermission('KICK_MEMBERS') {
   message.reply("You Can't kick anyone");
	return;
} else {
 // Now If they do kick the user
  member.kick();
}
// If this works please upvote!

3.83 (6 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to kick members using id discord.js How to kick discord js discord.js kick specific user how to kick members discord js kick someone discord js kick commands discord.js kick command discord.js.guide kick in discord.js discord.js kick member from voice discord .js kick cmd kick someone from discord.js discord.js kick members discord.js how to kick a user how to kick a user with a reason discord.js kick user from discord server discord.js kick member with discord.js discord js kick user by id dsicord bot kick js user by id discord js kick command discord.js KICK_MEMBERS discord.js kick user from id discord.js kick usere discord.js kick member how to kick a member discord.js discord.js kick log discord.js kick kick discord js kick members discord.js Kick all users discord.js how to kick someone in discord.js discord.js kick yourself member.kick(reason) discord.js discord.js kick command with reason discordjs kick user with id member kick discord.js discord js kickable kick member discord js kick command for discord.js kick user discord js discordjs canjot kick member discordjs kick member discordjs kick command kick discord.js kick command discord.js kick user discord.js kick command for users with KICK MEMBERS discord.js kick command for users with KICK_MEMBERS discord.js discord.js kick command discord js how to kick certain user discord js user.kick discord bot js kick user kick someone in discord.js kick member discord.js bot kick user from server discord.js discord js kick by id discord js kick discord .net kick user discord.js kick user
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source