mirror of
https://github.com/smallevilbeast/ntchat.git
synced 2026-07-02 03:16:21 +08:00
修复在回调中调用同步接口返回None的问题
This commit is contained in:
@@ -22,7 +22,11 @@ def on_recv_text_msg(wechat_instance: ntchat.WeChat, message):
|
||||
scene = dom.documentElement.getAttribute("scene")
|
||||
|
||||
# 自动同意好友申请
|
||||
wechat_instance.accept_friend_request(encryptusername, ticket, int(scene))
|
||||
ret = wechat_instance.accept_friend_request(encryptusername, ticket, int(scene))
|
||||
|
||||
if ret:
|
||||
# 通过后向他发条消息
|
||||
wechat_instance.send_text(to_wxid=ret["userName"], content="你好!!!!!")
|
||||
|
||||
|
||||
# 以下是为了让程序不结束,如果有用于PyQt等有主循环消息的框架,可以去除下面代码
|
||||
|
||||
Reference in New Issue
Block a user