cd /news/ai-agents/building-better-discord-bot-messages… · home › topics › ai-agents › article
[ARTICLE · art-170861] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Building Better Discord Bot Messages with Components V2 (and AI)

A developer released discord-components-v2-skill, an open-source agent skill that teaches AI coding assistants such as Claude Code, Cursor, and Codex how to build Discord messages using Components V2 and discord.js. The skill packages a focused reference on component structure, builders, limits, and API usage so agents avoid outdated embed patterns, and installs via 'npx skills add Dqrshan/discord-components-v2-skill' or a cloned repository's install.sh script.

by read2 min views18 publishedNov 16, 2026

If you've built Discord bots with discord.js, you're probably familiar with embeds.

They work well, but Discord's Components V2 opens up more possibilities for building structured, interactive, and modern messages.

The challenge? Getting the component structure, builders, limits, and API usage right can take time — especially when working with AI coding assistants.

That's why I built discord-components-v2-skill.

It's a ready-to-use agent skill that teaches AI coding assistants how to build Discord messages using Components V2 and discord.js.

Instead of repeatedly explaining the API to your coding agent, you can give it a focused reference covering:

It works with Claude Code, Cursor, Codex, and other agents supporting the Agent Skills format.

Here's what a simple Components V2 message looks like:

const {
  ContainerBuilder,
  TextDisplayBuilder,
  SeparatorBuilder,
  SeparatorSpacingSize,
  ActionRowBuilder,
  ButtonBuilder,
  ButtonStyle,
  MessageFlags,
} = require('discord.js');

await channel.send({
  flags: MessageFlags.IsComponentsV2,
  components: [
    new ContainerBuilder()
      .setAccentColor(0x5865F2)
      .addTextDisplayComponents(
        new TextDisplayBuilder()
          .setContent('# Welcome!\nWelcome to our server.')
      )
      .addSeparatorComponents(
        new SeparatorBuilder()
          .setDivider(true)
          .setSpacing(SeparatorSpacingSize.Small)
      )
      .addActionRowComponents(
        new ActionRowBuilder().addComponents(
          new ButtonBuilder()
            .setCustomId('welcome:continue')
            .setLabel('Continue')
            .setStyle(ButtonStyle.Primary)
        )
      ),
  ],
});

The skill helps your coding agent understand how to structure messages like this without relying on outdated embed patterns.

The easiest way to install it:

npx skills add Dqrshan/discord-components-v2-skill

You can also clone the repository and use the included installer:

git clone https://github.com/Dqrshan/discord-components-v2-skill.git

cd discord-components-v2-skill

./install.sh

AI coding assistants are useful, but they don't always get library-specific APIs right.

Discord Components V2 has its own rules, component limits, and builder patterns. A focused skill gives coding agents the context they need instead of making developers correct the same mistakes repeatedly.

The goal is simple: spend less time fixing generated Discord UI code and more time building your bot.

The project is open source and available on GitHub:

👉 Dqrshan/discord-components-v2-skill

If you build Discord bots or experiment with AI coding agents, give it a try.

Issues, feedback, and contributions are welcome!

Happy building! 🚀

── more in #ai-agents 4 stories · sorted by recency
── more on @discord 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/building-better-disc…] indexed:0 read:2min 2026-11-16 · —