From 3bc0746b94d4c2d0e66c565819e95e70d4599bfd Mon Sep 17 00:00:00 2001 From: Kato Twofold Date: Sat, 23 Oct 2021 01:02:10 +0300 Subject: [PATCH] Auto Remove --- src/app.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index b6bbc6c..6069009 100644 --- a/src/app.ts +++ b/src/app.ts @@ -80,7 +80,6 @@ async function processChannel(client: Client, channel: TextChannel) { let buff = await fs.readFile(file); let p = path.basename(file); - let msgAttachment = new MessageAttachment(buff, p); await (await channel.send({ @@ -89,6 +88,11 @@ async function processChannel(client: Client, channel: TextChannel) { ] })); + await fs.unlink(file) + .catch( err => { + console.error(`[😡] Could not delete ${file}`); + }) + await new Promise((_r, _e) => { setTimeout( () => { _r('asd');