✔️ - Typings
✔️ - Variables
✔️ - Database
❌ - All Functions
❌ - Custom Prefixes
🛠️ - Full Embed Support
✔️ - Status Manager
✔️ - Slash Command Support
❌ - All Condensed Functions
🛠️ - Button Support
🛠️ - Music Support
✔️ - Command Manager
🛠️ - event
const { Bot } = require("d.js-bdscript")
const bot = new Bot({
prefix: "prefix", //or array of prefixes
token: "token" //optional, can also be passed to bot.login()
})
bot.command({
name: "gay",
type: "basicCommand",
code: `
$if[$authorID==$client[owners];
$eval[$message]
;
No permissions!
]`
})
bot.event("onMessage")
bot.login("token")
Supposing our commands are all located in commands
folder (and sub-folders) and they look as follows:
module.exports = {
type: "basicCommand",
name: "ping",
code: `pong!`
}
We will use:
//Loading commands
bot.manager.load("./commands/")
//Refreshing commands loaded with command manager
//this can go in the command manager folder too.
bot.command({
type: "basicCommand",
name: "reload",
code: `
$if[$authorID==$client[owners];
$updateCommands commands were updated!
;
No permissions!
]
`
})
This creates 2 variables:
bot.variable([
{
name: "coins",
default: 0,
type: "INTEGER"
},
{
name: "username",
type: "TEXT"
}
])
Setting and getting the value right after (you can paste this command in one of your codes):
$setVar[coins;15;$authorID;user]
$setVar[username;$user[$authorID;username];$authorID;user]
$getVar[username;$authorID;user] has $getVar[coins;$authorID;user] coins!
We first create the slash command data.
bot.createSlashCommandData({
name: "test",
description: "simple test command",
options: [
{
name: "target",
type: "USER",
required: false,
description: "the user to mention!"
}
]
})
Now we have to create it on Discord:
//global slash command
bot.command({
type: "readyCommand",
code: `
$createSlashCommand[global;test]
`
})
//guild slash command
bot.command({
type: "readyCommand",
code: `
$createSlashCommand[123456789012345678;test]
`
})
//replying to them
bot.command({
type: "slashCommand",
code: `$reply hello $if[$slashOption[target]==;;<@$slashOption[target]>]`
})
//be sure to enable the slash command event
//skip this if you already did.
bot.event("onInteraction")
Soon...