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

18 lines
514 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)
2015-07-22 17:43:05 +02:00
local url = string.gsub(url, "https://img.centzilius.de", "http://img.centzilius.de")
2015-02-22 22:34:10 +01:00
send_photo_from_url(receiver, url)
2014-11-04 22:39:14 +01:00
end
return {
2015-04-20 18:52:25 +02:00
description = "Wenn ein Link zu einem Bild gesendet wird, läd und sendet der Bot das Bild.",
2015-04-28 17:49:11 +02:00
usage = {"Link zum Bild"},
patterns = {"(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