Pigcms How to close a chat bot _php instance

Source: Internet
Author: User
No brain Operation Example

1. Locate the WeixinAction.class.php file, path: your version \pigcms\lib\action\home

2, Query function chat, in the chat () function to modify the return value

Copy the Code code as follows:
Return ' Str_replace ' (' Highsea ', ' Hi ', $str) ';//For instance

For, as follows:
Return ' Pro, please wait for hospitality service reply ~ ';

3, (optional) The last comment off the "Small Yellow Chicken" section (can not comment or can):

Copy the Code code as follows:
/* Small 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 (' Hint: ', $this->my. ' Remind you: ', Str_replace (' {br} ', ' \ n ', $json [' content '])); * *

• Summary: This operation will not affect the public number of other key words of the reply, only to answer the question (originally request small yellow chicken) now directly reply: "Pro, please wait for hospitality service reply ~"; If you need to modify other operating source code

• If you optimize it, you can:

Configure an answer (or request your own interface server) first, when the visitor replies, such as "small yellow chicken" and then request the interface of the small yellow chicken ... Source code is not an example of ~

Small partners Learn how to shut down the chat robot in the pigcms, hope this article can be helpful to everyone.

  • 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.