# 首先 你得 安装 itchat 包       命令: pip install itchat pillow


# 代码实现如下:

import itchat,re

from itchat.content import *


@itchat.msg_register([TEXT])

def text_reply(msg):

    # 匹配任何文字和表情,然后自动回复(你好呀,美女)

    match = re.search("(.*)",msg["Text"]).span()

    if match:

        itchat.send(("你好呀,美女"),msg["FromUserName"])


# 匹配 图片,语言,视频,分享,然后自动回复(嘿嘿,嘿嘿)

@itchat.msg_register([PICTURE,RECORDING,VIDEO,SHARING])

def other_reply(msg):

    itchat.send(("嘿嘿,嘿嘿"),msg["FromUserName"])


if __name__ == "__main__":

    itchat.auto_login(enableCmdQR=True,hotReload=True)

    itchat.run()


# 打开微信扫一扫

python实现微信自动回复

相关文章:

  • 2021-12-23
  • 2021-09-30
  • 2021-05-01
猜你喜欢
  • 2022-01-03
  • 2021-11-30
  • 2021-10-16
  • 2021-05-30
  • 2021-05-30
  • 2021-05-02
相关资源
相似解决方案