From 7f4945fc34e67d02bda77617e60d2844bb8a9932 Mon Sep 17 00:00:00 2001 From: jie65535 Date: Wed, 30 Mar 2022 17:57:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B8=AE=E5=8A=A9=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 ++++++++++++---------- src/main/kotlin/JccCommand.kt | 11 +++++------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 12610e5..269078e 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,12 @@ - `run [stdin]` - `引用消息: run [stdin]` ### 参数说明 - - `language` 编程语言 例如:`python` - - `code` 代码 例如:`print("Hello world")` - - `pastebinUrl` pastebin地址 例如:`https://pastebin.ubuntu.com/p/KhBB7ZjVbD/` - - `stdin` 可选 作为标准输入的内容 +| 参数 | 说明 | 示例 | 备注 | +| ---- | ---- | --- | --- | +| `language` | 编程语言 | `python` | 用`/jcc list`列出所有支持的语言 | +| `code` | 代码 | `print("Hello world")` | 要运行的代码,支持换行 | +| `pastebinUrl` | pastebin地址 | `https://pastebin.ubuntu.com/p/KhBB7ZjVbD/` | 需要在 [pastebin](https://pastebin.ubuntu.com/) 上传代码 | +| `stdin` | 标准输入 | `1 2 3 4 5` | 可选 用于`scanf`之类 | ## 使用示例 ### 直接使用 @@ -19,18 +21,18 @@ `run c https://pastebin.ubuntu.com/p/KhBB7ZjVbD/` ### 从 引用 执行代码: -> print("Hello world") +> 引用: print("Hello world") -run python +`run python` ### 支持运行程序带输入: #### 例1 -run c https://pastebin.ubuntu.com/p/S2PyvRqJNf/ 1 2 3 4 +`run c https://pastebin.ubuntu.com/p/S2PyvRqJNf/ 1 2 3 4 5` #### 例2 -> https://pastebin.ubuntu.com/p/S2PyvRqJNf/ +> 引用: https://pastebin.ubuntu.com/p/S2PyvRqJNf/ -run c 1 2 3 4 5 +`run c 1 2 3 4 5` ## 其他指令 - /jcc help # 帮助 @@ -39,7 +41,7 @@ run c 1 2 3 4 5 --- -## 使用方法 +## 插件使用方法 本插件基于[Mirai-Console](https://github.com/mamoe/mirai-console)运行,您可以通过阅读[Mirai用户手册](https://docs.mirai.mamoe.net/UserManual.html)来了解如何安装、启动机器人。 `MiraiConsole`成功启动后,只需要将本项目[发布](https://github.com/jie65535/mirai-console-jcc-plugin/releases)的`.jar`文件放入`.\plugins\`目录下即可加载插件。 diff --git a/src/main/kotlin/JccCommand.kt b/src/main/kotlin/JccCommand.kt index d680b20..01a9f71 100644 --- a/src/main/kotlin/JccCommand.kt +++ b/src/main/kotlin/JccCommand.kt @@ -21,12 +21,11 @@ object JccCommand : CompositeCommand( @Description("帮助") suspend fun CommandSender.help() { sendMessage( - "$CMD_PREFIX [stdin]\n" + - "例如:${CMD_PREFIX} python print(\"Hello world\")\n" + - "支持从pastebin.ubuntu.com中运行代码:\n" + - "$CMD_PREFIX c https://pastebin.ubuntu.com/p/KhBB7ZjVbD/\n" + - "你还可以在后面跟随标准输入(仅pastebin支持):\n" + - "$CMD_PREFIX c https://pastebin.ubuntu.com/p/S2PyvRqJNf/ 1 2 3 4\n" + + "在线运行代码指令:\n" + + "$CMD_PREFIX \n" + + "$CMD_PREFIX [stdin]\n" + + "引用消息: $CMD_PREFIX [stdin]\n" + + "仓库地址:https://github.com/jie65535/mirai-console-jcc-plugin\n" + "其它指令:\n" + usage )