1
This commit is contained in:
@@ -189,16 +189,30 @@ class ChatHandler extends BaseHandler {
|
||||
|
||||
await this._saveChatMessagesToDb(parsed, friend, sn_code, platform_type);
|
||||
|
||||
const decision = await chatManager.getReplyContentFromDetail(parsed || {});
|
||||
const decision = await chatManager.getReplyContentFromDetail(parsed || {}, {
|
||||
sn_code,
|
||||
platform: platform_type,
|
||||
friendId: friend_id,
|
||||
encryptFriendId: friend.encryptFriendId || ''
|
||||
});
|
||||
|
||||
if (decision.replied && decision.reply_content) {
|
||||
if (decision.replied) {
|
||||
const action = decision.action || 'text';
|
||||
const content = decision.reply_content || '';
|
||||
const actionMessages = {
|
||||
send_resume: [{ type: 'send_resume', content }],
|
||||
exchange_wechat: [{ type: 'exchange_wechat', content }],
|
||||
exchange_phone: [{ type: 'exchange_phone', content }]
|
||||
};
|
||||
const messages = actionMessages[action] || [{ type: 'text', content }];
|
||||
const actionNames = { send_resume: '发送简历', exchange_wechat: '换微信', exchange_phone: '换电话' };
|
||||
const send_command = {
|
||||
command_type: 'send_chat_message',
|
||||
command_name: '发送聊天消息',
|
||||
command_name: actionNames[action] || '发送聊天消息',
|
||||
command_params: {
|
||||
platform: platform_type,
|
||||
friendId: friend_id,
|
||||
messages: [{ type: 'text', content: decision.reply_content }],
|
||||
messages,
|
||||
chatType: 'reply'
|
||||
},
|
||||
priority: config.getTaskPriority('auto_chat') || 6
|
||||
|
||||
Reference in New Issue
Block a user