Browse Source

Merge branch 'master' of adawesome.tech:git/bots/awesomemod

master
Abheek Dhawan 4 years ago
parent
commit
14eeaa74d4
  1. 13
      bot.js

13
bot.js

@ -634,9 +634,16 @@ async function usersWith(message) {
message.reply("query must contain at least 3 characters!") message.reply("query must contain at least 3 characters!")
return; return;
} }
const roles = message.guild.roles.cache.filter(role => role.name.toLowerCase().includes(message.content.split(" ")[1].toLowerCase())); const queriedRole = message.content.split(" ");
const role = roles.array()[0]; queriedRole.shift();
const membersList = roles.array()[0].members.array() 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!");
return;
}
const sortedRoles = roles.array().sort((a, b) => a.name.length - b.name.length);
const role = sortedRoles[0];
const membersList = sortedRoles[0].members.array()
if (membersList.length > threshold) { if (membersList.length > threshold) {
let embedContentArray = []; let embedContentArray = [];
while(membersList.length) { while(membersList.length) {

Loading…
Cancel
Save