GuidesCommands Deleting a Command In case you do not want the user to run some commands to the bot, you might want to temporarily "delete" the command without deleting the command file.
How to "delete" the command?
You will have to insert the "delete" variable and set it to true
.
Copy const { NoCliCommandType } = require("nocli-handler.js");
/**
* @type {import("nocli-handler.js").ICommand}
*/
const Command = {
delete: true, // <-- Temporarily "deletes" the command.
type: NoCliCommandType.Both, // Works for Slash commands also
description: "Checks client latency",
callback: ({ client, message, args, text }) => {
return `๐ Pong! \`${client.ws.ping}ms\``
}
}
module.exports = Command;
Copy import { ICommand, NoCliCommandType } from "nocli-handler.js";
export default {
delete: true, // <-- Temporarily "deletes" the command
type: NoCliCommandType.Both, // Works for Slash Commands also
description: "Ping",
callback: ({ client, message, args, text }) => {
return `๐ Pong! \`${client.ws.ping}ms\``;
}
} as ICommand;