20 lines
No EOL
704 B
JavaScript
20 lines
No EOL
704 B
JavaScript
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))
|
|
return message.reply("Sick you thought");
|
|
|
|
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.`);
|
|
});
|
|
}; |