Discord.Js Get All Members With Role

Source URL: N/A

Language: javascript

Created on: 2020-10-20 12:23:48

//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);
Discord.Js Get All Members With Role
content_copy