优化AI触发条件,确保只有对方发送的文字消息才会触发AI处理,提升消息处理逻辑的准确性。
This commit is contained in:
3
Moncter/weChat.ts
Normal file
3
Moncter/weChat.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
|
||||
@@ -845,9 +845,10 @@ export const useWeChatStore = create<WeChatState>()(
|
||||
currentMessages: [...state.currentMessages, message],
|
||||
}));
|
||||
|
||||
// 只有文字消息才触发AI(msgType === 1)
|
||||
// 只有文字消息才触发AI(msgType === 1),且必须是对方发送的消息(isSend !== true)
|
||||
if (
|
||||
message.msgType === 1 &&
|
||||
!message.isSend &&
|
||||
[1, 2].includes((currentContract as any).aiType || 0)
|
||||
) {
|
||||
console.log("📨 收到新消息,准备触发AI");
|
||||
|
||||
Reference in New Issue
Block a user