


1 The steps to register a WeChat business account are omitted. Very simple.
Select the application center below, Enterprise Assistant, and select callback mode.
Choose to randomly generate token AESKEY. Address Enter your server address.
Select Settings, create a new management group, and then you can see the COPID and Secret
Change the above 4 Parameters are written to the file below.
python3 -m pip install itchatmp ###python3安装模块 具体可百度itchatmp官方文档 vim main.py import itchatmp from itchatmp.content import TEXT itchatmp.update_config(itchatmp.WechatConfig( token='xxxxxxxxxxxx', copId = 'xxxxxxxxxxxxx', appSecret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', encryptMode=itchatmp.content.SAFE, encodingAesKey='xxxxxxxxxxxxxxxxxxxxxxxxxxxx',)) i='何全' @itchatmp.msg_register(itchatmp.content.TEXT) def text_reply(msg): if msg['Content'] == i : msg['Content'] = '姓名:{}'.format(i) return msg['Content'] else: print(23333) itchatmp.run()
python main.py ##运行测试了。。。。
修改端口号:itchatmp.run(port=8888) 记得修改防火墙,这里我就被坑了。 微信回调模式支持 x.x.x.x:8888 iptable -A INPUT -p tcp -m tcp --dport 8888 -j ACCEPT
Result:
When a WeChat enterprise account is received, the reply He Quan is returned Name: He Quan
The above is the detailed content of WeChat enterprise account development: Turn on callback mode/Python judgment information-reply to specified content sample code. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.