-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Components V2 #10166
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 #10166
Conversation
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.
Small mistakes in documentation that I found.
Something that I noticed later but didn't include here for reasons, in all walk_children
methods you used “it's children" instead of "its children", please correct that too.
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Soheab <[email protected]>
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.
This looks fine, there are still some nits but they're not blocking.
I've started testing, just to grasp the fundamentals. How would you go about embeding the LayoutView in a discord.embeds.Embed() or has this not yet been implemented? I know it can be done in discord.js I just don't see how it would be done in discord.py? I was thinking maybe using the example below, and will test with this but am unsure. class foo(Embed, LayoutView): |
@ConnerAdamsMaine Embeds and container v2 are two different things. The closest you have to an "embed" is |
@Rapptz it's not an embed per-say, it was just the best way I could think of it. I realize now that it was an idiotic idea, I do apologize on that part. It's hard thinking with 48 hours of sleep deprivation. I have checked and it is the |
Summary
Adds support for discord's components v2.
Testing and bug reporting is very much appreciated!
DDevs PR: discord/discord-api-docs#7487
SectionComponent
->ui.Section
TextDisplay
->ui.TextDisplay
ThumbnailComponent
->ui.Thumbnail
MediaGalleryComponent
->ui.MediaGallery
FileComponent
->ui.File
SeparatorComponent
->ui.Separator
Container
->ui.Container
ActionRow
->ui.ActionRow
ui.LayoutView
, that allows for these components to exist.id
attribute to all Components and UI Components.-> This also adds the
get_item
method toui.View
,ui.LayoutView
,ui.Container
, andui.Section
.These changes have been tested with the following snippets **(outdated)**:
All of these use the jishaku package
Sending Components v2
Code:
Result (as expected):

Sending Components v2 items on webhooks
1st snippet: sends interactible items on app owned and not app owned webhooks
Result (as expected):

2nd snippet: sends non-interactible items on not app owned webhook
Result (as expected):

Receiving other message's components v2
Code:
Result (as expected):

Checklist