Update giphy.lua
This commit is contained in:
parent
edfbe6eec4
commit
84b7062aed
@ -16,6 +16,7 @@ end
|
|||||||
|
|
||||||
function search(text)
|
function search(text)
|
||||||
local res, code = http.request(BASE_URL.."/gifs/search?q="..text.."&api_key="..API_KEY)
|
local res, code = http.request(BASE_URL.."/gifs/search?q="..text.."&api_key="..API_KEY)
|
||||||
|
if code ~= 200 then return nil end
|
||||||
local images = json:decode(res).data
|
local images = json:decode(res).data
|
||||||
if #images == 0 then return nil end -- No images
|
if #images == 0 then return nil end -- No images
|
||||||
local i = math.random(0,#images)
|
local i = math.random(0,#images)
|
||||||
|
Reference in New Issue
Block a user