WebAug 5, 2024 · List all users with a specific role with DiscordJS Ask Question Asked 7 months ago Modified 7 months ago Viewed 226 times 0 I already checked here but this unfortunately doesn't seem to help in my case. I am trying to list all members in a server that have the role with id 'roleID'. I get that role like so: WebApr 8, 2024 · javascript - Getting all members from role returns only the Bot and the user sending the command - Stack Overflow Getting all members from role returns only the Bot and the user sending the command [duplicate] Ask Question Asked 2 years ago Modified 1 year, 11 months ago Viewed 185 times 0 This question already has answers here:
node.js - How to get roles of users using discordjs slash …
WebAug 29, 2024 · Here's an example of how to get the role within the message event: client.on ("message", message => { const Role = message.guild.roles.cache.find (role => role.name == "among us"); // You can also get the role by ID like this: const Role = message.guild.roles.cache.get ("RoleID"); }); Share Improve this answer Follow WebSep 9, 2024 · The member.roles.remove methods takes a Role, Array of Roles or Collection of Roles as an argument. You've supplied the method with member.roles, which according to the docs, is of type GuildMemberRoleManager, which isn't an accepted argument type for the remove method.. Try changing … speedphone 12 an speedport smart 4 anmelden
javascript - How do I list all Members with a Role In …
WebNext, using a forEach loop, for each member of a server, you want to .find () for a certain role and if it finds that role in the member's roles, you can .push () that user's ID into the array else the loop just goes on. This may not work though, just something I thought of. – Hao C. Jun 29, 2024 at 21:11 Add a comment 1 Answer Sorted by: 2 WebNov 10, 2024 · To fix this, you can fetch all members by doing msg.guild.members.fetch (), then use msg.guild.roles.cache.get ("roleid").members.map (m => m.user.tag) to get the real output. Please do note that you will need the GUILD_MEMBERS intent if you are on v13. Fetching members from the guild will store them in cache. WebJan 30, 2024 · I want to get member count who have specific role. role.member is collection. how can i get member count? ps i'll use role id. Stack Overflow. About; Products For Teams; ... Discord.js - Command to Remove All Users Containing Role. 0. Role Count stats for Discord discord.js. 0. speedphone 12 kompatibel mit fritzbox