Command Aliases
Command Aliases are short forms to help run a command faster.
Using aliases option
aliases optionWe will use the ping command as an example. Let's set aliases "p" and "pi" for this command:
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;import { ICommand, NoCliCommandType } from "nocli-handler.js";
export default {
aliases: ["p", "pi"], // <-- Set aliases
description: "Checks client latency",
type: NoCliCommandType.Both,
callback: ({ client, message, args, text }) => {
return `π Pong! \`${client.ws.ping}ms\``;
}
} as ICommand;End Result:

Last updated