-
Couldn't load subscription status.
- Fork 1.3k
Error messages without closing a modal #4513
-
It would be nice to have a response type to allow showing an error message inside the modal if some of the fields aren't right, rather than having the modal close and requiring the user to re-enter their text
basically, let us show a message like that but with our own error message text
otherwise, bots have to implement holding modal state themselves so when users reopen the modal it keeps the text they had entered. which works but it's a bit clumsy
Beta Was this translation helpful? Give feedback.
All reactions
-
🚀 14
Replies: 2 comments 4 replies
-
I'd love this as well as just normal form validation like Bootstrap:
image
Like if we need an email, or something, let the bot validate it and return errors for the user to solve (this is in addition to your suggestion)
Beta Was this translation helpful? Give feedback.
All reactions
-
The following things they should add:
- User
- Role
- Channel
- Multiple Choice
- Choices (Here you can only select 1 out of the given choices. Like: Yes, No
And this
Like if we need an email, or something, let the bot validate it and return errors for the user to solve (this is in addition to your suggestion)
will never be. Because Discord cares about its users' safety, their personal information should be kept secret.
They will not make it so you can ask people for their email or stuff.
Beta Was this translation helpful? Give feedback.
All reactions
-
😕 4
-
All of those are separate suggestions, and that was an example, validations can apply to anything, not just emails; and besides, we do have a use case where we need an email, so it's not far-fetched.
Beta Was this translation helpful? Give feedback.
All reactions
-
But then it should only be made for Verified bots.
Because else Discord would be like any other social media channel: Insert your email and get free stuff! 😂
Beta Was this translation helpful? Give feedback.
All reactions
-
👎 24
-
I disagree. Anyone can create a custom bot for their discord community, and should be able to ask for any information they need to operate and perform validation on it. Then, it's the Discord server admin's responsibility to not enable bots that try to harvest users' data.
Validation and in-modal errors would be very helpful.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 4
-
I'll bump this as I'm trying out modals and see the same 3-year-old issue.
Modal inputs' native validation is limited, and if there is a need to have a deeper validation, for example, checking if the text input contains a specific phrase, then both options to do so are bad:
- Send a reply to the modal interaction so it closes and the user sees the message. However, the modal fields are now reset.
- Send a follow-up to the original interaction ONCE so the modal fields persist. However, now the modal doesn't close, and the user doesn't see the message without manually closing the modal.
We can use better label descriptions and store failed modal values in cache so they can be set as defaults on the next try; however, this is rather awkward for both the user and the developer.
Beta Was this translation helpful? Give feedback.