Skip to content

Commit f911ef6

Browse files
committed
docs:重命名配置文件并优化文档内容
- 将 docs/.vitepress/config.mts重命名为 docs/.vitepress/config.ts - 更新 config.ts 文件格式 - 在 plugin.md 中添加默认命令起始符说明,并调整文档结构
1 parent 6cebee1 commit f911ef6

File tree

3 files changed

+56
-55
lines changed

3 files changed

+56
-55
lines changed

docs/.vitepress/config.mts

Lines changed: 0 additions & 53 deletions
This file was deleted.

docs/.vitepress/config.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// https://vitepress.dev/reference/site-config
2+
export default ({
3+
title: "MuRainBot2 Doc",
4+
description: "MuRainBot2's Doc",
5+
themeConfig: {
6+
// https://vitepress.dev/reference/default-theme-config
7+
nav: [
8+
{ text: '主页', link: '/' },
9+
{ text: '文档', link: '/start/about' },
10+
{ text: '插件商店', link: '/ecosystem/plugins'},
11+
{ text: 'LibAPI文档', link: 'https://mrb2api.xiaosu.icu' }
12+
],
13+
14+
sidebar: [
15+
{
16+
text: '快速开始',
17+
items: [
18+
{ text: '介绍', link: '/start/about' },
19+
{ text: '快速开始', link: '/start/getting-started' },
20+
{ text: '编写插件', link: '/start/plugin'}
21+
]
22+
},
23+
{
24+
text: '深入',
25+
items: [
26+
{ text: '事件处理', link: '/advanced/event-handlers' },
27+
{ text: '操作', link: '/advanced/actions' },
28+
{ text: 'QQ富文本', link: '/advanced/rich-text' },
29+
{ text: 'QQ数据缓存', link: '/advanced/data-cache' },
30+
{ text: '插件配置', link: '/advanced/plugin-config' },
31+
{ text: '插件依赖', link: '/advanced/require-plugin' }
32+
]
33+
},
34+
{
35+
text: '生态',
36+
items: [
37+
{ text: '插件商店', link: '/ecosystem/plugins' }
38+
]
39+
}
40+
],
41+
42+
socialLinks: [
43+
{ icon: 'github', link: 'https://github.com/MuRainBot/MuRainBot2' }
44+
],
45+
46+
head: [
47+
['link', { rel: 'icon', href: '/favicon.ico' }]
48+
]
49+
},
50+
cleanUrls: true
51+
})

docs/start/plugin.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ rule = EventHandlers.CommandRule("hello", aliases={"你好"})
4646
**CommandRule 快速说明**
4747

4848
1. **自动匹配命令**
49-
- 默认匹配:`命令起始符 + 命令``命令起始符 + 别名`
49+
- 默认匹配:`命令起始符 + 命令``命令起始符 + 别名`(在默认情况下,命令起始符为 `["/"]`)
5050
- 若消息前带有 `@bot` 时,可直接匹配 **命令本身****别名**,无需命令起始符。
5151

5252
2. **自动处理**
@@ -98,7 +98,10 @@ def handler(event: EventClassifier.GroupMessageEvent):
9898

9999
::: tip
100100
此处我们监听的是群消息事件,所以只能在群聊中触发这个对话
101+
102+
以及由于默认的命令起始符为 `["/"]` 所以你需要使用 `/hello``/你好` 来触发这个对话,而非 `hello``你好`
103+
如果需要更改可以修改框架的配置文件,或者在实例化 `CommandRule` 的时候传入 `command_start` 参数。
101104
:::
102105

103106

104-
### 更进一步:你可以尝试边阅读[APIDoc](https://mrb2api.xiaosu.icu),边开始你下个插件的开发,或阅读 深入 板块的内容
107+
### 更进一步:你可以尝试阅读边栏 深入 板块的内容以更好的了解每个模块如何使用,或边阅读[APIDoc](https://mrb2api.xiaosu.icu),边开始你下个插件的开发。

0 commit comments

Comments
 (0)