From 5c1d5f33c2a43adfb97d006dc84f7bebc6f5b700 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 11 Apr 2018 01:16:11 +0000 Subject: [PATCH] Nevermind, they're actually smart --- commands/image-edit/shields-io-badge.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/image-edit/shields-io-badge.js b/commands/image-edit/shields-io-badge.js index e1e9156f..f0502ad6 100644 --- a/commands/image-edit/shields-io-badge.js +++ b/commands/image-edit/shields-io-badge.js @@ -35,10 +35,10 @@ module.exports = class ShieldsIoBadgeCommand extends Command { async run(msg, { subject, status, color }) { try { - const { body, headers } = await snekfetch.get(`https://img.shields.io/badge/${subject}-${status}-${color}.png`); - if (headers['content-type'] !== 'image/png') return msg.reply('Could not create the badge...'); + const { body } = await snekfetch.get(`https://img.shields.io/badge/${subject}-${status}-${color}.png`); return msg.say({ files: [{ attachment: body, name: 'badge.png' }] }); } catch (err) { + if (err.status === 404) return msg.reply('Could not create the badge...'); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } }