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-11-12 17:42:03 +01:00
|
|
|
local function run(msg, matches)
|
2016-02-02 22:44:09 +01:00
|
|
|
if string.starts(msg.text, "https") then
|
|
|
|
res,code = https.request('https://'..matches[1]..'.txt')
|
|
|
|
else
|
|
|
|
res,code = http.request('http://'..matches[1]..'.txt')
|
|
|
|
end
|
2016-02-02 22:47:42 +01:00
|
|
|
if code ~= 200 then return 'Fehler beim Laden der TXT' end
|
2015-11-12 17:42:03 +01:00
|
|
|
return res
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
description = "",
|
|
|
|
usage = "",
|
2016-02-02 22:44:09 +01:00
|
|
|
patterns = {"^https://(.*).txt$",
|
|
|
|
"^http://(.*).txt$"},
|
2015-11-12 17:42:03 +01:00
|
|
|
run = run
|
|
|
|
}
|