Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien8261 committed Aug 25, 2023
1 parent c896306 commit 91a9a95
Show file tree
Hide file tree
Showing 35 changed files with 337 additions and 325 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
text: '在 GitHub 上编辑此页'
},
socialLinks: [
{icon: 'github', link: 'https://github.com/AmiyaBot'}
{ icon: 'github', link: 'https://github.com/AmiyaBot' }
],
footer: {
message: 'MIT & CC BY-NC-SA 4.0 Licensed. More Info <a href="https://github.com/AmiyaBot/Amiya-Bot-docs/blob/master/README.md#%E7%89%88%E6%9D%83%E4%BF%A1%E6%81%AF" target="_blank">Click Here</a>.',
Expand Down
110 changes: 55 additions & 55 deletions docs/.vitepress/nav/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@ export default {
text: '开始使用',
collapsible: true,
items: [
{text: '起步', link: '/develop/basic/index.md'},
{text: '适配器选择', link: '/develop/basic/selectAdapter.md'},
{text: '多账号', link: '/develop/basic/multipleAccounts.md'}
{ text: '起步', link: '/develop/basic/index.md' },
{ text: '适配器选择', link: '/develop/basic/selectAdapter.md' },
{ text: '多账号', link: '/develop/basic/multipleAccounts.md' }
]
},
{
text: '基础开发',
collapsible: true,
items: [
{text: '声明', link: '/develop/basic/statement.md'},
{text: '注册消息响应', link: '/develop/basic/messageHandler.md'},
{text: '接收消息(Message 对象)', link: '/develop/basic/recvMessage.md'},
{text: '发送消息(Chain 对象)', link: '/develop/basic/sendMessage.md'},
{text: '发送主动消息', link: '/develop/basic/sendActiveMessage.md'},
{text: '创建连续对话', link: '/develop/basic/continuityMessage.md'},
{text: '撤回消息', link: '/develop/basic/recallMessage.md'}
{ text: '声明', link: '/develop/basic/statement.md' },
{ text: '注册消息响应', link: '/develop/basic/messageHandler.md' },
{ text: '接收消息(Message 对象)', link: '/develop/basic/recvMessage.md' },
{ text: '发送消息(Chain 对象)', link: '/develop/basic/sendMessage.md' },
{ text: '发送主动消息', link: '/develop/basic/sendActiveMessage.md' },
{ text: '创建连续对话', link: '/develop/basic/continuityMessage.md' },
{ text: '撤回消息', link: '/develop/basic/recallMessage.md' }
]
},
{
text: '消息的构建',
collapsible: true,
items: [
{text: '发送 At', link: '/develop/basic/chainBuild/at.md'},
{text: '发送表情', link: '/develop/basic/chainBuild/face.md'},
{text: '发送文字', link: '/develop/basic/chainBuild/text.md'},
{text: '发送图片', link: '/develop/basic/chainBuild/image.md'},
{text: '发送文字生成的图片', link: '/develop/basic/chainBuild/textImage.md'},
{text: '发送 html 生成的图片', link: '/develop/basic/chainBuild/html.md'},
{text: '发送 markdown 生成的图片', link: '/develop/basic/chainBuild/markdown.md'},
{text: '发送语音', link: '/develop/basic/chainBuild/voice.md'},
{text: '发送合并转发消息', link: '/develop/basic/chainBuild/forward.md'},
{text: '发送原生模板 & CQ码', link: '/develop/basic/chainBuild/extend.md'}
{ text: '发送 At', link: '/develop/basic/chainBuild/at.md' },
{ text: '发送表情', link: '/develop/basic/chainBuild/face.md' },
{ text: '发送文字', link: '/develop/basic/chainBuild/text.md' },
{ text: '发送图片', link: '/develop/basic/chainBuild/image.md' },
{ text: '发送文字生成的图片', link: '/develop/basic/chainBuild/textImage.md' },
{ text: '发送 html 生成的图片', link: '/develop/basic/chainBuild/html.md' },
{ text: '发送 markdown 生成的图片', link: '/develop/basic/chainBuild/markdown.md' },
{ text: '发送语音', link: '/develop/basic/chainBuild/voice.md' },
{ text: '发送合并转发消息', link: '/develop/basic/chainBuild/forward.md' },
{ text: '发送原生模板 & CQ码', link: '/develop/basic/chainBuild/extend.md' }
]
},
{
text: '监听',
collapsible: true,
items: [
{text: '事件监听', link: '/develop/basic/handleEvents.md'},
{text: '异常监听', link: '/develop/basic/handleException.md'}
{ text: '事件监听', link: '/develop/basic/handleEvents.md' },
{ text: '异常监听', link: '/develop/basic/handleException.md' }
]
},
{
text: '测试',
collapsible: true,
items: [
{text: '使用测试实例调试', link: '/develop/basic/testInstance.md'}
{ text: '使用测试实例调试', link: '/develop/basic/testInstance.md' }
]
}
],
Expand All @@ -59,30 +59,30 @@ export default {
text: '进阶开发',
collapsible: true,
items: [
{text: '说明', link: '/develop/advanced/index.md'},
{text: '生命周期', link: '/develop/advanced/lifeCycle.md'},
{text: '定时任务', link: '/develop/advanced/timedTask.md'},
{text: '事件总线', link: '/develop/advanced/eventBus.md'},
{text: '日志模块', link: '/develop/advanced/logger.md'},
{text: '加载插件', link: '/develop/advanced/loadPlugins.md'}
{ text: '说明', link: '/develop/advanced/index.md' },
{ text: '生命周期', link: '/develop/advanced/lifeCycle.md' },
{ text: '定时任务', link: '/develop/advanced/timedTask.md' },
{ text: '事件总线', link: '/develop/advanced/eventBus.md' },
{ text: '日志模块', link: '/develop/advanced/logger.md' },
{ text: '加载插件', link: '/develop/advanced/loadPlugins.md' }
]
},
{
text: '辅助',
collapsible: true,
items: [
{text: 'HTTP 请求', link: '/develop/advanced/httpRequests.md'},
{text: '处理 IO 阻塞的操作', link: '/develop/advanced/blockingIO.md'},
{text: '改变 Playwright 启动', link: '/develop/advanced/playwright.md'},
{text: '启动参数', link: '/develop/advanced/startupParameter.md'}
{ text: 'HTTP 请求', link: '/develop/advanced/httpRequests.md' },
{ text: '处理 IO 阻塞的操作', link: '/develop/advanced/blockingIO.md' },
{ text: '改变 Playwright 启动', link: '/develop/advanced/playwright.md' },
{ text: '启动参数', link: '/develop/advanced/startupParameter.md' }
]
},
{
text: '额外支持',
collapsible: true,
items: [
{text: 'HTTP 服务器', link: '/develop/advanced/httpSupport.md'},
{text: '数据库', link: '/develop/advanced/databaseSupport.md'}
{ text: 'HTTP 服务器', link: '/develop/advanced/httpSupport.md' },
{ text: '数据库', link: '/develop/advanced/databaseSupport.md' }
]
}
],
Expand All @@ -91,27 +91,27 @@ export default {
text: '准备',
collapsible: true,
items: [
{text: '插件开发说明', link: '/develop/plugin/index.md'},
{text: '环境准备', link: '/develop/plugin/env.md'},
{ text: '插件开发说明', link: '/develop/plugin/index.md' },
{ text: '环境准备', link: '/develop/plugin/env.md' },
]
},
{
text: '开发',
collapsible: true,
items: [
{text: '创建&编写插件', link: '/develop/plugin/create.md'},
{text: '插件生命周期', link: '/develop/plugin/life.md'},
{text: '添加插件文档', link: '/develop/plugin/addDoc.md'},
{text: '对接控制台', link: '/develop/plugin/consoleConfig.md'},
{text: '调试插件', link: '/develop/plugin/debug.md'},
{ text: '创建&编写插件', link: '/develop/plugin/create.md' },
{ text: '插件生命周期', link: '/develop/plugin/life.md' },
{ text: '添加插件文档', link: '/develop/plugin/addDoc.md' },
{ text: '对接控制台', link: '/develop/plugin/consoleConfig.md' },
{ text: '调试插件', link: '/develop/plugin/debug.md' },
]
},
{
text: '发布',
collapsible: true,
items: [
{text: '打包插件', link: '/develop/plugin/build.md'},
{text: '发布到插件商店', link: '/develop/plugin/publish.md'},
{ text: '打包插件', link: '/develop/plugin/build.md' },
{ text: '发布到插件商店', link: '/develop/plugin/publish.md' },
]
},
],
Expand All @@ -120,41 +120,41 @@ export default {
text: '准备',
collapsible: true,
items: [
{text: '部署AmiyaBot-demo-v6', link: '/guide/deploy/index.md'},
{text: '选择你的运营方', link: '/guide/deploy/yourChoose.md'},
{text: '开始部署', link: '/guide/deploy/getStarted.md'},
{ text: '部署AmiyaBot-demo-v6', link: '/guide/deploy/index.md' },
{ text: '选择你的运营方', link: '/guide/deploy/yourChoose.md' },
{ text: '开始部署', link: '/guide/deploy/getStarted.md' },
]
},
{
text: '使用控制台',
collapsible: true,
items: [
{text: '连接控制台', link: '/guide/deploy/console/index.md'},
{text: '配置实例', link: '/guide/deploy/console/configure.md'},
{text: '安装插件', link: '/guide/deploy/console/plugin.md'},
{ text: '连接控制台', link: '/guide/deploy/console/index.md' },
{ text: '配置实例', link: '/guide/deploy/console/configure.md' },
{ text: '安装插件', link: '/guide/deploy/console/plugin.md' },
]
},
{
text: '维护',
collapsible: true,
items: [
{text: '如何更新', link: '/guide/deploy/maintain/upgrade.md'},
{ text: '如何更新', link: '/guide/deploy/maintain/upgrade.md' },
]
},
{
text: '高级使用',
collapsible: true,
items: [
{text: '说明', link: '/guide/deploy/advanced/index.md'},
{text: '使用 Mysql', link: '/guide/deploy/advanced/mysql.md'},
{ text: '说明', link: '/guide/deploy/advanced/index.md' },
{ text: '使用 Mysql', link: '/guide/deploy/advanced/mysql.md' },
]
},
{
text: 'F&Q',
collapsible: true,
items: [
{text: '常见问题', link: '/guide/deploy/faq/commonProblem.md'},
{text: '插件常见问题', link: '/guide/deploy/faq/PluginProblem.md'}
{ text: '常见问题', link: '/guide/deploy/faq/commonProblem.md' },
{ text: '插件常见问题', link: '/guide/deploy/faq/PluginProblem.md' }
]
}
]
Expand Down
9 changes: 5 additions & 4 deletions docs/develop/advanced/databaseSupport.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# 数据库支持

