- get_txt hinzugefügt

- Gronkh-Soundboard ins Soundboard integriert
This commit is contained in:
Andreas Bielawski
2016-08-17 18:15:05 +02:00
parent 7025498768
commit 557405af2f
2 changed files with 56 additions and 18 deletions

21
miku/plugins/get_txt.lua Normal file
View File

@ -0,0 +1,21 @@
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