-
Notifications
You must be signed in to change notification settings - Fork 43
components v2 #426
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
components v2 #426
Conversation
6f3877c
to
b9dc7f3
Compare
TODO:
|
b9dc7f3
to
a4c16e4
Compare
90a29dd
to
bac9837
Compare
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.
Pull Request Overview
This PR upgrades the component system to version 2 by replacing the old ContainerComponent types with LayoutComponent types throughout the codebase. Key changes include renaming and updating methods and builders (e.g., SetComponents, AddComponents, etc.), updating JSON unmarshaling for modal interactions, and adjusting tests and examples to align with the new design.
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
_examples/componentsv2/example.go | New example demonstrating usage of the v2 component structure |
discord/component_iter.go and _test.go | New iterator implementation and test for iterating over LayoutComponents |
discord/select_menu.go | Updated select menu components to use LayoutComponent and new method names |
discord/interaction_modal_submit.go | Modified JSON unmarshaling for modal submit interactions to use a slice of LayoutComponent |
discord/_builder.go / message.go | Refactored builder methods and message structures to replace ContainerComponent with LayoutComponent |
discord/interaction_component.go | Refactored variable declarations for consistency |
_examples/test/examplebot.go | Updated import order to support component v2 changes |
Comments suppressed due to low confidence (1)
discord/interaction_modal_submit.go:101
- The updated unmarshaling logic now directly appends container components without iterating over subcomponents as before. Please verify that flattening nested components is no longer required for ModalSubmitInteractionData.
components = append(components, containerComponent.Component.(LayoutComponent))
No description provided.