Method WaitForModalAsync
- Namespace
- DSharpPlus.Interactivity
- Assembly
- DSharpPlus.Interactivity.dll
WaitForModalAsync(string, TimeSpan?)
Waits for a modal with the specified id to be submitted.
public Task<InteractivityResult<ModalSubmittedEventArgs>> WaitForModalAsync(string modal_id, TimeSpan? timeoutOverride = null)
Parameters
modal_id
stringThe id of the modal to wait for. Should be unique to avoid issues.
timeoutOverride
TimeSpan?Override the timeout period in InteractivityConfiguration.
Returns
- Task<InteractivityResult<ModalSubmittedEventArgs>>
A InteractivityResult<T> with a modal if the interactivity did not time out.
WaitForModalAsync(string, CancellationToken)
Waits for a modal with the specified id to be submitted.
public Task<InteractivityResult<ModalSubmittedEventArgs>> WaitForModalAsync(string modal_id, CancellationToken token)
Parameters
modal_id
stringThe id of the modal to wait for. Should be unique to avoid issues.
token
CancellationTokenA custom cancellation token that can be cancelled at any point.
Returns
- Task<InteractivityResult<ModalSubmittedEventArgs>>
A InteractivityResult<T> with a modal if the interactivity did not time out.
WaitForModalAsync(string, DiscordUser, TimeSpan?)
Waits for a modal with the specificed custom id to be submitted by the given user.
public Task<InteractivityResult<ModalSubmittedEventArgs>> WaitForModalAsync(string modal_id, DiscordUser user, TimeSpan? timeoutOverride = null)
Parameters
modal_id
stringThe id of the modal to wait for. Should be unique to avoid issues.
user
DiscordUserThe user to wait for the modal from.
timeoutOverride
TimeSpan?Override the timeout period in InteractivityConfiguration.
Returns
- Task<InteractivityResult<ModalSubmittedEventArgs>>
A InteractivityResult<T> with a modal if the interactivity did not time out.
WaitForModalAsync(string, DiscordUser, CancellationToken)
Waits for a modal with the specificed custom id to be submitted by the given user.
public Task<InteractivityResult<ModalSubmittedEventArgs>> WaitForModalAsync(string modal_id, DiscordUser user, CancellationToken token)
Parameters
modal_id
stringThe id of the modal to wait for. Should be unique to avoid issues.
user
DiscordUserThe user to wait for the modal from.
token
CancellationTokenA custom cancellation token that can be cancelled at any point.
Returns
- Task<InteractivityResult<ModalSubmittedEventArgs>>
A InteractivityResult<T> with a modal if the interactivity did not time out.