diff --git a/README.md b/README.md index 69f96cec2..6596ecd43 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ 您的 star 是对我们最大的鼓励(点击项目右上角); +## Use directly +**直接使用Mirai(终端环境/网页面板).** +[Mirai-Console](https://github.com/mamoe/mirai/tree/master/mirai-console) 插件支持, 在终端中启动Mirai并获得机器人服务 + ## Use as a library **把 Mirai 作为库内置于您的项目中使用.** Mirai 只上传在 `jcenter`, 因此请确保在 `build.gradle` 添加 `jcenter()` 仓库 diff --git a/mirai-console/README.MD b/mirai-console/README.MD new file mode 100644 index 000000000..3a6ae7272 --- /dev/null +++ b/mirai-console/README.MD @@ -0,0 +1,52 @@ +# Mirai Console +#### Mirai Console allows you to run Mirai in command lines/terminal. +#### 你可以终端中或命令行环境下运行在Mirai +
+ +#### More Importantly, Mirai Console support Plugins, tells the bot what to do +#### Mirai Console 支持插件系统, 你可以自己开发或使用公开的插件来逻辑化机器人, 如群管 +
+ +#### download 下载 +#### how to get/write plugins 如何获取/写插件 +
+
+ +### how to use(如何使用) +#### how to run Mirai Console + + + + +#### how to add plugins + + + + + diff --git a/mirai-console/src/main/kotlin/MiraiConsole.kt b/mirai-console/src/main/kotlin/MiraiConsole.kt index 0b9d983c4..1955790c3 100644 --- a/mirai-console/src/main/kotlin/MiraiConsole.kt +++ b/mirai-console/src/main/kotlin/MiraiConsole.kt @@ -1,5 +1,4 @@ -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch +import kotlinx.coroutines.runBlocking import net.mamoe.mirai.Bot import net.mamoe.mirai.alsoLogin import net.mamoe.mirai.plugin.PluginManager @@ -40,8 +39,13 @@ tailrec fun processNextCommandLine() { val qqNumber = commandArgs[1].toLong() val qqPassword = commandArgs[2] println("login...") - GlobalScope.launch { - Bot(qqNumber, qqPassword).alsoLogin() + + runBlocking { + try { + Bot(qqNumber, qqPassword).alsoLogin() + } catch (e: Exception) { + println("login failed") + } } } } diff --git a/mirai-plugins/image-sender/artifact/mirai-plugin-image-sender.jar b/mirai-plugins/image-sender/artifact/mirai-plugin-image-sender.jar index 4d317a317..4085cd215 100644 Binary files a/mirai-plugins/image-sender/artifact/mirai-plugin-image-sender.jar and b/mirai-plugins/image-sender/artifact/mirai-plugin-image-sender.jar differ