Skip to content

Yurba.js / yurba.js / CommandHandler

Type Alias: CommandHandler()

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

The handler function type for a command.

Parameters

message

Message

The message object.

args

CommandArgsSchema

The 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);
};