4
头图

What is WeChat?

WeChaty is an open source personal WeChat API project on Github, which provides programs such as Python, PHP, NodeJs, etc., so that we can use the API to operate personal WeChat: https://github.com/wechaty/wechaty

Currently WeChat has a variety of channels to achieve

image.png

Before this, the famous itChat and wxpy let us call the web version of WeChat interface to operate WeChat. Now the web version of WeChat is basically impossible to log in, so the developers developed WeChat, WeChat is a modern conversational RPA SDK, suitable for For chatbot development, you can create a WeChat bot with just a few lines of code.

How to use WeChat?

This article introduces using Python to log in to your personal WeChat using WeChat. The official source code is implemented using the iPad protocol, source code download: https://github.com/wechaty/python-wechaty-getting-started

# 第一步,下载源码
# 第二步,cd到源码的目录
cd python-wechaty-getting-started

# 第三步,安装
pip install -r requirements.txt

# 第四步,配置服务和TOKEN
Linux和Mac Os命令
export WECHATY_PUPPET=wechaty-puppet-service
export WECHATY_PUPPET_SERVICE_TOKEN=你申请的TOKEN

Windows命令
set WECHATY_PUPPET=wechaty-puppet-service
set WECHATY_PUPPET_SERVICE_TOKEN=你申请的TOKEN

# 第五步,启动微信机器人
cd到examples目录
cd examples

执行ding-dong-bot.py
python ding-dong-bot.py

login successful

For the above questions, you can consult WeChat to find me for research: sansure2016 (this article is published on multiple platforms, add me to remember which platform you added it on)


TANKING
4.8k 声望509 粉丝

热爱分享,热爱创作,热爱研究。