From 572db1d384e78e9770da8dcf0a9d58a98441d524 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Wed, 26 Jul 2023 13:38:23 +0300 Subject: [PATCH] send converted stickers in webp format --- bots/modules/stickers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bots/modules/stickers.py b/bots/modules/stickers.py index 5cb9ae4..10ac148 100644 --- a/bots/modules/stickers.py +++ b/bots/modules/stickers.py @@ -38,8 +38,8 @@ class StickersBotModuleConfig(TelegramBotModuleConfig): else: target_height = 512 im = im.resize((target_width, target_height), Image.ANTIALIAS) - with tempfile.NamedTemporaryFile(suffix='.png') as f: - im.save(f, 'png') + with tempfile.NamedTemporaryFile(suffix='.webp') as f: + im.save(f, 'webp') f.seek(0) update.message.reply_document(f, caption=f'{width}x{height} -> {target_width}x{target_height}')