Skip to content

feat(discord): Components support#678

Open
DeanMauro wants to merge 6 commits into
vercel:mainfrom
DeanMauro:feat/discord-componentsV2
Open

feat(discord): Components support#678
DeanMauro wants to merge 6 commits into
vercel:mainfrom
DeanMauro:feat/discord-componentsV2

Conversation

@DeanMauro

@DeanMauro DeanMauro commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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:

image

How

Embeds remain the default behavior. The Discord adapter now supports a componentsV2 flag to
When enabled, card messages render with Discord Components v2 containers, sections, text displays, media galleries, separators, buttons, and string selects, and include the IS_COMPONENTS_V2 message flag.

Test plan

Create a Chat with the Discord adapter. Set contentFormat: DiscordContentFormat.ComponentsV2 and create a post that uses sections, markdown, buttons, etc. Note that

  1. All elements should render correctly.
  2. Individual sections can contain their own actions.
  3. Markdown formatting gets rendered correctly.
import { Actions, Button, Card, CardText, Image, LinkButton, Section } from "chat";
import { createDiscordAdapter } from "@chat-adapter/discord";

const discord = createDiscordAdapter({
  contentFormat: DiscordContentFormat.ComponentsV2,
});

await thread.post(
  <Card title="Deployment ready" subtitle="Production build completed">
    <Section>
      <CardText>
        **Version 2.4.0** is ready to promote.

        Review the release notes, then choose an action below.
      </CardText>
      <Image url="https://example.com/deploy-preview.png" alt="Preview" />
    </Section>

    <Actions>
      <Button id="promote" style="primary">
        Promote
      </Button>
      <Button id="rollback" style="danger">
        Roll back
      </Button>
      <LinkButton url="https://example.com/deployments/123">
        View deployment
      </LinkButton>
    </Actions>
  </Card>
);

Checklist

  • All commits are signed and verified
  • All commits are signed off for the DCO (git commit -s)
  • pnpm validate passes
  • Changeset added (or N/A — see CONTRIBUTING.md)
  • Documentation updated (or N/A)

DeanMauro added 5 commits July 5, 2026 14:20
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`.
@DeanMauro DeanMauro requested a review from a team as a code owner July 6, 2026 16:10
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@DeanMauro is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread packages/adapter-discord/src/cards.ts Outdated
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
@DeanMauro

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant