nguLikScript

join Request

Nov 7th, 2022
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bot.on('new_chat_members', ctx => {
  2. if (helper.isIn(groupRestrict, ctx.chat.id) ){
  3.  
  4. let newUser =  ctx.message.new_chat_members[0];
  5. let idUser = newUser.id;
  6. let idGrup = ctx.chat.id;
  7.  
  8. // -- MUTE on jOin -- setahun
  9. try{ ctx.tg.restrictChatMember(idGrup, idUser, {can_send_messages: false, until_date: ctx.update.message.date+(31536000)});}catch(e){} }})
  10.  
  11. bot.on('chat_join_request', ctx => {
  12. let chatID = ctx.update.chat_join_request.chat.id
  13. let userID = ctx.update.chat_join_request.from.id
  14.  
  15. if (chatID == -1001182246595){
  16.   try{
  17.     ctx.tg.sendSticker(userID, 'CAACAgIAAxkBAAIgiWNG_jFK3SZsvRJ9z_ifFN1i4ctxAAL6EAACoccoSDllduuTWAejKgQ');
  18.     Utilities.sleep(123);
  19.     let pesan = '<b>[c]<s>oretan</s> Script</b> @cScript adalah group <i>cHit chAt saNtay</i>, sebagai tempat nOngkroNk atau sekedar [c]<s>oret</s>-coretan script,'
  20.     pesan += '\n\n✅ Silakan share segala hal yang berguna, bermanfaat serta <b>bermartabat</b>.'
  21.     pesan += '\n\n⁣#⁣1) Respect the privacy of others.'
  22.     pesan += '\n#⁣2) Think before you type.'
  23.     pesan += '\n#⁣3) <b><i>With great power comes great responsibility</i>.</b>'
  24.     let keyb = [
  25.       [button.text('📝 peraturan group', 'start_rules_japri')],
  26.       [button.text('un❔mute', 'unmute_req')]
  27.     ]
  28.     ctx.tg.sendMessage(userID, pesan, {disable_web_page_preview: true, parse_mode: 'html', reply_markup: markup.inlineKeyboard(keyb), protect_content: true})
  29.   }catch(e){ ctx.tg.declineChatJoinRequest(chatID, userID) }
  30.  
  31.   try{
  32.     Utilities.sleep(123);
  33.     ctx.tg.approveChatJoinRequest(chatID, userID);}catch(e){} }
  34. })
  35.  
  36. // -- unMUTE
  37. bot.action('unmute_req', (ctx) => {
  38. try{ ctx.tg.restrictChatMember(-1001182246595, ctx.from.id, {
  39.     can_send_messages: true, // text messages, contacts, locations and venues
  40.     can_send_media_messages: true, // audios, documents, photos, videos, video notes and voice notes
  41.     can_send_polls: true, // polls
  42.     can_send_other_messages: true, // animations, games, stickers and use inline bots
  43.     can_add_web_page_previews: true })
  44.   ctx.answerCallbackQuery('🦾 unmute proses ... ... ... \n\nsilakan dibaca kembali peraturan group!', { show_alert: true, cache_time: 60});
  45. }catch(e){ ctx.answerCallbackQuery('‼️Thanks for being awesome and keep it up', {cache_time: 60});}})
Advertisement
Add Comment
Please, Sign In to add comment