Auto Remove

This commit is contained in:
Daniel Legt 2021-10-23 01:02:10 +03:00
parent 538d13b19c
commit 3bc0746b94
1 changed files with 5 additions and 1 deletions

View File

@ -80,7 +80,6 @@ async function processChannel(client: Client, channel: TextChannel) {
let buff = await fs.readFile(file); let buff = await fs.readFile(file);
let p = path.basename(file); let p = path.basename(file);
let msgAttachment = new MessageAttachment(buff, p); let msgAttachment = new MessageAttachment(buff, p);
await (await channel.send({ 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) => { await new Promise((_r, _e) => {
setTimeout( () => { setTimeout( () => {
_r('asd'); _r('asd');