

Welcome to the Discord Bot Utilities package! ๐ฅ
Table of Contents
๐ฏ STARTER
Starter provides functionality for initializing and starting a Discord bot ๐ค.
Features:
- ๐ ๏ธ Handler for slash and prefix commands all in just two lines ๐ฉ
- ๐ A list displaying all information(number of commands, events, and comprehensive bot) ๐
- ๐งฐ Event handler in just one line ๐
- โ ๏ธ Anti-crash system with error lock ๐
- ๐ Direct connection with MongoDB ๐ฅ
- ๐ Logging for slash and prefix command usage with comprehensive information ๐งญ
๐ก Tip: Any option you don't want, just DELETE ๐๏ธ the option .
Starter โ๏ธ
const { starter } = require("djs-builder");
const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({
intents: Object.keys(GatewayIntentBits).map((a) => {
return GatewayIntentBits[a];
}),
});
const starterOptions = {
bot: {
token: "YOUR_BOT_TOKEN",
ownerId: "YOUR_USER_ID",
},
terminal: true,
Status: {
status: "online",
activities: ["Game 1", "Game 2"],
type: 0,
time: 60000,
},
database: {
url: "mongodb://localhost:27017",
},
slash: {
path: "./path/to/slash_commands",
log: "",
},
prefix: {
path: "./path/to/prefixes",
prefix: "!",
log: "",
custom_prefix: {
id : prefix,
id : prefix,
}
},
events: {
path: "./path/to/events",
},
anticrash: {
url: "https://your.crash.webhook.url",
mention_id: "YOUR_USER_ID",
},
};
await starter(client, starterOptions);
โ๏ธ function
- Easyest โจ
- Fastest โก
- Clear ๐งต
Than the discord.js
CreateRow ๐ต
๐ต CreateRow is a utility for managing the creation of Discord Row โจ.
const { CreateRow } = require('djs-builder');
const actionRow = new CreateRow([
[
{
id: 'button1',
style: 1,
label: 'Primary Button',
emoji: '๐',
enabled: false,
},
{
id: 'button2',
style: 2,
emoji: '๐',
enabled: true,
}
],
{
type : "string"
options : {
id: "menu",
placeholder: "Select an option",
min: 1,
max: 2,
data: [
{ 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: '๐' },
],
value: "id",
description: "about",
label: "name",
emoji: "icon"
}
}
]);
CreateBar ๐งพ
๐งพ 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
});
console.log(createProgressBar(7, 10, {
length: 20,
filledChar: '๐',
emptyChar: '๐ค',
}));
[๐๐๐๐๐๐๐๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค] 70%
Wait โฐ
โฐ Wait insted of collecter ๐คฎ โจ.
const { Wait } = require('djs-builder');
const message = await Wait({
context: message,
userId : (message.author.id || interaction.user.id),
type: "interaction",
time: 30000
message_Wait : message
});
log ๐ธ
๐ธ Log For All Discord Events โจ.
const { log } = require("djs-builder");
module.exports = {
name: "clientReady",
async run(client) {
await log(
client,
"YOUR_GUILD_ID",
"YOUR_CHANNEL_ID"
);
},
};
GetUser ๐ค
๐ค Utility function to get a member from a message โจ.
const data = await GetUser(message);
๐ฆ What does it return?
{
user: <GuildMember>,
args: [ "word1", "word2" ]
}
๐ How does it detect the user?
๐ ๏ธ Example usage (ban command) ๐ซ
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
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, feel free to contact us on discord.
