#coding=utf-8
import itchat
from itchat.content import TEXT
from itchat.content import *
import sys
import time
import re
import os
msg_information = {}
face_bug=None #针对表情包的内容
@itchat.msg_register([TEXT,PICTURE,FRIENDS,CARD,MAP,SHARING,RECORDING,ATTACHMENT,VIDEO],isFriendChat=True,isGroupChat=True)
def receive_msg(msg):
global face_bug
msg_time_rec = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) #接收消息的时间
if 'ActualNickName' in msg:
from_user = msg['ActualUserName'] #群消息的发送者,用户的唯一标识
msg_from = msg['ActualNickName']#发送者群内的昵称
friends = itchat.get_friends(update=True)#获取所有好友
for f in friends:
if from_user == f['UserName']: #如果群消息是好友发的
if f['RemarkName']: # 优先使用好友的备注名称,没有则使用昵称
msg_from = f['RemarkName']
else:
msg_fr
微信好友、群消息撤回信息重现
最新推荐文章于 2023-05-09 22:48:10 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)