requestGuildMembers

fun Gateway.requestGuildMembers(guildId: Snowflake, builder: RequestGuildMembersBuilder.() -> Unit = { requestAllMembers() }): Flow<GuildMembersChunk>(source)

Executes a RequestGuildMembers command configured by the builder for the given guildId on this gateway, returning a flow of GuildMembersChunk responses.

If no builder is specified, the request will be configured to fetch all members.

The returned flow is cold, and will execute the request only on subscription. Collection of this flow on a Gateway that is not running will result in an IllegalStateException being thrown.

Executing the request on a Gateway with a Shard that does not match the guild id can result in undefined behavior for the returned flow and inconsistencies in the cache.

This function expects request.nonce to contain a value, but it is not required. If no nonce was provided one will be generated instead.


Executes the request on this gateway, returning a flow of GuildMembersChunk responses.

The returned flow is cold, and will execute the request only on subscription. Collection of this flow on a Gateway that is not running will result in an IllegalStateException being thrown.

Executing the request on a Gateway with a Shard that does not match the guild id can result in undefined behavior for the returned flow and inconsistencies in the cache.

This function expects request.nonce to contain a value, but it is not required. If no nonce was provided one will be generated instead.