This commit is contained in:
Andreas Bielawski 2016-09-27 23:42:04 +02:00
parent 8fa8b99b3e
commit 3007e6b80f

View File

@ -9,7 +9,9 @@ post_photo.triggers = {
function post_photo:pre_process(msg, config)
if not msg.document then return msg end -- Ignore
if msg.caption then
if msg.caption:match("#ignore") then return msg end -- Ignore, when Caption contains "#ignore"
end
local mime_type = msg.document.mime_type
local valid_mimetypes = {['image/jpeg'] = true, ['image/png'] = true, ['image/bmp'] = true}
if not valid_mimetypes[mime_type] then return msg end