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
messageDiscordMessageThe message to wait for.
predicateFunc<ComponentInteractionCreatedEventArgs, bool>A filter predicate.
timeoutOverrideTimeSpan?Override the timeout period specified in InteractivityConfiguration.
Returns
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
messageDiscordMessageThe message to wait for.
predicateFunc<ComponentInteractionCreatedEventArgs, bool>A filter predicate.
tokenCancellationTokenA token that can be used to cancel interactivity. Pass None to wait indefinitely.
Returns
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
messageDiscordMessageThe message to wait on.
idstringThe Id of the dropdown to wait for.
timeoutOverrideTimeSpan?Overrides the timeout set in Timeout
Returns
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
messageDiscordMessageThe message to wait on.
idstringThe Id of the dropdown to wait for.
tokenCancellationTokenA custom cancellation token that can be cancelled at any point.
Returns
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
messageDiscordMessageThe message to wait on.
userDiscordUserThe user to wait for.
idstringThe Id of the dropdown to wait for.
timeoutOverrideTimeSpan?
Returns
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
messageDiscordMessageThe message to wait on.
userDiscordUserThe user to wait for.
idstringThe Id of the dropdown to wait for.
tokenCancellationTokenA custom cancellation token that can be cancelled at any point.