Updated plugin boobs.lua

This commit is contained in:
Akamaru 2015-04-16 21:42:25 +02:00
parent 5982738514
commit d71cac24cd

View File

@ -1,6 +1,7 @@
do do
function getRandomButts(attempt) -- Recursive function
local function getRandomButts(attempt)
attempt = attempt or 0 attempt = attempt or 0
attempt = attempt + 1 attempt = attempt + 1
@ -10,7 +11,7 @@ function getRandomButts(attempt)
local data = json:decode(res)[1] local data = json:decode(res)[1]
-- The OpenBoobs API sometimes returns an empty array -- The OpenBoobs API sometimes returns an empty array
if not data and attempt < 10 then if not data and attempt < 3 then
print('Keine Butts gefunden!') print('Keine Butts gefunden!')
return getRandomButts(attempt) return getRandomButts(attempt)
end end
@ -18,7 +19,7 @@ function getRandomButts(attempt)
return 'http://media.obutts.ru/' .. data.preview return 'http://media.obutts.ru/' .. data.preview
end end
function getRandomBoobs(attempt) local function getRandomBoobs(attempt)
attempt = attempt or 0 attempt = attempt or 0
attempt = attempt + 1 attempt = attempt + 1
@ -36,7 +37,7 @@ function getRandomBoobs(attempt)
return 'http://media.oboobs.ru/' .. data.preview return 'http://media.oboobs.ru/' .. data.preview
end end
function run(msg, matches) local function run(msg, matches)
local url = nil local url = nil
if matches[1] == "/boobs" then if matches[1] == "/boobs" then