From 006e46f4ef3c79de82e500977924b9ed6ad9b522 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 28 Oct 2025 21:56:49 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20prompt=20=E4=BF=AE=E6=94=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2c277665448978348205470e92225dcac28d95ac. --- bots/instance/open_source_reply_bot.ts | 3 ++- bots/instance/reply_bot.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bots/instance/open_source_reply_bot.ts b/bots/instance/open_source_reply_bot.ts index b57f1d655..e01f5aa0f 100644 --- a/bots/instance/open_source_reply_bot.ts +++ b/bots/instance/open_source_reply_bot.ts @@ -15,7 +15,7 @@ class OpenSourceReplyBot extends BotFather { "Respond in Chinese using well-structured Markdown sections such as 标题、列表、代码块等,让回复清晰易读。", "保持语气专业、耐心、详尽,绝不使用表情符号或颜文字,也不要卖萌。", "优先解答与项目代码、贡献流程、架构设计或排错相关的问题;", - "在需要时引用 README.md 与 CONTRIBUTING.md 中的要点(避免强行引用,仅在必要时引用),帮助用户快速定位文档位置。", + "在需要时引用 README.md 与 CONTRIBUTING.md 中的要点,帮助用户快速定位文档位置。", knowledgeBase, ].filter(Boolean); } @@ -29,6 +29,7 @@ class OpenSourceReplyBot extends BotFather { 若与主题无关则礼貌说明并跳过; 4)回复时引用 README 或 CONTRIBUTING 中的要点(如适用),并优先给出可执行的排查步骤或代码建议; 5)回复评论使用 reply_to_comment,回复帖子使用 reply_to_post; +6)若某通知最后一条已由本 bot 回复,则跳过避免重复; 7)整理已处理通知 ID 调用 mark_notifications_read; 8)结束时输出包含处理条目概览(URL或ID)的总结。`.trim(); } diff --git a/bots/instance/reply_bot.ts b/bots/instance/reply_bot.ts index e171d05fa..cf18dc6c5 100644 --- a/bots/instance/reply_bot.ts +++ b/bots/instance/reply_bot.ts @@ -21,6 +21,7 @@ class ReplyBot extends BotFather { 1)调用 list_unread_messages; 2)依次处理每条“提及/评论”:如需上下文则使用 get_post 获取,生成简明中文回复;如有 commentId 则用 reply_to_comment,否则用 reply_to_post; 3)跳过关注和系统事件; + 4)保证幂等性:如该贴最后一条是你自己发的回复,则跳过; 5)调用 mark_notifications_read,传入本次已处理的通知 ID 清理已读; 6)最多只处理最新10条;结束时仅输出简要摘要(包含URL或ID)。 `.trim();