Basic Usage

You can use this package as a wrapper for the Discord API or as a command handler.

Command handler

Setup

Free advice: Please don't copy-paste then ask for support because you don't understand it.

//index.js
const SHClient = require('shandler');
const Discord = require('discord.js');

const client = new Discord.Client();

const options = {
    commandsDir: 'commands', // commands folder path (required)
    showLogs: 'extra', // "extra"|"normal"|null (default: "extra")
    wrapper: false, // defaults to false
    cLogs: true, // logs most of the resolved promises
    autoDelete: true, // Automatically syncs the global application commands
    autoRegister: true, // Automatically register commands
    exclude: ['file'] // Exclude a file from the command directory. Make sure you only put the file name.
}

const handler = new SHClient(client, options);

Let's make a command file.

Command Options

You might've thought what all we can do with the options. Well, you can refer here at the Discord Documentation.

Wrapper

Starting Setup.

Registering a command

for registering a command you can use the .create() method.

Last updated

Was this helpful?