-
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.
Answered by
key2peace
Jul 29, 2023
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.
1 reply
Answer selected by
sanovskiy
-
How to get all members under the PRESENCE_UPDATE event plz help.. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.