-
-
Notifications
You must be signed in to change notification settings - Fork 246
Label and Select Menu support for Modals #1377
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
Merged
Merged
Conversation
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
Use top-level label component instead
It's valid to pass a Part instead of a Builder
It's only makes sense to restrict the usage to this context.
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.
This pull request introduces support for Discord's new
Label
component type, deprecates the use ofActionRow
as the top-level container in modals, and adds improved handling for required select menu components in modals. The changes update several classes to reflect these new features and deprecations, ensuring better alignment with Discord's evolving component API.New Label Component Support:
Label
component classes in both builders (src/Discord/Builders/Components/Label.php
) and parts (src/Discord/Parts/Channel/Message/Label.php
) to support Discord's top-level label container for modals. This includes serialization logic and usage documentation. [1] [2]TYPE_LABEL
(value 18) in theComponent
type constants and component mapping, allowing the system to recognize and instantiate Label components. [1] [2]Deprecation and Migration Guidance:
ActionRow
as the top-level container in modals, recommendingComponent::Label
instead. Updated documentation and comments in relevant files to reflect this change. [1] [2]label
property inTextInput
as deprecated for modals, since labels should now be provided by the newLabel
component. Updated constructor and setter to make the label optional. [1] [2] [3] [4] [5]Required Select Menu Improvements (Modal Only):
setRequired
methods toStringSelect
,RoleSelect
,UserSelect
, andMentionableSelect
to support marking select menus as required in modals. Updated serialization logic to enforce minimum value constraints for required selects. [1] [2] [3] [4] [5] [6]StringSelect
components to be used in modals, expanding their usage beyond messages.Interaction Handling Updates:
Label
container, ensuring that components within labels are correctly extracted and processed when handling modal submissions.Minor Consistency and Documentation Updates:
Let me know if you want a deeper explanation of how to migrate existing modal code to use the new
Label
component or have questions about the required select menu changes.