
Chat SDK adds Discord Components V2 support
Quick Answer
The Chat SDK now supports Discord Components V2, allowing flexible arrangement of text, images, and buttons in bot messages.
Quick Take
The Chat SDK now supports Discord Components V2, allowing flexible arrangement of text, images, and buttons in bot messages. This update includes new features like renaming threads, ignoring global pings, and precise mention detection, enhancing bot interaction while adhering to Discord's component limits.
Key Points
- Components V2 enables flexible layouts for bot messages with text, images, and buttons.
- New setThreadTitle() method allows renaming of Discord thread channels with appropriate permissions.
- Bots can now ignore global pings, reducing unnecessary notifications.
- Precise mention detection prevents false matches with similarly named users.
- Existing bots continue to function unchanged with the default embed format.
📖 Reader Mode
~2 min readYou can now send Discord bot messages with Components V2, an opt-in layout system that treats text, images, files, and buttons as flexible components you can arrange in any order.
Set the adapter's contentFormat option to ComponentsV2 and cards render with native containers, sections, media galleries, separators, buttons, and string selects. Embeds remain the default, so existing bots work unchanged.
lib/bot.tsx
import { Actions, Button, Card, CardText, Image, LinkButton, Section } from "chat";
import { createDiscordAdapter, DiscordContentFormat } 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>
);
A card with sections, markdown, images, and actions rendered as Discord Components V2.
Individual sections can carry their own actions, markdown renders correctly inside components, and the adapter enforces Discord's platform limits for you, including the 40-component cap per message.
This release also includes several other Discord adapter improvements:
Rename threads: A new
setThreadTitle()method renames native Discord thread channels. Your bot needs the Manage Threads permission to use it.Ignore global pings: Bots running in gateway mode no longer treat
@everyoneand@hereannouncements as mentions. A newrespondToGlobalMentionsconfig option (defaultfalse) lets you opt back in. Direct mentions, role mentions, and replies to the bot are unaffected.Precise mention detection: Mentions of similarly named users no longer trigger false matches. A message with
@bot-devno longer counts as a bot tag.
Read the documentation to get started or browse the adapter directory.
Special thanks to community contributors DeanMauro, onmax, FarazPatankar, and sivchari for laying the groundwork for these improvements.
— Originally published at vercel.com
Want this in your inbox every morning?
Daily brief at your local 8am — bilingual EN/中文, free.
More from Vercel AI
See more →
The Agent Stack
The Agent Stack by Vercel AI provides essential building blocks for creating production-grade agents, enabling seamless integration across multiple AI models and secure operations. It features components like AI Gateway for model routing, Workflow SDK for durable execution, and Vercel Connect for scoped access, streamlining agent development and deployment across various platforms.

