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
1191
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

  • 0.16.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
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 17 Jul 2022

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