From b72179cbc9be9c5e0d524befe91404e3d8de3756 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Sat, 27 Apr 2024 14:32:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0BotStageEvent=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=AE=9A=E4=B9=89=EF=BC=8C=E4=BB=A5=E5=8F=8A=E5=85=B6?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=AD=90=E7=B1=BB=E5=9E=8BBotRegisteredEvent?= =?UTF-8?q?=E3=80=81BotStartedEvent=E7=9A=84=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../love/forte/simbot/event/BotStageEvent.kt | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 simbot-api/src/commonMain/kotlin/love/forte/simbot/event/BotStageEvent.kt diff --git a/simbot-api/src/commonMain/kotlin/love/forte/simbot/event/BotStageEvent.kt b/simbot-api/src/commonMain/kotlin/love/forte/simbot/event/BotStageEvent.kt new file mode 100644 index 000000000..52637e111 --- /dev/null +++ b/simbot-api/src/commonMain/kotlin/love/forte/simbot/event/BotStageEvent.kt @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * Project https://github.com/simple-robot/simpler-robot + * Email ForteScarlet@163.com + * + * This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Lesser GNU General Public License for more details. + * + * You should have received a copy of the Lesser GNU General Public License + * along with this program. If not, see . + * + */ + +package love.forte.simbot.event + +import love.forte.simbot.bot.Bot +import love.forte.simbot.bot.BotManager + + +/** + * 与 Bot 相关的阶段性事件。 + * 例如bot被注册了、bot被启动了。 + * + * @author ForteScarlet + */ +public interface BotStageEvent : BotEvent { + /** + * 相关的 bot. + */ + override val bot: Bot +} + +/** + * 当一个 Bot 已经在某个 [BotManager] 中被注册后的事件。 + * + * @author ForteScarlet + */ +public interface BotRegisteredEvent : BotStageEvent + +/** + * 当一个 Bot **首次** 启动成功后的事件。 + * + * @author ForteScarlet + */ +public interface BotStartedEvent : BotStageEvent