feat(discord): Components support#678
Open
DeanMauro wants to merge 6 commits into
Open
Conversation
Refactor Discord adapter card configuration from a boolean `componentsV2` flag to an extensible `contentFormat` enum supporting "embeds" and "componentsv2". Adds validation, updates documentation, and includes type export for `DiscordContentFormat`.
Contributor
|
@DeanMauro is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Contributor
Author
|
@dancer @cramforce I have another one for you. Components unlock a lot more flexibility over embeds in how messages can be laid out. After this, I'll handle modal support. |
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.
Summary
What
Adds opt-in support for Discord Components.
Why
Discord Components allows developers more control over the layout of bot messages by treating text, images, files, and buttons as flexible components. Instead of the rigid text-above-embeds layout, elements can be arranged in any order or column.
An extreme example of what's possible with Components:
How
Embeds remain the default behavior. The Discord adapter now supports a
componentsV2flag toWhen enabled, card messages render with Discord Components v2 containers, sections, text displays, media galleries, separators, buttons, and string selects, and include the
IS_COMPONENTS_V2message flag.Test plan
Create a Chat with the Discord adapter. Set
contentFormat: DiscordContentFormat.ComponentsV2and create a post that uses sections, markdown, buttons, etc. Note thatChecklist
git commit -s)pnpm validatepasses