We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows
python 3.9
Latest Release
channel
wx(个人微信, itchat)
No response
想找到自动同意好友的功能
<此处粘贴终端日志>
The text was updated successfully, but these errors were encountered:
@itchat.msg_register(FRIENDS) def add_friend(msg): if msg['RecommendInfo']['Content'] == conf().get("auto_accept_friend_request"): username = msg['RecommendInfo']['UserName'] v4 = msg['RecommendInfo']['Ticket']
# 检查是否已经发送过欢迎消息 if username in WechatChannel().welcomed_friends: logger.debug(f"已经发送过欢迎消息给用户: {username}") return # 接受好友请求 itchat.instance.accept_friend(username, v4) time.sleep(1) # 获取新好友的信息 new_friend = itchat.instance.search_friends(userName=username) if new_friend: # 发送欢迎消息 welcome_text = conf().get("usage_instructions", "您好!我是您的AI助手,请问有什么可以帮您?") itchat.instance.send(welcome_text, toUserName=new_friend['UserName']) logger.info(f"发送欢迎消息给新好友: {new_friend['NickName']}") # 记录并保存已发送欢迎消息的好友 WechatChannel().welcomed_friends.add(username) WechatChannel()._save_welcomed_friends()
再wechat_channel.py中添加msg['RecommendInfo']['Content'] == conf().get("auto_accept_friend_request") 这一行可以去掉,因为我是设置了固定好友申请的内容才会自动添加好友
Sorry, something went wrong.
不建议重启了,现在itchat好像不能用了
对,能运行一旦重启就不能用了
No branches or pull requests
前置确认
操作系统类型?
Windows
运行的python版本是?
python 3.9
使用的chatgpt-on-wechat版本是?
Latest Release
运行的
channel
类型是?wx(个人微信, itchat)
复现步骤 🕹
No response
问题描述 😯
想找到自动同意好友的功能
终端日志 📒
The text was updated successfully, but these errors were encountered: