
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
djs-builder
Advanced tools
๐ Package Update! ๐ฅ - Add option `disabled` to the selectMenu options New features added: - `GetUser`: Easily fetch a user from ID, mention, or even from a reply. ๐ Fixes: - Minor bugs fixed - Improved stability and error handling

Welcome to the Discord Bot Utilities package! ๐ฅ
Starter provides functionality for initializing and starting a Discord bot ๐ค.
Features:
๐ก Tip: Any option you don't want, just
DELETE ๐๏ธthe option .
const { starter } = require("djs-builder");
const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({
intents: Object.keys(GatewayIntentBits).map((a) => {
return GatewayIntentBits[a];
}),
});
// Define starter options
const starterOptions = {
bot: {
token: "YOUR_BOT_TOKEN", // [OPTIONAL] Discord bot token
ownerId: "YOUR_USER_ID",
},
terminal: true,
Status: {
status: "online", // Required: Bot presence state ['online', 'offline', 'dnd', 'idle', 'Streaming']
activities: ["Game 1", "Game 2"], // [OPTIONAL] Bot activities
type: 0, // [OPTIONAL] Bot activity type
time: 60000, // [OPTIONAL] Activity rotation delay in milliseconds
},
database: {
url: "mongodb://localhost:27017", // Required: MongoDB connection URI
},
slash: {
path: "./path/to/slash_commands", // Required: Path to slash commands
log: "", // id of log channel
},
prefix: {
path: "./path/to/prefixes", // Required: Path to prefix settings
prefix: "!", // Required: Default bot prefix
log: "", // id of log channel
custom_prefix: {
id : prefix,
id : prefix,
} // select prefix for servers
},
events: {
path: "./path/to/events", // Required: Path to event handlers
},
anticrash: {
url: "https://your.crash.webhook.url", // Required: Webhook URL for crash alerts
mention_id: "YOUR_USER_ID", // [OPTIONAL] User ID to mention in crash alerts
},
};
await starter(client, starterOptions);
Than the discord.js
๐ต CreateRow is a utility for managing the creation of Discord Row โจ.
const { CreateRow } = require('djs-builder');
const actionRow = new CreateRow([
//// for any row add new [] or {}
// for buttom
[
{
id: 'button1', // ID for the button customId
style: 1, // style: Primary(1), Secondary(2), Success(3), Danger(4), Link(5)
label: 'Primary Button',
emoji: '๐', // Emoji for the button
enabled: false, // Whether the button is disabled
},
{
id: 'button2',
style: 2,
emoji: '๐',
enabled: true,
}
], ///// now it is row 1 for button and you can add more rows
{
type : "string" /// you can select from ["role" , "user" , "channel" ]
options : {
id: "menu", // ID for the select menu customId
placeholder: "Select an option", // Placeholder text for the select menu
min: 1, // Minimum number of selected values
max: 2, // Maximum number of selected values
data: [ // you shuld add your options (it not work for role , user and channel)
{ name: 'Option 1', id: 'option1', about: 'Description for Option 1', icon: '๐' },
{ name: 'Option 2', id: 'option2', about: 'Description for Option 2', icon: '๐' },
{ name: 'Option 3', id: 'option3', about: 'Description for Option 3', icon: '๐' },
], //// is should not look like this ,you selecit it in next step
value: "id", // here you can set the value of the selected option ( defult the value is will be index (0,1,2 .....) )
description: "about", // here you can set the description of the selected option ( defult the description not work )
label: "name", // here you can set the label of the selected option ( defult the label is (Option 1 , Option 2 , Option 3) )
emoji: "icon" // here you can set the emoji of the selected option ( defult the emoji not work )
}
}
]);
๐งพ CreateBar it โจ.
const { CreateBar } = require("djs-builder");
const menu = new CreateBar(0, 100, {
lenth: 20,
fill: "โ
",
empty: "โ",
partialChar: "โณ",
showPercent: true,
left: "[",
right: "]",
});
you can do any type of bar you want like
createProgressBar(3.7, 5, {
filledChar: '๐ฆ',
emptyChar: 'โฌ',
partialChar: '๐จ',
leftEdge: 'โฐ',
rightEdge: 'โฑ',
precision: 1
});
// โฐ๐ฆ๐ฆ๐ฆ๐จโฌโฑ 74.0%
console.log(createProgressBar(7, 10, {
length: 20,
filledChar: '๐',
emptyChar: '๐ค',
}));
[๐๐๐๐๐๐๐๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค] 70%
โฐ Wait insted of collecter ๐คฎ โจ.
const { Wait } = require('djs-builder');
const message = await Wait({
context: message, /// message or interaction
userId : (message.author.id || interaction.user.id), /// user id
type: "interaction", /// message to wait message or interaction to wait button/menu or both ๐ช
time: 30000 /// time in ms
message_Wait : message /// message of button (for button or both)
});
๐ธ Log For All Discord Events โจ.
const { log } = require("djs-builder");
module.exports = {
name: "clientReady",
async run(client) {
await log(
client,
"YOUR_GUILD_ID", /// your guild id
"YOUR_CHANNEL_ID" /// your log channel id
);
},
};
๐ค Utility function to get a member from a message โจ.
const data = await GetUser(message);
{
user: <GuildMember>, // ๐ฏ The targeted member
args: [ "word1", "word2" ] // โ๏ธ Remaining args after mention/ID
}
Mention inside the message
Example:
!ban @Ahmed Breaking rules.
User ID directly
Example:
!ban 123456789012345678 Spamming.
Reply to someoneโs message
Reply to a userโs message with:
!ban.
client.on("messageCreate", async (message) => {
if (!message.content.startsWith("!ban")) return;
const data = await GetUser(message);
if (!data) return message.reply("โ Couldn't find this user.");
const member = data.user;
const reason = data.args.join(" ") || "No reason provided";
await member.ban({ reason });
message.reply(`๐ซ ${member.user.tag} has been banned for: ${reason}`);
});
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, feel free to contact us on discord.
FAQs
๐ Package Update! ๐ฅ
The npm package djs-builder receives a total of 275 weekly downloads. As such, djs-builder popularity was classified as not popular.
We found that djs-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authoritiesโ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socketโs new workflow scanning support.