From 878462030dacea93a4353edd6e69a1ff15d1e92f Mon Sep 17 00:00:00 2001 From: Vincent Castellano Date: Wed, 8 Apr 2015 17:08:08 -0700 Subject: [PATCH] Don't 0 index the array of images. --- plugins/giphy.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/giphy.lua b/plugins/giphy.lua index 6d684fd..284689a 100644 --- a/plugins/giphy.lua +++ b/plugins/giphy.lua @@ -9,7 +9,7 @@ local API_KEY = 'dc6zaTOxFJmzC' -- public beta key function get_image(response) local images = json:decode(response).data 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 if image.images.downsized then @@ -72,4 +72,4 @@ return { run = run } -end \ No newline at end of file +end