1、效果
2、代码(本项目需要微信可以登录微信网页版)
场景:公司群,朋友群,消息太多,但是只想知道领导发的消息,就可以利用wxpy和微信实现消息群同步。让重要消息不再错漏。
1、能登录网页版微信的账号
2、相关环境
pip install 模块名
#coding=utf8
from wxpy import *
import schedule
import time
import http
import json
import datetime
import random
import os
import ctypes
bot = Bot(cache_path=True,console_qr = 2)
myself = bot.self
bot.enable_puid('wxpy_puid.pkl')
sync = ensure_one(bot.groups().search('同步'))
lie = ensure_one(sync.search('Lie'))
Goodog = ensure_one(sync.search('Goodog'))
# 群消息同步
@bot.register(sync)
def sync(msg):
if msg.member == Goodog:
msg.forward(lie, prefix='群消息同步:'+'\n')
while True:
schedule.run_pending()
time.sleep(1)