From 18b6e4846047b45629a597d23e8930f7beed1181 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 12 Oct 2019 15:10:11 +0200 Subject: [PATCH] loading message --- commands/fun/vidshittifyer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commands/fun/vidshittifyer.js b/commands/fun/vidshittifyer.js index 651e9164..c29de81f 100644 --- a/commands/fun/vidshittifyer.js +++ b/commands/fun/vidshittifyer.js @@ -50,13 +50,17 @@ class vidshittifyerCommand extends Command { compression = '10k'; } let option = `-b:v ${compression} -b:a ${compression}`; - if (args.link) { + let loadingmsg = await message.channel.send('Processing '); + + if (args.link) { return youtubedl.exec(args.link, ['-o', input], {}, function(err) { if (err) { console.error(err); + loadingmsg.delete(); return message.channel.send('An error has occured, I can\'t download from the link you provided.'); } + loadingmsg.delete(); shittify(); }); } else { @@ -70,6 +74,7 @@ class vidshittifyerCommand extends Command { return message.channel.send({files: [output]}) .catch(err => { console.error(err); + loadingmsg.delete(); return message.channel.send('On no! an error just occured! perhaps the file is too big?'); }); });