From a4c1c5c571310af11f2e5956e3f45b6529e8515f Mon Sep 17 00:00:00 2001 From: iwumingz Date: Sat, 9 Apr 2022 21:00:23 +0800 Subject: [PATCH] Update sticker naming --- plugins/updown.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/updown.py b/plugins/updown.py index 6d53f2e..637755f 100644 --- a/plugins/updown.py +++ b/plugins/updown.py @@ -1,5 +1,4 @@ import asyncio -from datetime import datetime import os from core import command @@ -43,13 +42,10 @@ async def download(_: Client, msg: Message): replied_msg = msg.reply_to_message if not replied_msg: return await show_cmd_tip(msg, cmd) - if replied_msg.sticker: - creation = datetime.strftime(datetime.now(), '%Y_%m_%d_%H_%M_%S') - file_name = f"{DOWNLOAD_PATH}sticker_{creation}.webp" - else: - file_name = DOWNLOAD_PATH if not where else where + try: - res = await replied_msg.download(file_name=file_name) + res = await replied_msg.download( + file_name=DOWNLOAD_PATH if not where else where) except ValueError: return await show_cmd_tip(msg, cmd) except Exception as e: