v0.3.2 更改了.env config的逻辑和memory优化

v0.3.2
更改了.env config的逻辑
memory优化
读空气优化
This commit is contained in:
SengokuCola
2025-03-02 15:00:12 +08:00
parent 31659497f0
commit 1cd7f80937
24 changed files with 538 additions and 317 deletions

View File

@@ -11,16 +11,18 @@ from .relationship_manager import relationship_manager
from ..schedule.schedule_generator import bot_schedule
from .willing_manager import willing_manager
# 获取驱动器
driver = get_driver()
config = driver.config
Database.initialize(
host= os.getenv("MONGODB_HOST"),
port= int(os.getenv("MONGODB_PORT")),
db_name= os.getenv("DATABASE_NAME"),
username= os.getenv("MONGODB_USERNAME"),
password= os.getenv("MONGODB_PASSWORD"),
auth_source=os.getenv("MONGODB_AUTH_SOURCE")
host= config.mongodb_host,
port= int(config.mongodb_port),
db_name= config.database_name,
username= config.mongodb_username,
password= config.mongodb_password,
auth_source= config.mongodb_auth_source
)
print("\033[1;32m[初始化数据库完成]\033[0m")
@@ -37,7 +39,7 @@ emoji_manager.initialize()
print(f"\033[1;32m正在唤醒{global_config.BOT_NICKNAME}......\033[0m")
# 创建机器人实例
chat_bot = ChatBot(global_config)
chat_bot = ChatBot()
# 注册消息处理器
group_msg = on_message()
# 创建定时任务