Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modals Improvements #2241

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft

Conversation

Cenngo
Copy link
Collaborator

@Cenngo Cenngo commented Apr 10, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant