A JavaScript wrapper for the Discord API.


Keywords
discord, javascript, nodejs
License
MPL-2.0
Install
npm install birb@1.0.0-pre.5

Documentation

huntr Known Vulnerabilities

NPM

About

Birb.JS is a simple, yet powerful Discord API wrapper for Node.JS.
With just a few lines of code, you can get a Discord bot connected to the API.
Birb.JS is still in development. It is highly recommended you DO NOT use it until it’s ready.

Links

Documentation
GitHub
NPM
Birb.JS Server
Discord API Server

Installation

Node.js v16.0.0+ is required.

npm install birb
# or
yarn add birb
# or
pnpm add birb

Optional Addons

Birb.JS comes with a few optional addons made by our team.
Please view their documentation for more information on how to use them.

  • @birbjs/framework is a framework to make the development of Discord bots easier and more efficient. It includes an in-built command handler, permission system, event manager and built-in slash command support (npm install @birbjs/framework)
  • @birbjs/sharding is a sharding utility that makes it easier to shard your Discord bot (npm install @birbjs/sharding)
  • @birbjs/cluster is a clustering utility that is built for larger Discord bots who need to split shards across multiple seperate servers (npm install @birbjs/cluster)
  • @birbjs/devtools is a debugging tool for Birb.js developers, contributors and maintainers. (npm install @birbjs/devtools --save-dev)

Optional Dependencies

These dependencies aren't required, but will allow Birb.JS to do things more efficiently. NPM may attempt to install these by default. To force NPM to not attempt to install these, add the --no-optional command line argument.

  • erlpack for faster (de)serialization of websocket data (npm install erlpack)
  • zlib-sync for websocket compression (npm install zlib-sync)
  • bufferutil for quicker (un)masking of websocket data and packets (npm install bufferutil)
  • utf-8-validate for more efficient websocket data validation (npm install utf-8-validate)
  • @discordjs/opus for voice support - e.g. talking in voice channels (npm install @discordjs/opus)

Most of these dependencies require node-gyp which some users may struggle to install (mostly due to very unhelpful errors).

If you're on Windows, run npm install windows-build-tools --global in an administrator command prompt.
If you're on Ubuntu, run sudo apt install build-tools.

Remember that these are optional dependencies. If you're struggling, feel free to ignore them. Birb.JS will only use them if they are available.

Example

const { Client, Intents } = require('birb');
const client = new Client({
    intents: new Intents(Intents.FLAGS.ALL),
});

client.listen('ready', () => {
    console.log('Connected to Discord!');
});

client.connect('your_bot_token');

Credits

Main Contributors

@knokbak*PL, @axisiscool, @PalmDevs

Dependencies

ws, petitio, crypit, @sapphire/snowflake, erlpack, bufferutil, utf-8-validate, zlib-sync

Dev Dependencies

typescript, copyfiles, @types/node, @types/ws, @birbjs/devtools

Licensing

Birb.js is currently licensed under the Mozilla Public License 2.0. You're free to use it as a library in both personal and commercial projects, free-of-charge.