why2lyj/ItChat-UOS

无法自动添加好友

jinde98 opened this issue · 0 comments

用的代码是

@itchat.msg_register(FRIENDS)
def add_friend(msg):
print(msg)
msg.user.verify()
msg.user.send('很高兴认识你')
出错提示如下:
File "/home/jd/.local/lib/python3.10/site-packages/itchat/components/register.py", line 60, in configured_reply
r = replyFn(msg)
File "/home/jd/wechat/wechatbot.py", line 57, in add_friend
msg.user.verify()
File "/home/jd/.local/lib/python3.10/site-packages/itchat/storage/templates.py", line 158, in verify
return self.core.add_friend(**self.verifyDict)
AttributeError: 'Core' object has no attribute 'add_friend'. Did you mean: 'get_friends'?
说没有add_friend 这个属性