Discord.Net
Discord.Net copied to clipboard
Modals Improvements
Moves ModalUtils
class to public, adds a ConfirmAsync
overload to be used with SocketInteractions and SendModalAsync()
method to InteractionUtils
class for prompting a modal and asynchronously awaiting the user response.
{
...
TestModal modal = await Context.Interaction.SendModalAsync<TestModal>(timeout: TimeSpan.FromMinutes(1));
...
}
Tho this may seem like a easy and foolproof way of getting user inputs inside a command execution body it should be noted that Discord doesn't send a gateway event for when a user dismisses a modal without responding. Which will result in this method to await until it times out, hogging resources needlessly in the meantime.