Skip to content

Commit 6116fa8

Browse files
authored
Merge pull request #827 from simple-robot/registered-and-started-event
增加BotStageEvent事件定义,以及其两个子类型BotRegisteredEvent、BotStartedEvent的定义
2 parents d6b777c + c5264d2 commit 6116fa8

File tree

2 files changed

+58
-3
lines changed

2 files changed

+58
-3
lines changed

config/detekt/detekt.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
build:
2-
maxIssues: 2147483647 # 先不限制最大问题
2+
maxIssues: 0
33
excludeCorrectable: false
4-
# weights:
5-
# formatting: 0
4+
weights:
5+
formatting: 1
66
# comments: 0
77
# complexity: 0
88
# LongParameterList: 0
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright (c) 2024. ForteScarlet.
3+
*
4+
* Project https://github.com/simple-robot/simpler-robot
5+
6+
*
7+
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Lesser General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* Lesser GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the Lesser GNU General Public License
20+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
package love.forte.simbot.event
25+
26+
import love.forte.simbot.bot.Bot
27+
import love.forte.simbot.bot.BotManager
28+
29+
30+
/**
31+
* 与 Bot 相关的阶段性事件。
32+
* 例如bot被注册了、bot被启动了。
33+
*
34+
* @author ForteScarlet
35+
*/
36+
public interface BotStageEvent : BotEvent {
37+
/**
38+
* 相关的 bot.
39+
*/
40+
override val bot: Bot
41+
}
42+
43+
/**
44+
* 当一个 Bot 已经在某个 [BotManager] 中被注册后的事件。
45+
*
46+
* @author ForteScarlet
47+
*/
48+
public interface BotRegisteredEvent : BotStageEvent
49+
50+
/**
51+
* 当一个 Bot **首次** 启动成功后的事件。
52+
*
53+
* @author ForteScarlet
54+
*/
55+
public interface BotStartedEvent : BotStageEvent

0 commit comments

Comments
 (0)