fix: check for the GUILD_MEMBERS intent when requesting members (#5229)

This commit is contained in:
Fleny
2026-07-26 05:32:20 +05:30
committed by GitHub
parent 8df275c8ec
commit fb46470862
+1 -1
View File
@@ -450,7 +450,7 @@ export function createGatewayManager(options: CreateGatewayManagerOptions): Gate
async requestMembers(guildId, options) {
const shardId = gateway.calculateShardId(guildId);
if (gateway.intents && (!options?.limit || options.limit > 1) && !(gateway.intents & GatewayIntents.GuildMembers))
if ((!options?.limit || options.limit > 1) && (gateway.intents & GatewayIntents.GuildMembers) === 0)
throw new Error('Cannot fetch more then 1 member without the GUILD_MEMBERS intent');
gateway.logger.debug(`[Gateway] requestMembers guildId: ${guildId} -> data: ${JSON.stringify(options)}`);