prevent returning deleted imgurs

This commit is contained in:
reality 2013-04-10 20:05:57 +00:00
parent 4fa870e34e
commit 88037de55e

View File

@ -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);