mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-18 09:25:46 +08:00
💡 update command docstrinrg
This commit is contained in:
parent
c636186321
commit
dc5c35a9ed
@ -4,46 +4,46 @@
|
||||
* **模块索引**
|
||||
|
||||
|
||||
* [nonebot](nonebot.md)
|
||||
* [nonebot](nonebot.html)
|
||||
|
||||
|
||||
* [nonebot.config](config.md)
|
||||
* [nonebot.config](config.html)
|
||||
|
||||
|
||||
* [nonebot.plugin](plugin.md)
|
||||
* [nonebot.plugin](plugin.html)
|
||||
|
||||
|
||||
* [nonebot.matcher](matcher.md)
|
||||
* [nonebot.matcher](matcher.html)
|
||||
|
||||
|
||||
* [nonebot.rule](rule.md)
|
||||
* [nonebot.rule](rule.html)
|
||||
|
||||
|
||||
* [nonebot.permission](permission.md)
|
||||
* [nonebot.permission](permission.html)
|
||||
|
||||
|
||||
* [nonebot.sched](sched.md)
|
||||
* [nonebot.sched](sched.html)
|
||||
|
||||
|
||||
* [nonebot.log](log.md)
|
||||
* [nonebot.log](log.html)
|
||||
|
||||
|
||||
* [nonebot.utils](utils.md)
|
||||
* [nonebot.utils](utils.html)
|
||||
|
||||
|
||||
* [nonebot.typing](typing.md)
|
||||
* [nonebot.typing](typing.html)
|
||||
|
||||
|
||||
* [nonebot.exception](exception.md)
|
||||
* [nonebot.exception](exception.html)
|
||||
|
||||
|
||||
* [nonebot.drivers](drivers/)
|
||||
|
||||
|
||||
* [nonebot.drivers.fastapi](drivers/fastapi.md)
|
||||
* [nonebot.drivers.fastapi](drivers/fastapi.html)
|
||||
|
||||
|
||||
* [nonebot.adapters](adapters/)
|
||||
|
||||
|
||||
* [nonebot.adapters.cqhttp](adapters/cqhttp.md)
|
||||
* [nonebot.adapters.cqhttp](adapters/cqhttp.html)
|
||||
|
@ -146,6 +146,8 @@ Rule(async_function, run_sync(sync_function))
|
||||
|
||||
命令形式匹配,根据配置里提供的 `command_start`, `command_sep` 判断消息是否为命令。
|
||||
|
||||
可以通过 `state["_prefix"]["command"]` 获取匹配成功的命令(例:`("test",)`),通过 `state["_prefix"]["raw_command"]` 获取匹配成功的原始命令文本(例:`"/test"`)。
|
||||
|
||||
|
||||
|
||||
* **参数**
|
||||
|
@ -2,18 +2,18 @@ NoneBot Api Reference
|
||||
=====================
|
||||
|
||||
:模块索引:
|
||||
- `nonebot <nonebot.rst>`_
|
||||
- `nonebot.config <config.rst>`_
|
||||
- `nonebot.plugin <plugin.rst>`_
|
||||
- `nonebot.matcher <matcher.rst>`_
|
||||
- `nonebot.rule <rule.rst>`_
|
||||
- `nonebot.permission <permission.rst>`_
|
||||
- `nonebot.sched <sched.rst>`_
|
||||
- `nonebot.log <log.rst>`_
|
||||
- `nonebot.utils <utils.rst>`_
|
||||
- `nonebot.typing <typing.rst>`_
|
||||
- `nonebot.exception <exception.rst>`_
|
||||
- `nonebot <nonebot.html>`_
|
||||
- `nonebot.config <config.html>`_
|
||||
- `nonebot.plugin <plugin.html>`_
|
||||
- `nonebot.matcher <matcher.html>`_
|
||||
- `nonebot.rule <rule.html>`_
|
||||
- `nonebot.permission <permission.html>`_
|
||||
- `nonebot.sched <sched.html>`_
|
||||
- `nonebot.log <log.html>`_
|
||||
- `nonebot.utils <utils.html>`_
|
||||
- `nonebot.typing <typing.html>`_
|
||||
- `nonebot.exception <exception.html>`_
|
||||
- `nonebot.drivers <drivers/>`_
|
||||
- `nonebot.drivers.fastapi <drivers/fastapi.rst>`_
|
||||
- `nonebot.drivers.fastapi <drivers/fastapi.html>`_
|
||||
- `nonebot.adapters <adapters/>`_
|
||||
- `nonebot.adapters.cqhttp <adapters/cqhttp.rst>`_
|
||||
- `nonebot.adapters.cqhttp <adapters/cqhttp.html>`_
|
||||
|
@ -200,6 +200,8 @@ def command(*cmds: Union[str, Tuple[str, ...]]) -> Rule:
|
||||
"""
|
||||
:说明:
|
||||
命令形式匹配,根据配置里提供的 ``command_start``, ``command_sep`` 判断消息是否为命令。
|
||||
|
||||
可以通过 ``state["_prefix"]["command"]`` 获取匹配成功的命令(例:``("test",)``),通过 ``state["_prefix"]["raw_command"]`` 获取匹配成功的原始命令文本(例:``"/test"``)。
|
||||
:参数:
|
||||
* ``*cmds: Union[str, Tuple[str, ...]]``: 命令内容
|
||||
:示例:
|
||||
|
Loading…
Reference in New Issue
Block a user