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/images.lua

21 lines
437 B
Lua
Raw Normal View History

2015-02-22 22:34:10 +01:00
do
2014-11-04 22:39:14 +01:00
function run(msg, matches)
2015-02-22 22:34:10 +01:00
local url = matches[1]
local receiver = get_receiver(msg)
send_photo_from_url(receiver, url)
2014-11-04 22:39:14 +01:00
end
return {
2015-02-22 22:34:10 +01:00
description = "When user sends image URL (ends with png, jpg, jpeg) download and send it to origin.",
usage = "",
patterns = {
2015-03-04 23:22:00 +01:00
"(https?://[%w-_%.%?%.:/%+=&]+%.png)$",
"(https?://[%w-_%.%?%.:/%+=&]+%.jpg)$",
"(https?://[%w-_%.%?%.:/%+=&]+%.jpeg)$",
2015-02-22 22:34:10 +01:00
},
run = run
}
2015-03-04 23:22:00 +01:00
end