Browse Source

Fix filter for members

master
Abheek Dhawan 4 years ago
parent
commit
fa1e41c848
  1. 8
      bot.js

8
bot.js

@ -551,9 +551,17 @@ async function userInfo(message) {
const members = message.guild.members.cache.filter(member => { const members = message.guild.members.cache.filter(member => {
if (member.nickname) { if (member.nickname) {
if (message.mentions.users.first()) {
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()); 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 { } else {
return member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase()) || member.nickname.toLowerCase().includes(message.content.split(" ")[1].toLowerCase());
}
} else {
if (message.mentions.users.first()) {
return message.mentions.users.first().id === member.user.id || 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())
} else {
return member.user.username.toLowerCase().includes(message.content.split(" ")[1].toLowerCase());
}
} }
}); });

Loading…
Cancel
Save