mirror of
https://github.com/reality/dbot.git
synced 2025-01-12 04:52:36 +01:00
prevent returning deleted imgurs
This commit is contained in:
parent
4fa870e34e
commit
88037de55e
@ -13,7 +13,8 @@ var imgur = function(dbot) {
|
|||||||
Math.random().toString(36).substr(2,6) +
|
Math.random().toString(36).substr(2,6) +
|
||||||
'.jpg';
|
'.jpg';
|
||||||
var image = request(testUrl, function(error, response, body) {
|
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);
|
callback(testUrl);
|
||||||
} else {
|
} else {
|
||||||
this.api.getRandomImage(callback);
|
this.api.getRandomImage(callback);
|
||||||
|
Loading…
Reference in New Issue
Block a user