def save_config(self, filename: str=None):
"""Save config to a JSON file.
* `filename` - The filename of the JSON file to be saved to. If not specified, the bot will
default to `Bot.config_file`.
"""
if not filename:
filename = self.config_file
with open(filename, "w") as file_object:
json.dump(self.config, file_object, indent=4, sort_keys=True)
评论列表
文章目录