diff --git a/commands/utility/download.js b/commands/utility/download.js index ea4400a6..1fe1e380 100644 --- a/commands/utility/download.js +++ b/commands/utility/download.js @@ -72,13 +72,14 @@ class DownloadCommand extends Command { loadingmsg.delete(); return message.channel.send('An error has occured, I can\'t download from the link you provided.'); } + let ext = 'mp4'; if (fs.existsSync(`${os.tmpdir()}/${fileName}`)) { ext = await filetype.fromFile(`${os.tmpdir()}/${fileName}`); ext = ext.ext; // This look stupid but hey, it work + fs.renameSync(`${os.tmpdir()}/${fileName}`, `${os.tmpdir()}/${fileName}.${ext}`); } - fs.renameSync(`${os.tmpdir()}/${fileName}`, `${os.tmpdir()}/${fileName}.${ext}`); let file = fs.statSync(`${os.tmpdir()}/${fileName}.${ext}`); let fileSize = file.size / 1000000.0;