mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-11-04 09:57:29 +03:00 
			
		
		
		
	Simplify mind-bending condition to continue checking handlers (#4247)
This commit is contained in:
		
							parent
							
								
									35fd0cc62b
								
							
						
					
					
						commit
						d32967eefe
					
				| 
						 | 
				
			
			@ -273,7 +273,7 @@ class Client:
 | 
			
		|||
        self._handlers: Dict[
 | 
			
		||||
            Type[Event], List[Tuple[Callable[[Any], Awaitable[Any]], Optional[Filter]]]
 | 
			
		||||
        ] = {}
 | 
			
		||||
        self._shortcircuit_handlers = not check_all_handlers
 | 
			
		||||
        self._check_all_handlers = check_all_handlers
 | 
			
		||||
 | 
			
		||||
        if self._session.user and self._config.catch_up and self._session.state:
 | 
			
		||||
            self._message_box.load(self._session.state)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -154,5 +154,5 @@ async def dispatch_next(client: Client) -> None:
 | 
			
		|||
            for handler, filter in handlers:
 | 
			
		||||
                if not filter or filter(event):
 | 
			
		||||
                    ret = await handler(event)
 | 
			
		||||
                    if ret is not Continue or client._shortcircuit_handlers:
 | 
			
		||||
                    if not (ret is Continue or client._check_all_handlers):
 | 
			
		||||
                        return
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user