https://github.com/simple-robot/simpler-robot
Simple Robot,一个bot风格的Kotlin多平台事件调度框架,异步高效、Java友好!/ A Bot-style Kotlin Multiplatform event scheduling framework, asynchronous and high-performance, java-friendly! 🐱😼😻😸
https://github.com/simple-robot/simpler-robot
bot bot-framework java kook-bot kotlin kotlin-coroutines kotlin-multiplatform qq-bot qq-guild-bot qqbot simbot simple-robot telegram-bot
Last synced: 17 days ago
JSON representation
Simple Robot,一个bot风格的Kotlin多平台事件调度框架,异步高效、Java友好!/ A Bot-style Kotlin Multiplatform event scheduling framework, asynchronous and high-performance, java-friendly! 🐱😼😻😸
- Host: GitHub
- URL: https://github.com/simple-robot/simpler-robot
- Owner: simple-robot
- License: lgpl-3.0
- Created: 2020-07-11T17:38:54.000Z (almost 5 years ago)
- Default Branch: v4-main
- Last Pushed: 2025-04-01T19:48:47.000Z (30 days ago)
- Last Synced: 2025-04-07T02:11:10.112Z (24 days ago)
- Topics: bot, bot-framework, java, kook-bot, kotlin, kotlin-coroutines, kotlin-multiplatform, qq-bot, qq-guild-bot, qqbot, simbot, simple-robot, telegram-bot
- Language: Kotlin
- Homepage: https://simbot.forte.love
- Size: 100 MB
- Stars: 537
- Watchers: 5
- Forks: 44
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: docs/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: COPYING
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
- Simple Robot -
~ simbot v4 ~
GitHub
|
Gitee
> 感谢 CatCode 开发团队成员制作的simbot logo <
> 走过路过,不要忘记点亮一颗⭐喔~ <
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
[English](README_en.md)
## 简介
**`Simple Robot`** (v4) 是一个基于[Kotlin协程](https://github.com/Kotlin/kotlinx.coroutines)
的[Kotlin多平台](https://kotlinlang.org/docs/multiplatform.html)
**Bot风格**高性能异步事件调度框架(下文简称simbot),
异步高效、Java友好~simbot提供统一的异步API和易用的风格设计,可以协助你更快速高效的编写**Bot风格**的事件调度应用。
主要应用于对接各种类型的Bot应用平台/框架,并提供部分组件库实现。simbot的**平台功能**由组件驱动,安装不同的组件库来获得不同的功能支持。
举个例子,在simbot中使用KOOK和QQ频道:
```Kotlin
suspend fun main() {
launchSimpleApplication { config() }
.joinWith { module() }
}fun ApplicationFactoryConfigurer<*, *, *>.config() {
// 安装KOOK和QQ频道组件库
useKook()
useQQGuild()
}/**
* 对已经构建完成的 `Application` 进行配置于应用
*/
suspend fun Application.module() {
registerBots()
registerListeners()
}/**
* 注册所需的bot
*/
suspend fun Application.registerBots() {
// ... 注册kook bot,并在此之后可处理到kook的相关事件
kookBots {
register(...) { ... }.start()
}// ... 注册QQ频道bot,并在此之后可处理到QQ频道的相关事件
qqGuildBots {
register(...) { ... }.start()
}
}fun Application.registerListeners() {
listeners {
// 注册一个事件处理器
// ChatChannelMessageEvent 是由simbot API定义的泛用类型,代表所有子频道消息事件
// 其中就包括QQ频道的公域消息事件, 或者KOOK的频道消息事件
listen {
println("context: $this")
println("context.event: $event")// 返回事件处理结果
EventResult.empty()
}// 再注册一个事件处理器
// 明确监听QQ频道的公域消息事件
// 使用 process 不需要返回值
process {
println("context: $this")
println("context.event: $event")
}// 再注册一个事件处理器
// 明确监听KOOK的频道消息事件
// 使用 process 不需要返回值
process {
println("context: $this")
println("context.event: $event")
}
}
}
```## 文档与引导
- [组织首页](https://github.com/simple-robot/) 了解更多有关组件、文档、以及社群等相关信息!
- [社群](https://simbot.forte.love/communities.html) 文档中也有提供社群信息喔
- [应用手册][doc-homepage]
- [文档引导站&API文档](https://docs.simbot.forte.love)## 协助我们
为我们点亮一个 **✨star🌟** 便是能够给予我们继续走下去的最大动力与支持!- 阅读 [**贡献指南**](docs/CONTRIBUTING_CN.md) 来了解如何贡献你的力量!
- 你可以通过 [**讨论区**][discussions] 与其他人或者simbot开发团队相互友好交流。
- 如果你通过此项目创建了一个很酷的开源项目,欢迎通过 [ISSUES][issues]、[讨论区][discussions]
等方式留下你的开源项目信息,并将你酷酷的项目展示在作品展示区。## 联系我们
- 如果想要反馈问题、提出建议建议或提出问题,请通过 [**ISSUES**][issues]。
- 如果想要与开发团队交流、与其他开发者交流,请前往 [**讨论区**][discussions]。
- 可以前往 [GitHub 组织首页](https://github.com/simple-robot/) 查看更多**社群信息**。[pr]: https://github.com/simple-robot/simpler-robot/pulls
[issues]: https://github.com/simple-robot/simpler-robot/issues
[discussions]: https://github.com/orgs/simple-robot/discussions## 特别鸣谢
感谢 [Jetbrains][jetbrains] 为团队提供的免费授权,也希望大家能够支持 [Jetbrains][jetbrains] 及其产品,支持正版。
[jetbrains]: https://www.jetbrains.com/?from=simpler-robot
## 星星!
[](https://star-history.com/#simple-robot/simpler-robot&Date)
> powered by [Star History](https://star-history.com)
## License
Simple Robot 使用 [LGPLv3](https://www.gnu.org/licenses/#LGPL) 协议开源。
```
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 .
```[doc-homepage]: https://simbot.forte.love/