diff --git a/commands/search/http-cat.js b/commands/search/http-cat.js index e717141c..999068bf 100644 --- a/commands/search/http-cat.js +++ b/commands/search/http-cat.js @@ -21,7 +21,8 @@ module.exports = class HttpCatCommand extends Command { async run(msg, { code }) { try { - const { body } = await request.get(`https://http.cat/${code}.jpg`); + const { body, headers } = await request.get(`https://http.cat/${code}.jpg`); + if (headers['content-type'] === 'text/html') return msg.say('Could not find any results.'); return msg.say({ files: [{ attachment: body, name: `${code}.jpg` }] }); } catch (err) { if (err.status === 404) return msg.say('Could not find any results.'); diff --git a/package.json b/package.json index 137ab149..81fc2ad1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "84.4.0", + "version": "84.4.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {