7行python代码实现微信聊天自动回复

7行python代码实现微信聊天自动回复

需要安装wxpy模块
安装方法:pip install wxpy

根据需要可自己注册图灵机器人,获取api_key
下面的代码可以直接使用。

可以将程序代码打包成exe(pyinstaller 文件名.py -F)存放在电脑中,方便使用。

代码

from wxpy import *
bot = Bot(cache_path=True)
tuling = Tuling(api_key='4a0488cdce684468b95591a641f0971d')
@bot.register()
def auto_reply(msg):
    tuling.do_reply(msg)
embed()

猜你喜欢

转载自blog.csdn.net/qq_41251963/article/details/82219440
今日推荐