forked from infernal1200/Virus-Tg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlock_fwd.lua
43 lines (31 loc) · 966 Bytes
/
lock_fwd.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
do
local function pre_process(msg)
--Checking mute
local hash = 'mate:'..msg.to.id
if redis:get(hash) and msg.fwd_from and not is_sudo(msg) and not is_owner(msg) and not is_momod(msg) and not is_admin1(msg) then
delete_msg(msg.id, ok_cb, true)
return ""
end
return msg
end
local function run(msg, matches)
chat_id = msg.to.id
if is_momod(msg) and matches[1] == 'lock' then
local hash = 'mate:'..msg.to.id
redis:set(hash, true)
return "Lock Forward > ON"
elseif is_momod(msg) and matches[1] == 'unlock' then
local hash = 'mate:'..msg.to.id
redis:del(hash)
return "Lock Forward > OFF"
end
end
return {
patterns = {
'^[/!#](lock) fwd$',
'^[/!#](unlock) fwd$'
},
run = run,
pre_process = pre_process
}
end