yvlu fix a bug

This commit is contained in:
xtaodada 2021-08-23 21:23:12 +08:00
parent 63fb13241f
commit 1af15553ba
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 5 additions and 2 deletions

View File

@ -702,7 +702,7 @@
},
{
"name": "yvlu",
"version": "1.11",
"version": "1.12",
"section": "chat",
"maintainer": "xtaodada",
"size": "4.8 kb",

View File

@ -5,7 +5,7 @@ from os import makedirs, remove
from PIL import Image, ImageFont, ImageDraw
from requests import get
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import MessageMediaPhoto
from telethon.tl.types import MessageMediaPhoto, MessageMediaWebPage
from pagermaid import bot
from pagermaid.listener import listener
from pagermaid.utils import alias_command
@ -159,6 +159,9 @@ async def yv_lu(context):
if isinstance(reply_message.media, MessageMediaPhoto):
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
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)