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,13 +60,15 @@ export class KoishiMetascanService {
),
);
this.addInterceptors(command, interceptorDefs);
command.action(async (argv) => {
try {
return await argv.next();
} catch (e) {
return this.exceptionHandler.handleActionException(e);
}
}, true);
if (!(result.data as CommandRegisterConfig).config?.empty) {
command.action(async (argv) => {
try {
return await argv.next();
} catch (e) {
return this.exceptionHandler.handleActionException(e);
}
}, true);
}
}
}
......
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