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:

This documentation has been updated using the dev branch. Please install the dev branch for this package. Testing is currently underway as the package is being finalized for the release of v2. Message will be delete upon updated package release.

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

Privacy Concerns

We do not save or maintain any information of your bot token. Discord-Features-Handler requires your bot token, to allow async/await tasks inside the modules folder, which can enables databases connection such as for MongoDB. For MongoDB to work and allowing it to post and update channels. We need all our discord events, ready event and bot to be logged in to be able to connect to the servers which uses the databases and display the information when bot starts up.

Notes

discord-features-handler allows you to create command and event files using predefined properties with the respective command or event names (event names associated with events such as ready, messageCreate, messageUpdate, or interactionCreate as listed in the discord.js documentation). As a flexible handler, this helps developers focus on what is required for their Discord bot without worrying about how to load files to connect to the Discord API using discord.js, allowing them to focus on the main aspect of the bot: its functionality and features. Developers also have the option to disable the provided messageCreate and interactionCreate events to customize how events and messages are handled using their own files. This handler also 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 the ability to preload files using this handler.

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