From 6f343cacdb98d2178b27b71e78a846822d9ea713 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 27 Feb 2020 18:09:28 +0100 Subject: [PATCH] catch error --- commands/fun/audio2image.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/fun/audio2image.js b/commands/fun/audio2image.js index b2a2be49..6faf65aa 100644 --- a/commands/fun/audio2image.js +++ b/commands/fun/audio2image.js @@ -60,7 +60,6 @@ class audio2imageCommand extends Command { .on('end', () => { ffmpeg() .input(`${os.tmpdir()}/${message.id}1.sw`) - //.size('1920x1080') .inputOption('-pixel_format rgb24') .inputOption(`-video_size ${args.video_size}`) .inputFormat('rawvideo') @@ -73,7 +72,10 @@ class audio2imageCommand extends Command { .on('end', () => { console.log('finished'); loadingmsg.delete(); - return message.channel.send({files: [`${os.tmpdir()}/a2i${message.id}.png`]}); + return message.channel.send({files: [`${os.tmpdir()}/a2i${message.id}.png`]}) + .catch(() => { + return message.channel.send('End result is too big to fit on discord!'); + }); }) .run(); })