Please describe the problem you are having in as much detail as possible:
Calling
Include a reproducible code sample here, if possible:
client.on("ready", async () => {
console.log("Ready"); // To check that we have, in fact, logged in
const guild = client.guilds.get("[guild id]"); // Get the guild
await guild.fetchMembers(); // Call fetchMembers()
console.log("Resolved"); // :( cri
});
Further details:
^11.5.1it can be related to recent discord intents stuff
they basically plan to not allow bots to access guild members at all and its in testing phase iirc
"At all" is not exact. They plan to remove that for bots that are in 100 guilds or more and are not "verified" to have access to fetching members.
Additionally, your statement says that they not allow you to access any GuildMember, but that's not true either
"At all" is not exact. They plan to remove that for bots that are in 100 guilds or more and are not "verified" to have access to fetching members.
Additionally, your statement says that they not allow you to access any GuildMember, but that's not true either
well, probably getting "verified" state will be only for huge trusted bots and smaller ones will not even have chance to get that
"at all" is pretty right because if someone is making public bot i dont think they would enable that to limit their bot to 100 servers
and accessing GuildMember will be probably available only via command messages and similar i guess?
(i did mean guild members itself, like fetching them or getting object from server members(like memberlist in client), not from things like messages)
well, probably getting "verified" state will be only for huge trusted bots and smaller ones will not even have chance to get that
The huge bots are already beyond 100 guilds, so that statement has no corelation to whether bot will be verified or not. Discord claims you need to have verified bot to have access after reaching 100 guilds, but does not say that your bot has to have 10000 guilds for verification being considered.
"at all" is pretty right because if someone is making public bot i dont think they would enable that to limit their bot to 100 servers
Well, what if someone is making bot for single guild? then they don't have limited access to fetching members.
Also, from definition of "at all", what you effectively said is that discord is testing api without guildmember objects, or that any access to any guildmember object is forbidden for bots.
and accessing GuildMember will be probably available only via command messages and similar i guess?
I don't remember specifics out of my head now, but it should be in this pull request to discord-api-docs
well, probably getting "verified" state will be only for huge trusted bots and smaller ones will not even have chance to get that
@Roki100 they've said that they'll whitelist any bot that applies and demonstrates that it uses the functionality
From what I've gathered, this should be marked as a wontfix? Such a shame :(
the devs haven't responded, but it seems to work for me on v12 (guild.members.fetch())
This is still working fine for me on 11.6.1.
disabledEvents of ClientOptions to avoid discarding required incoming events.If it still does not work attach a handler to raw and see if the expected GUILD_MEMBERS_CHUNK events are actually coming in:
client.on('raw', packet => {
if (packet.t === 'GUILD_MEMBERS_CHUNK') {
console.log(packet.t, packet.d.guild_id, packet.d.members.length);
}
});
If they do, there likely is something wrong on our end, not sure how much could be done about that though.
If none are coming, something else is wrong, either 2. or Discord.
re: Intents
Just to clarify that:
Unless you specify intents, the behavior of the gateway is the same as before, WITHOUT a 100 guilds limit of any form.
(At least that's what Discord promised us.)
Until gateway v7 drops, where intents are becoming mandatory.
Also applying for privileged intents is supposedly going to be somewhat reasonable and not restricted to just huge and "trusted" bots.
(How that actually works out is a different matter though.)
I have not disabled anything. I ran
yarn init -y
yarn add discord.js
and copy pasta'd the code I sent above (along with the requirements and .login, of course.
Going to close as we no longer support or fix version 11, feel free to re-open or link to this in a new issue if you can reproduce it on the current stable version (12.3.1 as of writing this).
Sounds good. v12 is working for me fine. Thanks :D