feat💥: add support for new features in modals#1784
Open
feat💥: add support for new features in modals#1784
Conversation
13 tasks
6c7bc2d to
e0893d7
Compare
Member
Author
|
Retooled this PR to be a catch-all for new modal features, since each phase tends to build upon the last. |
939cb8a to
b136375
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## breaking #1784 +/- ##
============================================
- Coverage 46.66% 46.51% -0.15%
============================================
Files 149 149
Lines 16602 16672 +70
============================================
+ Hits 7747 7755 +8
- Misses 8855 8917 +62 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Many attempts have been made to make this non-breaking - this means the UX is a little bit off. Also, as title says, untested.
This requires breaking the assumption that responses always has string keys. That being said, since this is Discord breaking things, not us, this should be fine for a non-breaking release.
Signed-off-by: Astrea <25420078+AstreaTSS@users.noreply.github.com>
Totally forgot Discord did this, oops.
Apparently this has been possible for a while now.
d0160af to
6ab3ba5
Compare
silasary
approved these changes
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Type
Description
This PR adds support for using new features in components related to
LabelComponent. This includesLabelComponentitself as well as select menus and file uploads.To use select menus or file uploads, users must use the new
LabelComponent, which also allows adding more flexible labels to questions.requiredvalue to control if they are required or not.FileUploadComponent, which is rather self-explanatory in terms of functionality.To get the values the user selects from these new options,
responsesinModalContexthas been changed to bedict[str, Any]as opposed todict[str, str]. This is a breaking change, but it shouldn't be considered a feature that cannot be merged until v6 because:InputTextstill returns a string, as expected. This only potentially breaks things if one were iterating throughresponses.Changes
LabelComponent.Modalto be able to handleLabelComponent.responsesforModalContextdict[str, Any].dict[str, str | list]- Discord plans on adding more components that break this assumption, though.ModalContextable to handleLabelComponentand the new options.FileUploadComponent.Related Issues
Test Scenarios
Python Compatibility
3.10.x3.11.xChecklist
pre-commitcode linter over all edited files