Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: AutoLoginEvent.toString #2750

Merged
merged 4 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1293,10 +1293,12 @@ public abstract class net/mamoe/mirai/console/events/AutoLoginEvent : net/mamoe/
public final class net/mamoe/mirai/console/events/AutoLoginEvent$Failure : net/mamoe/mirai/console/events/AutoLoginEvent {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public final fun getCause ()Ljava/lang/Throwable;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/console/events/AutoLoginEvent$Success : net/mamoe/mirai/console/events/AutoLoginEvent {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public fun toString ()Ljava/lang/String;
}

public abstract interface class net/mamoe/mirai/console/events/ConsoleEvent : net/mamoe/mirai/event/Event {
Expand Down
12 changes: 10 additions & 2 deletions mirai-console/backend/mirai-console/src/events/AutoLoginEvent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,21 @@ public sealed class AutoLoginEvent : BotEvent, ConsoleEvent, AbstractEvent() {
*/
public class Success @MiraiInternalApi constructor(
override val bot: Bot
) : AutoLoginEvent()
) : AutoLoginEvent() {
override fun toString(): String {
return "AutoLoginEvent.Success(bot=${bot.id}, protocol=${bot.configuration.protocol}, heartbeatStrategy=${bot.configuration.heartbeatStrategy})"
}
}

/**
* 登录失败
*/
public class Failure @MiraiInternalApi constructor(
override val bot: Bot,
public val cause: Throwable
) : AutoLoginEvent()
) : AutoLoginEvent() {
override fun toString(): String {
return "AutoLoginEvent.Failure(bot=${bot.id}, protocol=${bot.configuration.protocol}, cause=${cause})"
}
}
}
Loading