557405af2f
- Gronkh-Soundboard ins Soundboard integriert
21 lines
404 B
Lua
21 lines
404 B
Lua
local get_txt = {}
|
|
|
|
get_txt.triggers = {
|
|
"(https?://.*.txt)"
|
|
}
|
|
|
|
function get_txt:action(msg, config, matches)
|
|
local url = matches[1]
|
|
local doer = http
|
|
if url:match('^https') then
|
|
doer = https
|
|
end
|
|
local res, code = doer.request(url)
|
|
if code ~= 200 then
|
|
utilities.send_reply(self, msg, config.errors.connection)
|
|
return
|
|
end
|
|
utilities.send_reply(self, msg, res)
|
|
end
|
|
|
|
return get_txt |