删除Kdoc中存在的错误示例 (#386)

* Update SimpleCommand.kt

* Update Commands.md
This commit is contained in:
purofle 2021-08-03 04:30:08 +08:00 committed by GitHub
parent 6a63f1416f
commit 2c78c215b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -34,8 +34,7 @@ import kotlin.annotation.AnnotationTarget.VALUE_PARAMETER
* ```
* object MySimpleCommand : SimpleCommand(
* MyPlugin, "tell",
* description = "Message somebody",
* usage = "/tell <target> <message>" // usage 如不设置则自动根据带有 @Handler 的方法生成
* description = "Message somebody"
* ) {
* @Handler
* suspend fun CommandSender.onCommand(target: User, message: String) {

View File

@ -126,8 +126,7 @@ Mirai Console 内建 [`SimpleCommand`] 与 [`CompositeCommand`] 拥有 [`Command
```kotlin
object MySimpleCommand : SimpleCommand(
MyPluginMain, "tell", "私聊",
description = "Tell somebody privately",
usage = "/tell <target> <message>", // usage 如不设置则自动根据带有 @Handler 的方法生成
description = "Tell somebody privately"
) {
@Handler // 标记这是指令处理器 // 函数名随意
suspend fun CommandSender.handle(target: User, message: String) { // 这两个参数会被作为指令参数要求