Browse Source

Fix usersWith character limit

master
Abheek Dhawan 4 years ago
parent
commit
6533e5a885
  1. 12
      bot.js

12
bot.js

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