Python 8行代码微信自动聊天

需要先导入wxpy包

会自动跳出二维码,扫码登录

首先要自己去注册一个图灵机器人,网上有教程

from wxpy import *
turing = Tuling(api_key='a2787c27f0a6438b9ac7dd5d55a6dne2')#机器人的ID
bot=Bot()
friend=bot.friends().search('指定聊条人的名字')
@bot.register(chats=friend)
#@bot.register()
def communite(msg):
    resp=turing.do_reply(msg)
embed()

 

posted @ 2019-08-04 16:27  ZhangShuai2007  阅读(843)  评论(0编辑  收藏  举报