Don't 0 index the array of images.
This commit is contained in:
parent
f4ac6057ba
commit
878462030d
@ -9,7 +9,7 @@ local API_KEY = 'dc6zaTOxFJmzC' -- public beta key
|
|||||||
function get_image(response)
|
function get_image(response)
|
||||||
local images = json:decode(response).data
|
local images = json:decode(response).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(1,#images)
|
||||||
local image = images[i] -- A random one
|
local image = images[i] -- A random one
|
||||||
|
|
||||||
if image.images.downsized then
|
if image.images.downsized then
|
||||||
|
Reference in New Issue
Block a user