diff --git a/otouto/plugins/post_photo.lua b/otouto/plugins/post_photo.lua index bbf704c..55eb0e0 100644 --- a/otouto/plugins/post_photo.lua +++ b/otouto/plugins/post_photo.lua @@ -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:match("#ignore") then return msg end -- Ignore, when Caption contains "#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