discord-features-handler documentation

DiscordFeaturesHandler is a Discord.js commands, slash commands, and discord events handler that allows you to easily start creating command and event files for your discord.js bot.

You do not need to worry about how to handle and make a command or event run. This package provides a well-versed, all-around handler to create your Discord.js bot. This ensures that all your event, command, and module files are loaded without worrying about how to run these files. The only focus should be on what commands, events, and their functionality you should have for your bot.

DiscordFeaturesHandler is also MongoDB-ready, which means you can create your MongoDB files in the modules folder and we will load them for you! This package also supports TypeScript natively, so you can create your bot in JavaScript or TypeScript, based on your preferences. Currently supporting Discord.js v14.9 or newer.

Check roadmap for whats next update for the package.

Installation

To install the discord-features-handler package run the following command in your terminal:

npm install discord-features-handler

Install dev branch

This branch is still developing and there may be bugs. Check out the roadmap page to see what is added or tested

npm install git+https://github.com/bng94/discord-features-handler.git#dev 

Usage

Here is a very bare minimal example usage in your startup script file.

const { Client, GatewayIntentBits, Partials } = require("discord.js");
const DiscordFeaturesHandler = require("discord-features-handler");

const client = new Client({
 intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.DirectMessages,
  ],
  partials: [Partials.Channel, Partials.Channel],
});

DiscordFeaturesHandler(client, {
  config: "./config.js", // configuration file
  directories: {
    main: __dirname, // local path to your index.js file
  },
});

Want to jump right in?

Feeling like an eager beaver? Jump in to the quick start docs and get your bot and files are setup and get started on developing:

pageQuick Start

Want to deep dive?

Dive a little deeper and start exploring the DiscordFeaturesHandler setup and options reference to get an idea of everything that's possible with the package:

pageDiscordFeaturesHandler Setup

Notes

discord-features-handler allows you to follow the Discord.js guide with a few changes, such as using a JavaScript file instead of a JSON file for the config file, using the interactionReply function instead of execute for slash commands, and without creating your own handler for loading commands and events file. Also loading your modules files that contains features of your bot.

This is my first npm package that I created due to having three bots that I have created for different purposes, but using the same formats.

This documentation is based on discord.js documentation to have a very similar feel.

Support and Feedback

This package is looking for feedback and ideas to help cover more use cases. If you have any ideas feel free to share them or even contribute to this package! Please first discuss the add-on or change you wish to make, in the repository. If you like this package, and want to see more add-ons, please don't forget to give a star to the repository!

Please support me by starring the GitHub repository and/or providing some feedback, contributing, improving, and/or stating issues that you come along in the package to the GitHub repository.

Last updated