def load_server(self, server_id) -> bool:
if not os.path.exists("data/{}".format(server_id)):
return False
log.debug("Loading server: {}".format(server_id))
config = yaml.safe_load(open("data/{}/config.yml".format(server_id), "r"))
sections = yaml.safe_load(open("data/{}/sections.yml".format(server_id), "r"))
if os.path.exists("data/{}/notes.yml".format(server_id)):
notes = yaml.safe_load(open("data/{}/notes.yml".format(server_id), "r"))
else:
notes = DEFAULT_NOTES
if "notes_channel" not in config:
config["notes_channel"] = None
self.data[server_id] = {
"config": config,
"sections": self.load_sections(sections)
}
self.notes[server_id] = notes
return True
评论列表
文章目录