From cc77f6e3b77626997cbb22b11e1ca1a695ee9637 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Fri, 14 May 2021 08:10:03 -0500 Subject: [PATCH] Fix usersWith character limit --- bot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.js b/bot.js index bd97f01..000f954 100644 --- a/bot.js +++ b/bot.js @@ -856,12 +856,12 @@ async function usersWith(message) { message.reply("query must contain at least 3 characters!") return; } - if (message.content.split(" ")[1].length < 3) { + const queriedRole = message.content.split(" "); + queriedRole.shift(); + if (queriedRole.join(" ").length < 3) { message.reply("query must contain at least 3 characters!") return; } - const queriedRole = message.content.split(" "); - queriedRole.shift(); const roles = message.guild.roles.cache.filter(role => role.name.toLowerCase().includes(queriedRole.join(" ").toLowerCase())); if (!roles.array().length) { message.reply("no roles found with that name!");