itchat API接口函数 参照: 在安装python3.x的路径下:我这边python3.7 安装在C盘:
如:C:\Users\Administrator\AppData\Local\Programs\Python\Python37\Lib\site-packages\itchat\ 目录下的 core.py文件;
Itchat是用python对微信API的封装:
1.支持发送消息、图片、视频、地图、名片、文件等
#该发送消息的函数需要两个参数,消息的内容与接受者的UserName,即标识符
微信消息发送:itchat.send('Message Content', 'toUserName')
2.支持热登陆,不用每次登陆都要扫描二维码
itchat.auto_login(hotReload=True)
3.支持上传中文文件
1:消息自动回复
#coding=utf-8
import itchat
from itchat.content import *
@itchat.msg_register([PICTURE,TEXT])
def simple_reply(msg):
if msg['Type'] == TEXT:
ReplyContent = 'I received message: '+msg['Content']
if msg['Type'] == PICTURE:
ReplyContent = 'I received picture: '+msg['FileName']
itchat.send_msg('nice to meet you',msg['FromUserName