Table of Contents
API reference

Method WaitForSelectAsync

Namespace
DisCatSharp.Interactivity.Extensions
Assembly
DisCatSharp.Interactivity.dll

WaitForSelectAsync(DiscordMessage, Func<ComponentInteractionCreateEventArgs, bool>, ComponentType, TimeSpan?)

Waits for any dropdown to be interacted with.

public static Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(this DiscordMessage message, Func<ComponentInteractionCreateEventArgs, bool> predicate, ComponentType selectType, TimeSpan? timeoutOverride = null)

Parameters

message DiscordMessage

The message to wait for.

predicate Func<ComponentInteractionCreateEventArgs, bool>

A filter predicate.

selectType ComponentType

The type of the select menu.

timeoutOverride TimeSpan?

Override the timeout period specified in InteractivityConfiguration.

Returns

Task<InteractivityResult<ComponentInteractionCreateEventArgs>>

Exceptions

ArgumentException

Thrown when the message doesn't contain any dropdowns

WaitForSelectAsync(DiscordMessage, Func<ComponentInteractionCreateEventArgs, bool>, ComponentType, CancellationToken)

Waits for any dropdown to be interacted with.

public static Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(this DiscordMessage message, Func<ComponentInteractionCreateEventArgs, bool> predicate, ComponentType selectType, CancellationToken token)

Parameters

message DiscordMessage

The message to wait for.

predicate Func<ComponentInteractionCreateEventArgs, bool>

A filter predicate.

selectType ComponentType

The type of the select menu.

token CancellationToken

A token that can be used to cancel interactivity. Pass None to wait indefinitely.

Returns

Task<InteractivityResult<ComponentInteractionCreateEventArgs>>

Exceptions

ArgumentException

Thrown when the message doesn't contain any dropdowns

WaitForSelectAsync(DiscordMessage, string, ComponentType, TimeSpan?)

Waits for a dropdown to be interacted with.

public static Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(this DiscordMessage message, string id, ComponentType selectType, TimeSpan? timeoutOverride = null)

Parameters

message DiscordMessage

The message to wait on.

id string

The Id of the dropdown to wait for.

selectType ComponentType

The type of the select menu.

timeoutOverride TimeSpan?

Overrides the timeout set in Timeout

Returns

Task<InteractivityResult<ComponentInteractionCreateEventArgs>>

WaitForSelectAsync(DiscordMessage, string, ComponentType, CancellationToken)

Waits for a dropdown to be interacted with.

public static Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(this DiscordMessage message, string id, ComponentType selectType, CancellationToken token)

Parameters

message DiscordMessage

The message to wait on.

id string

The Id of the dropdown to wait for.

selectType ComponentType

The type of the select menu.

token CancellationToken

A custom cancellation token that can be cancelled at any point.

Returns

Task<InteractivityResult<ComponentInteractionCreateEventArgs>>

WaitForSelectAsync(DiscordMessage, DiscordUser, string, ComponentType, TimeSpan?)

Waits for a dropdown to be interacted with by the specified user.

public static Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(this DiscordMessage message, DiscordUser user, string id, ComponentType selectType, TimeSpan? timeoutOverride = null)

Parameters

message DiscordMessage

The message to wait on.

user DiscordUser

The user to wait for.

id string

The Id of the dropdown to wait for.

selectType ComponentType

The type of the select menu.

timeoutOverride TimeSpan?

Returns

Task<InteractivityResult<ComponentInteractionCreateEventArgs>>

WaitForSelectAsync(DiscordMessage, DiscordUser, string, ComponentType, CancellationToken)

Waits for a dropdown to be interacted with by the specified user.

public static Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(this DiscordMessage message, DiscordUser user, string id, ComponentType selectType, CancellationToken token)

Parameters

message DiscordMessage

The message to wait on.

user DiscordUser

The user to wait for.

id string

The Id of the dropdown to wait for.

selectType ComponentType

The type of the select menu.

token CancellationToken

A custom cancellation token that can be cancelled at any point.

Returns

Task<InteractivityResult<ComponentInteractionCreateEventArgs>>