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
messageDiscordMessageThe 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
messageDiscordMessageThe message to wait on.
timeoutOverrideTimeSpan?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
messageDiscordMessageThe message to wait on.
tokenCancellationTokenA 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
messageDiscordMessageThe message to wait on.
idstringThe Id of the button to wait for.
timeoutOverrideTimeSpan?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
messageDiscordMessageThe message to wait on.
idstringThe Id of the button to wait for.
tokenCancellationTokenA 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
messageDiscordMessageThe message to wait on.
userDiscordUserThe user to wait for button input from.
timeoutOverrideTimeSpan?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
messageDiscordMessageThe message to wait on.
userDiscordUserThe user to wait for button input from.
tokenCancellationTokenA 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
messageDiscordMessageThe message to wait on.
predicateFunc<ComponentInteractionCreatedEventArgs, bool>The predicate to filter interactions by.
timeoutOverrideTimeSpan?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
messageDiscordMessageThe message to wait on.
predicateFunc<ComponentInteractionCreatedEventArgs, bool>The predicate to filter interactions by.
tokenCancellationTokenA token to cancel interactivity with at any time. Pass None to wait indefinitely.