From 77b7a7cd08a25d393d5bd51422841f17e0bb33e2 Mon Sep 17 00:00:00 2001 From: LamGC Date: Mon, 2 May 2022 02:20:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(launch):=20=E5=AF=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=AD=E6=B2=A1=E6=9C=89=E5=90=AF=E7=94=A8=E4=BB=BB=E4=BD=95?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BA=BA=E7=9A=84=E6=83=85=E5=86=B5=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E8=AD=A6=E5=91=8A.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加对没有启用任何机器人时候的一个警告信息, 以防止被误认为无响应退出. --- scalabot-app/src/main/kotlin/AppMain.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scalabot-app/src/main/kotlin/AppMain.kt b/scalabot-app/src/main/kotlin/AppMain.kt index 674fa26..236e797 100644 --- a/scalabot-app/src/main/kotlin/AppMain.kt +++ b/scalabot-app/src/main/kotlin/AppMain.kt @@ -80,6 +80,9 @@ internal class Launcher : AutoCloseable { if (botConfigs.isEmpty()) { log.warn { "尚未配置任何机器人, 请先配置机器人后再启动本程序." } return false + } else if (botConfigs.none { it.enabled }) { + log.warn { "配置文件中没有已启用的机器人, 请至少启用一个机器人." } + return false } for (botConfig in botConfigs) { try {