mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 02:55:18 +08:00
add type check for argument keywords
This commit is contained in:
parent
2be73db35d
commit
a3c40092d9
@ -42,6 +42,9 @@ def on_natural_language(keywords: Union[Optional[Iterable], Callable] = None,
|
||||
:param allow_empty_message: handle empty messages
|
||||
"""
|
||||
|
||||
if isinstance(keywords, str):
|
||||
keywords = (keywords,)
|
||||
|
||||
def deco(func: Callable) -> Callable:
|
||||
nl_processor = NLProcessor(func=func, keywords=keywords,
|
||||
permission=permission,
|
||||
|
Loading…
Reference in New Issue
Block a user