Skip to content
New issue

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

revoke()方法在人数多的群聊中撤回消息太慢 #1015

Open
005Lacia opened this issue May 17, 2024 · 0 comments
Open

revoke()方法在人数多的群聊中撤回消息太慢 #1015

005Lacia opened this issue May 17, 2024 · 0 comments

Comments

@005Lacia
Copy link

005Lacia commented May 17, 2024

您的itchat版本为:1.5.0.dev

其他的内容或者问题更详细的描述都可以添加在下面:

在人数较多的群聊(300人左右)中撤回消息非常慢,长达6~8秒,而在个位人数的群聊中撤回消息只需要1秒左右。

python代码:
`# 事件消息
@itchat.msg_register(NOTE, isGroupChat=True)
def note(msg):

def revoke_msg():
    revoke_id = revoke_dict[cx_id]
    itchat.revoke(msgId=revoke_id, toUserName=msg.user.userName)  # 撤回查询映射的消息
    revoke_dict.pop(cx_id, None)

content = msg.Content
revoke_sign = re.search('<!\[CDATA\[(.*?)]]>', content)
if revoke_sign:
    if revoke_sign[1][-7:] == '撤回了一条消息':  # 撤回消息事件
        cx_id_sign = re.search('<msgid>(.*?)</msgid>', content)
        if cx_id_sign:
            cx_id = cx_id_sign[1]
            if cx_id in revoke_dict:
                Thread(target=revoke_msg).start()`
@005Lacia 005Lacia changed the title revoke()方法在撤回消息太慢 revoke()方法在人数多的群聊中撤回消息太慢 May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant