Function: defineCommand()
defineCommand<
ParamsList>(options):Command<ParamsList>
Defined in: packages/bakit/src/command/Command.ts:76
Define command entry, usually for modules.
Type Parameters
ParamsList
ParamsList extends readonly AnyParam<any>[] = any[]
Parameters
options
The command options.
string | Omit<{ description?: string; name: string; params?: BaseParam<{ description?: string; name: string; required?: boolean; }, unknown, boolean>[]; quotes?: boolean; }, "params"> & object
Returns
Command<ParamsList>
The entry of the command to deploy or register hooks.
Example
import { defineCommand } from "bakit";
const command = defineCommand({
name: "ping",
description: "Displays bot's latency.",
});
command.main(async (context) => {
await context.send(`Pong! ${context.client.ws.ping}ms!`);
});
export default command;