From 3007e6b80f8abd1439bb66040531afab7337f491 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Tue, 27 Sep 2016 23:42:04 +0200 Subject: [PATCH] *rage* --- otouto/plugins/post_photo.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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