This commit is contained in:
手瓜一十雪
2024-11-25 21:56:34 +08:00
parent 1adb4a4ba8
commit c3568d07e8

View File

@@ -912,11 +912,19 @@ export class OneBotMsgApi {
guildId: '', guildId: '',
peerUid: peer.peerUid, peerUid: peer.peerUid,
}, returnMsg.msgId); }, returnMsg.msgId);
setTimeout(() => { setTimeout(() => {
deleteAfterSentFiles.forEach(file => { deleteAfterSentFiles.forEach(file => {
try {
if (fs.existsSync(file)) {
fsPromise.unlink(file).then().catch(e => this.core.context.logger.logError.bind(this.core.context.logger)('发送消息删除文件失败', e)); fsPromise.unlink(file).then().catch(e => this.core.context.logger.logError.bind(this.core.context.logger)('发送消息删除文件失败', e));
}
} catch (error) {
this.core.context.logger.logError.bind(this.core.context.logger)('发送消息删除文件失败', (e as Error).message)
}
}); });
}, 60000); }, 60000);
return returnMsg; return returnMsg;
} }