ruff,修config

pull/15/head
UnCLAS-Prommer 2025-04-13 14:32:50 +08:00
parent 224c3029b4
commit a2ffb6fa8b
4 changed files with 5 additions and 10 deletions

View File

@ -23,12 +23,7 @@ class Config:
self.config_path = os.path.join(self.root_path, "config.toml")
def load_config(self):
include_configs = [
"Nickname",
"Napcat_Server",
"MaiBot_Server",
"Debug"
]
include_configs = ["Nickname", "Napcat_Server", "MaiBot_Server", "Debug"]
if os.path.exists(self.config_path):
with open(self.config_path, "rb") as f:
try:
@ -50,7 +45,7 @@ class Config:
self.napcat_heartbeat_interval = raw_config["Napcat_Server"].get("heartbeat", 30)
self.mai_host = raw_config["MaiBot_Server"].get("host", "localhost")
self.mai_port = raw_config["MaiBot_Server"].get("port", 8000)
self.debug_level = raw_config["Debug"].get("debug_level", "INFO")
self.debug_level = raw_config["Debug"].get("level", "INFO")
else:
logger.error("配置文件不存在!")
logger.info("正在创建配置文件...")

View File

@ -381,7 +381,6 @@ class RecvHandler:
else:
return Seg(type="text", data=f"回复{sender_nickname}的消息,说:")
async def handle_notice(self, raw_message: dict) -> None:
notice_type = raw_message.get("notice_type")
# message_time: int = raw_message.get("time")

View File

@ -127,6 +127,7 @@ async def get_stranger_info(websocket: Server.ServerConnection, user_id: int) ->
logger.debug(response)
return response.get("data")
async def get_message_detail(websocket: Server.ServerConnection, message_id: str) -> dict:
"""
获取消息详情