加入功能,自动撤回,将异常信息发送后,5秒撤回

This commit is contained in:
liuwei
2025-04-30 17:43:28 +08:00
parent 4321b2a1e5
commit 135d0292de
8 changed files with 181 additions and 11 deletions

View File

@@ -93,12 +93,12 @@ class MessageMixin(WechatAPIClientBase):
"NewMsgId": new_msg_id}
response = await session.post(f'http://{self.ip}:{self.port}/api/Msg/Revoke', json=json_param)
json_resp = await response.json()
if json_resp.get("Success"):
self.logging.info("消息撤回成功: 对方wxid:{} ClientMsgId:{} CreateTime:{} NewMsgId:{}",
wxid,
client_msg_id,
new_msg_id)
create_time,
new_msg_id) # 确保四个参数都正确传入
return True
else:
self.error_handler(json_resp)
@@ -144,8 +144,7 @@ class MessageMixin(WechatAPIClientBase):
if json_resp.get("Success"):
self.logging.info("发送文字消息: 对方wxid:{} at:{} 内容:{}", wxid, at, content)
data = json_resp.get("Data")
self.logging.info("send msg:{} ", data)
return data.get("List")[0].get("ClientMsgid"), data.get("List")[0].get("Createtime"), data.get("List")[
return data.get("List")[0].get("ClientMsgId"), data.get("List")[0].get("CreateTime"), data.get("List")[
0].get("NewMsgId")
else:
self.error_handler(json_resp)