Table of Contents

Method WaitForSelectAsync

Namespace
DSharpPlus.Interactivity.Extensions
Assembly
DSharpPlus.Interactivity.dll

WaitForSelectAsync(DiscordMessage, Func<ComponentInteractionCreatedEventArgs, bool>, TimeSpan?)

Waits for any dropdown to be interacted with.

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

Parameters

message DiscordMessage

The message to wait for.

predicate Func<ComponentInteractionCreatedEventArgs, bool>

A filter predicate.

timeoutOverride TimeSpan?

Override the timeout period specified in InteractivityConfiguration.

Returns

Task<InteractivityResult<ComponentInteractionCreatedEventArgs>>

Exceptions

ArgumentException

Thrown when the message doesn't contain any dropdowns

WaitForSelectAsync(DiscordMessage, Func<ComponentInteractionCreatedEventArgs, bool>, CancellationToken)

Waits for any dropdown to be interacted with.

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

Parameters

message DiscordMessage

The message to wait for.

predicate Func<ComponentInteractionCreatedEventArgs, bool>

A filter predicate.

token CancellationToken

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

Returns

Task<InteractivityResult<ComponentInteractionCreatedEventArgs>>

Exceptions

ArgumentException

Thrown when the message doesn't contain any dropdowns

WaitForSelectAsync(DiscordMessage, string, TimeSpan?)

Waits for a dropdown to be interacted with.

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

Parameters

message DiscordMessage

The message to wait on.

id string

The Id of the dropdown to wait for.

timeoutOverride TimeSpan?

Overrides the timeout set in Timeout

Returns

Task<InteractivityResult<ComponentInteractionCreatedEventArgs>>

WaitForSelectAsync(DiscordMessage, string, CancellationToken)

Waits for a dropdown to be interacted with.

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

Parameters

message DiscordMessage

The message to wait on.

id string

The Id of the dropdown to wait for.

token CancellationToken

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

Returns

Task<InteractivityResult<ComponentInteractionCreatedEventArgs>>

WaitForSelectAsync(DiscordMessage, DiscordUser, string, TimeSpan?)

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

public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForSelectAsync(this DiscordMessage message, DiscordUser user, string id, 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.

timeoutOverride TimeSpan?

Returns

Task<InteractivityResult<ComponentInteractionCreatedEventArgs>>

WaitForSelectAsync(DiscordMessage, DiscordUser, string, CancellationToken)

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

public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForSelectAsync(this DiscordMessage message, DiscordUser user, string id, 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.

token CancellationToken

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

Returns

Task<InteractivityResult<ComponentInteractionCreatedEventArgs>>