Try to fill out entire dictionary contents
Covers edge cases where the state is improperly setup.
This commit is contained in:
parent
d5cb732aaf
commit
0a3ed438af
@ -138,9 +138,11 @@ class Logbot(Bot):
|
|||||||
|
|
||||||
if room not in self.db.keys():
|
if room not in self.db.keys():
|
||||||
self.db[room] = {}
|
self.db[room] = {}
|
||||||
|
if "messages" not in self.db[room]:
|
||||||
self.db[room]["messages"] = {}
|
self.db[room]["messages"] = {}
|
||||||
|
if "title" not in self.db[room]:
|
||||||
self.db[room]["title"] = room
|
self.db[room]["title"] = room
|
||||||
self.log.info(f"Added to the database: { room }")
|
self.log.info(f"Added to the database: { room }")
|
||||||
|
|
||||||
if not os.path.exists(room_path):
|
if not os.path.exists(room_path):
|
||||||
os.mkdir(room_path)
|
os.mkdir(room_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user