
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
discordbot-script
Advanced tools
DiscordBot-Script is a powerful Discord.js framework allowing you to easily interact with the DiscordAPI.
$ npm install discordbot-script
This package allows you to make Discord bots with ease. We have a similar language structure as the well known mobile app, "Bot Designer for Discord". If you are not familiar with the app, you can still use this package because its very simple to understand.
const Dlang = require('discordbot-script')
const bot = new Dlang({
token: "TOKEN_HERE",
prefix: ["?", "!"]
})
bot.MessageEvent()
bot.Command({
name: "ping",
code: `
$ping ms
`
})
You can use events very easily! Events are for allowing the bot to respond when a particular action has taken place. For example, when someone joins the server, there is an event for it, below is an example.
bot.JoinedCommand({
name: "channelID or variable",
code: `
Something here like, <@$authorID> thanks for joining the server!
`
})
bot.onJoined()
bot.UserUpdateCommand({
name: "channelID or variable",
code: `
{tag} Updated thier username!
Old - {oldname}
New - {newname}
`
})
bot.onUserUpdate()
DiscordBot-Script functions are an essential key to perform tasks and execute commands, lets take a look at the simple example given below:
bot.Command({
name: "clear",
code: `
Cleared $message[1] messages
$clear[$message[1]]
`
})
The command handler is an extremely useful tool to allow you to store commands in organized folders and files instead of all in your main file. This chunk of code is stored in your main file.
NOTE: The commented content are options to log in the console upon bot start-up. There's already a default command log in this handler, edit as you wish. The commented content can be left there in your code as a note or be taken out.
const fs = require('fs');
const folders = fs.readdirSync("./commands/")
for (const files of folders) {
const folder = fs.readdirSync(`./commands/${files}/`).filter(file => file.endsWith(".js"))
for (const commands of folder) {
const command = require(`./commands/${files}/${commands}`)
bot.Command(command);
console.log(`Loaded: ${command.name} [${command.status}]`);
}
// ${folder} = File name with extension
// ${folders} = All Folder names
// ${command.name} = The loaded command name
// ${command.aliases} = All the aliases of the loaded command. Returns 'undefined' if no aliases are found
// ${command.status} = The status of the command. Returns 'undefined' if there's no status defined in the command header of the loaded command
}
All discordbot-script command codes are seen, read and executed by the bot from bottom to top
FAQs
DiscordBot-Script is a powerful Discord.js framework allowing you to easily interact with the DiscordAPI.
The npm package discordbot-script receives a total of 79 weekly downloads. As such, discordbot-script popularity was classified as not popular.
We found that discordbot-script demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.