From f9ec8e5083eb7821e6772b896b692b28b4bb5a6a Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 4 Jan 2022 19:30:26 +0800 Subject: [PATCH] =?UTF-8?q?yvlu=20=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 2 +- yvlu.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/list.json b/list.json index fd654d0..89ad486 100644 --- a/list.json +++ b/list.json @@ -682,7 +682,7 @@ }, { "name": "yvlu", - "version": "1.212", + "version": "1.213", "section": "chat", "maintainer": "xtaodada", "size": "10.4 kb", diff --git a/yvlu.py b/yvlu.py index ec7776a..b7b421e 100644 --- a/yvlu.py +++ b/yvlu.py @@ -7,7 +7,7 @@ from requests import get from telethon.errors import YouBlockedUserError, ForbiddenError, FloodWaitError, AuthKeyError from telethon.tl.functions.contacts import UnblockRequest from telethon.tl.functions.users import GetFullUserRequest -from telethon.tl.types import MessageMediaPhoto, MessageMediaWebPage +from telethon.tl.types import MessageMediaPhoto, MessageMediaWebPage, MessageMediaUnsupported from asyncio import TimeoutError from pagermaid import bot from pagermaid.listener import listener @@ -199,8 +199,9 @@ async def yv_lu_(context): file_name = 'plugins/yvlu/sticker.jpg' await bot.download_media(reply_message.photo, file_name) elif isinstance(reply_message.media, MessageMediaWebPage): - await context.edit('不支持的文件类型。') - return + return await context.edit('不支持的文件类型。') + elif isinstance(reply_message.media, MessageMediaUnsupported): + return await context.edit('不支持的文件类型。') elif "image" in reply_message.media.document.mime_type.split('/'): file_name = 'plugins/yvlu/sticker.jpg' await bot.download_file(reply_message.media.document, file_name)