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

优化内部Bot相关事件的继承关系 #154

Merged
merged 1 commit into from
Jun 17, 2024
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 @@ -701,14 +701,14 @@ public abstract class love/forte/simbot/component/qguild/event/QGBotEvent : love
public abstract fun getBot ()Llove/forte/simbot/component/qguild/bot/QGBot;
}

public abstract class love/forte/simbot/component/qguild/event/QGBotRegisteredEvent : love/forte/simbot/component/qguild/event/QGInternalBotEvent, love/forte/simbot/event/BotEvent {
public abstract class love/forte/simbot/component/qguild/event/QGBotRegisteredEvent : love/forte/simbot/component/qguild/event/QGInternalBotEvent, love/forte/simbot/event/BotRegisteredEvent {
public fun <init> ()V
public abstract fun getBot ()Llove/forte/simbot/component/qguild/bot/QGBot;
public fun getId ()Llove/forte/simbot/common/id/ID;
public fun getTime ()Llove/forte/simbot/common/time/Timestamp;
}

public abstract class love/forte/simbot/component/qguild/event/QGBotStartedEvent : love/forte/simbot/component/qguild/event/QGInternalBotEvent, love/forte/simbot/event/BotEvent {
public abstract class love/forte/simbot/component/qguild/event/QGBotStartedEvent : love/forte/simbot/component/qguild/event/QGInternalBotEvent, love/forte/simbot/event/BotStartedEvent {
public fun <init> ()V
public abstract fun getBot ()Llove/forte/simbot/component/qguild/bot/QGBot;
public fun getId ()Llove/forte/simbot/common/id/ID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import love.forte.simbot.common.id.UUID
import love.forte.simbot.common.time.Timestamp
import love.forte.simbot.component.qguild.bot.QGBot
import love.forte.simbot.component.qguild.bot.QQGuildBotManager
import love.forte.simbot.event.BotEvent
import love.forte.simbot.event.BotRegisteredEvent
import love.forte.simbot.event.BotStartedEvent
import love.forte.simbot.event.Event

/**
Expand All @@ -42,23 +43,22 @@ public sealed interface QGInternalBotEvent : Event
* @see QQGuildBotManager
* @see QQGuildBotManager.register
*/
public abstract class QGBotRegisteredEvent : QGInternalBotEvent, BotEvent {
public abstract class QGBotRegisteredEvent : QGInternalBotEvent, BotRegisteredEvent {
abstract override val bot: QGBot

@OptIn(ExperimentalSimbotAPI::class)
override val time: Timestamp = Timestamp.now()
override val id: ID = UUID.random()
}


/**
* qq频道组件中,每当 [QGBot.start] 被执行的时候会被推送的事件。
* 当事件被推送的时候代表此bot实际上已经完成的 `start` 的逻辑,但是[QGBot.start]会直到事件处理流程完成后才会最终返回。
*
* @see QGBot
* @see QGBot.start
*/
public abstract class QGBotStartedEvent : QGInternalBotEvent, BotEvent {
public abstract class QGBotStartedEvent : QGInternalBotEvent, BotStartedEvent {
abstract override val bot: QGBot

@OptIn(ExperimentalSimbotAPI::class)
Expand Down
Loading