mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-04 21:06:03 +00:00
refactor: 恢复所有审计API调用
This commit is contained in:
@@ -104,3 +104,20 @@ class AnnouncementManager:
|
||||
|
||||
await self.write_saved(all)
|
||||
return to_show
|
||||
|
||||
async def show_announcements(
|
||||
self
|
||||
):
|
||||
"""显示公告"""
|
||||
try:
|
||||
announcements = await self.fetch_new()
|
||||
for ann in announcements:
|
||||
self.ap.logger.info(f'[公告] {ann.time}: {ann.content}')
|
||||
|
||||
if announcements:
|
||||
|
||||
await self.ap.ctr_mgr.main.post_announcement_showed(
|
||||
ids=[item.id for item in announcements]
|
||||
)
|
||||
except Exception as e:
|
||||
self.ap.logger.warning(f'获取公告时出错: {e}')
|
||||
|
||||
@@ -148,7 +148,7 @@ class VersionManager:
|
||||
with open("current_tag", "w") as f:
|
||||
f.write(current_tag)
|
||||
|
||||
self.ap.ctr_mgr.main.post_update_record(
|
||||
await self.ap.ctr_mgr.main.post_update_record(
|
||||
spent_seconds=int(time.time()-start_time),
|
||||
infer_reason="update",
|
||||
old_version=old_tag,
|
||||
@@ -224,3 +224,13 @@ class VersionManager:
|
||||
|
||||
return 0
|
||||
|
||||
async def show_version_update(
|
||||
self
|
||||
):
|
||||
try:
|
||||
|
||||
if await self.ap.ver_mgr.is_new_version_available():
|
||||
self.ap.logger.info("有新版本可用,请使用 !update 命令更新")
|
||||
|
||||
except Exception as e:
|
||||
self.ap.logger.warning(f"检查版本更新时出错: {e}")
|
||||
|
||||
Reference in New Issue
Block a user