From eea7043334ae60f440e11fe2100d5687f41c7ec9 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Tue, 25 Feb 2020 14:09:42 +0100 Subject: [PATCH] Forgot to move that --- commands/utility/download.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;