diff --git a/src/addon/aikefu/event/KefuCreateConversation.php b/src/addon/aikefu/event/KefuCreateConversation.php index 0cd4b6a47..34b9027cd 100644 --- a/src/addon/aikefu/event/KefuCreateConversation.php +++ b/src/addon/aikefu/event/KefuCreateConversation.php @@ -37,45 +37,4 @@ class KefuCreateConversation ]; } } - - /** - * 处理智能客服获取历史消息事件 - * @param array $data 事件数据 - * @return array - */ - public function handleKefuGetHistory($data) - { - try { - // 创建addon的KefuApi实例 - $kefu_api = new KefuApi(); - - // 调用初始化方法设置属性 - $kefu_api->initializeForEvent($data); - - // 调用addon的getHistory方法 - $response = $kefu_api->getHistory(); - - // 返回响应数据 - return json_decode($response->getContent(), true); - } catch (\Exception $e) { - return [ - 'code' => -1, - 'message' => '获取历史消息失败:' . $e->getMessage(), - 'data' => [] - ]; - } - } - - /** - * 事件监听映射 - * @return array - */ - public function subscribe() - { - return [ - 'KefuChat' => 'handleKefuChat', - 'KefuCreateConversation' => 'handleKefuCreateConversation', - 'KefuGetHistory' => 'handleKefuGetHistory', - ]; - } }