mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-11-04 09:57:29 +03:00 
			
		
		
		
	Fix slicing dialogs was turning UserList into list
This commit is contained in:
		
							parent
							
								
									55b67b65a1
								
							
						
					
					
						commit
						50d413b1c9
					
				| 
						 | 
					@ -341,9 +341,11 @@ class TelegramClient(TelegramBareClient):
 | 
				
			||||||
            offset_peer = entities[utils.get_peer_id(r.dialogs[-1].peer)]
 | 
					            offset_peer = entities[utils.get_peer_id(r.dialogs[-1].peer)]
 | 
				
			||||||
            offset_id = r.messages[-1].id & 4294967296  # Telegram/danog magic
 | 
					            offset_id = r.messages[-1].id & 4294967296  # Telegram/danog magic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        dialogs = UserList(dialogs.values())
 | 
					        dialogs = UserList(
 | 
				
			||||||
 | 
					            itertools.islice(dialogs.values(), min(limit, len(dialogs)))
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
        dialogs.total = total_count
 | 
					        dialogs.total = total_count
 | 
				
			||||||
        return dialogs[:limit] if limit < float('inf') else dialogs
 | 
					        return dialogs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_drafts(self):  # TODO: Ability to provide a `filter`
 | 
					    def get_drafts(self):  # TODO: Ability to provide a `filter`
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user