quieted debug and fixed typo in subredditRequest() that i probably accidentally introduced

This commit is contained in:
Dalton
2018-12-11 21:54:45 -08:00
parent 3535272401
commit 5f1024c183

10
bot.js
View File

@@ -130,7 +130,7 @@ function bestEffortRequest(subpage, page_max) {
//let reddit_response = asyncSiteRequest(reddit_url, handleRedditJson);
let reddit_response = subredditRequest(subpage);
if (reddit_response) {
sendToBotTestingChannel("found content on reddit:" + reddit_response);
//sendToBotTestingChannel("found content on reddit:" + reddit_response);
return reddit_response;
}
@@ -138,7 +138,7 @@ function bestEffortRequest(subpage, page_max) {
if (page_max) {
imgur_response = imgurRequest(subpage, page_max);
if (imgur_response) {
sendToBotTestingChannel("found content on imgur:" + imgur_response);
//sendToBotTestingChannel("found content on imgur:" + imgur_response);
return imgur_response
}
}
@@ -148,12 +148,12 @@ function bestEffortRequest(subpage, page_max) {
//let redditbooru_response = asyncSiteRequest(redditbooru_url, handleRedditBooruJson);
let redditbooru_response = redditbooruRequest(subpage);
if (redditbooru_response) {
sendToBotTestingChannel("found content on redditbooru:" + redditbooru_response);
//sendToBotTestingChannel("found content on redditbooru:" + redditbooru_response);
return redditbooru_response
}
// leaving this here for debug.
sendToBotTestingChannel('reddit:' + reddit_response + '\nimgur:' + imgur_response + '\nredditbooru:' + redditbooru_response);
//sendToBotTestingChannel('reddit:' + reddit_response + '\nimgur:' + imgur_response + '\nredditbooru:' + redditbooru_response);
return "I couldn't find that, sauce?";
}
@@ -260,7 +260,7 @@ function subredditRequest(subreddit) {
counter++;
if (json.data.children[i].data.post_hint === "image" || json.data.children[i].data.post_hint === "link" || json.data.children.data.post_hint === "rich:video") {
if (json.data.children[i].data.post_hint === "image" || json.data.children[i].data.post_hint === "link" || json.data.children[i].data.post_hint === "rich:video") {
returnText = json.data.children[i].data.url;
break;
}