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

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,