This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
2015-04-19 21:18:06 +02:00
|
|
|
function getChuckNorris()
|
|
|
|
b = http.request("http://api.icndb.com/jokes/random/")
|
|
|
|
response = json:decode(b)
|
|
|
|
return response.value.joke
|
|
|
|
end
|
|
|
|
|
|
|
|
function run(msg, matches)
|
|
|
|
local j = getChuckNorris()
|
|
|
|
if (j == nil) then
|
2015-04-28 17:49:11 +02:00
|
|
|
return "Huch, da lief was falsch!"
|
2015-04-19 21:18:06 +02:00
|
|
|
else
|
|
|
|
return j
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return {
|
2015-04-20 18:52:25 +02:00
|
|
|
description = "Sendet Chuck Norris Witze (Englisch)",
|
2015-04-28 17:49:11 +02:00
|
|
|
usage = {"/cn"},
|
2015-04-19 21:18:06 +02:00
|
|
|
patterns = {"^/cn$"},
|
|
|
|
run = run
|
|
|
|
}
|