README
d.js-BDscript
REQUIRES NODEJS VERSION 14 OR EARLIER
Want to use beta version of the package? Use npm i https://github.com/Rubenennj/d.js-BDscript
to install upcoming updates.
Inspired in Bot Designer For Discord
Need help? Or hang out with other users who use this package? Then don't hesitate to join here!
Base for a d.js-BDscript bot
const bdjs = require("d.js-bdscript")
const bot = new bdjs({
token: "token here", //bot token
prefix: "!" //accepts an array of prefixes too
})
bot.command({
type: "command", //the command type, "command" stands for message event commands
name: "say", //command trigger
code: "$message"
})
bot.addEvent("onMessage") //add message callback
bot.login() //logs the bot on discord
Creating Variables
To create a variable, we have to use <Bot>.variable()
which accepts an array, or object. Each variable has to have a name and type, value is optional.
Method 1:
bot.variable({
name: "money",
value: 0,
type: "integer"
})
Method 2:
bot.variable({
money: {
value: 0,
type: "integer"
}
})
Method 3:
bot.variable([
{
name: "money",
value: 0,
type: "integer"
}
])