Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
Fixed [Junk removal issue](#2)
Browse files Browse the repository at this point in the history
Added junk_removal() function to remove all temporary pdf and image files from the host machine
  • Loading branch information
Philotheephilix authored May 2, 2023
1 parent ab846f4 commit c130650
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions multi_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ def convert(message):
with open("merged.pdf", 'rb') as pdf_file:
bot.send_document(message.chat.id, pdf_file)
bot.reply_to(message, "PDF file sent")
def junk_removal():
os.remove("merged\\merged.pdf")
print("merged pdf deleted....")
for i in a:
os.remove("tempimg\\"+i)
print("temp img is deleted")
for i in a:
os.remove("temppdf\\"+i+".pdf")
print("temp pdf is deleted..")
junk_removal()
@bot.message_handler(commands=["check_email"])
def check_email(message):
mail = imaplib.IMAP4_SSL("imap.gmail.com")
Expand Down

0 comments on commit c130650

Please sign in to comment.