How does PIGCMS disable chatbot _ php instances?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.