-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加BotStageEvent事件定义,以及其两个子类型BotRegisteredEvent、BotStartedEvent的定义
- Loading branch information
1 parent
d6b777c
commit b72179c
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
simbot-api/src/commonMain/kotlin/love/forte/simbot/event/BotStageEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2024. ForteScarlet. | ||
* | ||
* Project https://github.com/simple-robot/simpler-robot | ||
* Email [email protected] | ||
* | ||
* 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 <https://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
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 |