AmiyaBot 提供了 Sqlite 和 MySQL 数据库的 ORM
支持。基于 [peewee](https://github.com/coleifer/peewee),封装了部分表结构管理以及查询转换。日常使用的查询操作详见 [peewee文档](http://docs.peewee-orm.com/)
支持。基于 [peewee](https://github.com/coleifer/peewee)
,封装了部分表结构管理以及查询转换。日常使用的查询操作详见 [peewee文档](http://docs.peewee-orm.com/)

::: warning 温馨提示<br>
AmiyaBot 仅能提供有限的数据库支持,**推荐你使用自己的更优的数据库解决方案**
Expand Down Expand Up @@ -74,7 +75,7 @@ class TableName(BotBaseModel):
| 参数名 | 类型 | 释义 | 默认值 |
|------------|-------------|--------|-----|
| rows | List\[dict] | 数据列表 | |
| chunk_size | Int | 分片插入大小 | 200 |
| chunk_size | int | 分片插入大小 | 200 |

```python
data = [
Expand Down Expand Up @@ -132,8 +133,8 @@ data = query_to_list(TableName.select())
| 参数名 | 类型 | 释义 | 默认值 |
|-----------|-------------|-------------|-----|
| model | ModelSelect | peewee 查询对象 | |
| page | Int | 当前页 | |
| page_size | Int | 页行数 | |
| page | int | 当前页 | |
| page_size | int | 页行数 | |

```python
data = select_for_paginate(TableName.select(), 1, 10)
Expand Down
12 changes: 6 additions & 6 deletions docs/develop/advanced/eventBus.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ from amiyabot import event_bus

**publish**

| 参数名 | 类型 | 释义 | 默认值 |
|------------|--------|------|------|
| event_name | String | 事件名 | |
| data | Any | 事件数据 | None |
| 参数名 | 类型 | 释义 | 默认值 |
|------------|-----|------|------|
| event_name | str | 事件名 | |
| data | Any | 事件数据 | None |

```python
event_bus.publish('myEvent', data=...)
Expand All @@ -25,7 +25,7 @@ event_bus.publish('myEvent', data=...)

| 参数名 | 类型 | 释义 | 默认值 |
|------------|----------|----------|------|
| event_name | String | 事件名 | |
| event_name | str | 事件名 | |
| method | Callable | 响应方法(可选) | None |

::: tip 提示<br>
Expand Down Expand Up @@ -57,7 +57,7 @@ event_bus.subscribe('myEvent', event_handler)

| 参数名 | 类型 | 释义 | 默认值 |
|------------|----------|------|------|
| event_name | String | 事件名 | |
| event_name | str | 事件名 | |
| method | Callable | 响应方法 | None |

```python
Expand Down
Loading

0 comments on commit 91a9a95

Please sign in to comment.