def load_config(self, filename: str=None):
"""Load config from a JSON file.
* `filename` - The filename of the JSON file to be loaded. If not specified, the bot will
default to `Bot.config_file`.
"""
if not filename:
filename = self.config_file
with open(filename) as file_object:
config = json.load(file_object)
if isinstance(config, dict):
for key, value in config.items():
self.config[key] = value
评论列表
文章目录