Commit ce1147be authored by nanahira's avatar nanahira

dont add exception handler for empty commands

parent bc232825
......@@ -17,7 +17,7 @@ import { KoishiContextService } from './koishi-context.service';
import { Module } from '@nestjs/core/injector/module';
import { KoishiMetadataFetcherService } from '../koishi-metadata-fetcher/koishi-metadata-fetcher.service';
import { KoishiInterceptorManagerService } from '../koishi-interceptor-manager/koishi-interceptor-manager.service';
import { Registrar } from 'koishi-decorators';
import { CommandRegisterConfig, Registrar } from 'koishi-decorators';
import { handleActionException } from '../utility/wrap-action';
import { KoishiExceptionHandlerService } from '../koishi-exception-handler/koishi-exception-handler.service';
......@@ -60,6 +60,7 @@ export class KoishiMetascanService {
),
);
this.addInterceptors(command, interceptorDefs);
if (!(result.data as CommandRegisterConfig).config?.empty) {
command.action(async (argv) => {
try {
return await argv.next();
......@@ -69,6 +70,7 @@ export class KoishiMetascanService {
}, true);
}
}
}
private registerOnService(
ctx: Context,
......
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