nguLikScript

pinLock

Mar 21st, 2022
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // -- Lock Pin
  2. bot.hear(/^\.sPin$/i, (ctx) => {
  3. if (helper.isIn(adminBot, ctx.from.id) ){
  4.   var replyMsg = ctx.message.reply_to_message
  5.   if (replyMsg){
  6.   var idPesanPin = replyMsg.message_id;
  7.   userDB.setValue('pinIDgroup'+ctx.chat.id, idPesanPin)}
  8.   ctx.tg.pinChatMessage(ctx.chat.id, idPesanPin);}
  9. ctx.deleteMessage()})
  10.  
  11. // -- reload pin msg
  12. bot.hear(/^\.rPin$/i, (ctx) => {
  13. if (helper.isIn(adminBot, ctx.from.id) ){
  14.   ctx.unpinAllChatMessages();
  15.   ctx.tg.pinChatMessage(ctx.chat.id, userDB.getValue('pinIDgroup'+ctx.chat.id))};
  16. ctx.deleteMessage();})
  17.  
  18. // -- ngelock pin yang ditimpa pin oleh channel
  19. bot.on('message', ctx => {
  20. if (helper.isIn(markas, ctx.chat.id) ) { if (ctx.message.forward_from_chat){
  21.   if (ctx.message.from.id == 777000){
  22.     ctx.unpinAllChatMessages();
  23.     ctx.tg.pinChatMessage(ctx.chat.id, userDB.getValue('pinIDgroup'+ctx.chat.id));}}
  24. }})
  25.  
  26. // -- semua members bebas nge-pin
  27. bot.hear(/^\.ipin$/i, (ctx) => {
  28. if (helper.isIn(markas, ctx.chat.id) ){
  29.   var replyMsg = ctx.message.reply_to_message
  30.   if (replyMsg){ ctx.tg.pinChatMessage(ctx.chat.id, replyMsg.message_id);}}
  31.   ctx.deleteMessage();})
  32.  
  33. // -- semua members bebas unPin -- kecuali pinLock
  34. bot.hear(/^\.upin$/i, (ctx) => {
  35. if (helper.isIn(markas, ctx.chat.id) ){
  36.   let replyMsg = ctx.message.reply_to_message
  37.   let pinLock = userDB.getValue('pinIDgroup'+ctx.chat.id)
  38.   if (replyMsg.message_id != pinLock)
  39.     ctx.tg.unpinChatMessage(ctx.chat.id, replyMsg.message_id);
  40.   ctx.deleteMessage();}})
  41.  
  42. // -- trigger bersihkan pin(Lock)
  43. bot.hear(/^!xPin$/i, (ctx) => {
  44. if (helper.isIn(adminBot, ctx.from.id) ){
  45.   userDB.delete('pinIDgroup'+ctx.chat.id);
  46.   ctx.tg.unpinAllChatMessages();
  47.   ctx.replyItWithHTML('#pinLock‼️<b>OFF</b>');}
  48. ctx.deleteMessage();})
  49.  
Advertisement
Add Comment
Please, Sign In to add comment