Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete redundant delete and create folder #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions bot/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -49,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
Expand Down