From 9f25218a644894f8cc696481f86ad745a5a66ad3 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Thu, 1 Jul 2021 10:09:16 +0800 Subject: [PATCH] =?UTF-8?q?getstickers=20=E8=87=AA=E5=8A=A8=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=20webp=20=E4=B8=BA=20png?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- getstickers.py | 6 +++++- list.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/getstickers.py b/getstickers.py index e651304..bb0a105 100644 --- a/getstickers.py +++ b/getstickers.py @@ -2,6 +2,7 @@ import asyncio from collections import defaultdict import os import zipfile +from PIL import Image from telethon.tl.functions.messages import GetStickerSetRequest from telethon.errors import MessageNotModifiedError from pagermaid import working_dir @@ -26,7 +27,7 @@ except ImportError: @listener(is_plugin=True, outgoing=True, command=alias_command("getstickers"), - description="获取整个贴纸包的贴纸,任意值开启 tgs 转 gif 需要手动安装 pypi 依赖 lottie[gif] 。", + description="获取整个贴纸包的贴纸,任意值开启 tgs 转 gif;转 gif 需要手动安装 pypi 依赖 lottie[gif] 。", parameters="<任意值>") async def getstickers(context): tgs_gif = True @@ -67,6 +68,9 @@ async def getstickers(context): if file_ext_ns_ion == 'tgs' and lottie_import and tgs_gif: animated = import_tgs(os.path.join(path, file)) export_gif(animated, os.path.join(path, file)[:-3] + 'gif') + elif file_ext_ns_ion == 'webp': + im = Image.open(os.path.join(path, file)).convert('RGB') + im.save(os.path.join(path, file)[:-4] + 'png', 'png') pending_tasks = [ asyncio.ensure_future( diff --git a/list.json b/list.json index 218e6f2..82878aa 100644 --- a/list.json +++ b/list.json @@ -532,7 +532,7 @@ }, { "name": "getstickers", - "version": "1.0", + "version": "1.01", "section": "chat", "maintainer": "xtaodada", "size": "5.4 kb",