From ee98e202ddeefbba8f440bdb9b47edd86875c53b Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Thu, 1 Apr 2021 17:36:20 -0500 Subject: [PATCH] Try to reference collection like array --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 9fa533f..f43e510 100644 --- a/index.js +++ b/index.js @@ -45,9 +45,9 @@ async function usersWithRole(message) { if (message.content.split(" ")[1].length < 3) { message.reply("query must contain at least 3 characters!") } - const roles = message.guild.roles.cache.filter(role => role.name.includes(message.content.split(" ")[1])).name; + const roles = message.guild.roles.cache.filter(role => role.name.includes(message.content.split(" ")[1])); console.log(message.content.split(" ")[1]); - console.log(roles); + console.log(roles[0].name); } async function aboutServer(message) {