From 8d037f47d6bed6a932fdd2631a597c6c9e4a5289 Mon Sep 17 00:00:00 2001 From: naftali100 <48069590+naftali100@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:56:09 +0300 Subject: [PATCH 1/2] delete redundant create and delete folder --- bot/private.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/bot/private.py b/bot/private.py index 393cd47..ca6bc2f 100644 --- a/bot/private.py +++ b/bot/private.py @@ -36,8 +36,6 @@ def start_zip(_, msg: types.Message): except FileExistsError: # in case the folder already exist for file in list_dir(uid): remove(dir_work(uid) + file) # delete all file from folder - rmdir(dir_work(uid)) # delete folder - mkdir(dir_work(uid)) @Client.on_message(filters.media) From 989131f426e42db2d1b87a9447c0566b498a735d Mon Sep 17 00:00:00 2001 From: naftali100 <48069590+naftali100@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:58:52 +0300 Subject: [PATCH 2/2] delete unnecessary check since telegram limit file size anyway --- bot/private.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bot/private.py b/bot/private.py index ca6bc2f..a9f06ac 100644 --- a/bot/private.py +++ b/bot/private.py @@ -47,11 +47,7 @@ def enter_files(_, msg: types.Message): usr = User.get(uid=uid) if usr.status == 1: # check if user-status is "INSERT" - type = msg.document or msg.video or msg.photo or msg.audio - - if type.file_size > 20000000: - msg.reply(Msg.too_big) - elif len(list_dir(uid)) > 20: + if len(list_dir(uid)) > 20: msg.reply(Msg.too_much) else: downsts = msg.reply(Msg.downloading, True) # send status-download message