admin管理员组

文章数量:1400045

When I try and run membermanager.fetch(); (documentation), I get the error Error [GUILD_MEMBERS_TIMEOUT]: Members didn't arrive in time.

I have quite a good internet connection and I've tried giving it more time. This happens both on my test server with about 10 members and the server its intended for with about 30. membermanager.cache doesn't suffice for my use case. It's not a temporary problem as this was also happening yesterday. My discord.js version is 12.4.1 and I updated it this morning. If it helps the bot is written in typescript.

I've noticed it works if I pass the query parameter as a non-empty string or user as an array of user ids, but I assume the discord.js source code is calling a different method entirely.

This has properly left me stumped. If you could help that would be much appreciated.

When I try and run membermanager.fetch(); (documentation), I get the error Error [GUILD_MEMBERS_TIMEOUT]: Members didn't arrive in time.

I have quite a good internet connection and I've tried giving it more time. This happens both on my test server with about 10 members and the server its intended for with about 30. membermanager.cache doesn't suffice for my use case. It's not a temporary problem as this was also happening yesterday. My discord.js version is 12.4.1 and I updated it this morning. If it helps the bot is written in typescript.

I've noticed it works if I pass the query parameter as a non-empty string or user as an array of user ids, but I assume the discord.js source code is calling a different method entirely.

This has properly left me stumped. If you could help that would be much appreciated.

Share Improve this question asked Oct 27, 2020 at 15:38 radiishradiish 2182 silver badges9 bronze badges 6
  • What exactly are you trying to do? – user14023978 Commented Oct 27, 2020 at 15:40
  • Do you have the GUILD_MEMBERS intent enabled? – Lioness100 Commented Oct 27, 2020 at 15:45
  • @Lioness100 how do I enable that? – radiish Commented Oct 27, 2020 at 15:48
  • Check my answer to this question – Lioness100 Commented Oct 27, 2020 at 15:49
  • @Lioness100 you're a lifesaver! – radiish Commented Oct 27, 2020 at 15:51
 |  Show 1 more ment

1 Answer 1

Reset to default 8

Answering my own question here.

Turns out I didn't have the GUILD_MEMBERS intent set. A quick fix from this:

import { Client, Intents } from "discord.js";
export const client: Client = new Client();

to something that included intents:

import { Client, Intents } from "discord.js";
let intents = new Intents(Intents.NON_PRIVILEGED);
intents.add('GUILD_MEMBERS');
export const client: Client = new Client({ ws: {intents: intents} });

and a fix in the discord developer portal. That's all it needed.

本文标签: javascriptwhy does discordjs not let me do guildmembersfetch()Stack Overflow