Commit c712a338 authored by nanahira's avatar nanahira

command use

parent 1bb4cb2b
......@@ -139,6 +139,11 @@ export const CommandDef = (
): MethodDecorator & ClassDecorator =>
Metadata.append(KoishiCommandDefinition, def);
export const CommandUse = <T extends Command, R extends any[]>(
callback: (command: Command, ...args: R) => T,
...args: R
) => CommandDef((cmd) => callback(cmd, ...args));
export const CommandDescription = (desc: string) =>
CommandDef((cmd) => {
cmd.description = desc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment