From 9a731329415ad722399bf58ae6cef94f10c7e860 Mon Sep 17 00:00:00 2001 From: Xfjie314 <2075553664@qq.com> Date: Mon, 17 Nov 2025 22:27:17 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20Docs:=20=E8=B0=83=E6=95=B4=E6=96=87?= =?UTF-8?q?=E6=A1=A3=20`on=5Fcommand`=20import=20=E8=B7=AF=E5=BE=84=20(#37?= =?UTF-8?q?47)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> --- website/docs/tutorial/handler.mdx | 4 ++-- website/versioned_docs/version-2.4.2/tutorial/handler.mdx | 4 ++-- website/versioned_docs/version-2.4.3/tutorial/handler.mdx | 4 ++-- website/versioned_docs/version-2.4.4/tutorial/handler.mdx | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/website/docs/tutorial/handler.mdx b/website/docs/tutorial/handler.mdx index 466b15b3..4f11de0d 100644 --- a/website/docs/tutorial/handler.mdx +++ b/website/docs/tutorial/handler.mdx @@ -27,8 +27,8 @@ import Messenger from "@site/src/components/Messenger"; 顾名思义,“事件处理函数装饰器”是一个[装饰器(decorator)](https://docs.python.org/zh-cn/3/glossary.html#term-decorator),那么它的使用方法也同[函数定义](https://docs.python.org/zh-cn/3/reference/compound_stmts.html#function-definitions)中所展示的包装用法相同。例如: ```python {6-8} title=weather/__init__.py +from nonebot import on_command from nonebot.rule import to_me -from nonebot.plugin import on_command weather = on_command("天气", rule=to_me(), aliases={"weather", "查天气"}, priority=10, block=True) @@ -46,8 +46,8 @@ async def handle_function(): 事件响应器操作与事件处理函数装饰器类似,通常作为事件响应器 `Matcher` 的[类方法](https://docs.python.org/zh-cn/3/library/functions.html#classmethod)存在,因此事件响应器操作的调用方法也是 `Matcher.func()` 的形式。不过不同的是,事件响应器操作并不是装饰器,因此并不需要@进行标注。 ```python {8,9} title=weather/__init__.py +from nonebot import on_command from nonebot.rule import to_me -from nonebot.plugin import on_command weather = on_command("天气", rule=to_me(), aliases={"weather", "查天气"}, priority=10, block=True) diff --git a/website/versioned_docs/version-2.4.2/tutorial/handler.mdx b/website/versioned_docs/version-2.4.2/tutorial/handler.mdx index 466b15b3..4f11de0d 100644 --- a/website/versioned_docs/version-2.4.2/tutorial/handler.mdx +++ b/website/versioned_docs/version-2.4.2/tutorial/handler.mdx @@ -27,8 +27,8 @@ import Messenger from "@site/src/components/Messenger"; 顾名思义,“事件处理函数装饰器”是一个[装饰器(decorator)](https://docs.python.org/zh-cn/3/glossary.html#term-decorator),那么它的使用方法也同[函数定义](https://docs.python.org/zh-cn/3/reference/compound_stmts.html#function-definitions)中所展示的包装用法相同。例如: ```python {6-8} title=weather/__init__.py +from nonebot import on_command from nonebot.rule import to_me -from nonebot.plugin import on_command weather = on_command("天气", rule=to_me(), aliases={"weather", "查天气"}, priority=10, block=True) @@ -46,8 +46,8 @@ async def handle_function(): 事件响应器操作与事件处理函数装饰器类似,通常作为事件响应器 `Matcher` 的[类方法](https://docs.python.org/zh-cn/3/library/functions.html#classmethod)存在,因此事件响应器操作的调用方法也是 `Matcher.func()` 的形式。不过不同的是,事件响应器操作并不是装饰器,因此并不需要@进行标注。 ```python {8,9} title=weather/__init__.py +from nonebot import on_command from nonebot.rule import to_me -from nonebot.plugin import on_command weather = on_command("天气", rule=to_me(), aliases={"weather", "查天气"}, priority=10, block=True) diff --git a/website/versioned_docs/version-2.4.3/tutorial/handler.mdx b/website/versioned_docs/version-2.4.3/tutorial/handler.mdx index 466b15b3..4f11de0d 100644 --- a/website/versioned_docs/version-2.4.3/tutorial/handler.mdx +++ b/website/versioned_docs/version-2.4.3/tutorial/handler.mdx @@ -27,8 +27,8 @@ import Messenger from "@site/src/components/Messenger"; 顾名思义,“事件处理函数装饰器”是一个[装饰器(decorator)](https://docs.python.org/zh-cn/3/glossary.html#term-decorator),那么它的使用方法也同[函数定义](https://docs.python.org/zh-cn/3/reference/compound_stmts.html#function-definitions)中所展示的包装用法相同。例如: ```python {6-8} title=weather/__init__.py +from nonebot import on_command from nonebot.rule import to_me -from nonebot.plugin import on_command weather = on_command("天气", rule=to_me(), aliases={"weather", "查天气"}, priority=10, block=True) @@ -46,8 +46,8 @@ async def handle_function(): 事件响应器操作与事件处理函数装饰器类似,通常作为事件响应器 `Matcher` 的[类方法](https://docs.python.org/zh-cn/3/library/functions.html#classmethod)存在,因此事件响应器操作的调用方法也是 `Matcher.func()` 的形式。不过不同的是,事件响应器操作并不是装饰器,因此并不需要@进行标注。 ```python {8,9} title=weather/__init__.py +from nonebot import on_command from nonebot.rule import to_me -from nonebot.plugin import on_command weather = on_command("天气", rule=to_me(), aliases={"weather", "查天气"}, priority=10, block=True) diff --git a/website/versioned_docs/version-2.4.4/tutorial/handler.mdx b/website/versioned_docs/version-2.4.4/tutorial/handler.mdx index 466b15b3..4f11de0d 100644 --- a/website/versioned_docs/version-2.4.4/tutorial/handler.mdx +++ b/website/versioned_docs/version-2.4.4/tutorial/handler.mdx @@ -27,8 +27,8 @@ import Messenger from "@site/src/components/Messenger"; 顾名思义,“事件处理函数装饰器”是一个[装饰器(decorator)](https://docs.python.org/zh-cn/3/glossary.html#term-decorator),那么它的使用方法也同[函数定义](https://docs.python.org/zh-cn/3/reference/compound_stmts.html#function-definitions)中所展示的包装用法相同。例如: ```python {6-8} title=weather/__init__.py +from nonebot import on_command from nonebot.rule import to_me -from nonebot.plugin import on_command weather = on_command("天气", rule=to_me(), aliases={"weather", "查天气"}, priority=10, block=True) @@ -46,8 +46,8 @@ async def handle_function(): 事件响应器操作与事件处理函数装饰器类似,通常作为事件响应器 `Matcher` 的[类方法](https://docs.python.org/zh-cn/3/library/functions.html#classmethod)存在,因此事件响应器操作的调用方法也是 `Matcher.func()` 的形式。不过不同的是,事件响应器操作并不是装饰器,因此并不需要@进行标注。 ```python {8,9} title=weather/__init__.py +from nonebot import on_command from nonebot.rule import to_me -from nonebot.plugin import on_command weather = on_command("天气", rule=to_me(), aliases={"weather", "查天气"}, priority=10, block=True)