<commit_before>do
local function pre_process(msg)

    local community = 'lock_community:'..msg.to.id
    if not msg.text:match("#") and redis:get(community) and not is_momod(msg) then
            delete_msg(msg.id, ok_cb, true)
           end
    return msg
    end
    
 local function run(msg, matches)
if is_momod(msg) and matches[1] == "lock" and matches[2] == "community" then
 local community = 'lock_community:'..msg.to.id
redis:set(community, true)
return reply_msg(msg.id, "<b>Communtiy</b> <i>mode has been activated !</i>",ok_cb,false)
end
if is_momod(msg) and matches[1] == "unlock" and matches[2] == "community" then
 local community = 'lock_community:'..msg.to.id
   redis:del(community)
    return reply_msg(msg.id, "<b>community</b> <i>mode has been deactivated !</i>",ok_cb,false)
  end
end
return {
    patterns ={
        "^[#!/](lock) (community)$",
        "^[#!/](unlock) (community)$",
    },
run = run,
pre_process = pre_process 
}
end<commit_msg>Update lockcommunity.lua<commit_after>do
local function pre_process(msg)

    local community = 'lock_community:'..msg.to.id
    if not msg.text:match("#") and redis:get(community) and not is_momod(msg) then
            delete_msg(msg.id, ok_cb, true)
           end
    return msg
    end
    
 local function run(msg, matches)
if is_momod(msg) and matches[1] == "lock" and matches[2] == "community" then
 local community = 'lock_community:'..msg.to.id
redis:set(community, true)
return reply_msg(msg.id, "<b>Communtiy</b> <i>mode has been activated !</i>",ok_cb,false)
end
if is_momod(msg) and matches[1] == "unlock" and matches[2] == "community" then
 local community = 'lock_community:'..msg.to.id
   redis:del(community)
    return reply_msg(msg.id, "<b>community</b> <i>mode has been deactivated !</i>",ok_cb,false)
  end
end
return {
    patterns ={
        "^[#!/](lock) (community)$",
        "^[#!/](unlock) (community)$",
    },
run = run,
pre_process = pre_process 
}
end
--tnx to @MuteTeam
{'fraction_non_alphanumeric': 0.16312056737588654, 'fraction_numerical': 0.004052684903748734, 'mean_word_length': 3.840686274509804, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2195681', 'n_tokens_mistral': 733, 'n_tokens_neox': 693, 'n_words': 171}