Answers for "discord.js get all members with role"

1

discord.js get all members with role

//outputs the IDs of all members with the specified role as an array

// === discord.js v11 ===
message.guild.roles.get('ROLE-ID').members.map(m=>m.user.id);

// === discord.js v12 ===
message.guild.roles.cache.get('ROLE-ID').members.map(m=>m.user.id);
Posted by: Guest on October-20-2020

Code answers related to "discord.js get all members with role"

Code answers related to "Javascript"

Browse Popular Code Answers by Language