重写开箱更新箱子,允许更新目前所有箱子的皮肤

This commit is contained in:
HibiKier
2023-03-01 22:54:03 +08:00
parent 6d7e79e9de
commit 83c3f44ae7
9 changed files with 420 additions and 628 deletions
+11 -2
View File
@@ -53,11 +53,20 @@ async def init():
except Exception as e:
raise Exception(f"数据库连接错误.... {type(e)}: {e}")
if SCRIPT_METHOD:
logger.debug(f"即将运行SCRIPT_METHOD方法, 合计 <u><y>{len(SCRIPT_METHOD)}</y></u> 个...")
sql_list = []
for module, func in SCRIPT_METHOD:
try:
await func()
if sql := await func():
sql_list += sql
except Exception as e:
logger.debug(f"{module} 执行SQL", e=e)
logger.debug(f"{module} 执行SCRIPT_METHOD方法出错...", e=e)
for sql in sql_list:
logger.debug(f"执行SQL: {sql}")
try:
await TestSQL.raw(sql)
except Exception as e:
logger.debug(f"执行SQL: {sql} 错误...", e=e)
async def disconnect():
+2
View File
@@ -112,6 +112,8 @@ class logger:
e: Optional[Exception] = None,
):
template = cls.__parser_template(info, command, user_id, group_id, target)
if e:
template += f" || 错误 <r>{type(e)}: {e}</r>"
logger_.opt(colors=True).debug(template)
@classmethod