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_idstringThe id of the modal to wait for. Should be unique to avoid issues.
timeoutOverrideTimeSpan?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_idstringThe id of the modal to wait for. Should be unique to avoid issues.
tokenCancellationTokenA 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 specified custom id to be submitted by the given user.
public Task<InteractivityResult<ModalSubmittedEventArgs>> WaitForModalAsync(string modal_id, DiscordUser user, TimeSpan? timeoutOverride = null)
Parameters
modal_idstringThe id of the modal to wait for. Should be unique to avoid issues.
userDiscordUserThe user to wait for the modal from.
timeoutOverrideTimeSpan?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 specified custom id to be submitted by the given user.
public Task<InteractivityResult<ModalSubmittedEventArgs>> WaitForModalAsync(string modal_id, DiscordUser user, CancellationToken token)
Parameters
modal_idstringThe id of the modal to wait for. Should be unique to avoid issues.
userDiscordUserThe user to wait for the modal from.
tokenCancellationTokenA 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.