yvlu 修复错误

This commit is contained in:
xtaodada 2022-01-04 19:30:26 +08:00
parent aa87765ff1
commit f9ec8e5083
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 5 additions and 4 deletions

View File

@ -682,7 +682,7 @@
}, },
{ {
"name": "yvlu", "name": "yvlu",
"version": "1.212", "version": "1.213",
"section": "chat", "section": "chat",
"maintainer": "xtaodada", "maintainer": "xtaodada",
"size": "10.4 kb", "size": "10.4 kb",

View File

@ -7,7 +7,7 @@ from requests import get
from telethon.errors import YouBlockedUserError, ForbiddenError, FloodWaitError, AuthKeyError from telethon.errors import YouBlockedUserError, ForbiddenError, FloodWaitError, AuthKeyError
from telethon.tl.functions.contacts import UnblockRequest from telethon.tl.functions.contacts import UnblockRequest
from telethon.tl.functions.users import GetFullUserRequest 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 asyncio import TimeoutError
from pagermaid import bot from pagermaid import bot
from pagermaid.listener import listener from pagermaid.listener import listener
@ -199,8 +199,9 @@ async def yv_lu_(context):
file_name = 'plugins/yvlu/sticker.jpg' file_name = 'plugins/yvlu/sticker.jpg'
await bot.download_media(reply_message.photo, file_name) await bot.download_media(reply_message.photo, file_name)
elif isinstance(reply_message.media, MessageMediaWebPage): elif isinstance(reply_message.media, MessageMediaWebPage):
await context.edit('不支持的文件类型。') return await context.edit('不支持的文件类型。')
return elif isinstance(reply_message.media, MessageMediaUnsupported):
return await context.edit('不支持的文件类型。')
elif "image" in reply_message.media.document.mime_type.split('/'): elif "image" in reply_message.media.document.mime_type.split('/'):
file_name = 'plugins/yvlu/sticker.jpg' file_name = 'plugins/yvlu/sticker.jpg'
await bot.download_file(reply_message.media.document, file_name) await bot.download_file(reply_message.media.document, file_name)