JDA 4.2 how to get all users that have a specific role?

Viewed 1282

I'm looking to receive all discord users from a guild that have a specific role.

Since .getGuild().getMembersWithRoles([role]); only search cached users I don't know how to do it. Note, the discord server has multiple thousand users so caching everything would be bad.

I searched for something like: JDABot.retrieveUserByRole([role]); but didn't find anything.

JDA Version: 4.2.0_214-withDependencies

1 Answers
Related