From dfa97c9d24b8124ca38ec5eb605cde932cd6ea78 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Tue, 2 May 2023 23:30:19 +0800 Subject: --- hydroroll/bot.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'hydroroll/bot.py') diff --git a/hydroroll/bot.py b/hydroroll/bot.py index c2b99e6..cbfc07f 100644 --- a/hydroroll/bot.py +++ b/hydroroll/bot.py @@ -2,13 +2,10 @@ from iamai import Bot as _Bot from typing import Optional, Dict, List, Type, Any, Union from pathlib import Path import os -# 获取当前目录路径 -current_dir = Path.cwd() +from hydroroll.config import GlobalConfig -# 获取当前脚本文件路径 +current_dir = Path.cwd() script_file = current_dir.resolve() / __file__ - -# 获取当前脚本文件所在目录路径 script_dir = script_file.parent __all__ = ["Bot"] @@ -26,10 +23,7 @@ class Bot: config_dict=config_dict ) self.bot.load_plugins_from_dirs(Path(f"{script_dir}/plugins")) - self.create_folders() - self.init_data() - self.init_conf() - self.init_webui() + self.create_folder_structure(GlobalConfig._folder_dict) def run(self) -> None: self.bot.run() @@ -53,12 +47,4 @@ class Bot: os.mkdir(os.path.join(folder_path, 'logs')) if not os.path.isdir(os.path.join(folder_path, 'rules')): os.mkdir(os.path.join(folder_path, 'rules')) - - def init_data(self): - ... - - def init_webui(self): - ... - - def init_conf(self): - ... \ No newline at end of file + -- cgit v1.2.3-70-g09d2