diff --git a/bun.lockb b/bun.lockb index 6fa3d67..c21312e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index dfeb378..a109088 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/strftime": "^0.9.8", "@typescript-eslint/eslint-plugin": "^7.0.2", "@typescript-eslint/parser": "^7.0.2", - "bun-types": "^1.0.31", + "bun-types": "^1.0.36", "concurrently": "^8.2.2", "drizzle-kit": "^0.20.13", "eslint": "^8.56.0", diff --git a/src/commands/emoji.ts b/src/commands/emoji.ts index e431413..2de0e78 100644 --- a/src/commands/emoji.ts +++ b/src/commands/emoji.ts @@ -118,7 +118,7 @@ async function convertEmojis(emojis: RegExpMatchArray, message: Message) { ${magickPrefix} ${frameTwoPath} -quality 90 ${frameTwoPath} `.catch(console.error); - if (!compressOutput) { + if (!compressOutput || compressOutput.exitCode !== 0) { await message.channel.send(`Could not compress \`${name}\`, skipping...`); continue; } @@ -129,7 +129,7 @@ async function convertEmojis(emojis: RegExpMatchArray, message: Message) { ${magickPrefix} ${frameOnePath} ${frameTwoPath} -delay 100 ${gifPath} `.catch(console.error); - if (!convertOutput) { + if (!convertOutput || convertOutput.exitCode !== 0) { await message.channel.send(`Could not convert \`${name}\`, skipping...`); continue; } @@ -142,7 +142,7 @@ async function convertEmojis(emojis: RegExpMatchArray, message: Message) { animated: true, }); - if (!output) { + if (!output || ("exitCode" in output && output.exitCode !== 0)) { await message.channel.send( `Something went wrong while resizing \`${name}\`, skipping...` ); @@ -340,7 +340,7 @@ export async function addEmoji(message: Message, prefix: string) { animated: imgType === "gif", }); - if (!output) { + if (!output || ("exitCode" in output && output.exitCode !== 0)) { return message.channel.send( "Something went wrong while resizing the image, please try again!" ); diff --git a/src/commands/imgProcess.ts b/src/commands/imgProcess.ts index b720e0d..abcb1f9 100644 --- a/src/commands/imgProcess.ts +++ b/src/commands/imgProcess.ts @@ -40,7 +40,7 @@ export async function beautiful(input: Message | ChatInputCommandInteraction) { animated: false, }); - if (!output) { + if (!output || ("exitCode" in output && output.exitCode !== 0)) { return await sendOrReply( input, "I'm sorry, failed to resize the pfp. Maybe try again later?" @@ -146,7 +146,7 @@ export async function resizeImg(message: Message, prefix: string) { animated: imgType === "gif", }); - if (!output) { + if (!output || ("exitCode" in output && output.exitCode !== 0)) { return await message.channel.send( "I'm sorry, failed to resize the image. Maybe try again later?" );