1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-25 04:50:26 +08:00

feat: AutoLoginEvent.toString

This commit is contained in:
cssxsh 2023-07-24 22:49:22 +08:00
parent bd3f50f848
commit 35d22e911f
No known key found for this signature in database
GPG Key ID: 92849F91CA9D8ECE

View File

@ -36,4 +36,11 @@ public sealed class AutoLoginEvent : BotEvent, ConsoleEvent, AbstractEvent() {
override val bot: Bot,
public val cause: Throwable
) : AutoLoginEvent()
override fun toString(): String {
return when (this) {
is Success -> "AutoLoginEvent.Success(bot=${bot.id}, protocol=${bot.configuration.protocol}, heartbeatStrategy=${bot.configuration.heartbeatStrategy})"
is Failure -> "AutoLoginEvent.Failure(bot=${bot.id}, protocol=${bot.configuration.protocol}, message=${cause.message})"
}
}
}