Skip to content
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
6 changes: 4 additions & 2 deletions helpers/TeleViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async def progress(current, total):
# save to file
if messages.from_user is not None:
username = messages.from_user.username
directory = f'Downloads/{username}/logs'
directory = f'downloads/{username}/logs'
if not os.path.exists(directory):
os.makedirs(directory)
with open(f'{directory}/{username}_bot.txt', 'a') as file:
Expand All @@ -112,7 +112,9 @@ async def progress(current, total):
'a') as file:
file.write(str(messages))
else:
directory = f'Downloads/{chat_id}/logs'
directory = f'downloads/{chat_id}/logs'
if not os.path.exists(directory):
os.makedirs(directory)
with open(f'{directory}/{chat_id}_bot.txt', 'a') as file:
file.write(f"Message ID: {messages.id}\n")
file.write(f"Date: {messages.date}\n")
Expand Down