若智问题
This commit is contained in:
+11
@@ -27,8 +27,19 @@ def startup():
|
|||||||
rlib.set_log_level(logger._core.extra.get("nonebot_log_level", "INFO"))
|
rlib.set_log_level(logger._core.extra.get("nonebot_log_level", "INFO"))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"设置日志等级失败: {e}")
|
logger.error(f"设置日志等级失败: {e}")
|
||||||
|
|
||||||
|
|
||||||
|
flag = False
|
||||||
|
|
||||||
|
|
||||||
|
@driver.on_bot_connect
|
||||||
|
def _():
|
||||||
|
global flag
|
||||||
|
if flag:
|
||||||
|
return
|
||||||
rlib.boot(str(Path.cwd()), "nonebot_plugin_sekai_update_notify", pconfig.assets_studio_path)
|
rlib.boot(str(Path.cwd()), "nonebot_plugin_sekai_update_notify", pconfig.assets_studio_path)
|
||||||
scheduler.add_job(sync, "interval", seconds=10, id="sekai_update_sync", replace_existing=True)
|
scheduler.add_job(sync, "interval", seconds=10, id="sekai_update_sync", replace_existing=True)
|
||||||
|
flag = True
|
||||||
|
|
||||||
|
|
||||||
@driver.on_shutdown
|
@driver.on_shutdown
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ class FetchResultUnlinkedCards:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# 对应 Rust 中的 FetchResult 枚举
|
|
||||||
FetchResultType = Union[FetchResultEvent, FetchResultUnlinkedCards]
|
FetchResultType = Union[FetchResultEvent, FetchResultUnlinkedCards]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ async def sync():
|
|||||||
return
|
return
|
||||||
for component in data:
|
for component in data:
|
||||||
message = Message()
|
message = Message()
|
||||||
if component is FetchResultEvent:
|
if isinstance(component, FetchResultEvent):
|
||||||
inner = [MessageSegment.text(f"活动 {component.event_id} 更新了!")]
|
inner = [MessageSegment.text(f"活动 {component.event_id} 更新了!")]
|
||||||
else:
|
else:
|
||||||
inner = [MessageSegment.text("发现了新的非活动卡牌!")]
|
inner = [MessageSegment.text("发现了新的非活动卡牌!")]
|
||||||
|
|||||||
Reference in New Issue
Block a user