Getting members on Guild type doesn't return same amount members as when getting memberCount from it
I tried using rest. Gettings members from guild returns only the bot itself but getting member count returns 3(the actual amount)
14 Replies
what kord api did you call in both cases?
I got the guild from slash command:
Then case 1
case 2:
and case 2 not using rest:
case 2.1 calls this endpoint: https://discord.com/developers/docs/resources/guild#list-guild-members - so you are probably missing the guild members intent
case 2.2 uses either the cached members (which might not be all) or also calls this endpoint
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
also if you have a subtype of
GuildInteraction
(you can listen to the Guild
prefixed interaction create event or use an is
check), this can be simplified to interaction.guild
/ interaction.getGuild()
I got the intent already set up, but it still doesn't work
And it's chatInputCommandInteractionEvent
in your code and the dev portal?
then you can use
GuildChatInputCommandInteractionCreateEvent
yes
hm, that's weird
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
I also tried
It did give me the same result
I recreated bot(on dev dashboard), and it looks it was some problem with intents and that fixes problem(if you use something like ExampleGuild.fetchGuild().members, using rest api for me returns only bot, also requestMembers does the same thing)
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
it actually has
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
I mean i tried without fetchGuild, just accessing members, and it didn't work