Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@discordjs/builders

Package Overview
Dependencies
Maintainers
2
Versions
1185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@discordjs/builders

A set of builders that you can use when creating your bot

  • 1.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
126K
decreased by-41.75%
Maintainers
2
Weekly downloads
 
Created

What is @discordjs/builders?

@discordjs/builders is a utility package for building and formatting Discord API interactions, such as commands and embeds, in a structured and type-safe manner. It is part of the larger discord.js library ecosystem.

What are @discordjs/builders's main functionalities?

Slash Command Builder

The Slash Command Builder allows you to create and structure slash commands for your Discord bot. This example creates a simple 'ping' command that replies with 'Pong!'.

const { SlashCommandBuilder } = require('@discordjs/builders');

const command = new SlashCommandBuilder()
  .setName('ping')
  .setDescription('Replies with Pong!');

console.log(command.toJSON());

Embed Builder

The Embed Builder helps you create rich embed messages with various properties like title, description, and color. This example creates a simple embed with a title, description, and green color.

const { EmbedBuilder } = require('@discordjs/builders');

const embed = new EmbedBuilder()
  .setTitle('Sample Embed')
  .setDescription('This is an example of an embed')
  .setColor(0x00FF00);

console.log(embed.toJSON());

Button Builder

The Button Builder allows you to create interactive buttons for your Discord bot. This example creates a primary button with the label 'Click Me'.

const { ButtonBuilder, ButtonStyle } = require('@discordjs/builders');

const button = new ButtonBuilder()
  .setCustomId('primary-button')
  .setLabel('Click Me')
  .setStyle(ButtonStyle.Primary);

console.log(button.toJSON());

Select Menu Builder

The Select Menu Builder helps you create dropdown menus for your Discord bot. This example creates a select menu with two options.

const { SelectMenuBuilder } = require('@discordjs/builders');

const selectMenu = new SelectMenuBuilder()
  .setCustomId('select-menu')
  .setPlaceholder('Choose an option')
  .addOptions([
    { label: 'Option 1', value: 'option1' },
    { label: 'Option 2', value: 'option2' }
  ]);

console.log(selectMenu.toJSON());

Other packages similar to @discordjs/builders

Keywords

FAQs

Package last updated on 02 Sep 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc