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}
1ban someone discord jsJavascript By Lime on Jun 21 2020
2if (!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send("Invalid Permissions")
3let User = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0])
4if (!User) return message.channel.send("Invalid User")
5if (User.hasPermission("BAN_MEMBERS")) return message.reply("Invalid Permissions")
6let banReason = args.join(" ").slice(22);
7if (!banReason) {
8 banReason = "None"
9}
10
11User.ban({reason: banReason})