4

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.

radiish
  • 208
  • 2
  • 9

1 Answers1

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.

radiish
  • 208
  • 2
  • 9