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
feat(modals): modals, input text components and modal submits, v13 style #7431
Conversation
Does this not conflict with a pre-existing draft PR under #7023 ? If so, would it be worth closing the existing one if development will take place within this PR instead? |
It does not, because this is for v13. We do talk to each other internally about these things. |
Seems like <Message>.createMessageComponentCollector() doesn't collect model submit interactions, is this intentional? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding to what was already said, it's not input text, it's text input
So these should be changed as well
They aren't really message components, they just happen to share the inheritance in v13. There is no message to call `createMessageComponentCollector() on because you didn't send a Message, you presented a Modal. The InteractionCollector supports them: const collector = new InteractionCollector(
interaction.client,
{ interactionType: Constants.InteractionTypes.MODAL_SUBMIT }
); |
Raw object modals arent really supported at the moment. This is a draft and shouldn't be installed. I think I know why this specifically isn't working though. |
Looks like if you defer ModalSubmitInteraction, it throws an error when editing the reply, I am not sure if modal interactions are supposed to have deferring but here is the error when editing the reply: G:\ModalTest\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:140
const message = await this.webhook.editMessage('@original', options);
^
TypeError: Cannot read properties of undefined (reading 'editMessage')
at ModalSubmitInteraction.editReply (G:\ModalTest\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:140:40)
at Object.execute (G:\ModalTest\events\interactions.js:26:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5) |
Thanks, I had made an incorrect assumption that some properties were inherited but were instead missing. Should work now. |
Co-authored-by: Parbez <imranbarbhuiya.fsd@gmail.com>
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Would this PR be stable enough for prod? |
I've been using it on my prod bot in 1.5k servers with no problems at all |
PRs are inherently unstable and I would never recommend using one in prod. |
Please describe the changes this PR makes and why it should be merged:
This provides support for Modals, Input Text components and Modal Submit Interactions in a semver:minor, hopefully non-breaking way for v13.
This therefore lacks improvements that have been made in the v14 and/or builders codebases, like more accurate typings for ActionRows in both messages and modals, and other such things.
Status and versioning classification: