Enabling Slash Commands
Slash commands are commands registered from a bot to Discord with the "/" prefix for those who are not used to legacy (or text) commands.
Using slash option
slash optionconst { NoCliCommandType } = require("nocli-handler.js");
/**
* @type {import("nocli-handler.js").ICommand}
*/
const Command = {
description: "Checks client latency",
type: NoCliCommandType.Both, // <-- Set the command type here (optional)
callback: ({ client, message, args, text }) => {
return `π Pong! \`${client.ws.ping}ms\``
}
}
module.exports = Command;import { ICommand, NoCliCommandType } from "nocli-handler.js";
export default {
description: "Ping",
type: NoCliCommandType.Both, // <-- Set the command type here
callback: ({ client, message, args, text }) => {
return `π Pong! \`${client.ws.ping}ms\``;
}
} as ICommand;Last updated

