Installation
Install the package using npm:
npm install djs-helpers
Then import it in your code:
const { embeds, buttons, send, reply, timestamps } = require('djs-helpers');
Message Sending
Send messages easily with automatic context detection for both regular messages and interactions.
Basic Usage
// For messages
send(message, { content: "Hello!" });
reply(message, { content: "This is a reply" });
// For interactions
send(interaction, { content: "Hello!" });
reply(interaction, {
content: "This is a hidden reply",
hide: true
});
Combined Usage
// With embeds and buttons
send(message, {
content: "Welcome!",
embed: embeds.generate({
title: "My Embed",
description: "Click the button below"
}),
component: buttons.generate({
label: "Click Me",
id: "click-btn",
style: "PRIMARY"
})
});
All Options
Introduction
A simple package to create Discord.js embeds and buttons with ease.
const { embeds, buttons } = require('djs-helpers');
Embeds Helper
Create embeds easily with a simple object structure.
Basic Usage
const myEmbed = embeds.generate({
title: 'My Embed',
description: 'This is a description',
color: 'RED'
});
All Options
Fields Example
// Array format
fields: [
['Field Name', 'Field Value', true], // inline
['Another Field', 'Another Value', false] // not inline
]
// Object format
fields: {
1: ['Field Name', 'Field Value', true],
2: ['Another Field', 'Another Value', false]
}
Embed Example
Timestamps Helper
Generate Discord timestamps easily.
Basic Usage
const timestamp = timestamps.generate('02/13/2025', 'SHORT_DATE');
All Formats
Color Support
Colors can be specified in multiple formats: