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/get_data.lua
2015-11-13 13:52:15 +01:00

22 lines
698 B
Lua

local function run(msg, matches)
local receiver = get_receiver(msg)
local url = matches[1]
if string.match(msg.text, "[Gg][Ee][Tt][Dd][Aa][Tt][Aa]") or string.match(msg.text, "[Ww][Gg][Ee][Tt]") then
send_document_from_url(receiver, url)
elseif string.match(msg.text, "[Gg][Ee][Tt][Ii][Mm][Gg]") then
send_photo_from_url(receiver, url)
end
end
return {
description = "Ein plugin, um Bilder oder Dateien zu downloaden",
usage = {"/getdata [URL]",
"/wget [URL]",
"/getimg [URL]"},
patterns = {"^/[Gg][Ee][Tt][Dd][Aa][Tt][Aa] (.*)$",
"/[Ww][Gg][Ee][Tt] (.*)$",
"^/[Gg][Ee][Tt][Ii][Mm][Gg] (.*)$"
},
run = run
}
--by Akamaru [https://ponywave.de]