🍱 [feat] more beautiful apt upload. (#176)
This commit is contained in:
parent
3c99db4f58
commit
5b89bce878
@ -255,7 +255,8 @@ async def plugin(context):
|
||||
await context.edit(lang('apt_uploading'))
|
||||
await upload_attachment(file_name,
|
||||
context.chat_id, reply_id,
|
||||
caption=f"PagerMaid-Modify {context.parameter[1]} plugin.")
|
||||
caption=f"PagerMaid-Modify {context.parameter[1]} plugin.",
|
||||
thumb="pagermaid/static/images/logo.jpg")
|
||||
remove(file_name)
|
||||
await context.delete()
|
||||
else:
|
||||
|
BIN
pagermaid/static/images/logo.jpg
Normal file
BIN
pagermaid/static/images/logo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.1 KiB |
@ -38,7 +38,7 @@ def alias_command(command: str) -> str:
|
||||
return command
|
||||
|
||||
|
||||
async def upload_attachment(file_path, chat_id, reply_id, caption=None, preview=None, document=None):
|
||||
async def upload_attachment(file_path, chat_id, reply_id, caption=None, preview=None, document=None, thumb=None):
|
||||
""" Uploads a local attachment file. """
|
||||
if not exists(file_path):
|
||||
return False
|
||||
@ -49,7 +49,8 @@ async def upload_attachment(file_path, chat_id, reply_id, caption=None, preview=
|
||||
reply_to=reply_id,
|
||||
caption=caption,
|
||||
link_preview=preview,
|
||||
force_document=document
|
||||
force_document=document,
|
||||
thumb=thumb,
|
||||
)
|
||||
except BaseException as exception:
|
||||
raise exception
|
||||
|
Loading…
Reference in New Issue
Block a user