From ffd5cfd4f47de286339ab6714b5e7ab89438bbe8 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Thu, 11 Aug 2016 03:41:43 +0200 Subject: [PATCH] Banhammer: Kritischer Fix --- otouto/bot.lua | 1 + otouto/plugins/banhammer.lua | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/otouto/bot.lua b/otouto/bot.lua index a6c5c45..0d3f786 100644 --- a/otouto/bot.lua +++ b/otouto/bot.lua @@ -70,6 +70,7 @@ function bot:on_msg_receive(msg, config) -- The fn run whenever a message is rec msg.text_lower = msg.text:lower() end msg = pre_process_msg(self, msg, config) + if not msg then return end -- deleted by banning if is_service_msg(msg) then msg = service_modify_msg(msg) diff --git a/otouto/plugins/banhammer.lua b/otouto/plugins/banhammer.lua index f0669de..fe8aa99 100644 --- a/otouto/plugins/banhammer.lua +++ b/otouto/plugins/banhammer.lua @@ -103,7 +103,7 @@ function banhammer:pre_process(msg, self, config) if banned then print('Banned user talking!') banhammer:ban_user(user_id, chat_id, self) - msg.text = '' + return end end @@ -142,9 +142,7 @@ function banhammer:pre_process(msg, self, config) end if not allowed then - msg.text = '' - msg.text_lower = '' - msg.entities = '' + return end -- else