- 源码分类:游戏源码
- 发布日期:2020-01-24 08:31
- 展示次数:4349
- 下载次数:1
- 收藏次数:7
- 分享人员:企业网站模板素材
给自己的微信连接图灵机器人,完成很有意思的自动回复和互动#coding=UTF8 import requests import itchat
KEY = 'd2d6c527ea374504bfc88edf7e0a1d21' def get_response(msg):
apiURL = 'http://www.tuling123.com/openapi/api' data = { 'key' : KEY, 'info' : msg, 'userid' : 'wechat-robot',
} try:
r = requests.post(apiUrl, data=data).json() return r.get('text') except: return @itchat.msg_register(itchat.content.TEXT) def tuling_reply(msg):
DEFAULTReply = 'I received: ' msg['Text']
reply = get_response(msg['Text']) return reply or defaultReply
itchat.auto_login(hotReload=True)
itchat.run()
评论
来源:python 连接微信和图灵机器人,完成自动智能回复
素材牛牛网所有素材均为本站用户上传,仅供学习与参考,请勿用于商业用途,如有侵犯您的版权请联系客服服务QQ
本站提供各类程序源码素材。
如果对本站有任何意见请点击右侧侧边栏的反馈意见,我们会及时处理。