This article mainly introduces several methods for PIGCMS to disable chatbots, which are very practical and recommended to you. Example of brainless operations
1. Find the WeixinAction. class. php file. Path: Your version \ PigCms \ Lib \ Action \ Home
2. query the function chat and modify the return value in the chat () function.
The Code is as follows:
Return 'str _ replace ('highsea', 'Hi', $ str) '; // example
Is as follows:
Return ', please wait for the customer service to reply ~ ';
3. (optional) comment out the "Yellow Chicken" section (either not commented or ):
The Code is as follows:
/* Yellow Chicken */
/* $ Str = 'HTTP: // 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 ('prompt: ', $ this-> my. 'remind you: ', str_replace (' {br} ', "\ n", $ json ['content']); */
• Conclusion: this operation will not affect the reply of other keywords of the public account. It will only reply directly to questions that cannot be answered (originally a request for xiaohuang chicken): "dear, please wait for the customer service reply ~"; If you need to modify the source code of other operations
• If optimized, you can:
Configure a uniform answer (or request your own interface server). When a visitor replies, such as a "Yellow Chicken", the system then requests the interface of the chicken ...... The source code is not used as an example ~
I hope this article will help you learn how to disable chatbots in PIGCMS.