forked from infernal1200/Virus-Tg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlock_eng.lua
50 lines (48 loc) · 1.06 KB
/
lock_eng.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
antienglish = {}-- An empty table for solving multiple kicking problem
do
local function run(msg, matches)
if msg.to.type == 'chat' then
if is_momod(msg) then -- Ignore mods,owner,admins
return
end
local data = load_data(_config.moderation.data)
if data[tostring(msg.to.id)]['settings']['lock_eng'] then
if data[tostring(msg.to.id)]['settings']['lock_eng'] == 'yes' then
if antienglish[msg.from.id] == true then
return
end
send_large_msg("chat#id".. msg.to.id , "english words is not allowed here⛔️")
local name = user_print_name(msg.from)
savelog(msg.to.id, name.." ["..msg.from.id.."] kicked (english was locked) ")
chat_del_user('chat#id'..msg.to.id,'user#id'..msg.from.id,ok_cb,false)
antienglish[msg.from.id] = true
return
end
end
return
end
end
local function cron()
antienglish = {} -- Clear antienglish table
end
return {
patterns = {
"(a)",
"(o)",
"(l)",
"(A)",
"(O)",
"(L)",
"(M)",
"(e)",
"(E)",
"(i)",
"(I)",
"(u)",
"(U)",
"(m)"
},
run = run,
cron = cron
}
end