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-2/miku/plugins/z0r.lua

26 lines
604 B
Lua

local z0r = {}
function z0r:init(config)
z0r.triggers = {
"https?://z0r.de/(%d+)$",
"^/[Zz]0[Rr] (%d+)$"
}
z0r.doc = [[*
]]..config.cmd_pat..[[z0r* _<ID>_: Sendet Loop von z0r]]
end
z0r.command = 'z0r <ID>'
function z0r:action(msg, config, matches)
local id = matches[1]
utilities.send_typing(msg.chat.id, 'upload_video')
local url = 'http://z0r.de/L/z0r-de_'..matches[1]..'.swf'
local file = download_to_file(url)
if not file then
utilities.send_reply(msg, config.errors.connection)
return
end
utilities.send_document(msg.chat.id, file, nil, msg.message_id)
end
return z0r