fixed empty list returning
This commit is contained in:
2
bot.js
2
bot.js
@@ -268,7 +268,7 @@ async function asyncImageRequest(requested_item) {
|
||||
image_url_list = image_url_list.concat(reddit_url_list, imgur_url_list); //, getUrlListFromRedditBooru(redditbooru_json)
|
||||
//console.log('image concat list:' + image_url_list);
|
||||
|
||||
if (image_url_list) {
|
||||
if (!(!Array.isArray(image_url_list) || !image_url_list.length)) {
|
||||
return image_url_list[getRandomInt(0, image_url_list.length - 1)];
|
||||
} else {
|
||||
return "I couldn't find that, sauce?";
|
||||
|
Reference in New Issue
Block a user