Skip to content

Commit

Permalink
Merge pull request #827 from simple-robot/registered-and-started-event
Browse files Browse the repository at this point in the history
增加BotStageEvent事件定义,以及其两个子类型BotRegisteredEvent、BotStartedEvent的定义
  • Loading branch information
ForteScarlet committed Apr 27, 2024
2 parents d6b777c + c5264d2 commit 6116fa8
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
build:
maxIssues: 2147483647 # 先不限制最大问题
maxIssues: 0
excludeCorrectable: false
# weights:
# formatting: 0
weights:
formatting: 1
# comments: 0
# complexity: 0
# LongParameterList: 0
Expand Down
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 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 <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

0 comments on commit 6116fa8

Please sign in to comment.