🍱 [feat] more beautiful apt upload. (#176)

This commit is contained in:
Xtao_dada 2022-02-17 20:46:13 +08:00 committed by GitHub
parent 3c99db4f58
commit 5b89bce878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -255,7 +255,8 @@ async def plugin(context):
await context.edit(lang('apt_uploading')) await context.edit(lang('apt_uploading'))
await upload_attachment(file_name, await upload_attachment(file_name,
context.chat_id, reply_id, 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) remove(file_name)
await context.delete() await context.delete()
else: else:

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -38,7 +38,7 @@ def alias_command(command: str) -> str:
return command 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. """ """ Uploads a local attachment file. """
if not exists(file_path): if not exists(file_path):
return False return False
@ -49,7 +49,8 @@ async def upload_attachment(file_path, chat_id, reply_id, caption=None, preview=
reply_to=reply_id, reply_to=reply_id,
caption=caption, caption=caption,
link_preview=preview, link_preview=preview,
force_document=document force_document=document,
thumb=thumb,
) )
except BaseException as exception: except BaseException as exception:
raise exception raise exception