Check if log.txt exists before trying to open

This fixes #3
This commit is contained in:
Shivam Jha 2019-10-17 21:45:03 +05:30 committed by GitHub
parent 35f99c849f
commit fa664e6663
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,8 @@ import threading
from telegram.ext import Updater
import os
if os.path.exists('log.txt'):
with open('log.txt', 'r+') as f:
f.truncate(0)