Introduction
The Official DBD.JS Version 4.0.0x Documentation

Setting up

To begin you must install the package
You must be on NodeJS v14 and above to ensure it will work properly.
Copied!
This should take approximately couple of seconds to install.
Once you've installed the package we can initialize the setup.
index.js
1
const dbd = require("dbd.js");
2
const bot = new dbd.Bot({
3
intents: true,
4
prefix: "PREFIX",
5
revertReading: false,
6
})
7
8
bot.enableEvent("message"); //Allow to runs Commands
9
bot.enableEvent("ready"); //Executes when Client is Ready
10
11
const id = bot.createCommmand({code:"$log[$username[$clientID] is Ready.]"});
12
bot.assignType(bot.Types.Ready, id);
13
14
15
bot.login("TOKEN")
Copied!
You must enter a prefix via PREFIX
You must enter a valid Discord Bot Token via TOKEN

Usage of Command

index.js
1
bot.assignType(bot.Types.Message, bot.createCommmand({
2
name:"command",
3
code:"code"
4
}))
Copied!

Example + Command

index.js
1
const dbd = require("dbd.js");
2
const bot = new dbd.Bot({
3
intents: true,
4
prefix: "PREFIX",
5
revertReading: false,
6
})
7
8
bot.enableEvent("message"); //Allow to runs Commands
9
bot.enableEvent("ready"); //Executes when Client is Ready
10
11
const id = bot.createCommmand({code:"$log[$username[$clientID] is Ready.]"});
12
bot.assignType(bot.Types.Ready, id);
13
14
/*COMMAND EXAMPLE BELOW*/
15
bot.assignType(bot.Types.Message, bot.createCommmand({
16
name:"ping", //Command Name
17
code:"Pong! $pingms" //Returns <Websocket Ping> ms
18
}))
19
20
bot.login("TOKEN")
Copied!
Last modified 5mo ago