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

22 lines
698 B
Lua
Raw Normal View History

2015-11-12 17:42:03 +01:00
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]",
2015-11-13 13:52:15 +01:00
"/wget [URL]",
2015-11-12 17:42:03 +01:00
"/getimg [URL]"},
2015-11-13 13:52:15 +01:00
patterns = {"^/[Gg][Ee][Tt][Dd][Aa][Tt][Aa] (.*)$",
"/[Ww][Gg][Ee][Tt] (.*)$",
"^/[Gg][Ee][Tt][Ii][Mm][Gg] (.*)$"
2015-11-12 17:42:03 +01:00
},
run = run
}
--by Akamaru [https://ponywave.de]