Command Aliases

Command Aliases are short forms to help run a command faster.

Command Aliases can only be used for legacy commands. Unless you set the slash option in your command to true, command aliases will work for your command.

Using aliases option

We will use the ping command as an example. Let's set aliases "p" and "pi" for this command:

ping.js
const { NoCliCommandType } = require("nocli-handler.js");

/**
 * @type {import("nocli-handler.js").ICommand}
 */
const Command = {
    aliases: ["p", "pi"], // <-- Set aliases
    type: NoCliCommandType.Both,
    description: "Checks client latency",
    callback: ({ client, message, args, text }) => {
        return `๐Ÿ“ Pong! \`${client.ws.ping}ms\``;
    }
}

module.exports = Command;

End Result:

Last updated