Creating a command

Create your own command

You can contribute to Wump by creating your own command, this is very easy if you have a basic understanding of Node.JSarrow-up-right

extData of a command

Every command has extData, this basically is the command-specific settings object, it's structured as followed:

_base.js

cmd.extData = {
    // Information
    path       : undefined, // The config path of the command [`wump.utility.ping` for example] ( optional )
    name       : null,      // Command name        ( required )
    syntax     : null,      // Command syntax      ( optional )
    bearer     : 'wump',    // Command bearer      ( required )
    aliases    : [],        // Command aliases     ( optional )
    argument   : [],        // Command arguments   ( optional )
    description: null,      // Command description ( optional )
    // Checks
    hidden     : false,     // Hidden from view    ( true / false )
    enabled    : true,      // Enabled or disabled ( true / false )
    cooldown   : 1000,      // Command cooldown    ( optional )
    category   : 'General', // Command category    ( required )
    ownerOnly  : false,     // Owner only          ( true / false )
    guildOnly  : false,     // Guild only          ( true / false )
    permissions: []         // Bot permissions     ( optional )
}

Base command class

A command is structured as followed:

Creating your command

A command should be put inside of Command.emitas followed:

Localizing your command

Localizing is done with the private Command._localize function as followed:

How to submit

After you've tested and linted your command, you can submit it by creating a pull requestarrow-up-right on GitHubarrow-up-right. It may take some time for your pull request to be reviewed

Last updated