forked from Supositware/Haha-Yes
Send error message when link dosent work
This commit is contained in:
parent
2a857938af
commit
29a4b7bb73
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue