mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: 清理ins图片
This commit is contained in:
parent
47ec00a057
commit
208f4e4b84
@ -897,8 +897,10 @@ export class tools extends plugin {
|
|||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
if (imgPromise.length > 0) {
|
if (imgPromise.length > 0) {
|
||||||
|
let path = []
|
||||||
const images = await Promise.all(imgPromise).then(paths => {
|
const images = await Promise.all(imgPromise).then(paths => {
|
||||||
return paths.map(item => {
|
return paths.map(item => {
|
||||||
|
path.push(item);
|
||||||
return {
|
return {
|
||||||
message: segment.image(fs.readFileSync(item)),
|
message: segment.image(fs.readFileSync(item)),
|
||||||
nickname: e.sender.card || e.user_id,
|
nickname: e.sender.card || e.user_id,
|
||||||
@ -907,6 +909,10 @@ export class tools extends plugin {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
await this.reply(await Bot.makeForwardMsg(images));
|
await this.reply(await Bot.makeForwardMsg(images));
|
||||||
|
// 清理
|
||||||
|
path.forEach(item => {
|
||||||
|
fs.unlinkSync(item);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user