其他 type nic post odin 微信 mes 消息 def
http://blog.csdn.net/mdpsdhr/article/details/61195817
- #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'])
- itchat.auto_login()
- itchat.run()
- itchat.send_msg('nice to meet you', msg['FromUserName'])里面的
- msg['FromUserName']替换成要发送到人的UserName
- #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'])
- itchat.auto_login(hotReload=True)
- #itchat.run()
- friends_info = itchat.get_friends(update=True)
- for i in friends_info:
- print(i) #打印每个好友的信息
- itchat.send_msg('nice to meet you','******')
来源: http://www.bubuko.com/infodetail-2453614.html