English
简介
Simple Robot
(v4) 是一个基于Kotlin协程
的Kotlin多平台
Bot风格高性能异步事件调度框架(下文简称simbot),
异步高效、Java友好~
simbot提供统一的异步API和易用的风格设计,可以协助你更快速高效的编写Bot风格的事件调度应用。
主要应用于对接各种类型的Bot应用平台/框架,并提供部分组件库实现。
simbot的平台功能由组件驱动,安装不同的组件库来获得不同的功能支持。
举个例子,在simbot中使用KOOK和QQ频道:
suspend fun main() {
launchSimpleApplication { config() }
.joinWith { module() }
}
fun ApplicationFactoryConfigurer<*, *, *>.config() {
useKook()
useQQGuild()
}
suspend fun Application.module() {
registerBots()
registerListeners()
}
suspend fun Application.registerBots() {
kookBots {
register(...) { ... }.start()
}
qqGuildBots {
register(...) { ... }.start()
}
}
fun Application.registerListeners() {
listeners {
listen<ChatChannelMessageEvent> {
println("context: $this")
println("context.event: $event")
EventResult.empty()
}
process<QGAtMessageCreateEvent> {
println("context: $this")
println("context.event: $event")
}
process<KookChannelMessageEvent> {
println("context: $this")
println("context.event: $event")
}
}
}
文档与引导
协助我们
为我们点亮一个 ✨star🌟 便是能够给予我们继续走下去的最大动力与支持!
- 阅读 贡献指南 来了解如何贡献你的力量!
- 你可以通过 讨论区 与其他人或者simbot开发团队相互友好交流。
- 如果你通过此项目创建了一个很酷的开源项目,欢迎通过 ISSUES、讨论区
等方式留下你的开源项目信息,并将你酷酷的项目展示在作品展示区。
联系我们
特别鸣谢
感谢 Jetbrains 为团队提供的免费授权,也希望大家能够支持 Jetbrains 及其产品,支持正版。
星星!

powered by Star History
License
Simple Robot 使用 LGPLv3 协议开源。
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/>.