This commit is contained in:
手瓜一十雪 2024-09-02 16:31:18 +08:00
parent a5ce424a40
commit 7d91e05a69

View File

@ -28,18 +28,14 @@ class DeleteMsg extends BaseAction<Payload, void> {
const ret = this.core.eventWrapper.registerListen( const ret = this.core.eventWrapper.registerListen(
'NodeIKernelMsgListener/onMsgInfoListUpdate', 'NodeIKernelMsgListener/onMsgInfoListUpdate',
1, 1,
5000, 1000,
(msgs) => !!msgs.find(m => m.msgId === msg.MsgId && m.recallTime !== '0'), (msgs) => !!msgs.find(m => m.msgId === msg.MsgId && m.recallTime !== '0'),
).catch(() => new Promise<undefined>((resolve) => { ).catch(() => undefined);
resolve(undefined);
}));
await this.core.apis.MsgApi.recallMsg(msg.Peer, [msg.MsgId]); await this.core.apis.MsgApi.recallMsg(msg.Peer, [msg.MsgId]);
const data = await ret; const data = await ret;
if (!data) { if (!data) throw new Error('Recall failed');
//throw new Error('Recall failed'); } else {
} throw new Error('Recall failed');
//await sleep(100);
//await NTQQMsgApi.getMsgsByMsgId(msg.Peer, [msg.MsgId]);
} }
} }
} }