Skip to content

Type Alias: CommandHandler() ​

CommandHandler = (message, args) => Promise<void>

The handler function type for a command.

Parameters ​

NameTypeDescription
messageMessageModelThe message object.
argsCommandArgsSchemaThe parsed arguments according to the schema.

Returns ​

Promise<void>

Example ​

ts
const handler: CommandHandler = async (message, args) => {
  // args.name, args.age, etc.
  console.log(args);
};