python-wechaty
python-wechaty copied to clipboard
🐛🐛 Bug Report: 添加好友没有响应
Describe your problem
A clear and concise description of what the bug is.
Reproduce your problem
async def addFriend(self):
try:
self.keyword=str(int(self.keyword))
print(f'debug1 查找手机号: {[self.keyword]}')
wx_contact=await self.Friendship.search(phone=self.keyword)
print(f'debug2 查找手机号: {[self.keyword]}')
except ValueError:
print(f'debug3 查找微信号: {[self.keyword]}')
wx_contact=await self.Friendship.search(weixin=self.keyword)
print(f'debug4 查找微信号: {[self.keyword]}')
if wx_contact:
# await self.Friendship.add(wx_contact)
await self.Friendship.add(wx_contact,'hello')
return '好友请求发送成功'
else:
return '好友请求发送失败'
Error info
-
2021-08-10 14:33:51,968 - Wechaty - INFO - receive message <Message#message_type_text[🗣 Contact <@d e5e0e1b1aa66d7c189b249e5f1a9a36005ca2ab7c106a04a49d0a77505b7429> <大有> 添加好友 jw775280097> debug3 查找微信号: ['jw775280097'] 2021-08-10 14:33:51,972 - FriendShip - INFO - search() <<class 'abc.Friendship'>, jw775280097, None> 2021-08-10 14:33:51,986 - Wechaty - ERROR - internal error <>
-
2021-08-10 14:34:15,886 - Wechaty - INFO - receive message <Message#message_type_text[🗣 Contact <@d e5e0e1b1aa66d7c189b249e5f1a9a36005ca2ab7c106a04a49d0a77505b7429> <大有> 添加好友 18086528526> debug1 查找手机号: ['18086528526'] 2021-08-10 14:34:15,893 - FriendShip - INFO - search() <<class 'abc.Friendship'>, None, 18086528526> 2021-08-10 14:34:15,906 - Wechaty - ERROR - internal error <>
-
screen shot image
Additional context
日志里没有打印出 debug2或debug4 这句,似乎没有执行到那里 哪里写的不对吗?