I'm having an issue with my code. When I type in the command "exp kick @user being toxic", it doesn't do anything. It seems to be ignoring my command. Here is the code snippet that I'm using:
client.on("message", message => {
var command = message.content.toLowerCase().split(" ")[0];
if(command == prefix + "kick"){
if(message.guild.member(message.author).hasPermission("KICK_MEMBERS")) {
return message.channel.send("Please Check Your Permissions");
}
if(!message.guild.member(client.user).hasPermission("KICK_MEMBERS")) {
return message.channel.send("Please Check My Permissions");
}
const user = message.mentions.users.first();
if(!user) {
return message.channel.send("I can't find this user!");
}
const reason = message.content.split(" ").slice(2).join(" ");
if(!reason) {
return message.channel.send("Please state the reason for the kick!");
}
if(message.guild.member(user).kickable) {
return message.channel.send("This user seems to have permissions that are preventing the kick.");
}
message.guild.member(user).kick({reason: reason});
return message.channel.send(`Kicked the user \`${user.tag}\``);
}
})