mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-11-04 01:47:27 +03:00 
			
		
		
		
	Fix remove_event_handler's loop
This commit is contained in:
		
							parent
							
								
									e69c186782
								
							
						
					
					
						commit
						5fd6155168
					
				| 
						 | 
					@ -2276,8 +2276,10 @@ class TelegramClient(TelegramBareClient):
 | 
				
			||||||
        if event and not isinstance(event, type):
 | 
					        if event and not isinstance(event, type):
 | 
				
			||||||
            event = type(event)
 | 
					            event = type(event)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for i, ec in enumerate(self._event_builders):
 | 
					        i = len(self._event_builders)
 | 
				
			||||||
            ev, cb = ec
 | 
					        while i:
 | 
				
			||||||
 | 
					            i -= 1
 | 
				
			||||||
 | 
					            ev, cb = self._event_builders[i]
 | 
				
			||||||
            if cb == callback and (not event or isinstance(ev, event)):
 | 
					            if cb == callback and (not event or isinstance(ev, event)):
 | 
				
			||||||
                del self._event_builders[i]
 | 
					                del self._event_builders[i]
 | 
				
			||||||
                found += 1
 | 
					                found += 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user