Components V2 - #10166
Conversation
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Rapptz
left a comment
There was a problem hiding this comment.
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.SectionTextDisplay->ui.TextDisplayThumbnailComponent->ui.ThumbnailMediaGalleryComponent->ui.MediaGalleryFileComponent->ui.FileSeparatorComponent->ui.SeparatorContainer->ui.ContainerActionRow->ui.ActionRowui.LayoutView, that allows for these components to exist.idattribute to all Components and UI Components.-> This also adds the
get_itemmethod 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