基于Python开发的微信图灵机器人

#!/usr/bin/env python3
# coding: utf-8
from wxpy import *

# 微信登陆

bot = Bot(console_qr=2,cache_path=True)

# 定位群
company_group = bot.groups().search('test')[0]

# 定位测试人
boss = company_group.search('WR')[0]

# 初始化图灵机器人 (API key 申请: http://tuling123.com)

tuling = Tuling(api_key='************************')

# 自动回复所有文字消息

@bot.register(company_group,msg_types=TEXT)

def auto_reply_all(msg):
    
    tuling.do_reply(msg)

# 开始运行 #join 保证程序运行不退出. 

bot.join()         

测试:微信test群中@WR发信息.WR自动回复.

猜你喜欢

转载自blog.csdn.net/weixin_38098312/article/details/80345308