Releases: simple-robot/simpler-robot
v3.0.0.preview.10.1
组件更新
修复版本,组件不会在后续跟进更新
仓库参考
- simbot-api: v3.0.0.preview.10.1
- simbot-core: v3.0.0.preview.10.1
- simbot-logger: v3.0.0.preview.10.1
- simboot-api: v3.0.0.preview.10.1
- simboot-core: v3.0.0.preview.10.1
- simboot-core-annotation: v3.0.0.preview.10.1
- simboot-core-spring-boot-starter: v3.0.0.preview.10.1
其他日志
What's Changed
- 调整优化 SimpleListener 的相关函数 by @ForliyScarlet in #290
- 修复@FilterValue使用报错的问题 by @ForliyScarlet in #292
Full Changelog: v3.0.0.preview.10.0...v3.0.0.preview.10.1
v3.0.0.preview.10.0
持续会话
优化、重写持续会话api,并修复曾经在java端使用会报错的问题。
ContinuousSessionContext
现在拥有更全面的文档注释以及api以供使用。
简单示例
suspend fun EventProcessingContext.fooListener(event: BarEvent, session: ContinuousSessionContext) {
val nextTar: TarEvent = session { next(key = TarEvent) }
val name = session.waiting { event, provider ->
// ...
provider.push("Name")
}
val message: MessageContent = session { nextMessage(key = TarMessageEvent) }
// ...
}
依赖规则更新
相关组件在后续的更新中,会调整它们的依赖策略:将不再传递 love.forte.simbot
和 love.forte.simbot.boot
坐标下的依赖。因此不论是否要使用某些组件,都必须自行引入simbot的核心依赖。
组件更新
相关组件会在后续跟进更新
仓库参考
- simbot-api: v3.0.0.preview.10.0
- simbot-core: v3.0.0.preview.10.0
- simbot-logger: v3.0.0.preview.10.0
- simboot-api: v3.0.0.preview.10.0
- simboot-core: v3.0.0.preview.10.0
- simboot-core-annotation: v3.0.0.preview.10.0
- simboot-core-spring-boot-starter: v3.0.0.preview.10.0
其他日志
What's Changed
- 持续会话API重构 by @ForliyScarlet in #279
- bot内容器拆分 by @ForliyScarlet in #280
- 重构监听器、拦截器;增加"监听准备" by @ForliyScarlet in #285
- 持续会话API优化 by @ForliyScarlet in #284
- 优化ParameterBinder.Context部分API by @ForliyScarlet in #286
- preview.10重构 by @ForliyScarlet in #289
Full Changelog: v3.0.0.preview.9.1...v3.0.0.preview.10.0
v3.0.0.preview.9.1
组件更新
修复性版本,组件不跟进更新。
仓库参考
- simbot-api: v3.0.0.preview.9.1
- simbot-core: v3.0.0.preview.9.1
- simbot-logger: v3.0.0.preview.9.1
- simboot-api: v3.0.0.preview.9.1
- simboot-core: v3.0.0.preview.9.1
- simboot-core-annotation: v3.0.0.preview.9.1
- simboot-core-spring-boot-starter: v3.0.0.preview.9.1
其他日志
What's Changed
- 修复SpringBoot下无法扫描动态代理目标类的问题 by @ForliyScarlet in #282
Full Changelog: v3.0.0.preview.9.0...v3.0.0.preview.9.1
v3.0.0.preview.9.0
preview.10重构过渡版本
名称变更
调整部分事件接口名称:
ChatroomMessageEvent
->ChatRoomMessageEvent
日志模块
现在只有 simbot-core
、simboot-core
模块中会携带并传递 simbot-logger
模块,
而 simboot-core-spring-boot-starter
模块将会使用 `` 作为默认日志实现。
但是仍有组件可能会携带 simbot-logger
。这会在未来慢慢优化。如有需要,请考虑排除 love.forte.simbot:simbot-logger
模块
并添加所需要的其他 SLF4J
框架实现。
Application实现
由 api
模块所提供的新概念,且 core
、boot
、spring-boot-starter
模块分别提供其各自的默认实现。
Application
将作为simbot应用程序以一个整体性存在,并提供DSL风格的构建代码。
e.g.
simbotApplication(Foo) {
installAll()
install(/* ... */) { /* ... */ }
useTar { /* ... */ }
useBar { /* ... */ }
eventProcessor { /* ... */ }
listeners { /* ... */ }
bots { /* ... */ }
/* ... */
}
有关 Application
的更多使用代码实例请参考《2022年第19周周报》中的 重构 - 第九预览
部分:https://simbot.forte.love/blog/2022/05/13/weak-19-report
BotVerifyInfo
重构 BotVerifyInfo
实现,现在 BotVerifyInfo
也属于 Resource
的一种类型,
并在构建时即解析出 *.bot
文件中的 component
信息。
BortVerifyInfo
现在应当支持更多格式(json
、yaml
、properties
)。其中,json
格式应为默认支持格式,
而其他格式则需要使用者选择引入所需依赖。
模块重构
伴随着 Application
的产生,core
、boot
、spring-boot-starter
模块中的大部分内部实现会发生大量变更。
不过对于boot
和 spring-boot-starter
模块的使用者来讲,可能不会很容易察觉到。
重构之后,simbot的原生启动方式以及原始的 core
模块将不再是Java友好的。如果是Java使用者可以考虑直接使用
boot
或者 spring-boot-starter
。
后续
preview.10.x
更新完持续会话等剩余重构内容后,会开始收集并修改由此重构而产生的问题。当问题解决后,会开始考虑进入beta
阶段。
组件更新
相关组件会在后续跟进更新
仓库参考
- simbot-api: v3.0.0.preview.9.0
- simbot-core: v3.0.0.preview.9.0
- simbot-logger: v3.0.0.preview.9.0
- simboot-api: v3.0.0.preview.9.0
- simboot-core: v3.0.0.preview.9.0
- simboot-core-annotation: v3.0.0.preview.9.0
- simboot-core-spring-boot-starter: v3.0.0.preview.9.0
其他日志
What's Changed
- Application.Environment中提供序列化模块相关api by @ForliyScarlet in #268
- ApplicationBuilder相关调整 by @ForliyScarlet in #269
- Boot相关模块下为listener提供部分原始属性 by @ForteScarlet in #272
- 大面积重构 by @ForteScarlet in #274
- Application相关内容的异步调整 by @ForliyScarlet in #275
Full Changelog: v3.0.0.preview.8.1...v3.0.0.preview.9.0
v3.0.0.preview.8.1
组件更新
相关组件会在后续跟进更新
仓库参考
- simbot-api: v3.0.0.preview.8.1
- simbot-core: v3.0.0.preview.8.1
- simbot-logger: v3.0.0.preview.8.1
- simboot-api: v3.0.0.preview.8.1
- simboot-core: v3.0.0.preview.8.1
- simboot-core-annotation: v3.0.0.preview.8.1
- simboot-core-spring-boot-starter: v3.0.0.preview.8.1
其他日志
What's Changed
- 更新ktx.coroutines版本到
v1.6.1
by @ForliyScarlet in #265 - 更新kotlin到
v1.6.10
by @ForliyScarlet in #266 - 只在
simbot-core
、simboot-core
中传递使用simbot-logger
作为默认SLF4J日志实现 by @ForliyScarlet in #267
Full Changelog: v3.0.0.preview.8.0...v3.0.0.preview.8.1
v3.0.0.preview.8.0
⚠️ 不兼容更新。
事件相关变更
-
变更部分事件的定义,去除大部分事件API的默认实现、去除部分事件的部分泛型定义。
去除泛型的变更所涉及的事件:
ChangeEvent
、ChangedEvent
、StartPointEvent
、
EndPointEvent
、IncreaseEvent
、DecreaseEvent
、
FriendChangedEvent
、FriendIncreaseEvent
、FriendDecreaseEvent
、
MemberChangedEvent
、MemberIncreaseEvent
、MemberDecreaseEvent
-
新增标准事件类型:
FriendChangedEvent
来作为好友的对应增加/减少事件的父类事件。
调整 OriginBotManager & BotManager
- 调整了
OriginBotManager
中getManagers
的返回值,现在它将直接返回List
类型。 OriginBotManager
的getManagers
取消@JvmSynthetic
注解。OriginBotManager
中增加额外的getBot
重载。OriginBotManager
中增加getAny
。BotManager
的get
方法增加operator
修饰符。
重构 BotVerifyInfo
重构 BotVerifyInfo
, 为其在 preview.10.x
重构时能够支持多格式做准备。
对比
旧
val path = Path("my-bot.bot")
val info = path.asBotVerifyInfo()
// 获取源输入流并操作
val inputStream = info.inputStream()
// do by inputStream...
新
val path = Path("my-bot.bot")
val info = path.toBotVerifyInfo(StandardBotVerifyInfoDecoderFactory.Json)
// 可以直接进行反序列化
val config = info.decode(MyConfig.serializer())
// do...
// 保留获取源输入流的能力
val inputStream = info.inputStream()
说本周更就本周更
组件更新
相关组件会在后续跟进更新
仓库参考
- simbot-api: v3.0.0.preview.8.0
- simbot-core: v3.0.0.preview.8.0
- simbot-logger: v3.0.0.preview.8.0
- simboot-api: v3.0.0.preview.8.0
- simboot-core: v3.0.0.preview.8.0
- simboot-core-annotation: v3.0.0.preview.8.0
- simboot-core-spring-boot-starter: v3.0.0.preview.8.0
变更日志
What's Changed
- 更新版本 v3.0.0.preview.7.0 by @ForteScarlet in #243
- 为 SingleOnlyMessage 提供toString约束 by @ForliyScarlet in #247
- 调整BotManager部分API by @ForteScarlet in #248
- 调整大部分Event类型定义 by @ForliyScarlet in #249
- 为Image提供阻塞的resource获取API by @ForliyScarlet in #252
- Member 实现 SendSupport 接口 by @ForliyScarlet in #254
- Member 实现 SendSupport 接口 by @ForliyScarlet in #253
- 调整
BotManager
和OriginBotManager
相关内容。 by @ForliyScarlet in #255 - 重写 BotVerifyInfo by @ForliyScarlet in #256
- 提供
Resource
的子类型DeserializableResource
by @ForteScarlet in #257
New Contributors
- @ForliyScarlet made their first contribution in #247
Full Changelog: v3.0.0.preview.7.0...v3.0.0.preview.8.0
v3.0.0.preview.7.0
组件更新
此版本理论上兼容旧代码,可直接引入更新,无需更新组件版本。因此各组件不会即时跟进。
但同时,如果使用旧的 v3.0.0-preview.6.0
, 则可能无法正常使用 Spring Boot Starter
模块(普通boot模块正常)。
其他日志
What's Changed
- 优化Messages下相关内容效果 by @ForteScarlet in #240
- boot相关模块提供现自定义组件注册配置类 by @ForteScarlet in #242
Full Changelog: v3.0.0.preview.6.0...v3.0.0.preview.7.0
v3.0.0.preview.6.0
v3.0.0.preview.5.0
组件机制更新
在基础的core模块下,组件将不再是“自动加载”的内容,而是需要你在构建 coreListenerManager
的时候主动加入的。
val manager = coreListenerManager {
install(TestComponent)
// 或者尝试自动加载
installAll() // 实验性的,尝试加载当前环境中的所有(支持被自动加载的)组件
}
// 配置类
final CoreListenerManagerConfiguration configuration = new CoreListenerManagerConfiguration();
// 注册一个组件。大多数情况下,组件的注册器为组件的伴生对象,因此Java中可以使用 `XxxComponent.Registrar`(或者`XxxComponent.Companion`等)
configuration.install(TestComponent.Registrar);
// 或者尝试自动加载
// 这是实验性的。尝试加载当前环境中的所有(支持被自动加载的)组件
configuration.installAll();
CoreListenerManager.newInstance(configuration);
监听函数注册机制更新
现在,在基础的core模块下,更推荐在 coreListenerManager
配置范围内完成对监听函数的全部注册。后期动态注册监听函数的api会暂时保留,但是不保证日后是否会过时并删除。
coreListenerManager {
// 配置监听函数相关内容
listeners {
// 可以直接注册一个 EventListener 实例
listener(coreListener { ... })
// 通过DSL配置一个监听函数
listener(FriendMessageEvent) {
// 可以提供部分过滤器逻辑
filter { true }
filters {
filter { true }
filter { true }
filter { true }
}
// 监听函数的处理逻辑
handle { context, event ->
// do...
null
}
}
}
}
// 构建配置类
final CoreListenerManagerConfiguration configuration = new CoreListenerManagerConfiguration();
// 构建一个监听函数实例。
EventListener listener1 = CoreListenerUtil.newCoreListener(FriendMessageEvent.Key, (context, event) -> {
// do..
return null;
});
// 添加监听函数
// Java中,使用 `addListener` 是相对比较简便的方式。
configuration.addListener(listener1);
// 构建 manager
CoreListenerManager manager = CoreListenerManager.newInstance(configuration);
组件更新
相关组件会在后续跟进更新
其他日志
What's Changed
- 调整coreListenerManager的配置方式与listener的注册时机 by @ForteScarlet in #227
- 为Bot追加
isMe
API以尝试解决BOT的多ID问题 by @ForteScarlet in #228 - 调整/重构组件机制 by @ForteScarlet in #229
- 为
MuteSupport.mute
的参数提供默认值 by @ForteScarlet in #234
Full Changelog: v3.0.0.preview.4.1...v3.0.0.preview.5.0