Method WaitForSelectAsync
- Namespace
- DSharpPlus.Interactivity
- Assembly
- DSharpPlus.Interactivity.dll
WaitForSelectAsync(DiscordMessage, Func<ComponentInteractionCreatedEventArgs, bool>, TimeSpan?)
Waits for any dropdown to be interacted with.
public Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForSelectAsync(DiscordMessage message, Func<ComponentInteractionCreatedEventArgs, bool> predicate, TimeSpan? timeoutOverride = null)
Parameters
message
DiscordMessageThe message to wait for.
predicate
Func<ComponentInteractionCreatedEventArgs, bool>A filter predicate.
timeoutOverride
TimeSpan?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 Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForSelectAsync(DiscordMessage message, Func<ComponentInteractionCreatedEventArgs, bool> predicate, CancellationToken token)
Parameters
message
DiscordMessageThe message to wait for.
predicate
Func<ComponentInteractionCreatedEventArgs, bool>A filter predicate.
token
CancellationTokenA token that can be used to cancel interactivity. Pass System.Threading.CancellationToken.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 Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForSelectAsync(DiscordMessage message, string id, TimeSpan? timeoutOverride = null)
Parameters
message
DiscordMessageThe message to wait on.
id
stringThe Id of the dropdown to wait on.
timeoutOverride
TimeSpan?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, CancellationToken)
Waits for a dropdown to be interacted with.
public Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForSelectAsync(DiscordMessage message, string id, CancellationToken token)
Parameters
message
DiscordMessageThe message to wait on.
id
stringThe Id of the dropdown to wait on.
token
CancellationTokenA 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, TimeSpan?)
Waits for a dropdown to be interacted with by a specific user.
public Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForSelectAsync(DiscordMessage message, DiscordUser user, string id, TimeSpan? timeoutOverride = null)
Parameters
message
DiscordMessageThe message to wait on.
user
DiscordUserThe user to wait on.
id
stringThe Id of the dropdown to wait on.
timeoutOverride
TimeSpan?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, CancellationToken)
Waits for a dropdown to be interacted with by a specific user.
public Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForSelectAsync(DiscordMessage message, DiscordUser user, string id, CancellationToken token)
Parameters
message
DiscordMessageThe message to wait on.
user
DiscordUserThe user to wait on.
id
stringThe Id of the dropdown to wait on.
token
CancellationTokenA 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.