From 5b89bce8788ec3ee98d532d0a24a1e0c1221277c Mon Sep 17 00:00:00 2001 From: Xtao_dada Date: Thu, 17 Feb 2022 20:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=B1=20[feat]=20more=20beautiful=20apt?= =?UTF-8?q?=20upload.=20(#176)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagermaid/modules/plugin.py | 3 ++- pagermaid/static/images/logo.jpg | Bin 0 -> 7240 bytes pagermaid/utils.py | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 pagermaid/static/images/logo.jpg diff --git a/pagermaid/modules/plugin.py b/pagermaid/modules/plugin.py index 05fe8f7..a41f18e 100644 --- a/pagermaid/modules/plugin.py +++ b/pagermaid/modules/plugin.py @@ -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: diff --git a/pagermaid/static/images/logo.jpg b/pagermaid/static/images/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7dd24c28cd3e2201976029e33ccf7d760e2d4338 GIT binary patch literal 7240 zcmbt&cQ{V&fE*tr2ol5saR6X)5EeP;t`A`P zXB9aAtmc0W4+O@>!NtPATLkd`6UYwvpCAqZ@VTB~dN?T_@9tS%06-o;M;+yidba*w`O^7UYpbHY8v12>`jb zzr#5csYidBD;hrAu3x5APLMmA>S+BA2%SVa1-v&g-hRD#sRBQqelWONnZW(1BE$?w z%#I*cAbp%vu}W^mPLngZ;%(aH69Al*jGm#C$cF^ygsd z_C8$}p8$Wd27S3?xuyGhoV!cJa`N18)urtR0L=b6l6*f} z#rhFmG=J0}`&XWbR3Wk2eli5Wf`46I#Ii*G;KNKtBy7w8!;lF8ZM^=DAq@a9+yOx@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ruY&i}H@1;NdlhgW*1Uapexc zP(tuuN?>E*;rvg+_+Lt3Q?QGPD#6Jpsn|GRwm9O-`re%XNgw~q35UhH=PW}l3{Z00 z17FD4i8G_MifJb?m;~*P$&@rDhd8sS2Xp$JH(Ak3SC}NpyFGIc&>8$Qfeu`<*J&bX zlya(>4eiQq`1T~xHkf>V@_@h3RY0`j(&Bl=sw;TrnskTQulXQVV}sTQC*VNjNZ^a@ z8*k0{-j*8gm)Oj0wApJZqXvT%;$M=>wgb_1tl#(a*0?_!TI(9XZP*R{okVQ>zxltG zr|?`B>wFKNQ|eD;=g7F-t zIjKCPiD@9A^;@J^Z7d){6IddFUr;06!d=i$RQsX`99h`c&&!1wVkj>C#N7quRk$To z^?)BL=jq?D-)C1FH7eK_s<*B&UPtb?qfW_`q5(hXX0Xr~glE&yaAw##y2zskE$3`*^*?%*c`0##g!>qCOR}Na)0JwXhGDuK_tTCKLsv>(LNSFaouB;aS=Dj6^(uw{3;zcs0r%tp literal 0 HcmV?d00001 diff --git a/pagermaid/utils.py b/pagermaid/utils.py index f78d81e..273ae78 100644 --- a/pagermaid/utils.py +++ b/pagermaid/utils.py @@ -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