Discord.Net: DownloadUsersAsync() "doesn't work"
This is an FYI issue for everyone with these issues.
You need MEMBERS intent for DownloadUsersAsync()
to work. (If you ask for presences with this operation, presence intent is also required.) Enable it on your bot page: https://discord.com/developers/applications
It Hangs
- See this comment
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (13 by maintainers)
With Discord.Net >3.0 you need to specify the intent in your clients config, its also best practice to not download users on the gateway thread incase the call lasts long.
Glad to help.
@RheaAyase would you mind linking to my comment instead since it should contain most of the causes and solutions about it? Or add that info to the first post.
@230Daniel Huh, that number of requests is awfully suspicious and dangerous. The gateway has a ratelimit of 120r/60s and you did 117 of them there (and there’s still identify, heartbeat and maybe some other requests), so you might be reaching it and the gateway connection might have been dropped (plus ignoring all the following requests).
Maybe more reasons to polish and merge #1537 soon.
Could you try doing the requests manually + delaying them and see if you can succesfully download all? As doing 90 or so downloads per minute.
This isn’t true. You only need the server members intent to be able to download and receive users in gateway events (except GUILD_CREATE that needs the presence intent for some reason according to another dev, but this doesn’t interfere with the download). Without presence, they will all be “offline” since that’s related to presences (including activities).