Discord's Components V2 update finally lets bots put text, images, thumbnails, dividers, buttons, and dropdowns together inside a single clean card. It looks much better than old embeds, especially for dashboards, shop menus, and help panels.
The catch is how much code it takes to write by hand in discord.js .
Just to send a basic welcome card with two lines of text, a user avatar on the side, a divider line, and two buttons, you end up stacking six or seven different classes inside each other:
import { ContainerBuilder , SectionBuilder , TextDisplayBuilder , ThumbnailBuilder , SeparatorBuilder , SeparatorSpacingSize , ActionRowBuilder , ButtonBuilder , ButtonStyle , MessageFlags , } from "discord.js" ;
const container = new ContainerBuilder ( ) . setAccentColor ( 0x5865f2 ) . addSectionComponents ( new SectionBuilder ( ) . addTextDisplayComponents ( new TextDisplayBuilder ( ) . setContent ( "## Welcome to the server" ) , new TextDisplayBuilder ( ) . setContent ( "Glad to have you here." ) ) .β¦