🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

discord-components

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-components

A discord.js Discordcomponents builder

1.0.26
latest
Source
npm
Version published
Weekly downloads
15
-80.77%
Maintainers
1
Weekly downloads
 
Created
Source

Discord Discord Message Component Builders for Discord.js

This repository contains TypeScript builders for crafting Discord Message Components with full type safety, clean structure, and reusable patterns.

It wraps raw Discord API component structures into easy-to-use, chainable builders designed for use in bots, utilities, or frameworks.

🔗 Reference: Discord Developer Docs – Message Components

🔗 Support/Hangout Discord: Altvine 🔗 My Discord Bot: Merlin

🧱 Included Builders

Each builder corresponds to a Discord component type, with smart defaults, validation, and clear APIs.

ComponentBuilder ClassDescription
ButtonButtonBuilderBuild styled, interactive buttons with labels, emojis, custom IDs, and URLs.
String SelectStringSelectBuilderCreate menus with up to 25 options using custom labels, values, emojis, etc.
User SelectUserSelectBuilderSelect one or more users from the server dynamically.
Role SelectRoleSelectBuilderLet users choose one or more server roles.
Mentionable SelectMentionableSelectBuilderSelect users or roles with a unified component.
Channel SelectChannelSelectBuilderChoose from specific types of server channels (text, voice, etc.).
Action RowActionRowBuilderCompose select menus or buttons into Discord action rows.
ContainerContainerBuilderA utility for grouping components together.
Media GalleryMediaGalleryUtility to bundle media content.
Section / SeparatorSectionBuilder, SeparatorDisplay structured sections and dividers.
File & ThumbnailFile, ThumbnailAttach files or images.
Text DisplaysTextDisplayRender text blocks inside components.

📦 Installation

Clone or copy this directory into your bot or utility project. It is framework-agnostic and works with any method that sends raw Discord payloads (e.g., REST, Interactions API, libraries like discord.js, harmony, etc.). Originally designed to be used with discord.js.

import { Builder, TextDisplay } from 'discord-components';

const components = new Builder().addComponents([
  new TextDisplay("Testing"),
]);

sendMessage(components.toJSON());

Keywords

discord

FAQs

Package last updated on 27 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts