Haha-Yes/commands/kick.js

20 lines
704 B
JavaScript
Raw Normal View History

2018-09-06 15:02:53 +02:00
exports.run = (client, message, [mention, ...reason]) => {
const StaffRole = message.guild.roles.find("name", "Staff");
if (!StaffRole)
return console.log("The Staff role does not exist");
if (!message.member.roles.has(StaffRole.id))
2018-09-06 17:28:49 +02:00
return message.reply("Sick you thought");
2018-09-06 15:02:53 +02:00
if (message.mentions.members.size === 0)
return message.reply("Please mention a user to kick");
if (!message.guild.me.hasPermission("KICK_MEMBERS"))
return message.reply("");
const kickMember = message.mentions.members.first();
kickMember.kick(reason.join(" ")).then(member => {
message.reply(`${member.user.username} was succesfully kicked.`);
});
};