Skip to content

Commit

Permalink
Update messages.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chase535 authored Aug 18, 2022
1 parent cdb2ab4 commit 64f251b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions WeChatPush/itchat/async_components/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ def produce_msg(core, msgList):
# by default we think there may be a user missing not a mp
m['User'].core = core
msg = {'ChatRoom': '0', 'NotifyCloseContact': '0'}
if m.get('FromUserName') == 'weixin':
if str(m.get('FromUserName')) == 'weixin':
msg['Name'] = msg['NickName'] = '微信团队'
elif m.get('MsgType') == 37:
msg['Name'] = msg['NickName'] = m.get('RecommendInfo').get('NickName')
elif '@@' in str(m.get('FromUserName')) or '@@' in str(m.get('ToUserName')):
msg['ChatRoom'] = '1'
msg['NickName'] = msg['ChatRoomName'] = m.get('User').get('NickName')
Expand All @@ -100,6 +98,7 @@ def produce_msg(core, msgList):
elif m.get('MsgType') == 34: # voice
msg['Type'] = 'Recording'
elif m.get('MsgType') == 37: # friends
msg['Name'] = msg['NickName'] = m.get('RecommendInfo').get('NickName')
msg['Type'] = 'Friends'
elif m.get('MsgType') == 42: # name card
msg['Type'] = 'Card'
Expand Down

0 comments on commit 64f251b

Please sign in to comment.