add type check for argument keywords

This commit is contained in:
Yorushika 2019-06-27 14:36:15 +08:00
parent 2be73db35d
commit a3c40092d9
No known key found for this signature in database
GPG Key ID: E5232C4565B13CB6

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,