From 88037de55ee2b9e7d2371438301bccf5af1f9912 Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 10 Apr 2013 20:05:57 +0000 Subject: [PATCH] prevent returning deleted imgurs --- modules/imgur/imgur.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 2dad0b6..744e390 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -13,7 +13,8 @@ var imgur = function(dbot) { Math.random().toString(36).substr(2,6) + '.jpg'; var image = request(testUrl, function(error, response, body) { - if(!error && response.statusCode == 200) { + // 492 is body.length of a removed image + if(!error && response.statusCode == 200 && body.length != 492) { callback(testUrl); } else { this.api.getRandomImage(callback);