Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bot.on('new_chat_members', ctx => {
- if (helper.isIn(groupRestrict, ctx.chat.id) ){
- let newUser = ctx.message.new_chat_members[0];
- let idUser = newUser.id;
- let idGrup = ctx.chat.id;
- // -- MUTE on jOin -- setahun
- try{ ctx.tg.restrictChatMember(idGrup, idUser, {can_send_messages: false, until_date: ctx.update.message.date+(31536000)});}catch(e){} }})
- bot.on('chat_join_request', ctx => {
- let chatID = ctx.update.chat_join_request.chat.id
- let userID = ctx.update.chat_join_request.from.id
- if (chatID == -1001182246595){
- try{
- ctx.tg.sendSticker(userID, 'CAACAgIAAxkBAAIgiWNG_jFK3SZsvRJ9z_ifFN1i4ctxAAL6EAACoccoSDllduuTWAejKgQ');
- Utilities.sleep(123);
- 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,'
- pesan += '\n\n✅ Silakan share segala hal yang berguna, bermanfaat serta <b>bermartabat</b>.'
- pesan += '\n\n#1) Respect the privacy of others.'
- pesan += '\n#2) Think before you type.'
- pesan += '\n#3) <b><i>With great power comes great responsibility</i>.</b>'
- let keyb = [
- [button.text('📝 peraturan group', 'start_rules_japri')],
- [button.text('un❔mute', 'unmute_req')]
- ]
- ctx.tg.sendMessage(userID, pesan, {disable_web_page_preview: true, parse_mode: 'html', reply_markup: markup.inlineKeyboard(keyb), protect_content: true})
- }catch(e){ ctx.tg.declineChatJoinRequest(chatID, userID) }
- try{
- Utilities.sleep(123);
- ctx.tg.approveChatJoinRequest(chatID, userID);}catch(e){} }
- })
- // -- unMUTE
- bot.action('unmute_req', (ctx) => {
- try{ ctx.tg.restrictChatMember(-1001182246595, ctx.from.id, {
- can_send_messages: true, // text messages, contacts, locations and venues
- can_send_media_messages: true, // audios, documents, photos, videos, video notes and voice notes
- can_send_polls: true, // polls
- can_send_other_messages: true, // animations, games, stickers and use inline bots
- can_add_web_page_previews: true })
- ctx.answerCallbackQuery('🦾 unmute proses ... ... ... \n\nsilakan dibaca kembali peraturan group!', { show_alert: true, cache_time: 60});
- }catch(e){ ctx.answerCallbackQuery('‼️Thanks for being awesome and keep it up', {cache_time: 60});}})
Advertisement
Add Comment
Please, Sign In to add comment