mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-05 03:39:59 +08:00
重写开箱更新箱子,允许更新目前所有箱子的皮肤
This commit is contained in:
+11
-2
@@ -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():
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user