diff --git a/index.js b/index.js index c0595a0..33ef256 100644 --- a/index.js +++ b/index.js @@ -24,6 +24,18 @@ fs.readdir(tmpDir, (err, files) => { } }); +fs.readdir(tmpDir, (err, files) => { + if (err) throw err; + + for (const file of files) { + if (file.endsWith('.part')) { + fs.unlink(path.join(tmpDir, file), err => { + if (err) throw err; + }); + } + } +}); + const commandFiles = fs.readdirSync(path.join(__dirname, 'commands')).filter(file => file.endsWith('.js')); for (const file of commandFiles) { const command = require(`./commands/${file}`);