missing reddit and imgur fixes
This commit is contained in:
13
bot.js
13
bot.js
@@ -256,8 +256,17 @@ async function asyncImageRequest(requested_item) {
|
|||||||
// todo need to check config to see if it's a valid booruuuuu
|
// todo need to check config to see if it's a valid booruuuuu
|
||||||
//let redditbooru_json = await loadJson("https://" + requested_item + ".redditbooru.com/images/?limit=1000");
|
//let redditbooru_json = await loadJson("https://" + requested_item + ".redditbooru.com/images/?limit=1000");
|
||||||
|
|
||||||
image_url_list = image_url_list.concat(getUrlListFromReddit(reddit_json), getUrlListFromImgur(imgur_json)); //, getUrlListFromRedditBooru(redditbooru_json)
|
let reddit_url_list = [];
|
||||||
console.log('image concat list:' + image_url_list);
|
let imgur_url_list = [];
|
||||||
|
|
||||||
|
if(reddit_json) {
|
||||||
|
reddit_url_list = getUrlListFromReddit(reddit_json);
|
||||||
|
}
|
||||||
|
if(imgur_json){
|
||||||
|
imgur_url_list = getUrlListFromImgur(imgur_json);
|
||||||
|
}
|
||||||
|
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 (image_url_list) {
|
||||||
return image_url_list[getRandomInt(0, image_url_list.length - 1)];
|
return image_url_list[getRandomInt(0, image_url_list.length - 1)];
|
||||||
|
Reference in New Issue
Block a user