🎖 自动删除下载的动图源文件
This commit is contained in:
parent
81f73c0f9b
commit
94e1c9bdc8
@ -1,5 +1,6 @@
|
|||||||
""" PagerMaid module to handle sticker collection. """
|
""" PagerMaid module to handle sticker collection. """
|
||||||
|
|
||||||
|
from os import remove
|
||||||
from urllib import request
|
from urllib import request
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from telethon.tl.types import DocumentAttributeFilename, MessageMediaPhoto
|
from telethon.tl.types import DocumentAttributeFilename, MessageMediaPhoto
|
||||||
@ -156,6 +157,7 @@ async def upload_sticker(animated, message, context, file, conversation):
|
|||||||
if animated:
|
if animated:
|
||||||
await context.edit("上传动图中 . . .")
|
await context.edit("上传动图中 . . .")
|
||||||
await conversation.send_file("AnimatedSticker.tgs", force_document=True)
|
await conversation.send_file("AnimatedSticker.tgs", force_document=True)
|
||||||
|
remove("AnimatedSticker.tgs")
|
||||||
else:
|
else:
|
||||||
file.seek(0)
|
file.seek(0)
|
||||||
await context.edit("上传图片中 . . .")
|
await context.edit("上传图片中 . . .")
|
||||||
|
Loading…
Reference in New Issue
Block a user