mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-31 06:56:39 +00:00 
			
		
		
		
	add type check for argument keywords
				
					
				
			This commit is contained in:
		| @@ -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, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user