function antispam:on_new_message(message, configuration, language)
if message.from.id == 777000 then
return false
end
-- Thanks to GingerPlusPlus for the idea
if message.chat.type ~= 'private' and mattata.get_setting(message.chat.id, 'remove pasted code') then
if message.entities then
for _, entity in pairs(message.entities) do
if (entity.type == 'pre' or entity.type == 'code') and entity.length > configuration.administration.global_antispam.max_code_length and not mattata.is_group_admin(message.chat.id, message.from.id) then
local success = mattata.delete_message(message.chat.id, message.message_id)
if success then
local name = mattata.get_formatted_user(message.from.id, message.from.first_name, 'html')
local output = string.format(language['antispam']['11'], name, configuration.administration.global_antispam.max_code_length, self.info.username:lower())
local messages = redis:get('messages:' .. message.from.id .. ':' .. message.chat.id) or 0
if message.chat.type == 'supergroup' and (message.entities or message.photo or message.document) and mattata.get_setting(message.chat.id, 'kick media on join') and messages <= 2 and not mattata.is_group_admin(message.chat.id, message.from.id) and redis:get('join_time:' .. message.from.id .. ':' .. message.chat.id) then