simple-robot / simbot-component-onebot

一个Kotlin多平台的 OneBot SDK 实现,一个异步高效、Java 友好的 Simple Robot 组件库 ~ 🐱🐱🐱
https://simbot.forte.love/component-onebot.html
GNU Lesser General Public License v3.0
10 stars 3 forks source link

try to reconnect when websocket is disconnected #106

Closed kukume closed 1 month ago

kukume commented 1 month ago

try to reconnect when websocket is disconnected

ForteScarlet commented 1 month ago

尝试为 OneBotBotImpl.kt#L429 https://github.com/simple-robot/simbot-component-onebot/blob/1b4cc2a32208cc300e0655aadd6e0395f6d3fa09/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/internal/OneBotBotImpl.kt#L429 捕获 CancellationException 来避免其产生异常而导致 launch 意外终止,然后尝试一下是否可行