Skip to content

Commit 7daff02

Browse files
committed
feat: send startup notification to internal group on bot launch
1 parent cfe1798 commit 7daff02

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,15 @@ async def main():
419419
log.info("程序启动, WS_URL=%s, 通知群=%d, 白名单=%s", WS_URL, INTERNAL_GROUP_ID, WHITELIST)
420420
log.info("里程碑阈值(分钟): %s", MILESTONES)
421421

422+
try:
423+
await client.send_group_msg(
424+
group_id=str(INTERNAL_GROUP_ID),
425+
message="🤖 客服机器人已启动,开始监听消息。",
426+
)
427+
log.info("启动通知已发送至群 %d", INTERNAL_GROUP_ID)
428+
except Exception as e:
429+
log.error("发送启动通知失败: %s", e, exc_info=True)
430+
422431
# 启动定时巡检后台任务
423432
asyncio.create_task(monitor_loop())
424433

0 commit comments

Comments
 (0)