wechaty / python-wechaty

Python Wechaty is a Conversational RPA SDK for Chatbot Makers written in Python
https://wechaty.readthedocs.io/zh_CN/latest/
Apache License 2.0
1.55k stars 229 forks source link

🐛🐛 Bug Report: 关于contact.is_friend()返回是否是机器人好友的结果 #328

Open xin0501 opened 2 years ago

xin0501 commented 2 years ago

requirements

Describe your problem

使用contact.is_friend(),提取Contact.find_all()返回结果中的机器人好友,结果不完全正确。很多是机器人好友的联系人会被检测为不是机器人的好友。

Reproduce your problem

测试代码

contacts = await self.bot.Contact.find_all()
for contact in contacts:
  # await contact.say(text[2:])
  if contact.is_friend():
      await from_contact.say(f"此账号为微信好友:{contact.name}")
  else:
      await from_contact.say(f"此账号不是微信好友:{contact.name}")

Your experiments

很多好友,我已经双向确认过了,确实是机器人的好友,但是实际返回的结果为,此账号不是微信好友。不知道我哪里做的不对。

wj-Mcat commented 2 years ago

The info of contact is fetched from server of puppet servicer, so if there is wrong info, python-wechaty can do nothing but puppet servicer, eg: @padlocal .