forked from Supositware/Haha-Yes
catch error in format
This commit is contained in:
parent
bb6f0590cf
commit
8c3f193163
1 changed files with 3 additions and 0 deletions
|
@ -71,6 +71,9 @@ class posterCommand extends Command {
|
||||||
const PADDING = 40;
|
const PADDING = 40;
|
||||||
|
|
||||||
img.format(function(err, format) {
|
img.format(function(err, format) {
|
||||||
|
if (err) {
|
||||||
|
return message.channel.send('An error has occured, is it an image?');
|
||||||
|
}
|
||||||
let output = `${os.tmpdir()}/poster${message.id}.${format.toLocaleLowerCase()}`;
|
let output = `${os.tmpdir()}/poster${message.id}.${format.toLocaleLowerCase()}`;
|
||||||
// Get the image size to calculate top and bottom text positions
|
// Get the image size to calculate top and bottom text positions
|
||||||
img.size(function(err, value) {
|
img.size(function(err, value) {
|
||||||
|
|
Loading…
Reference in a new issue