|
|
@ -132,9 +132,8 @@ class Logbot(Bot): |
|
|
|
new_key = str(int(keys[-1]) + 1) |
|
|
|
if media_post: |
|
|
|
self.db[message.room]["messages"][new_key] = {} |
|
|
|
self.db[message.room]["messages"][new_key]['post'] = '' |
|
|
|
self.db[message.room]["messages"][new_key]['post'] = media_post |
|
|
|
self.db[message.room]["messages"][new_key]['media'] = {} |
|
|
|
self.db[message.room]["messages"][new_key]['media']['post'] = media_post |
|
|
|
self.db[message.room]["messages"][new_key]['media']['type'] = media_type |
|
|
|
self.db[message.room]["messages"][new_key]['media']['url'] = os.path.join("https://vvvvvvaria.org/logs/", media_url) |
|
|
|
self.db[message.room]["messages"][new_key]['media']['size'] = media_size |
|
|
@ -171,17 +170,15 @@ class Logbot(Bot): |
|
|
|
if "folder" not in self.db[room]: |
|
|
|
self.db[room]["folder"] = self._parse_room_name(room) |
|
|
|
if "stylesheet" not in self.db[room]: |
|
|
|
self.db[room]["stylesheet"] = "timeline" # default stylesheet |
|
|
|
self.db[room]["stylesheet"] = "timeline" # default stylesheet |
|
|
|
if "font" not in self.db[room]: |
|
|
|
self.db[room]["font"] = "none" # default font |
|
|
|
self.db[room]["font"] = "none" # default font |
|
|
|
self.db._dumps() |
|
|
|
self.log.info(f"Added to the database: { room }") |
|
|
|
|
|
|
|
if not os.path.exists(room_path): |
|
|
|
os.mkdir(room_path) |
|
|
|
stylesheet_path = os.path.join( |
|
|
|
"stylesheets", self.db[room]["stylesheet"] + ".css" |
|
|
|
) |
|
|
|
stylesheet_path = os.path.join("stylesheets", self.db[room]["stylesheet"] + ".css") |
|
|
|
stylesheet_dest_path = os.path.join(room_path, "stylesheet.css") |
|
|
|
shutil.copy(stylesheet_path, stylesheet_dest_path) |
|
|
|
self.log.info(f"Created a folder for: { room }") |
|
|
|