PigCMS 微信公眾號模組預設整合「小黃雞」聊天機器人,當關鍵字無匹配回覆時自動請求第三方 API。若需關閉此功能或改為自訂預設回覆(如「請等待客服」),可直接修改原始碼。
版本目錄/PigCms/Lib/Action/Home/WeixinAction.class.php
chat() 方法搜尋 function chat,在方法內找到回覆邏輯。
// 原始碼可能類似: // return 'str_replace(\'highsea\', \'hi\', $str)'; // 範例 // 修改為自訂文字: return '親,請等待客服回復~';
/* 小黃雞 API 呼叫
$str = 'https://api.bd001.com/iMicms_com/api.php?key=free&appid=0&msg=' . urlencode($name);
$json = Http::fsockopenDownload($str);
if ($json === false) {
$json = file_get_contents($str);
}
$json = json_decode($json, true);
$str = str_replace('HighSea', $this->my, str_replace('提示:', $this->my . '提醒您:', str_replace('{br}', "\n", $json['content'])));
// */
此修改**僅影響無匹配關鍵字時的預設回覆**,不影響:
簡單修改即可關閉第三方聊天機器人,提升品牌形象與使用者體驗。