send converted stickers in webp format
This commit is contained in:
		@@ -38,8 +38,8 @@ class StickersBotModuleConfig(TelegramBotModuleConfig):
 | 
				
			|||||||
        else:
 | 
					        else:
 | 
				
			||||||
            target_height = 512
 | 
					            target_height = 512
 | 
				
			||||||
        im = im.resize((target_width, target_height), Image.ANTIALIAS)
 | 
					        im = im.resize((target_width, target_height), Image.ANTIALIAS)
 | 
				
			||||||
        with tempfile.NamedTemporaryFile(suffix='.png') as f:
 | 
					        with tempfile.NamedTemporaryFile(suffix='.webp') as f:
 | 
				
			||||||
            im.save(f, 'png')
 | 
					            im.save(f, 'webp')
 | 
				
			||||||
            f.seek(0)
 | 
					            f.seek(0)
 | 
				
			||||||
            update.message.reply_document(f, caption=f'{width}x{height} -> {target_width}x{target_height}')
 | 
					            update.message.reply_document(f, caption=f'{width}x{height} -> {target_width}x{target_height}')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user