mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-12-05 15:41:56 +00:00
🔧 fix(apps/ai.js): correct keyword matching to use event message instead of user message
This commit is contained in:
parent
7619b01000
commit
f59dffbf37
@ -180,7 +180,7 @@ async function processMessage(userMessage, e, aiConfig) {
|
||||
* @returns {Promise<[{type: string, data: string}]>}
|
||||
*/
|
||||
async function handleKeywordMode(userMessage, e) {
|
||||
const matchResult = await KeywordMatcher.matchKeywords(userMessage, 'ai');
|
||||
const matchResult = await KeywordMatcher.matchKeywords(e.msg, 'ai');
|
||||
|
||||
if (matchResult && matchResult.matched) {
|
||||
return [
|
||||
@ -214,7 +214,7 @@ async function handleMixMode(userMessage, e, aiConfig) {
|
||||
logger.info('[crystelf-ai] 消息过长,使用ai回复');
|
||||
return await callAiForResponse(userMessage, e, aiConfig);
|
||||
} else {
|
||||
const matchResult = await KeywordMatcher.matchKeywords(userMessage, 'ai');
|
||||
const matchResult = await KeywordMatcher.matchKeywords(e.msg, 'ai');
|
||||
if (matchResult && matchResult.matched) {
|
||||
const session = SessionManager.createOrGetSession(e.group_id, e.user_id, e);
|
||||
const historyLen = aiConfig.chatHistory;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user