Merge pull request #81 from yorushika/master

修复 @on_natural_language 装饰器未检查 keywords 参数类型可能导致匹配错误的问题
This commit is contained in:
Richard Chien 2019-06-27 14:39:26 +08:00 committed by GitHub
commit 60101e7634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,