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.
Mikubot/plugins/chucknorris.lua

21 lines
421 B
Lua

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
return "Huch, da lief was falsch!"
else
return j
end
end
return {
description = "Sendet Chuck Norris Witze (Englisch)",
usage = {"/cn"},
patterns = {"^/cn$"},
run = run
}