From 03df2d8bb7df2967b5539a75bdd4dea6e50d36dc Mon Sep 17 00:00:00 2001 From: Him188 Date: Mon, 3 May 2021 17:06:50 +0800 Subject: [PATCH] Update docs about example for commands for Java --- backend/mirai-console/src/command/CompositeCommand.kt | 5 ++++- backend/mirai-console/src/command/RawCommand.kt | 2 +- backend/mirai-console/src/command/SimpleCommand.kt | 8 +++++--- .../src/command/java/JCompositeCommand.kt | 10 ++++++---- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/backend/mirai-console/src/command/CompositeCommand.kt b/backend/mirai-console/src/command/CompositeCommand.kt index 305cbd65b..ac2d3d06a 100644 --- a/backend/mirai-console/src/command/CompositeCommand.kt +++ b/backend/mirai-console/src/command/CompositeCommand.kt @@ -18,6 +18,7 @@ package net.mamoe.mirai.console.command import net.mamoe.mirai.console.command.descriptor.* +import net.mamoe.mirai.console.command.java.JCompositeCommand import net.mamoe.mirai.console.compiler.common.ResolveContext import net.mamoe.mirai.console.compiler.common.ResolveContext.Kind.COMMAND_NAME import net.mamoe.mirai.console.compiler.common.ResolveContext.Kind.RESTRICTED_CONSOLE_COMMAND_OWNER @@ -31,7 +32,9 @@ import kotlin.annotation.AnnotationTarget.FUNCTION /** * 复合指令. 指令注册时候会通过反射构造指令解析器. * - * 示例: + * Java 示例查看 [JCompositeCommand]. + * + * Kotlin 示例: * ``` * @OptIn(ConsoleExperimentalAPI::class) * object MyCompositeCommand : CompositeCommand( diff --git a/backend/mirai-console/src/command/RawCommand.kt b/backend/mirai-console/src/command/RawCommand.kt index 850ac5612..638973f60 100644 --- a/backend/mirai-console/src/command/RawCommand.kt +++ b/backend/mirai-console/src/command/RawCommand.kt @@ -76,7 +76,7 @@ public abstract class RawCommand( * * @param args 指令参数. * - * @see CommandManager.execute 查看更多信息 + * @see CommandManager.executeCommand 查看更多信息 */ public abstract suspend fun CommandSender.onCommand(args: MessageChain) } diff --git a/backend/mirai-console/src/command/SimpleCommand.kt b/backend/mirai-console/src/command/SimpleCommand.kt index 84ceffbc7..d85d0fcd3 100644 --- a/backend/mirai-console/src/command/SimpleCommand.kt +++ b/backend/mirai-console/src/command/SimpleCommand.kt @@ -33,10 +33,12 @@ import kotlin.annotation.AnnotationTarget.VALUE_PARAMETER /** * 简单的, 支持参数自动解析的指令. * - * 要查看指令解析流程, 参考 [CommandManager.executeCommand] - * 要查看参数解析方式, 参考 [CommandValueArgumentParser] + * 要查看指令解析流程, 参考 [CommandManager.executeCommand]. + * 要查看参数解析方式, 参考 [CommandValueArgumentParser]. * - * Kotlin 实现: + * Java 示例查看 [JSimpleCommand]. + * + * Kotlin 示例: * ``` * object MySimpleCommand : SimpleCommand( * MyPlugin, "tell", diff --git a/backend/mirai-console/src/command/java/JCompositeCommand.kt b/backend/mirai-console/src/command/java/JCompositeCommand.kt index c7be80672..bbeb28bb6 100644 --- a/backend/mirai-console/src/command/java/JCompositeCommand.kt +++ b/backend/mirai-console/src/command/java/JCompositeCommand.kt @@ -1,10 +1,10 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 Mamoe Technologies and contributors. * - * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. - * Use of this source code is governed by the GNU AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link. + * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. + * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link. * - * https://github.com/mamoe/mirai/blob/master/LICENSE + * https://github.com/mamoe/mirai/blob/master/LICENSE */ package net.mamoe.mirai.console.command.java @@ -68,6 +68,8 @@ import net.mamoe.mirai.console.permission.Permission * } * ``` * + * Kotlin 示例查看 [CompositeCommand] + * * @see buildCommandArgumentContext */ public abstract class JCompositeCommand