Repository: discordjs/discord.js
File: packages/core/src/client.ts (TypeScript)

Code before:
		const presences: RequestGuildMembersResult['presences'] = [];
		const nonce = options.nonce ?? DiscordSnowflake.generate().toString();

		for await (const data of this.requestGuildMembersIterator({ ...options, nonce }, timeout)) {
			members.push(...data.members);
			if (data.presences) presences.push(...data.presences);
			if (data.notFound) notFound.push(...data.notFound);
		}

		return { members, nonce, notFound, presences };
	}

	/**
	 * Requests soundboard sounds from the gateway and returns an async iterator that yields the data from each soundboard sounds event.
	 *
	 * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds}
	 * @param options - The options for the request
	 * @param timeout - The timeout for waiting for each soundboard sounds
	 * @example
	 * Requesting soundboard sounds for specific guilds
	 * ```ts
	 * for await (const { soundboardSounds } of this.requestSoundboardSoundsIterator({
	 *	guild_ids: ['1234567890', '9876543210'],
	 * 	})) {
	 *	console.log(soundboardSounds);
	 *}
	 * ```
	 */
	public async *requestSoundboardSoundsIterator(options: GatewayRequestSoundboardSoundsData, timeout = 10_000) {
		const shardCount = await this.gateway.getShardCount();
		const shardIds = groupBy(options.guild_ids, (guildId) => calculateShardId(guildId, shardCount));

		const controller = new AbortController();

		let timer: NodeJS.Timeout | undefined = createTimer(controller, timeout);

		for (const [shardId, guildIds] of shardIds) {
			await this.gateway.send(shardId, {
				op: GatewayOpcodes.RequestSoundboardSounds,
				// eslint-disable-next-line id-length
				d: {
					...options,
					guild_ids: guildIds,
				},
			});
		}

		try {
			const iterator = AsyncEventEmitter.on(this, GatewayDispatchEvents.SoundboardSounds, {
				signal: controller.signal,
			});

Review comment (suggestion):
```suggestion
	 * for await (const { guildId, soundboardSounds } of this.requestSoundboardSoundsIterator({
	 *	guild_ids: ['1234567890', '9876543210'],
	 * })) {
	 *	console.log(`Soundboard sounds for guild ${guildId}:`, soundboardSounds);
	 * }
```

Code after:
		const presences: RequestGuildMembersResult['presences'] = [];
		const nonce = options.nonce ?? DiscordSnowflake.generate().toString();

		for await (const data of this.requestGuildMembersIterator({ ...options, nonce }, timeout)) {
			members.push(...data.members);
			if (data.presences) presences.push(...data.presences);
			if (data.notFound) notFound.push(...data.notFound);
		}

		return { members, nonce, notFound, presences };
	}

	/**
	 * Requests soundboard sounds from the gateway and returns an async iterator that yields the data from each soundboard sounds event.
	 *
	 * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds}
	 * @param options - The options for the request
	 * @param timeout - The timeout for waiting for each soundboard sounds
	 * @example
	 * Requesting soundboard sounds for specific guilds
	 * ```ts
	 * for await (const { guildId, soundboardSounds } of this.requestSoundboardSoundsIterator({
	 *	guild_ids: ['1234567890', '9876543210'],
	 * })) {
	 *	console.log(`Soundboard sounds for guild ${guildId}:`, soundboardSounds);
	 * }
	 * ```
	 */
	public async *requestSoundboardSoundsIterator(options: GatewayRequestSoundboardSoundsData, timeout = 10_000) {
		const shardCount = await this.gateway.getShardCount();
		const shardIds = Map.groupBy(options.guild_ids, (guildId) => calculateShardId(guildId, shardCount));

		const controller = new AbortController();

		let timer: NodeJS.Timeout | undefined = createTimer(controller, timeout);

		for (const [shardId, guildIds] of shardIds) {
			await this.gateway.send(shardId, {
				op: GatewayOpcodes.RequestSoundboardSounds,
				// eslint-disable-next-line id-length
				d: {
					...options,
					guild_ids: guildIds,
				},
			});
		}

		try {
			const iterator = AsyncEventEmitter.on(this, GatewayDispatchEvents.SoundboardSounds, {
				signal: controller.signal,
			});