Skip to content

Commit 758906d

Browse files
authored
Update WebSocketBotClient.kt
1 parent 764a9f0 commit 758906d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/net/lz1998/mirai/entity/WebSocketBotClient.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class WebsocketBotClient(override var botId: Long, override var password: String
4848
val req = withContext(Dispatchers.IO) { BFrame.parseFrom(bytes.toByteArray()) }
4949
val resp = onRemoteApi(req)
5050
val ok = wsClient?.send(resp.toByteArray().toByteString())
51-
if (!ok!!) {
51+
if (ok==null || !ok) {
5252
wsConnect()
5353
}
5454
}
@@ -161,9 +161,9 @@ class WebsocketBotClient(override var botId: Long, override var password: String
161161
val eventFrame = botEvent.toFrame() ?: return
162162
// TODO 写二进制还是json?配置
163163
val ok = wsClient?.send(eventFrame.toByteArray().toByteString())
164-
if (!ok!!) {
164+
if (ok==null || !ok) {
165165
wsConnect()
166166
}
167167
}
168168

169-
}
169+
}

0 commit comments

Comments
 (0)