mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-01 01:25:07 +08:00
🐛 fix matcher create missing block (#1859)
This commit is contained in:
parent
315dcb329e
commit
8fbc85cf50
@ -118,6 +118,7 @@ def on_message(*args, _depth: int = 0, **kwargs) -> Type[Matcher]:
|
|||||||
block: 是否阻止事件向更低优先级传递
|
block: 是否阻止事件向更低优先级传递
|
||||||
state: 默认 state
|
state: 默认 state
|
||||||
"""
|
"""
|
||||||
|
kwargs.setdefault("block", True)
|
||||||
return on("message", *args, **kwargs, _depth=_depth + 1)
|
return on("message", *args, **kwargs, _depth=_depth + 1)
|
||||||
|
|
||||||
|
|
||||||
@ -274,10 +275,9 @@ def on_command(
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
commands = {cmd} | (aliases or set())
|
commands = {cmd} | (aliases or set())
|
||||||
block = kwargs.pop("block", False)
|
kwargs.setdefault("block", False)
|
||||||
return on_message(
|
return on_message(
|
||||||
command(*commands, force_whitespace=force_whitespace) & rule,
|
command(*commands, force_whitespace=force_whitespace) & rule,
|
||||||
block=block,
|
|
||||||
**kwargs,
|
**kwargs,
|
||||||
_depth=_depth + 1,
|
_depth=_depth + 1,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user