Skip to content

Commit e5fe74a

Browse files
committed
fix minecraftServerStats detection when bot is offline
1 parent 3b4eb29 commit e5fe74a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/com/xiaoyv404/mirai/app/minecraftServer/MinecraftServerStats.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class MinecraftServerStats : NfApp(), IFshApp {
132132
suspend fun check(info: MinecraftServer) {
133133
val information = getServerInfo(info.host, info.port)
134134
val groups = mutableListOf<Contact>()
135-
val bot = Bot.instances.firstOrNull() ?: return
135+
val bot = Bot.instances.firstOrNull()
136136

137137
val statusD = information.status
138138
val players = information.serverInformationFormat?.players
@@ -168,7 +168,7 @@ class MinecraftServerStats : NfApp(), IFshApp {
168168
log.info("服务器 ${info.name} 离线")
169169

170170
// 如果在隐藏状态就不发送消息
171-
if (info.mock)
171+
if (info.mock || bot == null)
172172
return
173173

174174
MinecraftServerMap { serverID = info.id }.findByServerId().forEach {

0 commit comments

Comments
 (0)