Create a function that puts the number of users in a certain server id or all servers combined of a server bot into a into basically a int required function that gathers the number of users in a server or a total number of servers #1667
Unanswered
MasterScary
asked this question in
Questions and Help
Replies: 2 comments
-
Please ask in the JDA Discord next time, as we could've answered this question fairly easy. In general, there are more than enough ways to get specific values such as total amount of members or from specific guilds. Here are two examples I quickly made. JDA jda = JDABuilder.createDefault("S3cretT0k3n")
.enableIntents(GatewayIntent.GUILD_MEMBERS) // Those are required to get Guild members
.setChunkingFilter(ChunkingFilter.ALL)
.setMemberCachePolicy(MemberCachePolicy.ALL)
.build();
// get all users in total:
long totalUsers = jda.getUserCache().size();
// get from a specific server
long guildUsers = jda.getGuildById(1234567890L).getMemberCount(); Also, follow the issue template next time please :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
no worries we already did 🙃 |
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
-
just think this may be a cool easy feature
Beta Was this translation helpful? Give feedback.
All reactions