diff --git a/src/main/java/snw/kookbc/impl/command/litecommands/LiteKookFactory.java b/src/main/java/snw/kookbc/impl/command/litecommands/LiteKookFactory.java index ffc978dc..487dae04 100644 --- a/src/main/java/snw/kookbc/impl/command/litecommands/LiteKookFactory.java +++ b/src/main/java/snw/kookbc/impl/command/litecommands/LiteKookFactory.java @@ -20,16 +20,9 @@ import dev.rollczi.litecommands.LiteCommandsBuilder; import dev.rollczi.litecommands.LiteCommandsFactory; -import dev.rollczi.litecommands.LiteCommandsInternal; import dev.rollczi.litecommands.extension.annotations.LiteAnnotationsProcessorExtension; -import dev.rollczi.litecommands.handler.result.ResultHandler; -import dev.rollczi.litecommands.handler.result.ResultHandlerChain; -import dev.rollczi.litecommands.invocation.Invocation; -import dev.rollczi.litecommands.message.InvokedMessage; -import dev.rollczi.litecommands.processor.LiteBuilderProcessor; import snw.jkook.Core; import snw.jkook.HttpAPI; -import snw.jkook.command.CommandException; import snw.jkook.command.CommandSender; import snw.jkook.command.ConsoleCommandSender; import snw.jkook.entity.CustomEmoji; @@ -80,8 +73,8 @@ public static .bind(Plugin.class, () -> plugin) .bindUnsafe(plugin.getClass(), () -> plugin) .bind(KBCClient.class, () -> client) - .extension(processorExtension) .validatorGlobal(new ResultTypeValidator()) + .extension(processorExtension) .context(Message.class, new KookMessageContextual()) .context(User.class, new KookOnlyUserContextual<>("只有用户才能执行该命令")) .context(ConsoleCommandSender.class, new KookOnlyConsoleContextual<>("只有后台才能执行该命令")) diff --git a/src/main/java/snw/kookbc/impl/command/litecommands/annotations/result/ResultAnnotationResolver.java b/src/main/java/snw/kookbc/impl/command/litecommands/annotations/result/ResultAnnotationResolver.java index f74a05b2..7075627f 100644 --- a/src/main/java/snw/kookbc/impl/command/litecommands/annotations/result/ResultAnnotationResolver.java +++ b/src/main/java/snw/kookbc/impl/command/litecommands/annotations/result/ResultAnnotationResolver.java @@ -36,7 +36,7 @@ public ResultAnnotationResolver(Logger logger) { @Override public AnnotationInvoker process(AnnotationInvoker invoker) { - return invoker.on(Result.class, (annotation, metaHolder) -> { + return invoker.onExecutorStructure(Result.class, (annotation, builder, executorProvider) -> { ResultType resultTypes = annotation.value(); if (!Objects.equals(ResultType.class, annotation.custom())) { try { @@ -47,7 +47,7 @@ public AnnotationInvoker process(AnnotationInvoker invoker) { } } if (resultTypes == ResultTypes.DEFAULT) return; - metaHolder.meta().put(ResultType.RESULT_TYPE_KEY, resultTypes); + builder.meta().put(ResultType.RESULT_TYPE_KEY, resultTypes); }); }