Table of Contents
API reference

Method SearchMembersAsync

Namespace
DisCatSharp.Experimental.Entities
Assembly
DisCatSharp.Experimental.dll

SearchMembersAsync(DiscordGuild, DiscordGuildMemberSearchParams, CancellationToken)

Searches the guild for members through elasticsearch. If the guild isn't indexed yet, it'll return a 202 accepted response, we're gonna throw at this point. Access the NotIndexedException's RetryAfter field to know when to retry this request.

public static Task<DiscordSearchGuildMembersResponse> SearchMembersAsync(this DiscordGuild guild, DiscordGuildMemberSearchParams searchParams, CancellationToken cancellationToken = default)

Parameters

guild DiscordGuild

The guild.

searchParams DiscordGuildMemberSearchParams

The guild member search params

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordSearchGuildMembersResponse>

Exceptions

ValidationException

Thrown if the user gave an invalid input.

NotIndexedException

Thrown if the elasticsearch endpoint has not finished indexing yet.

UnauthorizedException

Thrown when the client does not have the ManageGuild permission.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.