Skip to content

Commit

Permalink
feat: AutoLoginEvent.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Jul 24, 2023
1 parent bd3f50f commit 35d22e9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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})"
}
}
}

0 comments on commit 35d22e9

Please sign in to comment.