Banhammer: Kritischer Fix

This commit is contained in:
Andreas Bielawski 2016-08-11 03:41:43 +02:00
parent c931404452
commit ffd5cfd4f4
2 changed files with 3 additions and 4 deletions

View File

@ -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() msg.text_lower = msg.text:lower()
end end
msg = pre_process_msg(self, msg, config) msg = pre_process_msg(self, msg, config)
if not msg then return end -- deleted by banning
if is_service_msg(msg) then if is_service_msg(msg) then
msg = service_modify_msg(msg) msg = service_modify_msg(msg)

View File

@ -103,7 +103,7 @@ function banhammer:pre_process(msg, self, config)
if banned then if banned then
print('Banned user talking!') print('Banned user talking!')
banhammer:ban_user(user_id, chat_id, self) banhammer:ban_user(user_id, chat_id, self)
msg.text = '' return
end end
end end
@ -142,9 +142,7 @@ function banhammer:pre_process(msg, self, config)
end end
if not allowed then if not allowed then
msg.text = '' return
msg.text_lower = ''
msg.entities = ''
end end
-- else -- else