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 🙏

© 2025 – Pkg Stats / Ryan Hefner

discord-bot-core

v0.8.4

Published

A modular Discord bot

Downloads

5

Readme

discord-bot-core

discord-bot-core is a modular bot for Discord servers

NPM

Top features include:

  • Completely modular design
  • Built-in server-specific permission system
    • You can add people to roles, or link them to server roles.
    • Each subcommand can have a different permission
  • Parser with argument types
    • Your command doesn't get called unless all required arguments are present, so you don't need to check that!
  • Self-generated help
    • You provide a help string for each subcommand, and the command signature is generated from the argument list
  • Simple interface to respond to messages
    • You can just call e.mention().respond("Hello!") to generate @Windsdon Hello!
  • Server-specific databases (or you can make it global)

More documentation to come.

Getting Started

Install Node.

Download the current version of the bot, and extract it somewhere.

Using the command line, navigate to the directory that contains package.json, and execute:

npm install

This will install all dependencies of the package.

Create an account for your bot, if don't have one yet. Next, create a file named login.txt with your bot's Discord login information, following this format:

[email protected]:your-bots-password

and then run

node bot

It everything went well, you should see something like

info: Starting
info: Creating bot instance
info: Generating key
No token provided, and unable to parse 'tenc'. Using login method.
info: Connected as Your Bot - (<some numbers>)
info: Reloading permissions
info: Finished reloading permissions
info: Loading 4 plugins
info: Loading plugin core
info: Added permission * to group 0:root
info: Your auth key is 3a05c5b4c14277e2006a645d389e439cb0c37694c0d193fc558fa1ab32aab79a. Use it to get root privileges.
info: Completed setup for core
...

Take note of your auth key, as you'll need it to get root access on your bot.

Send a PM to your bot with !authkey <your key here>, and you should see a reply telling that you are now root.

From now on, you can start using your bot! Use !help to see a list of available commands.

Remeber! You need to enable your bot on a channel to use most commands! Do this by running !enable

Changelog

v0.6.0

  • Changed callback on e.respond() to callback(err, response)

v0.5.0

  • Added plugins/plugins.txt
    • Used as a load list
    • Can be used to load modules installed using npm
      • If plugins/<mod> isn't a folder, tries require(<mod>)
    • Created with plugin folder if doesn't exist
  • Renamed plugin constructor to init (was f)
  • Changed the addCommandControlHandler interface
    • Renamed to addCommandHandler
    • Removed the data argument (if you want to pass custom data, we recommend using async.apply(fn, data))
    • New signature: addCommandHandler(handler, type)
    • The callback given to the handlers is callback(err)
      • If you provide err.message and not set err.silent, the message is sent to the user
    • Handler signature is fn(o, callback). Properties of o are set as they are created. See details bellow.
    • Valid types:
      • start: called before anything is processed.
      • parsed: called after the parser returns (adds obj to o)
      • end: called after permissions are checked (adds e to o)
  • onMessage now runs on a Fiber
  • Added e.deleteMessage([id,] callback)
  • Added e.getRoles([uid], [sid])
    • Defaults to e's uid and sid. If uid is null, returns all server roles
  • Added e.getRole(rid, [sid])
    • Make sid null or false to search globally, otherwise will only search on e's server
  • Added e.roleName(rid, [sid])
    • Same as above
  • Updated help command
    • Now suggest subcommands even if there is a parent command
  • Fixed #3 and #6
    • Most (group, sid) argument pairs on PluginManager's functions accept the format group = "sid:group", sid = undefined
    • Fixed validation on group names
  • Message queues are now channel based
var o = {
    user: user,
    userID: userID,
    channelID: channelID,
    message: message,
    rawEvent: rawEvent,
    _disco: self, // the current DiscordBot instance
    obj: parsedObject, // the object returned from the parser
    e: e // the DiscordBotMessage object
};