From dcf299bcf225e446b72a9058a68fd81a4f6f876d Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 11 Jul 2020 01:33:12 +0200 Subject: [PATCH] Use event for download --- commands/fun/midify.js | 4 ++-- commands/fun/vidshittifier.js | 4 ++-- commands/fun/ytp.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/fun/midify.js b/commands/fun/midify.js index 60912713..e1907674 100644 --- a/commands/fun/midify.js +++ b/commands/fun/midify.js @@ -60,11 +60,11 @@ class midifyCommand extends Command { if (url) { downloader(url, null, input) - .catch((err) => { + .on('error', (err) => { loadingmsg.delete(); return message.channel.send(err, { code: true }); }) - .then(output => { + .on('end', output => { // Convert to wav ffmpeg() .input(output) diff --git a/commands/fun/vidshittifier.js b/commands/fun/vidshittifier.js index 8a4c378c..6703b296 100644 --- a/commands/fun/vidshittifier.js +++ b/commands/fun/vidshittifier.js @@ -57,11 +57,11 @@ class vidshittifierCommand extends Command { if (url) { downloader(args.link, null, input) - .catch((err) => { + .on('error', (err) => { loadingmsg.delete(); return message.channel.send(err, { code: true }); }) - .then(() => { + .on('end', () => { shittifie(); }); } else { diff --git a/commands/fun/ytp.js b/commands/fun/ytp.js index 35f9c15e..5a7ef1a0 100644 --- a/commands/fun/ytp.js +++ b/commands/fun/ytp.js @@ -137,11 +137,11 @@ class ytpCommand extends Command { if (url) { return downloader(url, ['--format=mp4'], `./asset/ytp/userVid/${message.id}.mp4`) - .catch((err) => { + .on('error', (err) => { loadingmsg.delete(); return message.channel.send(err, { code: true }); }) - .then(async output => { + .on('end', async output => { const hash = md5File.sync(output); const ytphash = await ytpHash.findOne({where: {hash: hash}});