mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
fix #1171 && Improve message recall handling and cleanup
Changed recallMsg to return the result of the event call. Added a 5-second cache cleanup for recall events in DeleteMsg. Removed an unnecessary blank line in plugin.ts.
This commit is contained in:
@@ -16,6 +16,9 @@ class DeleteMsg extends OneBotAction<Payload, void> {
|
||||
async _handle(payload: Payload) {
|
||||
const msg = MessageUnique.getMsgIdAndPeerByShortId(Number(payload.message_id));
|
||||
if (msg) {
|
||||
this.obContext.recallEventCache.set(msg.MsgId, setTimeout(() => {
|
||||
this.obContext.recallEventCache.delete(msg.MsgId);
|
||||
}, 5000));
|
||||
await this.core.apis.MsgApi.recallMsg(msg.Peer, msg.MsgId);
|
||||
} else {
|
||||
throw new Error('Recall failed');
|
||||
|
||||
Reference in New Issue
Block a user