Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Lock Plugins --
- -- By @Peyman_lua --
- --------- Lock Fosh ---------
- do
- local function pre_process(msg)
- local save_redis_fosh = 'fosh:'..msg.to.id
- if redis:get(save_redis_fosh) then
- local foshs = msg.text:match("عجب")
- if foshs and is_momod(msg) then
- delete_msg(msg.id, ok_cb, true)
- end
- end
- end
- local function run(msg, matches)
- local save_redis_fosh = 'fosh:'..msg.to.id
- chat_id = msg.to.id
- if matches[1] == 'locks' and matches[2] == 'foshs' and is_momod(msg) then
- redis:set(save_redis_fosh, true)
- local text = '🔴 فحش با موفقیت #قفل شد.\n'
- ..'برای تنظیم فحش های بیشتر از دستور زیر استفاده کنید.\n'
- ..'<code>!filter word </code>\n'
- reply_msg(msg['id'], text, ok_cb, true)
- --[[else
- local text2 = '🔴 فحش هم اکنون #قفل می باشد.'
- reply_msg(msg['id'], text2, ok_cb, true) ]]
- elseif matches[1] == 'unlocks' and matches[2] == 'foshs' and is_momod(msg) then
- redis:del(save_redis_fosh)
- local text = '🔵 فحش با موفقیت #باز شد.'
- reply_msg(msg['id'], text, ok_cb, true)
- --[[else
- local text2 = '🔵 فحش هم اکنون #باز می باشد.'
- reply_msg(msg['id'], text2, ok_cb, true)]]
- end
- end
- return {
- patterns = {
- '^[!/#](locks) (.*)$',
- '^[!/#](unlocks) (.*)$',
- },
- run = run,
- pre_process = pre_process
- }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement