-
I don't know if the Discord API has the functionality to get users with a specific role. Retrieving all users and then iterating over them to find the right role is not a very optimal solution. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There is ->filter() which pretty much does the same, just looks easier to use $roleholders = $guild->members->filter(function($member) use ($role) { return $member->roles->has($role->id); }); This should return a Collection of members with a specified role. |
Beta Was this translation helpful? Give feedback.
-
How to get all members under the PRESENCE_UPDATE event plz help.. |
Beta Was this translation helpful? Give feedback.
There is ->filter() which pretty much does the same, just looks easier to use
This should return a Collection of members with a specified role.