Skip to content

Commit

Permalink
release: v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Jun 7, 2024
1 parent e5d8038 commit 5a86b54
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .changelog/v0.0.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
> 对应核心版本: [**v4.0.0-RC2**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-RC2)

我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-onebot/issues)[协助](https://github.com/simple-robot/simbot-component-onebot/pulls)
感谢您的贡献与支持!

也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可!
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,25 @@ public class MyApp {

目前可监听到的**组件事件**

- `OneBotMessageEvent`
- `OneBotGroupMessageEvent`
- `OneBotNormalGroupMessageEvent`
- `OneBotAnonymousGroupMessageEvent`
- `OneBotNoticeGroupMessageEvent`
- `OneBotPrivateMessageEvent`
- `OneBotFriendMessageEvent`
- `OneBotGroupPrivateMessageEvent`
- `OneBotUnknownEvent`
- `OneBotUnsupportedEvent`
- `OneBotMessageEvent` 消息事件
- `OneBotGroupMessageEvent` 群消息事件
- `OneBotNormalGroupMessageEvent` 普通群消息事件
- `OneBotAnonymousGroupMessageEvent` 匿名群消息事件
- `OneBotNoticeGroupMessageEvent` 群系统通知消息事件
- `OneBotPrivateMessageEvent` 私聊消息事件
- `OneBotFriendMessageEvent` 好友私聊消息事件
- `OneBotGroupPrivateMessageEvent` 群成员临时会话私聊事件
- `OneBotMetaEvent` 元事件
- `OneBotLifecycleEvent` 生命周期事件
- `OneBotHeartbeatEvent` 心跳事件
- `OneBotRequestEvent` 请求事件
- `OneBotFriendRequestEvent` 好友添加请求事件
- `OneBotGroupRequestEvent` 群添加请求事件
- `OneBotUnknownEvent` 未知事件
- `OneBotUnsupportedEvent` 未支持事件
- `OneBotBotStageEvent` 组件内Bot阶段事件
- `OneBotBotRegisteredEvent` Bot被注册了事件
- `OneBotBotStartedEvent` Bot被(首次)启动了事件

其中,可以通过 `OneBotUnsupportedEvent``OneBotUnknownEvent`
来间接地监听那些尚未提供组件事件类型的原始事件。
Expand Down
34 changes: 34 additions & 0 deletions Writerside/topics/Event.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,43 @@
</def>
</deflist>

</def>
<def id="OneBotMetaEvent" title="OneBotMetaEvent">
元数据相关的事件
<deflist>
<def id="OneBotLifecycleEvent" title="OneBotLifecycleEvent">
生命周期事件
</def>
<def id="OneBotHeartbeatEvent" title="OneBotHeartbeatEvent">
心跳事件
</def>
</deflist>
</def>
<def id="OneBotRequestEvent" title="OneBotRequestEvent">
请求相关的事件
<deflist>
<def id="OneBotFriendRequestEvent" title="OneBotFriendRequestEvent">
好友添加申请
</def>
<def id="OneBotGroupRequestEvent" title="OneBotGroupRequestEvent">
群添加申请
</def>
</deflist>
</def>


<def id="OneBotBotStageEvent" title="OneBotBotStageEvent">
与OneBot协议本身无关的Bot的阶段事件。
<deflist>
<def id="OneBotBotRegisteredEvent" title="OneBotBotRegisteredEvent">
一个 `OneBotBot` 被注册了的事件
</def>
<def id="OneBotBotStartedEvent" title="OneBotBotStartedEvent">
一个 `OneBotBot` 被(首次)启动了的事件
</def>
</deflist>
</def>
</deflist>


### 未知事件
Expand Down
2 changes: 1 addition & 1 deletion Writerside/v.list
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<var name="api-doc" value="https://docs.simbot.forte.love"/>
<var name="jb" value="阻塞"/>
<var name="ja" value="异步"/>
<var name="version" value="0.0.2"/>
<var name="version" value="0.0.3"/>
<var name="minimum-core-version" value="4.0.0-RC2"/>
</vars>
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,14 @@ internal class OneBotBotImpl(
launch { s.launch() }
}

isStarted = true
launch {
eventProcessor
.push(OneBotBotStartedEventImpl(this@OneBotBotImpl))
.onEachErrorLog(logger)
.collect()
if (!isStarted) {
isStarted = true
launch {
eventProcessor
.push(OneBotBotStartedEventImpl(this@OneBotBotImpl))
.onEachErrorLog(logger)
.collect()
}
}
}

Expand Down

0 comments on commit 5a86b54

Please sign in to comment.