From 14215f52dd51f9f356c69e296431ad50d54fa83b Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Tue, 5 Jul 2016 20:32:35 +0200 Subject: [PATCH] Fix, wenn keine Bilder gefunden --- otouto/plugins/gImages.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/otouto/plugins/gImages.lua b/otouto/plugins/gImages.lua index 93165dc..661a9ec 100644 --- a/otouto/plugins/gImages.lua +++ b/otouto/plugins/gImages.lua @@ -110,8 +110,8 @@ function gImages:callback(callback, msg, self, config, input) end function gImages:get_image(input) - local apikey = cred_data.google_apikey_2 -- 100 requests is RIDICULOUS, Google! - local cseid = cred_data.google_cse_id_2 + local apikey = cred_data.google_apikey -- 100 requests is RIDICULOUS, Google! + local cseid = cred_data.google_cse_id local BASE_URL = 'https://www.googleapis.com/customsearch/v1' local url = BASE_URL..'/?searchType=image&alt=json&num=10&key='..apikey..'&cx='..cseid..'&safe=high'..'&q=' .. input .. '&fields=items(link,mime,image(contextLink))' local jstr, res = HTTPS.request(url) @@ -173,7 +173,7 @@ function gImages:action(msg, config, matches) if results == 403 then utilities.send_reply(self, msg, config.errors.quotaexceeded, true) return - elseif not results then + elseif not results or results == 'NORESULTS' then utilities.send_reply(self, msg, config.errors.results, true) return end