-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ee3673
commit 426f837
Showing
11 changed files
with
602 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE terms SYSTEM "https://resources.jetbrains.com/writerside/1.0/glossary.dtd"> | ||
<terms> | ||
<term name="simbot4">Simple Robot v4 的简称,通常用于统称"simbot4标准API"和"simbot4核心库"</term> | ||
<term name="组件">组件:针对一组一个或多个「组件标识」和「插件」的统称。</term> | ||
</terms> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE instance-profile | ||
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd"> | ||
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd"> | ||
|
||
<instance-profile id="ob" | ||
name="Simple Robot | OneBot" | ||
start-page="Home.md"> | ||
<toc-element topic="Home.md"/> | ||
<toc-element topic="quick-start.md"> | ||
<toc-element topic="use-onebot11.md"/> | ||
</toc-element> | ||
<toc-element toc-title="基础内容"> | ||
<toc-element topic="Event.md"> | ||
<toc-element topic="modules.md"/> | ||
<toc-element toc-title="OneBot11"> | ||
<toc-element topic="onebot11-bot-config.md"/> | ||
<toc-element topic="onebot11-event.md"> | ||
</toc-element> | ||
<toc-element topic="onebot11-message.md"/> | ||
</toc-element> | ||
<toc-element topic="Message.md"/> | ||
</toc-element> | ||
</instance-profile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# 模块概述 | ||
|
||
## 公共模块 | ||
|
||
OneBot组件为所有协议实现的模块提供了一些共享内容的模块, | ||
命名为 `simbot-component-onebot-common`。 | ||
|
||
此模块中会定义一些通用的类型或注解等。 | ||
对于普通开发者来讲可以不用过多关注,此模块由其他组件模块引用并使用。 | ||
|
||
## OneBot11 | ||
|
||
在OneBot组件中,我们提供了针对 [OneBot11](https://github.com/botuniverse/onebot-11) | ||
协议的组件实现模块,它们的坐标以 `simbot-component-onebot-v11` 作为开头: | ||
|
||
<list> | ||
<li><control>simbot-component-onebot-v11-common</control> | ||
|
||
在OneBot11协议的实现模块中进行共享的模块。 | ||
对于普通开发者来讲可以不用过多关注,此模块由其他组件模块引用并使用。 | ||
</li> | ||
<li><control>simbot-component-onebot-v11-core</control> | ||
|
||
OneBot11协议作为一个simbot组件的实现模块。通常会是你**真正使用**的模块。 | ||
</li> | ||
<li><control>simbot-component-onebot-v11-event</control> | ||
|
||
对OneBot11协议中的[原始事件](https://github.com/botuniverse/onebot-11/tree/master/event) | ||
类型提供定义的模块, | ||
被 `simbot-component-onebot-v11-core` 引用并依赖。 | ||
|
||
<tip> | ||
|
||
需要注意的是这里的事件并不是simbot中的**事件**,而仅仅是一种数据类实现, | ||
是对原始事件的JSON结构的基本映射。 | ||
</tip> | ||
</li> | ||
<li><control>simbot-component-onebot-v11-message</control> | ||
|
||
对OneBot11协议中的[原始消息段](https://github.com/botuniverse/onebot-11/blob/master/message/segment.md) | ||
类型提供定义的模块。 | ||
|
||
这里定义的大部分类型都是针对消息段的数据类实现, | ||
是对它们的JSON结构的基本映射, | ||
被 `simbot-component-onebot-v11-core` 引用并依赖。 | ||
|
||
</li> | ||
</list> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Bot配置文件 | ||
|
||
<warning>TODO</warning> | ||
|
||
Bot配置文件通常情况下是配合Spring Boot starter的时候用的。 | ||
|
||
当使用Spring Boot starter时, | ||
配置文件放在资源目录 <path>resources</path> 中的 <path>/simbot-bots/</path> 目录下, | ||
以 `.bot.json` 格式结尾,例如 `myBot.bot.json`。 | ||
|
||
<warning title="记得清理注释"> | ||
|
||
实际上JSON配置文件是**不允许**使用注释的,这里只是方便展示。 | ||
|
||
</warning> | ||
|
||
<tabs> | ||
<tab title="较完整示例"> | ||
|
||
```json | ||
{ | ||
// 固定值 | ||
"component": "simbot.onebot11", | ||
"authorization": { | ||
// 唯一ID,作为组件内 Bot 的 id,用于组件内去重。可以随便编,但建议是bot的qq号 | ||
"botUniqueId": "123456", | ||
// api地址,是个http/https服务器的路径,默认localhost:3000 | ||
"apiServerHost": "http://localhost:3000", | ||
// 订阅事件的服务器地址,是个ws/wss路径,默认localhost:3001 | ||
"eventServerHost":"ws://localhost:3001", | ||
// 配置的 token,可以是null | ||
"accessToken": null | ||
}, | ||
// 额外的可选配置 | ||
// config本身以及其内的各项属性绝大多数都可省略或null | ||
"config": { | ||
// API请求中的超时请求配置。整数数字,单位毫秒,默认为 `null`。 | ||
"apiHttpRequestTimeoutMillis": null, | ||
// API请求中的超时请求配置。整数数字,单位毫秒,默认为 `null`。 | ||
"apiHttpConnectTimeoutMillis": null, | ||
// API请求中的超时请求配置。整数数字,单位毫秒,默认为 `null`。 | ||
"apiHttpSocketTimeoutMillis": null, | ||
// 每次尝试连接到 ws 服务时的最大重试次数,大于等于0的整数,默认为 2147483647 | ||
"wsConnectMaxRetryTimes": null, | ||
// 每次尝试连接到 ws 服务时,如果需要重新尝试,则每次尝试之间的等待时长 | ||
// 整数数字,单位毫秒,默认为 3500 | ||
"wsConnectRetryDelayMillis": null, | ||
} | ||
} | ||
``` | ||
|
||
</tab> | ||
<tab title="简单示例"> | ||
|
||
```json | ||
{ | ||
"component": "simbot.onebot11", | ||
"authorization": { | ||
"botUniqueId": "123456", | ||
"apiServerHost": "http://localhost:3000", | ||
"eventServerHost":"ws://localhost:3001" | ||
} | ||
} | ||
``` | ||
|
||
</tab> | ||
</tabs> | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 开始使用 | ||
|
||
|
Oops, something went wrong.