Chuck Norris unesape HTML but HTML cant scape from Chuck Norris

This commit is contained in:
Akamaru 2015-06-23 16:41:31 +02:00
parent 04a95b6cc4
commit 3a104f5c04

View File

@ -1,16 +1,13 @@
function getChuckNorris() local function chuck()
b = http.request("http://api.icndb.com/jokes/random/") local random = http.request("http://api.icndb.com/jokes/random")
response = json:decode(b) local decode = json:decode(random)
return response.value.joke local joke = decode.value.joke
return joke
end end
function run(msg, matches) local function run(msg)
local j = getChuckNorris() local joke = chuck()
if (j == nil) then return unescape_html(joke)
return "Huch, da lief was falsch!"
else
return j
end
end end
return { return {