|
|
@@ -66,7 +66,7 @@ var sendPic = function(userID, chatID) { |
|
|
|
postID = utils.r(1, (+postCount));
|
|
|
|
request("http://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=1" + tagsString(user.last_tags, user.rating) + "&pid=" + postID, function (err, re, body) {
|
|
|
|
utils.parseXml(body, function(err, result) {
|
|
|
|
if (typeof result.posts.post[0] === "undefined") {
|
|
|
|
if (typeof result.posts.post === "undefined") {
|
|
|
|
bot.sendMessage({
|
|
|
|
chat_id: userID,
|
|
|
|
text: "I'm sorry, but I was unable to find any images for those tags. Perhaps try again? I have reset the tags for you, btw."
|