diff --git a/archive/2.0.0a3/api/drivers/README.md b/archive/2.0.0a3/api/drivers/README.md deleted file mode 100644 index f78812f0..00000000 --- a/archive/2.0.0a3/api/drivers/README.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -contentSidebar: true -sidebarDepth: 0 ---- - -# NoneBot.drivers 模块 - -## 后端驱动适配基类 - -各驱动请继承以下基类 - - -## _class_ `BaseDriver` - -基类:`abc.ABC` - -Driver 基类。将后端框架封装,以满足适配器使用。 - - -### `_adapters` - - -* **类型** - - `Dict[str, Type[Bot]]` - - - -* **说明** - - 已注册的适配器列表 - - - -### _abstract_ `__init__(env, config)` - -Initialize self. See help(type(self)) for accurate signature. diff --git a/archive/2.0.0a3/api/drivers/fastapi.md b/archive/2.0.0a3/api/drivers/fastapi.md deleted file mode 100644 index 029c9bc8..00000000 --- a/archive/2.0.0a3/api/drivers/fastapi.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -contentSidebar: true -sidebarDepth: 0 ---- - -# NoneBot.drivers.fastapi 模块 - - -## _class_ `Driver` - -基类:[`nonebot.drivers.BaseDriver`](#None) - - -### `__init__(env, config)` - -Initialize self. See help(type(self)) for accurate signature. diff --git a/archive/2.0.0a3/README.md b/archive/2.0.0a4/README.md similarity index 100% rename from archive/2.0.0a3/README.md rename to archive/2.0.0a4/README.md diff --git a/archive/2.0.0a3/api/README.md b/archive/2.0.0a4/api/README.md similarity index 94% rename from archive/2.0.0a3/api/README.md rename to archive/2.0.0a4/api/README.md index 52c6e9f6..dcfb548c 100644 --- a/archive/2.0.0a3/api/README.md +++ b/archive/2.0.0a4/api/README.md @@ -10,6 +10,9 @@ * [nonebot.config](config.html) + * [nonebot.plugin](plugin.html) + + * [nonebot.matcher](matcher.html) diff --git a/archive/2.0.0a3/api/adapters/README.md b/archive/2.0.0a4/api/adapters/README.md similarity index 100% rename from archive/2.0.0a3/api/adapters/README.md rename to archive/2.0.0a4/api/adapters/README.md diff --git a/archive/2.0.0a3/api/adapters/cqhttp.md b/archive/2.0.0a4/api/adapters/cqhttp.md similarity index 97% rename from archive/2.0.0a3/api/adapters/cqhttp.md rename to archive/2.0.0a4/api/adapters/cqhttp.md index aae78f86..73b4e044 100644 --- a/archive/2.0.0a3/api/adapters/cqhttp.md +++ b/archive/2.0.0a4/api/adapters/cqhttp.md @@ -405,7 +405,11 @@ CQHTTP 协议 Event 适配。继承属性参考 [BaseEvent](./#class-baseevent) 基类:[`nonebot.adapters.BaseMessageSegment`](#None) +CQHTTP 协议 MessageSegment 适配。具体方法参考协议消息段类型或源码。 + ## _class_ `Message` 基类:[`nonebot.adapters.BaseMessage`](#None) + +CQHTTP 协议 Message 适配。 diff --git a/archive/2.0.0a3/api/config.md b/archive/2.0.0a4/api/config.md similarity index 100% rename from archive/2.0.0a3/api/config.md rename to archive/2.0.0a4/api/config.md diff --git a/archive/2.0.0a4/api/drivers/README.md b/archive/2.0.0a4/api/drivers/README.md new file mode 100644 index 00000000..624220ba --- /dev/null +++ b/archive/2.0.0a4/api/drivers/README.md @@ -0,0 +1,246 @@ +--- +contentSidebar: true +sidebarDepth: 0 +--- + +# NoneBot.drivers 模块 + +## 后端驱动适配基类 + +各驱动请继承以下基类 + + +## _class_ `BaseDriver` + +基类:`abc.ABC` + +Driver 基类。将后端框架封装,以满足适配器使用。 + + +### `_adapters` + + +* **类型** + + `Dict[str, Type[Bot]]` + + + +* **说明** + + 已注册的适配器列表 + + + +### _abstract_ `__init__(env, config)` + + +* **参数** + + + * `env: Env`: 包含环境信息的 Env 对象 + + + * `config: Config`: 包含配置信息的 Config 对象 + + + +### `env` + + +* **类型** + + `str` + + + +* **说明** + + 环境名称 + + + +### `config` + + +* **类型** + + `Config` + + + +* **说明** + + 配置对象 + + + +### `_clients` + + +* **类型** + + `Dict[str, Bot]` + + + +* **说明** + + 已连接的 Bot + + + +### _classmethod_ `register_adapter(name, adapter)` + + +* **说明** + + 注册一个协议适配器 + + + +* **参数** + + + * `name: str`: 适配器名称,用于在连接时进行识别 + + + * `adapter: Type[Bot]`: 适配器 Class + + + +### _abstract property_ `type` + +驱动类型名称 + + +### _abstract property_ `server_app` + +驱动 APP 对象 + + +### _abstract property_ `asgi` + +驱动 ASGI 对象 + + +### _abstract property_ `logger` + +驱动专属 logger 日志记录器 + + +### _property_ `bots` + + +* **类型** + + `Dict[str, Bot]` + + + +* **说明** + + 获取当前所有已连接的 Bot + + + +### _abstract_ `on_startup(func)` + +注册一个在驱动启动时运行的函数 + + +### _abstract_ `on_shutdown(func)` + +注册一个在驱动停止时运行的函数 + + +### _abstract_ `run(host=None, port=None, *args, **kwargs)` + + +* **说明** + + 启动驱动框架 + + + +* **参数** + + + * `host: Optional[str]`: 驱动绑定 IP + + + * `post: Optional[int]`: 驱动绑定端口 + + + * `*args` + + + * `**kwargs` + + + +### _abstract async_ `_handle_http()` + +用于处理 HTTP 类型请求的函数 + + +### _abstract async_ `_handle_ws_reverse()` + +用于处理 WebSocket 类型请求的函数 + + +## _class_ `BaseWebSocket` + +基类:`object` + +WebSocket 连接封装,统一接口方便外部调用。 + + +### _abstract_ `__init__(websocket)` + + +* **参数** + + + * `websocket: Any`: WebSocket 连接对象 + + + +### _property_ `websocket` + +WebSocket 连接对象 + + +### _abstract property_ `closed` + + +* **类型** + + `bool` + + + +* **说明** + + 连接是否已经关闭 + + + +### _abstract async_ `accept()` + +接受 WebSocket 连接请求 + + +### _abstract async_ `close(code)` + +关闭 WebSocket 连接请求 + + +### _abstract async_ `receive()` + +接收一条 WebSocket 信息 + + +### _abstract async_ `send(data)` + +发送一条 WebSocket 信息 diff --git a/archive/2.0.0a4/api/drivers/fastapi.md b/archive/2.0.0a4/api/drivers/fastapi.md new file mode 100644 index 00000000..523b09b2 --- /dev/null +++ b/archive/2.0.0a4/api/drivers/fastapi.md @@ -0,0 +1,125 @@ +--- +contentSidebar: true +sidebarDepth: 0 +--- + +# NoneBot.drivers.fastapi 模块 + +## FastAPI 驱动适配 + +后端使用方法请参考: [FastAPI 文档](https://fastapi.tiangolo.com/) + + +## _class_ `Driver` + +基类:[`nonebot.drivers.BaseDriver`](#None) + +FastAPI 驱动框架 + + +### `__init__(env, config)` + + +* **参数** + + + +* `env: Env`: 包含环境信息的 Env 对象 + + +* `config: Config`: 包含配置信息的 Config 对象 + + +### _property_ `type` + +驱动名称: `fastapi` + + +### _property_ `server_app` + +`FastAPI APP` 对象 + + +### _property_ `asgi` + +`FastAPI APP` 对象 + + +### _property_ `logger` + +fastapi 使用的 logger + + +### `on_startup(func)` + +参考文档: [Events](https://fastapi.tiangolo.com/advanced/events/#startup-event) + + +### `on_shutdown(func)` + +参考文档: [Events](https://fastapi.tiangolo.com/advanced/events/#startup-event) + + +### `run(host=None, port=None, *, app=None, **kwargs)` + +使用 `uvicorn` 启动 FastAPI + + +### _async_ `_handle_http(adapter, data=Body(Ellipsis), x_self_id=Header(None), x_signature=Header(None), auth=Depends(get_auth_bearer))` + +用于处理 HTTP 类型请求的函数 + + +### _async_ `_handle_ws_reverse(adapter, websocket, x_self_id=Header(None), auth=Depends(get_auth_bearer))` + +用于处理 WebSocket 类型请求的函数 + + +## _class_ `WebSocket` + +基类:[`nonebot.drivers.BaseWebSocket`](#None) + + +### `__init__(websocket)` + + +* **参数** + + + +* `websocket: Any`: WebSocket 连接对象 + + +### _property_ `closed` + + +* **类型** + + `bool` + + + +* **说明** + + 连接是否已经关闭 + + + +### _async_ `accept()` + +接受 WebSocket 连接请求 + + +### _async_ `close(code=1000)` + +关闭 WebSocket 连接请求 + + +### _async_ `receive()` + +接收一条 WebSocket 信息 + + +### _async_ `send(data)` + +发送一条 WebSocket 信息 diff --git a/archive/2.0.0a3/api/exception.md b/archive/2.0.0a4/api/exception.md similarity index 100% rename from archive/2.0.0a3/api/exception.md rename to archive/2.0.0a4/api/exception.md diff --git a/archive/2.0.0a3/api/log.md b/archive/2.0.0a4/api/log.md similarity index 100% rename from archive/2.0.0a3/api/log.md rename to archive/2.0.0a4/api/log.md diff --git a/archive/2.0.0a3/api/matcher.md b/archive/2.0.0a4/api/matcher.md similarity index 90% rename from archive/2.0.0a3/api/matcher.md rename to archive/2.0.0a4/api/matcher.md index c1176030..b061cd64 100644 --- a/archive/2.0.0a3/api/matcher.md +++ b/archive/2.0.0a4/api/matcher.md @@ -377,7 +377,7 @@ sidebarDepth: 0 -### _async classmethod_ `send(message)` +### _async classmethod_ `send(message, **kwargs)` * **说明** @@ -392,8 +392,11 @@ sidebarDepth: 0 * `message: Union[str, Message, MessageSegment]`: 消息内容 + * `**kwargs`: 其他传递给 `bot.send` 的参数,请参考对应 adapter 的 bot 对象 api -### _async classmethod_ `finish(message=None)` + + +### _async classmethod_ `finish(message=None, **kwargs)` * **说明** @@ -408,8 +411,11 @@ sidebarDepth: 0 * `message: Union[str, Message, MessageSegment]`: 消息内容 + * `**kwargs`: 其他传递给 `bot.send` 的参数,请参考对应 adapter 的 bot 对象 api -### _async classmethod_ `pause(prompt=None)` + + +### _async classmethod_ `pause(prompt=None, **kwargs)` * **说明** @@ -424,8 +430,11 @@ sidebarDepth: 0 * `prompt: Union[str, Message, MessageSegment]`: 消息内容 + * `**kwargs`: 其他传递给 `bot.send` 的参数,请参考对应 adapter 的 bot 对象 api -### _async classmethod_ `reject(prompt=None)` + + +### _async classmethod_ `reject(prompt=None, **kwargs)` * **说明** @@ -440,6 +449,9 @@ sidebarDepth: 0 * `prompt: Union[str, Message, MessageSegment]`: 消息内容 + * `**kwargs`: 其他传递给 `bot.send` 的参数,请参考对应 adapter 的 bot 对象 api + + ## _class_ `MatcherGroup` diff --git a/archive/2.0.0a3/api/nonebot.md b/archive/2.0.0a4/api/nonebot.md similarity index 100% rename from archive/2.0.0a3/api/nonebot.md rename to archive/2.0.0a4/api/nonebot.md diff --git a/archive/2.0.0a3/api/permission.md b/archive/2.0.0a4/api/permission.md similarity index 100% rename from archive/2.0.0a3/api/permission.md rename to archive/2.0.0a4/api/permission.md diff --git a/archive/2.0.0a4/api/plugin.md b/archive/2.0.0a4/api/plugin.md new file mode 100644 index 00000000..42cdf84f --- /dev/null +++ b/archive/2.0.0a4/api/plugin.md @@ -0,0 +1,629 @@ +--- +contentSidebar: true +sidebarDepth: 0 +--- + +# NoneBot.plugin 模块 + +## 插件 + +为 NoneBot 插件开发提供便携的定义函数。 + + +## `plugins` + + +* **类型** + + `Dict[str, Plugin]` + + + +* **说明** + + 已加载的插件 + + + +## _class_ `Plugin` + +基类:`object` + +存储插件信息 + + +### `name` + + +* **类型**: `str` + + +* **说明**: 插件名称,使用 文件/文件夹 名称作为插件名 + + +### `module` + + +* **类型**: `ModuleType` + + +* **说明**: 插件模块对象 + + +### `matcher` + + +* **类型**: `Set[Type[Matcher]]` + + +* **说明**: 插件内定义的 `Matcher` + + +## `on(type='', rule=None, permission=None, *, handlers=None, temp=False, priority=1, block=False, state=None)` + + +* **说明** + + 注册一个基础事件响应器,可自定义类型。 + + + +* **参数** + + + * `type: str`: 事件响应器类型 + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `permission: Optional[Permission]`: 事件响应权限 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## `on_metaevent(rule=None, *, handlers=None, temp=False, priority=1, block=False, state=None)` + + +* **说明** + + 注册一个元事件响应器。 + + + +* **参数** + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## `on_message(rule=None, permission=None, *, handlers=None, temp=False, priority=1, block=True, state=None)` + + +* **说明** + + 注册一个消息事件响应器。 + + + +* **参数** + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `permission: Optional[Permission]`: 事件响应权限 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## `on_notice(rule=None, *, handlers=None, temp=False, priority=1, block=False, state=None)` + + +* **说明** + + 注册一个通知事件响应器。 + + + +* **参数** + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## `on_request(rule=None, *, handlers=None, temp=False, priority=1, block=False, state=None)` + + +* **说明** + + 注册一个请求事件响应器。 + + + +* **参数** + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## `on_startswith(msg, rule=None, **kwargs)` + + +* **说明** + + 注册一个消息事件响应器,并且当消息的\*\*文本部分\*\*以指定内容开头时响应。 + + + +* **参数** + + + * `msg: str`: 指定消息开头内容 + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `permission: Optional[Permission]`: 事件响应权限 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## `on_endswith(msg, rule=None, **kwargs)` + + +* **说明** + + 注册一个消息事件响应器,并且当消息的\*\*文本部分\*\*以指定内容结尾时响应。 + + + +* **参数** + + + * `msg: str`: 指定消息结尾内容 + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `permission: Optional[Permission]`: 事件响应权限 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## `on_keyword(keywords, rule=None, **kwargs)` + + +* **说明** + + 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。 + + + +* **参数** + + + * `keywords: Set[str]`: 关键词列表 + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `permission: Optional[Permission]`: 事件响应权限 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## `on_command(cmd, rule=None, aliases=None, **kwargs)` + + +* **说明** + + 注册一个消息事件响应器,并且当消息以指定命令开头时响应。 + + 命令匹配规则参考: [命令形式匹配](rule.html#command-command) + + + +* **参数** + + + * `cmd: Union[str, Tuple[str, ...]]`: 指定命令内容 + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `aliases: Optional[Set[Union[str, Tuple[str, ...]]]]`: 命令别名 + + + * `permission: Optional[Permission]`: 事件响应权限 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## `on_regex(pattern, flags=0, rule=None, **kwargs)` + + +* **说明** + + 注册一个消息事件响应器,并且当消息匹配正则表达式时响应。 + + 命令匹配规则参考: [正则匹配](rule.html#regex-regex-flags-0) + + + +* **参数** + + + * `pattern: str`: 正则表达式 + + + * `flags: Union[int, re.RegexFlag]`: 正则匹配标志 + + + * `rule: Optional[Union[Rule, RuleChecker]]`: 事件响应规则 + + + * `permission: Optional[Permission]`: 事件响应权限 + + + * `handlers: Optional[List[Handler]]`: 事件处理函数列表 + + + * `temp: bool`: 是否为临时事件响应器(仅执行一次) + + + * `priority: int`: 事件响应器优先级 + + + * `block: bool`: 是否阻止事件向更低优先级传递 + + + * `state: Optional[dict]`: 默认的 state + + + +* **返回** + + + * `Type[Matcher]` + + + +## _class_ `CommandGroup` + +基类:`object` + +命令组,用于声明一组有相同名称前缀的命令。 + + +### `__init__(cmd, **kwargs)` + + +* **参数** + + + * `cmd: Union[str, Tuple[str, ...]]`: 命令前缀 + + + * `**kwargs`: 其他传递给 `on_command` 的参数默认值,参考 [on_command](#on-command-cmd-rule-none-aliases-none-kwargs) + + + +### `basecmd` + + +* **类型**: `Tuple[str, ...]` + + +* **说明**: 命令前缀 + + +### `base_kwargs` + + +* **类型**: `Dict[str, Any]` + + +* **说明**: 其他传递给 `on_command` 的参数默认值 + + +### `command(cmd, **kwargs)` + + +* **说明** + + 注册一个新的命令。 + + + +* **参数** + + + * `cmd: Union[str, Tuple[str, ...]]`: 命令前缀 + + + * `**kwargs`: 其他传递给 `on_command` 的参数,将会覆盖命令组默认值 + + + +* **返回** + + + * `Type[Matcher]` + + + +## `load_plugin(module_path)` + + +* **说明** + + 使用 `importlib` 加载单个插件,可以是本地插件或是通过 `pip` 安装的插件。 + + + +* **参数** + + + * `module_path: str`: 插件名称 `path.to.your.plugin` + + + +* **返回** + + + * `Optional[Plugin]` + + + +## `load_plugins(*plugin_dir)` + + +* **说明** + + 导入目录下多个插件,以 `_` 开头的插件不会被导入! + + + +* **参数** + + + * `*plugin_dir: str`: 插件路径 + + + +* **返回** + + + * `Set[Plugin]` + + + +## `load_builtin_plugins()` + + +* **说明** + + 导入 NoneBot 内置插件 + + + +* **返回** + + + * `Plugin` + + + +## `get_loaded_plugins()` + + +* **说明** + + 获取当前已导入的插件。 + + + +* **返回** + + + * `Set[Plugin]` diff --git a/archive/2.0.0a3/api/rule.md b/archive/2.0.0a4/api/rule.md similarity index 79% rename from archive/2.0.0a3/api/rule.md rename to archive/2.0.0a4/api/rule.md index 2054d04b..dade2a5b 100644 --- a/archive/2.0.0a3/api/rule.md +++ b/archive/2.0.0a4/api/rule.md @@ -123,7 +123,7 @@ Rule(async_function, run_sync(sync_function)) -## `keyword(msg)` +## `keyword(*keywords)` * **说明** @@ -135,23 +135,25 @@ Rule(async_function, run_sync(sync_function)) * **参数** - * `msg: str`: 关键词 + * `*keywords: str`: 关键词 -## `command(command)` +## `command(*cmds)` * **说明** 命令形式匹配,根据配置里提供的 `command_start`, `command_sep` 判断消息是否为命令。 + 可以通过 `state["_prefix"]["command"]` 获取匹配成功的命令(例:`("test",)`),通过 `state["_prefix"]["raw_command"]` 获取匹配成功的原始命令文本(例:`"/test"`)。 + * **参数** - * `command: Tuples[str, ...]`: 命令内容 + * `*cmds: Union[str, Tuple[str, ...]]`: 命令内容 @@ -173,7 +175,9 @@ Rule(async_function, run_sync(sync_function)) * **说明** - 根据正则表达式进行匹配 + 根据正则表达式进行匹配。 + + 可以通过 `state["_matched"]` 获取正则表达式匹配成功的文本。 @@ -186,6 +190,10 @@ Rule(async_function, run_sync(sync_function)) * `flags: Union[int, re.RegexFlag]`: 正则标志 +:::tip 提示 +正则表达式匹配使用 search 而非 match,如需从头匹配请使用 `r"^xxx"` 来确保匹配开头 +::: + ## `to_me()` diff --git a/archive/2.0.0a3/api/sched.md b/archive/2.0.0a4/api/sched.md similarity index 100% rename from archive/2.0.0a3/api/sched.md rename to archive/2.0.0a4/api/sched.md diff --git a/archive/2.0.0a3/api/typing.md b/archive/2.0.0a4/api/typing.md similarity index 100% rename from archive/2.0.0a3/api/typing.md rename to archive/2.0.0a4/api/typing.md diff --git a/archive/2.0.0a3/api/utils.md b/archive/2.0.0a4/api/utils.md similarity index 100% rename from archive/2.0.0a3/api/utils.md rename to archive/2.0.0a4/api/utils.md diff --git a/archive/2.0.0a3/guide/README.md b/archive/2.0.0a4/guide/README.md similarity index 98% rename from archive/2.0.0a3/guide/README.md rename to archive/2.0.0a4/guide/README.md index 86397ee2..43b7f325 100644 --- a/archive/2.0.0a3/guide/README.md +++ b/archive/2.0.0a4/guide/README.md @@ -20,6 +20,8 @@ NoneBot2 是一个可扩展的 Python 异步机器人框架,它会对机器人 ## 它如何工作? + + ~~未填坑~~ ## 特色 diff --git a/archive/2.0.0a3/guide/basic-configuration.md b/archive/2.0.0a4/guide/basic-configuration.md similarity index 100% rename from archive/2.0.0a3/guide/basic-configuration.md rename to archive/2.0.0a4/guide/basic-configuration.md diff --git a/archive/2.0.0a3/guide/creating-a-project.md b/archive/2.0.0a4/guide/creating-a-project.md similarity index 100% rename from archive/2.0.0a3/guide/creating-a-project.md rename to archive/2.0.0a4/guide/creating-a-project.md diff --git a/archive/2.0.0a3/guide/getting-started.md b/archive/2.0.0a4/guide/getting-started.md similarity index 97% rename from archive/2.0.0a3/guide/getting-started.md rename to archive/2.0.0a4/guide/getting-started.md index d52a9396..9c358ead 100644 --- a/archive/2.0.0a3/guide/getting-started.md +++ b/archive/2.0.0a4/guide/getting-started.md @@ -136,11 +136,11 @@ QQ 协议端举例: 现在,尝试向你的 QQ 机器人账号发送如下内容: ```default -/say 你好,世界 +/echo 你好,世界 ``` 到这里如果一切 OK,你应该会收到机器人给你回复了 `你好,世界`。这一历史性的对话标志着你已经成功地运行了一个 NoneBot 的最小实例,开始了编写更强大的 QQ 机器人的创意之旅! - + diff --git a/archive/2.0.0a3/guide/installation.md b/archive/2.0.0a4/guide/installation.md similarity index 94% rename from archive/2.0.0a3/guide/installation.md rename to archive/2.0.0a4/guide/installation.md index 06a88598..4f6e68e1 100644 --- a/archive/2.0.0a3/guide/installation.md +++ b/archive/2.0.0a4/guide/installation.md @@ -6,7 +6,10 @@ 请确保你的 Python 版本 >= 3.7。 ::: +请在安装 nonebot2 之前卸载 nonebot 1.x + ```bash +pip uninstall nonebot pip install nonebot2 ``` diff --git a/archive/2.0.0a3/guide/writing-a-plugin.md b/archive/2.0.0a4/guide/writing-a-plugin.md similarity index 100% rename from archive/2.0.0a3/guide/writing-a-plugin.md rename to archive/2.0.0a4/guide/writing-a-plugin.md diff --git a/archive/2.0.0a3/sidebar.config.json b/archive/2.0.0a4/sidebar.config.json similarity index 92% rename from archive/2.0.0a3/sidebar.config.json rename to archive/2.0.0a4/sidebar.config.json index c68d09ef..54e78eaa 100644 --- a/archive/2.0.0a3/sidebar.config.json +++ b/archive/2.0.0a4/sidebar.config.json @@ -1,4 +1,5 @@ { + "sidebar": {}, "locales": { "/": { "label": "简体中文", @@ -17,6 +18,10 @@ { "text": "API", "link": "/api/" + }, + { + "text": "插件广场", + "link": "/plugin-store" } ], "sidebarDepth": 2, @@ -51,6 +56,10 @@ "title": "nonebot.config 模块", "path": "config" }, + { + "title": "nonebot.plugin 模块", + "path": "plugin" + }, { "title": "nonebot.matcher 模块", "path": "matcher" diff --git a/docs/.vuepress/versions.json b/docs/.vuepress/versions.json index 65abfcfd..56a1527a 100644 --- a/docs/.vuepress/versions.json +++ b/docs/.vuepress/versions.json @@ -1,3 +1,3 @@ [ - "2.0.0a3" + "2.0.0a4" ] \ No newline at end of file