feat: Require messages to start with /ai

Co-authored-by: jxxghp <jxxghp@qq.com>
This commit is contained in:
Cursor Agent
2025-11-23 06:34:31 +00:00
parent 9b5f863832
commit 2b32250504

View File

@@ -943,6 +943,16 @@ class MessageChain(ChainBase):
return
# 提取用户消息
if not text.startswith("/ai"):
self.post_message(Notification(
channel=channel,
source=source,
userid=userid,
username=username,
title="消息格式错误,请以 /ai 开头"
))
return
user_message = text[3:].strip() # 移除 "/ai" 前缀
if not user_message:
self.post_message(Notification(