mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-02-20 09:38:23 +08:00
Merge pull request #81 from yorushika/master
修复 @on_natural_language 装饰器未检查 keywords 参数类型可能导致匹配错误的问题
This commit is contained in:
commit
60101e7634
@ -42,6 +42,9 @@ def on_natural_language(keywords: Union[Optional[Iterable], Callable] = None,
|
|||||||
:param allow_empty_message: handle empty messages
|
:param allow_empty_message: handle empty messages
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if isinstance(keywords, str):
|
||||||
|
keywords = (keywords,)
|
||||||
|
|
||||||
def deco(func: Callable) -> Callable:
|
def deco(func: Callable) -> Callable:
|
||||||
nl_processor = NLProcessor(func=func, keywords=keywords,
|
nl_processor = NLProcessor(func=func, keywords=keywords,
|
||||||
permission=permission,
|
permission=permission,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user