From c629d07bcbaf9f3d4509a36605787046eba93db4 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Tue, 27 Sep 2016 23:39:20 +0200 Subject: [PATCH] =?UTF-8?q?-=20Quotes:=20HTML=20bei=20Liste=20-=20Post-Pho?= =?UTF-8?q?to:=20Ignorieren,=20wenn=20Caption=20"#ignore"=20enth=C3=A4lt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- otouto/plugins/post_photo.lua | 1 + otouto/plugins/quotes.lua | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/otouto/plugins/post_photo.lua b/otouto/plugins/post_photo.lua index 6d04cbb..bbf704c 100644 --- a/otouto/plugins/post_photo.lua +++ b/otouto/plugins/post_photo.lua @@ -9,6 +9,7 @@ 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" 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 diff --git a/otouto/plugins/quotes.lua b/otouto/plugins/quotes.lua index e02835e..b8dfccc 100644 --- a/otouto/plugins/quotes.lua +++ b/otouto/plugins/quotes.lua @@ -63,7 +63,7 @@ function quotes:callback(callback, msg, self, config) local text = "" for num,quote in pairs(quotes_table) do - text = text..num..") "..quote..'\n' + text = text..''..num..") "..quote..'\n' end if not text or text == "" then @@ -75,7 +75,7 @@ function quotes:callback(callback, msg, self, config) while text_len > 4096 do to_send_text = string.sub(text, 1, 4096) text = string.sub(text, 4096, text_len) - local res = utilities.send_message(callback.from.id, to_send_text) + local res = utilities.send_message(callback.from.id, to_send_text, true, nil, 'HTML') if not res then utilities.answer_callback_query(callback, 'Bitte starte den Bot zuerst privat!', true) @@ -84,7 +84,7 @@ function quotes:callback(callback, msg, self, config) text_len = string.len(text) end - local res = utilities.send_message(callback.from.id, text) + local res = utilities.send_message(callback.from.id, to_send_text, true, nil, 'HTML') if not res then utilities.answer_callback_query(callback, 'Bitte starte den Bot zuerst privat!', true) return