Fixed some paths

This commit is contained in:
Profitroll 2023-01-04 13:31:42 +01:00
parent 8cb3ef283b
commit 083281e784
1 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ if configGet("enabled", "scheduler", "cache_members"):
async for member in app.get_chat_members(configGet("destination_group")):
list_of_users.append(member.user.id)
makedirs("cache", exist_ok=True)
jsonSave(list_of_users, f"cache{sep}group_members")
jsonSave(list_of_users, path.join(configGet("cache", "locations"), "group_members"))
if configGet("enabled", "scheduler", "cache_admins"):
@scheduler.scheduled_job(trigger="interval", seconds=configGet("interval", "scheduler", "cache_admins"))
@ -31,7 +31,7 @@ if configGet("enabled", "scheduler", "cache_admins"):
async for member in app.get_chat_members(configGet("admin_group")):
list_of_users.append(member.user.id)
makedirs("cache", exist_ok=True)
jsonSave(list_of_users, f"cache{sep}admins")
jsonSave(list_of_users, path.join(configGet("cache", "locations"), "admins"))
# Cache the avatars of group members
if configGet("enabled", "scheduler", "cache_avatars"):
@ -45,7 +45,7 @@ if configGet("enabled", "scheduler", "cache_avatars"):
if user.photo != None:
if not path.exists(f'{configGet("cache", "locations")}{sep}avatars{sep}{user.photo.big_file_id}'):
print(f'Pre-cached avatar {user.photo.big_file_id} of {user.id}', flush=True)
await app.download_media(user.photo.big_file_id, file_name=f'{configGet("cache", "locations")}{sep}avatars{sep}{user.photo.big_file_id}')
await app.download_media(user.photo.big_file_id, file_name=path.join(configGet("cache", "locations"), "avatars", user.photo.big_file_id))
logWrite("Avatars caching performed")