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