From 68bfd7ed178785c2dcfb9e294d3f6ac974e70b27 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 27 Feb 2020 16:20:30 +0100 Subject: [PATCH] add error message --- commands/fun/image2audio.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/fun/image2audio.js b/commands/fun/image2audio.js index b71d4cf..7dbc1a7 100644 --- a/commands/fun/image2audio.js +++ b/commands/fun/image2audio.js @@ -56,7 +56,10 @@ class image2audioCommand extends Command { .on('end', () => { console.log('finished'); loadingmsg.delete(); - return message.channel.send({files: [`${os.tmpdir()}/i2a_${message.id}.wav`]}); + return message.channel.send({files: [`${os.tmpdir()}/i2a_${message.id}.wav`]}) + .catch(() => { + return message.channel.send('End result is too big to fit on discord!'); + }); }) .run(); })