mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-11-04 09:57:29 +03:00 
			
		
		
		
	Rename "callback" to "progress_callback" for consistency
This commit is contained in:
		
							parent
							
								
									fd6a9a4318
								
							
						
					
					
						commit
						1d0ad9628d
					
				| 
						 | 
					@ -479,7 +479,7 @@ class TelegramClient(TelegramBareClient):
 | 
				
			||||||
    # region Uploading files
 | 
					    # region Uploading files
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def send_file(self, entity, file, caption='',
 | 
					    def send_file(self, entity, file, caption='',
 | 
				
			||||||
                  force_document=False, callback=None):
 | 
					                  force_document=False, progress_callback=None):
 | 
				
			||||||
        """Sends a file to the specified entity.
 | 
					        """Sends a file to the specified entity.
 | 
				
			||||||
           The file may either be a path, a byte array, or a stream.
 | 
					           The file may either be a path, a byte array, or a stream.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -511,8 +511,9 @@ class TelegramClient(TelegramBareClient):
 | 
				
			||||||
        if file_hash in self._upload_cache:
 | 
					        if file_hash in self._upload_cache:
 | 
				
			||||||
            file_handle = self._upload_cache[file_hash]
 | 
					            file_handle = self._upload_cache[file_hash]
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            file_handle = self.upload_file(file, progress_callback=callback)
 | 
					            self._upload_cache[file_hash] = file_handle = self.upload_file(
 | 
				
			||||||
            self._upload_cache[file_hash] = file_handle
 | 
					                file, progress_callback=progress_callback
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if as_photo and not force_document:
 | 
					        if as_photo and not force_document:
 | 
				
			||||||
            media = InputMediaUploadedPhoto(file_handle, caption)
 | 
					            media = InputMediaUploadedPhoto(file_handle, caption)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user