fix parse mode for too large files
This commit is contained in:
		
							
								
								
									
										5
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								main.py
									
									
									
									
									
								
							@@ -73,7 +73,8 @@ async def check_updates():
 | 
			
		||||
                                                         parse_mode=ParseMode.HTML)
 | 
			
		||||
                                else:
 | 
			
		||||
                                    await bot.send_message(int(os.environ['SEND_CHAT']),
 | 
			
		||||
                                                           f'File is too large: {post.file.url}\n\n' + caption)
 | 
			
		||||
                                                           f'File is too large: {post.file.url}\n\n' + caption,
 | 
			
		||||
                                                           parse_mode=ParseMode.HTML)
 | 
			
		||||
                            elif post.file.ext == 'gif':
 | 
			
		||||
                                await bot.send_animation(int(os.environ['SEND_CHAT']),
 | 
			
		||||
                                                         file,
 | 
			
		||||
@@ -81,7 +82,7 @@ async def check_updates():
 | 
			
		||||
                                                         height=post.file.height,
 | 
			
		||||
                                                         thumb=post.preview.url,
 | 
			
		||||
                                                         caption=caption,
 | 
			
		||||
                                                     parse_mode=ParseMode.HTML)
 | 
			
		||||
                                                         parse_mode=ParseMode.HTML)
 | 
			
		||||
                            elif post.file.ext in ('png', 'jpg'):
 | 
			
		||||
                                if post.file.size > 10000000:
 | 
			
		||||
                                    logging.warning('compressing')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user