Table of Contents

Method EnumerateRequestMembersAsync

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

EnumerateRequestMembersAsync(string, int, bool?, IEnumerable<ulong>?, string?, CancellationToken)

Requests that Discord send a list of guild members based on the specified arguments. This method will fire the GuildMembersChunked event.

If no arguments aside from presences and nonce are specified, this will request all guild members.

public IAsyncEnumerable<DiscordMember> EnumerateRequestMembersAsync(string query = "", int limit = 0, bool? presences = null, IEnumerable<ulong>? userIds = null, string? nonce = null, CancellationToken cancellationToken = default)

Parameters

query string

Filters the returned members based on what the username starts with. Either this or userIds must not be null. The limit must also be greater than 0 if this is specified.

limit int

Total number of members to request. This must be greater than 0 if query is specified.

presences bool?

Whether to include the Presences associated with the fetched members.

userIds IEnumerable<ulong>

Whether to limit the request to the specified user ids. Either this or query must not be null.

nonce string

The unique string to identify the response. This must be unique per-guild if multiple requests to the same guild are made.

cancellationToken CancellationToken

A cancellation token to cancel the iterator with.

Returns

IAsyncEnumerable<DiscordMember>

An asynchronous iterator that will return all members.