forked from Supositware/Haha-Yes
catch error
This commit is contained in:
parent
1ef5ec1140
commit
6f343cacdb
1 changed files with 4 additions and 2 deletions
|
@ -60,7 +60,6 @@ class audio2imageCommand extends Command {
|
||||||
.on('end', () => {
|
.on('end', () => {
|
||||||
ffmpeg()
|
ffmpeg()
|
||||||
.input(`${os.tmpdir()}/${message.id}1.sw`)
|
.input(`${os.tmpdir()}/${message.id}1.sw`)
|
||||||
//.size('1920x1080')
|
|
||||||
.inputOption('-pixel_format rgb24')
|
.inputOption('-pixel_format rgb24')
|
||||||
.inputOption(`-video_size ${args.video_size}`)
|
.inputOption(`-video_size ${args.video_size}`)
|
||||||
.inputFormat('rawvideo')
|
.inputFormat('rawvideo')
|
||||||
|
@ -73,7 +72,10 @@ class audio2imageCommand extends Command {
|
||||||
.on('end', () => {
|
.on('end', () => {
|
||||||
console.log('finished');
|
console.log('finished');
|
||||||
loadingmsg.delete();
|
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();
|
.run();
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue