also changed the roomname to foldername in saving images

This commit is contained in:
manetta 2021-05-06 23:26:36 +02:00
parent 38237e9699
commit 52a26d1646

View File

@ -76,8 +76,8 @@ class Logbot(Bot):
os.path.basename(parsed_url.path).replace(" ", "_").replace("%20", "_")
) # safe url's
self.log.info(f"as the file: { filename }")
roomname = re.sub(r"@.*", "", message.room)
path = os.path.join(self.output, roomname, media_type)
folder_name = self.db[message.room]["folder"]
path = os.path.join(self.output, folder_name, media_type)
if not os.path.isdir(path):
os.mkdir(path)
file_path = os.path.join(path, filename)