diff --git a/bot.js b/bot.js index 35f511d..7f06e4f 100644 --- a/bot.js +++ b/bot.js @@ -479,9 +479,9 @@ async function userInfo(message) { const members = message.guild.members.cache.filter(member => { if (member.nickname) { - return member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) || member.nickname.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()); + return message.mentions.users.first().id === member.user.id || member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) || member.nickname.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()); } else { - return member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) + return message.mentions.users.first().id === member.user.id || member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) } }); @@ -638,9 +638,9 @@ async function ban(message) { const members = message.guild.members.cache.filter(member => { if (member.nickname) { - return member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) || member.nickname.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()); + return message.mentions.users.first().id === member.user.id || member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) || member.nickname.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()); } else { - return member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) + return message.mentions.users.first().id === member.user.id || member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) } }); @@ -704,9 +704,9 @@ async function kick(message) { const members = message.guild.members.cache.filter(member => { if (member.nickname) { - return member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) || member.nickname.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()); + return message.mentions.users.first().id === member.user.id || member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) || member.nickname.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()); } else { - return member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) + return message.mentions.users.first().id === member.user.id || member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) } });