Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. -- Lock Plugins --
  2. -- By @Peyman_lua --
  3.  
  4. --------- Lock Fosh ---------
  5. do
  6. local function pre_process(msg)
  7.     local save_redis_fosh = 'fosh:'..msg.to.id
  8.     if redis:get(save_redis_fosh) then
  9.         local foshs = msg.text:match("عجب")
  10.         if foshs and is_momod(msg) then
  11.             delete_msg(msg.id, ok_cb, true)
  12.         end
  13.     end
  14. end
  15.    
  16.     local function run(msg, matches)
  17.         local save_redis_fosh = 'fosh:'..msg.to.id
  18.         chat_id =  msg.to.id
  19.         if matches[1] == 'locks' and matches[2] == 'foshs' and is_momod(msg) then
  20.             redis:set(save_redis_fosh, true)
  21.             local text = '🔴 فحش با موفقیت #قفل شد.\n'
  22.             ..'برای تنظیم فحش های بیشتر از دستور زیر استفاده کنید.\n'
  23.             ..'<code>!filter word </code>\n'
  24.             reply_msg(msg['id'], text, ok_cb, true)
  25.         --[[else
  26.             local text2 = '🔴 فحش هم اکنون #قفل می باشد.'
  27.             reply_msg(msg['id'], text2, ok_cb, true) ]]
  28.         elseif matches[1] == 'unlocks' and matches[2] == 'foshs' and is_momod(msg) then
  29.             redis:del(save_redis_fosh)
  30.             local text = '🔵 فحش با موفقیت #باز شد.'
  31.             reply_msg(msg['id'], text, ok_cb, true)
  32.         --[[else
  33.             local text2 = '🔵 فحش هم اکنون #باز می باشد.'
  34.             reply_msg(msg['id'], text2, ok_cb, true)]]
  35.         end
  36.     end
  37.    
  38.     return {
  39.         patterns = {
  40.             '^[!/#](locks) (.*)$',
  41.             '^[!/#](unlocks) (.*)$',
  42.         },
  43.         run = run,
  44.         pre_process = pre_process
  45.     }
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement