aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/hydroroll/bot.py
diff options
context:
space:
mode:
author简律纯 <hsiangnianian@outlook.com>2023-05-02 23:30:19 +0800
committer简律纯 <hsiangnianian@outlook.com>2023-05-02 23:30:19 +0800
commitdfa97c9d24b8124ca38ec5eb605cde932cd6ea78 (patch)
tree470a8bfd1960964b8c9724c19de876cf52cf60c3 /hydroroll/bot.py
parent45c49007ee01143ad26899751b856658321cd3ae (diff)
downloadHydroRoll-dfa97c9d24b8124ca38ec5eb605cde932cd6ea78.tar.gz
HydroRoll-dfa97c9d24b8124ca38ec5eb605cde932cd6ea78.zip
Diffstat (limited to 'hydroroll/bot.py')
-rw-r--r--hydroroll/bot.py22
1 files changed, 4 insertions, 18 deletions
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
+