mirror of
https://github.com/mamoe/mirai.git
synced 2025-04-24 20:43:33 +08:00
Add isOnline
This commit is contained in:
parent
d6d1f2c74d
commit
cc853ce078
mirai-core/src/commonMain/kotlin/net.mamoe.mirai
@ -98,7 +98,11 @@ abstract class BotImpl<N : BotNetworkHandler> constructor(
|
||||
}
|
||||
_network = createNetworkHandler(this.coroutineContext)
|
||||
|
||||
_network.login()
|
||||
while (true){
|
||||
_network.login()
|
||||
delay(3000)
|
||||
logger.warning("Login failed. Retrying in 3s...")
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract fun createNetworkHandler(coroutineContext: CoroutineContext): N
|
||||
|
@ -21,10 +21,15 @@ import net.mamoe.mirai.data.Profile
|
||||
* @author Him188moe
|
||||
*/
|
||||
interface QQ : Contact, CoroutineScope {
|
||||
/**
|
||||
* 是否在线. 这个属性的值将会与服务器同步更新.
|
||||
*/
|
||||
val isOnline: Boolean
|
||||
|
||||
/**
|
||||
* 请求头像下载链接
|
||||
*/
|
||||
// @MiraiExperimentalAPI
|
||||
// @MiraiExperimentalAPI
|
||||
//suspend fun queryAvatar(): AvatarLink
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user