2020-12-19 11:15:57 +08:00
|
|
|
|
# Mirai
|
|
|
|
|
|
|
|
|
|
欢迎来到 mirai 文档。
|
|
|
|
|
|
|
|
|
|
## 生态
|
|
|
|
|
|
2020-12-28 17:40:17 +08:00
|
|
|
|
**[Mirai 生态概览](mirai-ecology.md)**
|
2020-12-19 11:15:57 +08:00
|
|
|
|
|
2021-01-24 15:59:54 +08:00
|
|
|
|
## 社区 SDK
|
2020-12-19 11:41:48 +08:00
|
|
|
|
|
2021-01-11 21:24:32 +08:00
|
|
|
|
**mirai 官方提供 Kotlin/Java 等 JVM 平台语言开发支持。如果不熟悉这些语言,请使用以下社区 SDK:**
|
2020-12-19 11:41:48 +08:00
|
|
|
|
|
|
|
|
|
[`mirai-console`]: https://github.com/mamoe/mirai-console
|
|
|
|
|
|
2021-01-11 21:11:33 +08:00
|
|
|
|
这些 SDK 基于 [`mirai-console`]。[`mirai-console`] 是 mirai 官方维护的一个*应用程序*。可以在 [这里](https://github.com/mamoe/mirai-console/blob/master/docs/Run.md) 了解如何启动 [`mirai-console`](也可以稍后在各 SDK 的说明中了解)。
|
2020-12-19 11:41:48 +08:00
|
|
|
|
|
|
|
|
|
[mamoe/mirai-api-http]: https://github.com/mamoe/mirai-api-http
|
|
|
|
|
[iTXTech/mirai-native]: https://github.com/iTXTech/mirai-native
|
|
|
|
|
[iTXTech/mirai-js]: https://github.com/iTXTech/mirai-js
|
2021-01-24 15:59:54 +08:00
|
|
|
|
[iTXTech/mirai-kts]: https://github.com/iTXTech/mirai-kts
|
2020-12-19 11:41:48 +08:00
|
|
|
|
[GraiaProject/Application]: https://github.com/GraiaProject/Application
|
2021-02-03 10:25:24 +08:00
|
|
|
|
[NoneBot]: https://github.com/nonebot/nonebot2
|
2020-12-19 11:41:48 +08:00
|
|
|
|
[RedBeanN/node-mirai]: https://github.com/RedBeanN/node-mirai
|
|
|
|
|
[Logiase/gomirai]: https://github.com/Logiase/gomirai
|
|
|
|
|
[StageGuard/mirai-rhinojs-sdk]: https://github.com/StageGuard/mirai-rhinojs-sdk
|
|
|
|
|
[cyanray/mirai-cpp]: https://github.com/cyanray/mirai-cpp
|
|
|
|
|
[Chlorie/miraipp]: https://github.com/Chlorie/miraipp-template
|
|
|
|
|
[Executor-Cheng/mirai-CSharp]: https://github.com/Executor-Cheng/mirai-CSharp
|
|
|
|
|
[HoshinoTented/mirai-rs]: https://github.com/HoshinoTented/mirai-rs
|
|
|
|
|
[YunYouJun/mirai-ts]: https://github.com/YunYouJun/mirai-ts
|
|
|
|
|
[only52607/e-mirai]: https://github.com/only52607/e-mirai
|
|
|
|
|
[theGravityLab/ProjHyperai]: https://github.com/theGravityLab/ProjHyperai
|
2021-01-24 15:33:19 +08:00
|
|
|
|
[yyuueexxiinngg/onebot-kotlin]: https://github.com/yyuueexxiinngg/onebot-kotlin
|
|
|
|
|
[Nambers/MiraiCP]:https://github.com/Nambers/MiraiCP
|
|
|
|
|
|
|
|
|
|
[Rhino]: https://github.com/mozilla/rhino
|
|
|
|
|
[OneBot]: https://github.com/howmanybots/onebot
|
|
|
|
|
|
2021-02-03 10:42:13 +08:00
|
|
|
|
| 技术 | 实现 | 维护者及项目地址 |
|
|
|
|
|
|:-------------------|:-----------------------------|:--------------------------------------------|
|
|
|
|
|
| ***Mirai Http*** | Mirai 标准 | [mamoe/mirai-api-http] |
|
|
|
|
|
| *OneBot Http* | [OneBot] 标准 | [yyuueexxiinngg/onebot-kotlin] |
|
|
|
|
|
| `Kotlin Scripting` | JVM | [iTXTech/mirai-kts] |
|
|
|
|
|
| `Python` | *Mirai Http* | [Graia Framework][GraiaProject/Application] |
|
|
|
|
|
| `Python` | *Mirai Http* / *OneBot Http* | [NoneBot] |
|
|
|
|
|
| `C++` | *Mirai Http* | [cyanray/mirai-cpp] |
|
|
|
|
|
| `C++` | *Mirai Http* | [Chlorie/miraipp] |
|
|
|
|
|
| `C#` | *Mirai Http* | [Executor-Cheng/mirai-CSharp] |
|
|
|
|
|
| `Rust` | *Mirai Http* | [HoshinoTented/mirai-rs] |
|
|
|
|
|
| `JavaScript` | [Rhino] / JVM | [iTXTech/mirai-js] |
|
|
|
|
|
| `JavaScript` | Node.js / *Mirai Http* | [RedBeanN/node-mirai] |
|
|
|
|
|
| `JavaScript` | TypeScript / *Mirai Http* | [YunYouJun/mirai-ts] |
|
|
|
|
|
| `.Net/C#` | *Mirai Http* | [Hyperai][theGravityLab/ProjHyperai] |
|
|
|
|
|
| `Go` | *Mirai Http* | [Logiase/gomirai] |
|
|
|
|
|
| `易语言` | *Mirai Http* | [only52607/e-mirai] |
|
|
|
|
|
| *酷 Q DLL 插件* | JNI | [iTXTech/mirai-native] |
|
2020-12-19 11:41:48 +08:00
|
|
|
|
|
2021-01-11 21:24:32 +08:00
|
|
|
|
> *想在这里添加你的项目?欢迎[提交 PR](https://github.com/mamoe/mirai/edit/dev/docs/README.md)。*
|
2020-12-31 18:51:36 +08:00
|
|
|
|
|
2021-01-11 21:24:32 +08:00
|
|
|
|
特别地,有一些 SDK 直接基于 mirai-core 开发,不需要 [`mirai-console`]:
|
2020-12-19 11:43:30 +08:00
|
|
|
|
|
2021-01-11 21:24:32 +08:00
|
|
|
|
- `Lua`: [lua-mirai](https://github.com/only52607/lua-mirai)
|
2020-12-19 11:43:30 +08:00
|
|
|
|
|
2021-01-11 21:11:33 +08:00
|
|
|
|
## JVM 平台 Mirai 开发
|
|
|
|
|
|
2021-01-24 15:59:54 +08:00
|
|
|
|
**为了避免遇到各种问题,请仔细阅读。**
|
2021-01-11 21:11:33 +08:00
|
|
|
|
|
2021-01-11 21:24:32 +08:00
|
|
|
|
1. [JVM 环境和开发准备工作(2 分钟)](Preparations.md#mirai---preparations)
|
2021-02-01 00:36:45 +08:00
|
|
|
|
2. **配置项目依赖** (二选一)
|
2021-01-11 21:11:33 +08:00
|
|
|
|
- 要把 mirai-core 嵌入一个应用使用,请阅读 [配置项目依赖](ConfiguringProjects.md)。
|
|
|
|
|
- 要为 [`mirai-console`] 框架开发插件,请阅读 [mirai-console 的配置插件项目](https://github.com/mamoe/mirai-console/blob/master/docs/ConfiguringProjects.md)。
|
2021-01-11 21:24:32 +08:00
|
|
|
|
3. 阅读 API 文档(见下文)
|
2020-12-19 11:15:57 +08:00
|
|
|
|
|
2021-01-24 15:59:54 +08:00
|
|
|
|
> 如果你不知道 `mirai-core` 或 [`mirai-console`] 是什么,请阅读 [Mirai 生态概览](mirai-ecology.md)。
|
2021-01-11 21:11:33 +08:00
|
|
|
|
>
|
|
|
|
|
> 如果你希望先确认 mirai 能够正常运行才能安心阅读文档,可克隆 [mirai-hello-world](https://github.com/project-mirai/mirai-hello-world) 并运行其中 Kotlin 或 Java 入口点 `main`。
|
2020-12-19 11:15:57 +08:00
|
|
|
|
|
|
|
|
|
|
2021-01-11 21:11:33 +08:00
|
|
|
|
### mirai-core API 文档
|
2020-12-19 11:15:57 +08:00
|
|
|
|
|
2021-01-13 16:07:02 +08:00
|
|
|
|
> *适用于 2.x 版本*
|
|
|
|
|
|
2020-12-19 16:01:58 +08:00
|
|
|
|
- [Bots](Bots.md)
|
2020-12-19 11:41:48 +08:00
|
|
|
|
- [Contacts](Contacts.md)
|
2020-12-19 16:01:58 +08:00
|
|
|
|
- [Events](Events.md)
|
2020-12-31 18:51:36 +08:00
|
|
|
|
- [Messages](Messages.md)
|
2021-01-13 16:07:02 +08:00
|
|
|
|
|
2021-01-21 15:51:28 +08:00
|
|
|
|
> 希望改进文档? 请在 [#848](https://github.com/mamoe/mirai/discussions/848) 提出建议
|