npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dcnlx

v0.0.9

Published

DSH.js is a package powered by Eris.#2000.

Readme

discordbot-script

Discord NPM Downloads


$ 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
  `
})

EVENTS

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()

FUNCTIONS

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]]
  `
})

COMMAND HANDLER

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
}

EVENT HANDLER

The Event Handler will reduce thousands of lines in the main file by allowing events and other bot functions that would normally have to be in the main file, can be in their own files with this Handler being in the main file.

NOTE: Please visit the Official DB-Script Documentation on Gitbook for more information on how to use the Event Handler.

const events = fs.readdirSync("./events/");
for (const Files of events) {
    const eventFile = fs.readdirSync(`./events/${Files}/`).filter(file => file.endsWith(".js"))
    for (const event of eventFile) {
        const obj = require(`./events/${Files}/${event}`);
        if (typeof(obj) != "object") {
        console.log("invalid module.exports data ...shutting down");
        process.exit();
}
        const eventName = Object.keys(obj);
        const eventData = Object.values(obj)[0];
        if (typeof(eventData) != "object") {
            if (typeof(eventData) != "number") {
                console.log("invalid event data ...shutting down");
                process.exit();
             }
        }
        bot[eventName](eventData);
        if(bot.vars){
            bot.Variables(eventData);
        } if(bot.awaitedCommands){
            bot.AwaitedCommand(eventData);
        }

        console.log(`Loaded Event: ${event}`);
    }
}

CODE INTERPRETATION

All discordbot-script command codes are seen, read and executed by the bot from bottom to top


Official DB-Script Documentation