diff --git a/commands/misc/dl.js b/commands/misc/dl.js index 57a5027..b5ffbe8 100644 --- a/commands/misc/dl.js +++ b/commands/misc/dl.js @@ -9,7 +9,8 @@ module.exports = { "Usage: dl " ], async execute({message, args}) { - const downloadsDir = path.resolve(process.cwd(), 'data', 'downloads', Date.now().toString()); + + const downloadsDir = path.resolve(process.cwd(), 'data', 'downloads', Math.floor(new Date).toString()); const cookieFilepath = path.resolve(process.cwd(), 'data', 'cookies.txt') if(!fs.existsSync(cookieFilepath)) { message.channel.send("Some dependencies are needed for the command to work properly. Please let the bot's owner know.") @@ -45,7 +46,7 @@ module.exports = { let files = fs.readdirSync(downloadsDir); - if(files.length < 1) { + if(files < 1) { this.cleanUp(downloadsDir); originalMessage.edit("Something went wrong when downloading the video.") return;