Why we ditched Discord Embeds for Components V2 (and built a minimalist bot)
Why we ditched Discord Embeds for Components V2 (and built a minimalist bot)
为什么我们放弃 Discord Embeds 转而使用 Components V2(并构建了一个极简机器人)
If you’ve used Discord in the past few years, you’ve probably noticed that almost every bot feels identical: giant colorful embeds, endless emojis, noisy confirmation messages, and clunky reaction-based menus. When building ego — a curated social utility bot — we decided to take a completely different route: keep it minimal, understated, and built entirely around Discord Components V2. Here is why we moved away from classic embeds and how we structured the architecture. 如果你在过去几年中使用过 Discord,你可能已经注意到几乎所有的机器人看起来都如出一辙:巨大的彩色嵌入式卡片(Embeds)、无穷无尽的表情符号、嘈杂的确认消息以及笨重的基于反应(Reaction)的菜单。在构建 ego(一款精选的社交实用机器人)时,我们决定走一条完全不同的路线:保持极简、低调,并完全围绕 Discord Components V2 构建。以下是我们放弃传统 Embeds 的原因以及我们构建架构的方式。
The Problem with Traditional Embeds
传统 Embeds 的问题
Classic Discord embeds were great in 2017, but today they have major UX flaws:
- Visual noise: High-contrast colored sidebars draw unnecessary attention to trivial status messages.
- Screen real estate: A simple command response can take up half a phone screen.
- Impersonal feel: They look like automated marketing bots rather than natural platform utilities. 经典的 Discord Embeds 在 2017 年表现出色,但如今它们存在严重的 UX(用户体验)缺陷:
- 视觉噪音: 高对比度的彩色侧边栏会吸引不必要的注意力到琐碎的状态消息上。
- 屏幕空间占用: 一个简单的命令响应可能会占据手机屏幕的一半。
- 缺乏个性: 它们看起来更像是自动化的营销机器人,而不是原生平台工具。
Discord markdown has evolved. Features like subtext, blockquotes, and native Components V2 (containers, sections, buttons, and separators) allow you to build interfaces that feel native to Discord’s dark theme. Instead of big colorful banners with decorative emojis, clean status blocks like this look significantly better: Discord 的 Markdown 语法已经进化。诸如副文本(subtext)、引用块(blockquotes)以及原生的 Components V2(容器、分区、按钮和分隔符)等功能,使你能够构建出与 Discord 深色主题浑然一体的界面。与其使用带有装饰性表情符号的大型彩色横幅,像下面这样简洁的状态块看起来要好得多:
ws: 16ms -# shard 0 · 14 guilds
Tech Stack Choices: Pragmatism Over Hype
技术栈选择:实用主义胜过炒作
For ego’s core architecture, we opted for:
- Runtime: Node.js 22 + TypeScript (ESM)
- Library: discord.js v14
- Database: SQLite with better-sqlite3 and drizzle-orm
- Cache / Hot-State: Optional Redis layer, falling back to in-memory 对于 ego 的核心架构,我们选择了:
- 运行时: Node.js 22 + TypeScript (ESM)
- 库: discord.js v14
- 数据库: SQLite,配合 better-sqlite3 和 drizzle-orm
- 缓存/热状态: 可选的 Redis 层,并回退到内存存储
Why SQLite + Drizzle? A lot of bot developers immediately spin up PostgreSQL or MongoDB. For a social utility bot handling local guild preferences, fast identity histories, and low-latency lookups, an embedded SQLite database running with WAL mode (Write-Ahead Logging) delivers sub-millisecond query times with zero networking overhead. 为什么选择 SQLite + Drizzle?许多机器人开发者会直接部署 PostgreSQL 或 MongoDB。但对于一个处理本地服务器偏好设置、快速身份历史记录和低延迟查询的社交实用机器人来说,运行在 WAL 模式(预写式日志)下的嵌入式 SQLite 数据库可以提供亚毫秒级的查询时间,且零网络开销。
export const userSnapshots = sqliteTable('user_snapshots', {
id: text('id').primaryKey(),
userId: text('user_id').notNull(),
username: text('username').notNull(),
avatarHash: text('avatar_hash'),
capturedAt: integer('captured_at', { mode: 'timestamp' }).notNull(),
});
Killer Feature: Frictionless Media Auto-Resolution
杀手级功能:无缝媒体自动解析
One of the biggest pain points in modern Discord is broken video previews when someone pastes a link from Instagram, X (Twitter), or TikTok. Rather than making users run commands like /fixlink or paste alternative domains, ego listens passively for supported URLs:
- Resolves the direct media source via backend streamers.
- Attaches the video/photo directly using native Discord message attachments.
- Suppresses the original broken embed using MessageFlags.SuppressEmbeds.
现代 Discord 的最大痛点之一是当有人粘贴来自 Instagram、X (Twitter) 或 TikTok 的链接时,视频预览往往无法显示。ego 不会让用户运行
/fixlink之类的命令或粘贴替代域名,而是被动监听支持的 URL: - 通过后端流媒体解析直接媒体源。
- 使用 Discord 原生消息附件直接附加视频/照片。
- 使用
MessageFlags.SuppressEmbeds抑制原始的损坏嵌入。
The result: users get instant playable video right in their feed without clutter or friction. 结果:用户可以直接在信息流中获得即时可播放的视频,没有任何杂乱或阻碍。
What We Learned
我们的经验教训
- Restraint is a feature: Removing information is harder than adding it, but users appreciate tools that don’t shout for attention.
- Components V2 are the future of Discord UI: Separators, accessory thumbnails, and discreet button rows provide significantly better hierarchy than legacy embeds.
- Keep feature logic out of generic event files: Isolate features into dedicated modules with their own lifecycle hooks and services.
- 克制是一种功能: 删除信息比添加信息更难,但用户更欣赏那些不会“大声喧哗”以博取关注的工具。
- Components V2 是 Discord UI 的未来: 分隔符、辅助缩略图和低调的按钮行比传统的 Embeds 提供了更好的层级结构。
- 将功能逻辑从通用事件文件中剥离: 将功能隔离到具有各自生命周期钩子和服务功能的独立模块中。
You can check out the live project at ego.skin. How are you approaching UI design in Discord applications in 2026? Are you still using embeds or transitioning to components? Let me know in the comments! 你可以访问 ego.skin 查看该项目。在 2026 年,你是如何进行 Discord 应用的 UI 设计的?你还在使用 Embeds 还是正在转向 Components?请在评论区告诉我!