Method WaitForButtonAsync
- Namespace
- DSharpPlus.Interactivity.Extensions
- Assembly
- DSharpPlus.Interactivity.dll
WaitForButtonAsync(DiscordMessage)
Waits for any button to be pressed on the specified message.
public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForButtonAsync(this DiscordMessage message)
Parameters
message
DiscordMessageThe message to wait on.
Returns
WaitForButtonAsync(DiscordMessage, TimeSpan?)
Waits for any button to be pressed on the specified message.
public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForButtonAsync(this DiscordMessage message, TimeSpan? timeoutOverride = null)
Parameters
message
DiscordMessageThe message to wait on.
timeoutOverride
TimeSpan?Overrides the timeout set in Timeout
Returns
WaitForButtonAsync(DiscordMessage, CancellationToken)
Waits for any button to be pressed on the specified message.
public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForButtonAsync(this DiscordMessage message, CancellationToken token)
Parameters
message
DiscordMessageThe message to wait on.
token
CancellationTokenA custom cancellation token that can be cancelled at any point.
Returns
WaitForButtonAsync(DiscordMessage, string, TimeSpan?)
Waits for a button with the specified Id to be pressed on the specified message.
public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForButtonAsync(this DiscordMessage message, string id, TimeSpan? timeoutOverride = null)
Parameters
message
DiscordMessageThe message to wait on.
id
stringThe Id of the button to wait for.
timeoutOverride
TimeSpan?Overrides the timeout set in Timeout
Returns
WaitForButtonAsync(DiscordMessage, string, CancellationToken)
Waits for a button with the specified Id to be pressed on the specified message.
public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForButtonAsync(this DiscordMessage message, string id, CancellationToken token)
Parameters
message
DiscordMessageThe message to wait on.
id
stringThe Id of the button to wait for.
token
CancellationTokenA custom cancellation token that can be cancelled at any point.
Returns
WaitForButtonAsync(DiscordMessage, DiscordUser, TimeSpan?)
Waits for any button to be pressed on the specified message by the specified user.
public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForButtonAsync(this DiscordMessage message, DiscordUser user, TimeSpan? timeoutOverride = null)
Parameters
message
DiscordMessageThe message to wait on.
user
DiscordUserThe user to wait for button input from.
timeoutOverride
TimeSpan?Overrides the timeout set in Timeout
Returns
WaitForButtonAsync(DiscordMessage, DiscordUser, CancellationToken)
Waits for any button to be pressed on the specified message by the specified user.
public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForButtonAsync(this DiscordMessage message, DiscordUser user, CancellationToken token)
Parameters
message
DiscordMessageThe message to wait on.
user
DiscordUserThe user to wait for button input from.
token
CancellationTokenA custom cancellation token that can be cancelled at any point.
Returns
WaitForButtonAsync(DiscordMessage, Func<ComponentInteractionCreatedEventArgs, bool>, TimeSpan?)
Waits for any button to be interacted with.
public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForButtonAsync(this DiscordMessage message, Func<ComponentInteractionCreatedEventArgs, bool> predicate, TimeSpan? timeoutOverride = null)
Parameters
message
DiscordMessageThe message to wait on.
predicate
Func<ComponentInteractionCreatedEventArgs, bool>The predicate to filter interactions by.
timeoutOverride
TimeSpan?Override the timeout specified in InteractivityConfiguration
Returns
WaitForButtonAsync(DiscordMessage, Func<ComponentInteractionCreatedEventArgs, bool>, CancellationToken)
Waits for any button to be interacted with.
public static Task<InteractivityResult<ComponentInteractionCreatedEventArgs>> WaitForButtonAsync(this DiscordMessage message, Func<ComponentInteractionCreatedEventArgs, bool> predicate, CancellationToken token)
Parameters
message
DiscordMessageThe message to wait on.
predicate
Func<ComponentInteractionCreatedEventArgs, bool>The predicate to filter interactions by.
token
CancellationTokenA token to cancel interactivity with at any time. Pass None to wait indefinitely.