From 29a4b7bb739a9fbe06e7ca9ff34ff92caf487204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sat, 15 Jun 2019 21:44:49 +0200 Subject: [PATCH] Send error message when link dosent work --- commands/images/meme.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/images/meme.js b/commands/images/meme.js index e575469c..1b3b1e0f 100644 --- a/commands/images/meme.js +++ b/commands/images/meme.js @@ -34,6 +34,10 @@ class memeCommand extends Command { let Attachment = (message.attachments).array(); if (args.ImageURL) { fetch(args.ImageURL) + .catch(err => { + console.error(err); + return message.channel.send('An error has occured, is your link valid?'); + }) .then(res => { const dest = fs.createWriteStream('./img/memeInput.gif'); res.body.pipe(dest);