Method WaitForSelectAsync
- Namespace
- DisCatSharp.Interactivity
- Assembly
- DisCatSharp.Interactivity.dll
WaitForSelectAsync(DiscordMessage, Func<ComponentInteractionCreateEventArgs, bool>, ComponentType, TimeSpan?)
Waits for any dropdown to be interacted with.
public Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(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 Provided message does not contain any dropdowns
WaitForSelectAsync(DiscordMessage, Func<ComponentInteractionCreateEventArgs, bool>, ComponentType, CancellationToken)
Waits for any dropdown to be interacted with.
public Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(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 Provided message does not contain any dropdowns
WaitForSelectAsync(DiscordMessage, string, ComponentType, TimeSpan?)
Waits for a dropdown to be interacted with.
public Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(DiscordMessage message, string id, ComponentType selectType, TimeSpan? timeoutOverride = null)
Parameters
messageDiscordMessageThe message to wait on.
idstringThe Id of the dropdown to wait on.
selectTypeComponentTypeThe type of the select menu.
timeoutOverrideTimeSpan?Override the timeout period specified in InteractivityConfiguration.
Returns
Remarks
This is here for backwards-compatibility and will internally create a cancellation token.
Exceptions
- ArgumentException
Thrown when the message does not have any dropdowns or any dropdown with the specified Id.
WaitForSelectAsync(DiscordMessage, string, ComponentType, CancellationToken)
Waits for a dropdown to be interacted with.
public Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(DiscordMessage message, string id, ComponentType selectType, CancellationToken token)
Parameters
messageDiscordMessageThe message to wait on.
idstringThe Id of the dropdown to wait on.
selectTypeComponentTypeThe type of the select menu.
tokenCancellationTokenA custom cancellation token that can be cancelled at any point.
Returns
Exceptions
- ArgumentException
Thrown when the message does not have any dropdowns or any dropdown with the specified Id.
WaitForSelectAsync(DiscordMessage, DiscordUser, string, ComponentType, TimeSpan?)
Waits for a dropdown to be interacted with by a specific user.
public Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(DiscordMessage message, DiscordUser user, string id, ComponentType selectType, TimeSpan? timeoutOverride = null)
Parameters
messageDiscordMessageThe message to wait on.
userDiscordUserThe user to wait on.
idstringThe Id of the dropdown to wait on.
selectTypeComponentTypeThe type of the select menu.
timeoutOverrideTimeSpan?Override the timeout period specified in InteractivityConfiguration.
Returns
Exceptions
- ArgumentException
Thrown when the message does not have any dropdowns or any dropdown with the specified Id.
WaitForSelectAsync(DiscordMessage, DiscordUser, string, ComponentType, CancellationToken)
Waits for a dropdown to be interacted with by a specific user.
public Task<InteractivityResult<ComponentInteractionCreateEventArgs>> WaitForSelectAsync(DiscordMessage message, DiscordUser user, string id, ComponentType selectType, CancellationToken token)
Parameters
messageDiscordMessageThe message to wait on.
userDiscordUserThe user to wait on.
idstringThe Id of the dropdown to wait on.
selectTypeComponentTypeThe type of the select menu.
tokenCancellationTokenA custom cancellation token that can be cancelled at any point.
Returns
Exceptions
- ArgumentException
Thrown when the message does not have any dropdowns or any dropdown with the specified Id.