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
querystringFilters the returned members based on what the username starts with. Either this or
userIdsmust not be null. Thelimitmust also be greater than 0 if this is specified.limitintTotal number of members to request. This must be greater than 0 if
queryis specified.presencesbool?Whether to include the Presences associated with the fetched members.
userIdsIEnumerable<ulong>Whether to limit the request to the specified user ids. Either this or
querymust not be null.noncestringThe unique string to identify the response. This must be unique per-guild if multiple requests to the same guild are made.
cancellationTokenCancellationTokenA cancellation token to cancel the iterator with.
Returns
- IAsyncEnumerable<DiscordMember>
An asynchronous iterator that will return all members.