mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-05 11:37:14 +00:00
📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3s
Ruff Lint / Ruff Lint (push) Failing after 3s
Site Deploy / publish (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m34s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3m3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3m31s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3m59s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3s
Ruff Lint / Ruff Lint (push) Failing after 3s
Site Deploy / publish (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m34s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3m3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3m31s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3m59s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled
This commit is contained in:
@ -14,11 +14,9 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 存储一个事件响应器到插件。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `matcher` (type[[Matcher](../matcher.md#Matcher)]): 事件响应器
|
||||
|
||||
- **返回**
|
||||
|
||||
- None
|
||||
|
||||
## _def_ `get_matcher_plugin(depth=...)` {#get-matcher-plugin}
|
||||
@ -30,11 +28,9 @@ description: nonebot.plugin.on 模块
|
||||
**Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `depth` (int): 调用栈深度
|
||||
|
||||
- **返回**
|
||||
|
||||
- [Plugin](model.md#Plugin) | None
|
||||
|
||||
## _def_ `get_matcher_module(depth=...)` {#get-matcher-module}
|
||||
@ -46,11 +42,9 @@ description: nonebot.plugin.on 模块
|
||||
**Deprecated**, 请使用 [get_matcher_source](#get-matcher-source) 获取信息。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `depth` (int): 调用栈深度
|
||||
|
||||
- **返回**
|
||||
|
||||
- ModuleType | None
|
||||
|
||||
## _def_ `get_matcher_source(depth=...)` {#get-matcher-source}
|
||||
@ -58,11 +52,9 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 获取事件响应器定义所在源码信息。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `depth` (int): 调用栈深度
|
||||
|
||||
- **返回**
|
||||
|
||||
- MatcherSource | None
|
||||
|
||||
## _def_ `on(type="", rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on}
|
||||
@ -70,7 +62,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个基础事件响应器,可自定义类型。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `type` (str): 事件响应器类型
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -90,7 +81,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_metaevent(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-metaevent}
|
||||
@ -98,7 +88,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个元事件响应器。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
|
||||
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
|
||||
@ -116,7 +105,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_message(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-message}
|
||||
@ -124,7 +112,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
|
||||
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
|
||||
@ -142,7 +129,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_notice(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-notice}
|
||||
@ -150,7 +136,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个通知事件响应器。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
|
||||
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
|
||||
@ -168,7 +153,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_request(rule=..., permission=..., *, handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-request}
|
||||
@ -176,7 +160,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个请求事件响应器。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
|
||||
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
|
||||
@ -194,7 +177,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_startswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-startswith}
|
||||
@ -202,7 +184,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `msg` (str | tuple[str, ...]): 指定消息开头内容
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -224,7 +205,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_endswith(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-endswith}
|
||||
@ -232,7 +212,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `msg` (str | tuple[str, ...]): 指定消息结尾内容
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -254,7 +233,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_fullmatch(msg, rule=..., ignorecase=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-fullmatch}
|
||||
@ -262,7 +240,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `msg` (str | tuple[str, ...]): 指定消息全匹配内容
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -284,7 +261,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_keyword(keywords, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-keyword}
|
||||
@ -292,7 +268,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `keywords` (set[str]): 关键词列表
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -312,7 +287,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_command(cmd, rule=..., aliases=..., force_whitespace=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-command}
|
||||
@ -324,7 +298,6 @@ description: nonebot.plugin.on 模块
|
||||
命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_
|
||||
|
||||
- **参数**
|
||||
|
||||
- `cmd` (str | tuple[str, ...]): 指定命令内容
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -348,7 +321,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_shell_command(cmd, rule=..., aliases=..., parser=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-shell-command}
|
||||
@ -363,7 +335,6 @@ description: nonebot.plugin.on 模块
|
||||
通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `cmd` (str | tuple[str, ...]): 指定命令内容
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -387,7 +358,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_regex(pattern, flags=..., rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-regex}
|
||||
@ -399,7 +369,6 @@ description: nonebot.plugin.on 模块
|
||||
命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_
|
||||
|
||||
- **参数**
|
||||
|
||||
- `pattern` (str): 正则表达式
|
||||
|
||||
- `flags` (int | re.RegexFlag): 正则匹配标志
|
||||
@ -421,7 +390,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _def_ `on_type(types, rule=..., *, permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#on-type}
|
||||
@ -429,7 +397,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)], ...]): 事件类型
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -449,13 +416,11 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _class_ `CommandGroup(cmd, prefix_aliases=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup}
|
||||
|
||||
- **参数**
|
||||
|
||||
- `cmd` (str | tuple[str, ...])
|
||||
|
||||
- `prefix_aliases` (bool)
|
||||
@ -481,7 +446,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个新的命令。新参数将会覆盖命令组默认值
|
||||
|
||||
- **参数**
|
||||
|
||||
- `cmd` (str | tuple[str, ...]): 指定命令内容
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -505,7 +469,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `shell_command(cmd, *, rule=..., aliases=..., parser=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#CommandGroup-shell-command}
|
||||
@ -513,7 +476,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个新的 `shell_like` 命令。新参数将会覆盖命令组默认值
|
||||
|
||||
- **参数**
|
||||
|
||||
- `cmd` (str | tuple[str, ...]): 指定命令内容
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -537,13 +499,11 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
## _class_ `MatcherGroup(*, type=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup}
|
||||
|
||||
- **参数**
|
||||
|
||||
- `type` (str)
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None)
|
||||
@ -567,7 +527,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个基础事件响应器,可自定义类型。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `type` (str): 事件响应器类型
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -587,7 +546,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_metaevent(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-metaevent}
|
||||
@ -595,7 +553,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个元事件响应器。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
|
||||
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
|
||||
@ -613,7 +570,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_message(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-message}
|
||||
@ -621,7 +577,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
|
||||
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
|
||||
@ -639,7 +594,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_notice(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-notice}
|
||||
@ -647,7 +601,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个通知事件响应器。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
|
||||
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
|
||||
@ -665,7 +618,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_request(*, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-request}
|
||||
@ -673,7 +625,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个请求事件响应器。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
|
||||
- `permission` ([Permission](../permission.md#Permission) | [T_PermissionChecker](../typing.md#T-PermissionChecker) | None): 事件响应权限
|
||||
@ -691,7 +642,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_startswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-startswith}
|
||||
@ -699,7 +649,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容开头时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `msg` (str | tuple[str, ...]): 指定消息开头内容
|
||||
|
||||
- `ignorecase` (bool): 是否忽略大小写
|
||||
@ -721,7 +670,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_endswith(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-endswith}
|
||||
@ -729,7 +677,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**以指定内容结尾时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `msg` (str | tuple[str, ...]): 指定消息结尾内容
|
||||
|
||||
- `ignorecase` (bool): 是否忽略大小写
|
||||
@ -751,7 +698,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_fullmatch(msg, *, ignorecase=..., rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-fullmatch}
|
||||
@ -759,7 +705,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器,并且当消息的**文本部分**与指定内容完全一致时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `msg` (str | tuple[str, ...]): 指定消息全匹配内容
|
||||
|
||||
- `ignorecase` (bool): 是否忽略大小写
|
||||
@ -781,7 +726,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_keyword(keywords, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-keyword}
|
||||
@ -789,7 +733,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个消息事件响应器,并且当消息纯文本部分包含关键词时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `keywords` (set[str]): 关键词列表
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -809,7 +752,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_command(cmd, aliases=..., force_whitespace=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-command}
|
||||
@ -821,7 +763,6 @@ description: nonebot.plugin.on 模块
|
||||
命令匹配规则参考: `命令形式匹配 <rule.md#command-command>`\_
|
||||
|
||||
- **参数**
|
||||
|
||||
- `cmd` (str | tuple[str, ...]): 指定命令内容
|
||||
|
||||
- `aliases` (set[str | tuple[str, ...]] | None): 命令别名
|
||||
@ -845,7 +786,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_shell_command(cmd, aliases=..., parser=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-shell-command}
|
||||
@ -860,7 +800,6 @@ description: nonebot.plugin.on 模块
|
||||
通过 [ShellCommandArgs](../params.md#ShellCommandArgs) 获取解析后的参数字典。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `cmd` (str | tuple[str, ...]): 指定命令内容
|
||||
|
||||
- `aliases` (set[str | tuple[str, ...]] | None): 命令别名
|
||||
@ -884,7 +823,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_regex(pattern, flags=..., *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-regex}
|
||||
@ -896,7 +834,6 @@ description: nonebot.plugin.on 模块
|
||||
命令匹配规则参考: `正则匹配 <rule.md#regex-regex-flags-0>`\_
|
||||
|
||||
- **参数**
|
||||
|
||||
- `pattern` (str): 正则表达式
|
||||
|
||||
- `flags` (int | re.RegexFlag): 正则匹配标志
|
||||
@ -918,7 +855,6 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
||||
### _method_ `on_type(types, *, rule=..., permission=..., handlers=..., temp=..., expire_time=..., priority=..., block=..., state=...)` {#MatcherGroup-on-type}
|
||||
@ -926,7 +862,6 @@ description: nonebot.plugin.on 模块
|
||||
- **说明:** 注册一个事件响应器,并且当事件为指定类型时响应。
|
||||
|
||||
- **参数**
|
||||
|
||||
- `types` (type[[Event](../adapters/index.md#Event)] | tuple[type[[Event](../adapters/index.md#Event)]]): 事件类型
|
||||
|
||||
- `rule` ([Rule](../rule.md#Rule) | [T_RuleChecker](../typing.md#T-RuleChecker) | None): 事件响应规则
|
||||
@ -946,5 +881,4 @@ description: nonebot.plugin.on 模块
|
||||
- `state` ([T_State](../typing.md#T-State) | None): 默认 state
|
||||
|
||||
- **返回**
|
||||
|
||||
- type[[Matcher](../matcher.md#Matcher)]
|
||||
|
Reference in New Issue
Block a user