BotOfflineEvent

sealed class BotOfflineEvent : AbstractEvent, BotEvent

Bot 离线时广播的事件. Bot 离线不会 关闭 Bot, 只会关闭 Bot 的网络层.

Types

Active
Link copied to clipboard
data class Active(bot: Bot, cause: Throwable?) : BotOfflineEvent, BotActiveEvent, BotOfflineEvent.CauseAware

主动离线.

CauseAware
Link copied to clipboard
interface CauseAware
Dropped
Link copied to clipboard
data class Dropped @MiraiInternalApi constructor(bot: Bot, cause: Throwable?) : BotOfflineEvent, Packet, BotPassiveEvent, BotOfflineEvent.CauseAware

因网络问题而掉线

Force
Link copied to clipboard
data class Force @MiraiInternalApi constructor(bot: Bot, title: String, message: String) : BotOfflineEvent, Packet, BotPassiveEvent

被挤下线. 默认不会自动重连. 可将 reconnect 改为 true 以重连.

MsfOffline
Link copied to clipboard
@MiraiInternalApi(message = "This is very experimental and might be changed")
data class MsfOffline @MiraiInternalApi constructor(bot: Bot, cause: Throwable?) : BotOfflineEvent, Packet, BotPassiveEvent, BotOfflineEvent.CauseAware

被服务器断开

RequireReconnect
Link copied to clipboard

服务器主动要求更换另一个服务器

Functions

cancel
Link copied to clipboard
fun cancel()
intercept
Link copied to clipboard
abstract fun intercept()

拦截这个事件

Properties

bot
Link copied to clipboard
abstract val bot: Bot
isCancelled
Link copied to clipboard
val isCancelled: Boolean
isIntercepted
Link copied to clipboard
abstract val isIntercepted: Boolean

事件是否已被拦截.

reconnect
Link copied to clipboard
open val reconnect: Boolean

true 时会尝试重连. 仅 BotOfflineEvent.Force 默认为 false, 其他默认为 true.

Inheritors

Active
Link copied to clipboard
Force
Link copied to clipboard
MsfOffline
Link copied to clipboard
Dropped
Link copied to clipboard
RequireReconnect
Link copied to clipboard