A command for the bot to reply with statistics about a role should be created.
The command should return role member count, role name, role color, and percent of users with the role.
Code that works for getting the member count is:
let split = msg.content.split[' '];
await msg.guild.members.fetch();
let role = guild.roles.cache.find(role => role.name == split[1]);
msg.reply(`there are ${role.members.size} members with the ${split[1]} role.`);
The content of the message in this case is something like bc!rolemembers Bearcat. We would need to use something other than a space or use substr since a role's name may contain a space.
A command for the bot to reply with statistics about a role should be created. The command should return role member count, role name, role color, and percent of users with the role.
Code that works for getting the member count is:
The content of the message in this case is something like
bc!rolemembers Bearcat
. We would need to use something other than a space or use substr since a role's name may contain a space.