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/fortunes_uc3m.lua

22 lines
401 B
Lua
Raw Normal View History

2014-11-04 16:09:08 +01:00
function get_fortunes_uc3m()
math.randomseed(os.time())
local i = math.random(0,178) -- max 178
local web = "http://www.gul.es/fortunes/f"..i
b, c, h = http.request(web)
return b
end
function run(msg, matches)
return get_fortunes_uc3m()
end
return {
description = "Fortunes from Universidad Carlos III",
2014-11-04 22:06:59 +01:00
usage = "!uc3m",
patterns = {"^!uc3m$"},
2014-11-04 16:09:08 +01:00
run = run
}