From bc03d86c90bbb44bd9f8e66ecc6272b2faa3467b Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Wed, 13 Jul 2016 21:32:14 +0200 Subject: [PATCH] bImages: Fix --- otouto/plugins/bImages.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/otouto/plugins/bImages.lua b/otouto/plugins/bImages.lua index 083ee53..12d8fbd 100644 --- a/otouto/plugins/bImages.lua +++ b/otouto/plugins/bImages.lua @@ -48,13 +48,11 @@ function bImages:getImages(query) if images[n].encodingFormat == 'jpeg' then -- Inline-Querys MUST use JPEG photos! local photo_url = images[n].contentUrl local thumb_url = images[n].thumbnailUrl - results = results..'{"type":"photo","id":"'..math.random(100000000000000000)..'","photo_url":"'..photo_url..'","thumb_url":"'..thumb_url..'","photo_width":'..images[n].width..',"photo_height":'..images[n].height..',"reply_markup":{"inline_keyboard":[[{"text":"Bing aufrufen","url":"'..images[n].webSearchUrl..'"},{"text":"Bild aufrufen","url":"'..photo_url..'"}]]}}' - if n < #images then - results = results..',' - end + results = results..'{"type":"photo","id":"'..math.random(100000000000000000)..'","photo_url":"'..photo_url..'","thumb_url":"'..thumb_url..'","photo_width":'..images[n].width..',"photo_height":'..images[n].height..',"reply_markup":{"inline_keyboard":[[{"text":"Bing aufrufen","url":"'..images[n].webSearchUrl..'"},{"text":"Bild aufrufen","url":"'..photo_url..'"}]]}},' end end + local results = results:sub(0, -2) local results = results..']' cache_data('bImages', string.lower(query), results, 1209600, 'key') return results