4.0.1 • Published 3 years ago

d.js-bdscript v4.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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"
    }
])
4.0.1

3 years ago

4.0.0

3 years ago

3.0.0

3 years ago

2.6.1

3 years ago

2.6.0

3 years ago

2.5.0

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.3.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago