more async edits and config updated for boorus

This commit is contained in:
Dalton
2018-12-11 23:31:23 -08:00
parent b722e83b47
commit 63883e4824
2 changed files with 142 additions and 11 deletions

1
bot.js
View File

@@ -239,6 +239,7 @@ async function asyncImageRequest(channelMessage) {
let image_url_list = [];
let reddit_json = await loadJson("https://www.reddit.com/r/" + requested_item + "/.json?show=all&count=25&limit=100");
let imgur_json = await loadJson('https://api.imgur.com/3/gallery/r/' + requested_item + '/time/' + getRandomInt(1, 5));
// 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");
image_url_list.concat(getUrlListFromReddit(reddit_json), getUrlListFromImgur(imgur_json)); //, getUrlListFromRedditBooru(redditbooru_json)