Running Events inside a Command
I'm currently working on this for a separate "Features"/"Events" directory that contains event files. So please use this feature temporarily.
/**
* @type {import("nocli-handler.js").ICommand}
*/
const Command = {
init: (client) => {
// Create events here
},
type: "BOTH",
description: "Checks client latency",
callback: ({ client, message, args, text }) => {
return `๐ Pong! \`${client.ws.ping}ms\``;
}
}
module.exports = Command;
import { ICommand } from "nocli-handler.js";
export default {
init: (client) => {
// Create events here
},
description: "Checks client latency",
type: "BOTH",
callback: ({ client, message, args, text }) => {
return `๐ Pong! \`${client.ws.ping}ms\``;
}
} as ICommand;
After creating events using init
function, once the program starts, this function will automatically be called once.