Commit cc853ce0 authored by Him188's avatar Him188

Add isOnline

parent d6d1f2c7
...@@ -98,7 +98,11 @@ abstract class BotImpl<N : BotNetworkHandler> constructor( ...@@ -98,7 +98,11 @@ abstract class BotImpl<N : BotNetworkHandler> constructor(
} }
_network = createNetworkHandler(this.coroutineContext) _network = createNetworkHandler(this.coroutineContext)
while (true){
_network.login() _network.login()
delay(3000)
logger.warning("Login failed. Retrying in 3s...")
}
} }
protected abstract fun createNetworkHandler(coroutineContext: CoroutineContext): N protected abstract fun createNetworkHandler(coroutineContext: CoroutineContext): N
......
...@@ -21,6 +21,11 @@ import net.mamoe.mirai.data.Profile ...@@ -21,6 +21,11 @@ import net.mamoe.mirai.data.Profile
* @author Him188moe * @author Him188moe
*/ */
interface QQ : Contact, CoroutineScope { interface QQ : Contact, CoroutineScope {
/**
* 是否在线. 这个属性的值将会与服务器同步更新.
*/
val isOnline: Boolean
/** /**
* 请求头像下载链接 * 请求头像下载链接
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment