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/otouto/plugins/images.lua
Andreas Bielawski 5362d40b3f - Portiere Credentials_Manager
- Portiere Location_Manager
- get_location() in utilites
- send_typing() in images und media
2016-06-14 16:17:13 +02:00

17 lines
451 B
Lua

local images = {}
local utilities = require('otouto.utilities')
images.triggers = {
"(https?://[%w-_%%%.%?%.:,/%+=~&%[%]]+%.[Pp][Nn][Gg])$",
"(https?://[%w-_%%%.%?%.:,/%+=~&%[%]]+%.[Jj][Pp][Ee]?[Gg])$"
}
function images:action(msg)
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local url = matches[1]
local file = download_to_file(url)
utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)
end
return images