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}]>}
|
* @returns {Promise<[{type: string, data: string}]>}
|
||||||
*/
|
*/
|
||||||
async function handleKeywordMode(userMessage, e) {
|
async function handleKeywordMode(userMessage, e) {
|
||||||
const matchResult = await KeywordMatcher.matchKeywords(userMessage, 'ai');
|
const matchResult = await KeywordMatcher.matchKeywords(e.msg, 'ai');
|
||||||
|
|
||||||
if (matchResult && matchResult.matched) {
|
if (matchResult && matchResult.matched) {
|
||||||
return [
|
return [
|
||||||
@ -214,7 +214,7 @@ async function handleMixMode(userMessage, e, aiConfig) {
|
|||||||
logger.info('[crystelf-ai] 消息过长,使用ai回复');
|
logger.info('[crystelf-ai] 消息过长,使用ai回复');
|
||||||
return await callAiForResponse(userMessage, e, aiConfig);
|
return await callAiForResponse(userMessage, e, aiConfig);
|
||||||
} else {
|
} else {
|
||||||
const matchResult = await KeywordMatcher.matchKeywords(userMessage, 'ai');
|
const matchResult = await KeywordMatcher.matchKeywords(e.msg, 'ai');
|
||||||
if (matchResult && matchResult.matched) {
|
if (matchResult && matchResult.matched) {
|
||||||
const session = SessionManager.createOrGetSession(e.group_id, e.user_id, e);
|
const session = SessionManager.createOrGetSession(e.group_id, e.user_id, e);
|
||||||
const historyLen = aiConfig.chatHistory;
|
const historyLen = aiConfig.chatHistory;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user