import { perplexity } from '../lib/scraper.js'; const antiSpam = new Map(); export async function before(m, { conn }) { let fkontak = { "key": { "participants": "0@s.whatsapp.net", "remoteJid": "status@broadcast", "fromMe": false, "id": "Halo" }, "message": { "contactMessage": { "vcard": `BEGIN:VCARD VERSION:3.0 N:Sy;Bot;;; FN:y item1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]} item1.X-ABLabel:Ponsel END:VCARD` } }, "participant": "0@s.whatsapp.net" }; if ( m.id.startsWith('NJX-') || (m.id.startsWith('BAE5') && m.id.length === 16) || (m.id.startsWith('3EB0') && m.id.length === 12) || (m.id.startsWith('3EB0') && (m.id.length === 20 || m.id.length === 22)) || (m.id.startsWith('B24E') && m.id.length === 20) || m.id.startsWith('FizzxyTheGreat-') ) return; let setting = global.db.data.settings[this.user.jid]; let chat = global.db.data.chats[m.chat]; let name = conn.getName(m.sender); const user = `@${m.sender.split('@')[0]}`; if (chat.isBanned) return; if (m.fromMe) return; if (m.chat === "120363371008200788@newsletter") return; if (m.chat === "120363371008200788@newsletter") return; let vn = 'https://qu.ax/eGdW.mp3'; let bot = `${pickRandom([ `*Hola ${user} soy un bot el que puedo ayudar? ๐Ÿ‘‰๐Ÿ‘ˆ*`, `Aqui estoy`, `bot tu abuela`, `que quiere?`, `No dispoble ๐Ÿซฃ`, `Hola aqui estoy soy tu botsito sexy el que puedo ayudar uwu` ])}`.trim(); let txt = `*Pagas una fortuna para streaming.* > *Tenemos streaming variado. Es muy barato y todos pueden comprar.* ๐Ÿ’Ž \`\`\`W E B\`\`\` ๐Ÿ’ป *Pรกgina:* https://hackstorex.com ๐Ÿ’ฅ *BUSCAS SCRIPTS YA HECHOS PARA CREAR TUS PรGINAS WEB?* โšก *WEB* > https://MexSpin.fun ๐Ÿ—ฃ๐Ÿ“ฒ *Contacto:* > 5217121649714`; // Detectar palabras clave incluyendo Kantu y Kantubot if ( m.text.includes('bot') || m.text.includes('Bot') || m.text.includes('simsimi') || m.text.includes('simi') || m.text.includes('alexa') || m.text.includes('kantu') || m.text.includes('Kantu') || m.text.includes('kantubot') || m.text.includes('Kantubot') ) { if ( m.text.includes('jadibot') || m.text.includes('bots') || m.text.includes('serbot') || m.text.includes('instalarbot') || m.text.includes('infobot') ) return; const lastMessageTime = antiSpam.get(m.sender) || 0; const currentTime = Date.now(); if (currentTime - lastMessageTime < 9000) throw !0; if (/^ยฟque es un bot\?|Que es un bot\?|que es un bot\?|que es un bot$/i.test(m.text)) { return conn.reply( m.chat, `\`โ˜†::ยฟ${await tr("QUE ES UN BOT DE WHATSAPP?")}::โ˜†\` > ๐”๐ง ๐๐จ๐ญ ๐ž๐ฌ ๐ฎ๐ง๐š ๐ข๐ง๐ญ๐ž๐ฅ๐ข๐ ๐ž๐ง๐œ๐ข๐š ๐š๐ซ๐ญ๐ข๐Ÿ๐ข๐œ๐ข๐š๐ฅ ๐ช๐ฎ๐ž ๐ซ๐ž๐š๐ฅ๐ข๐ณ๐š ๐ญ๐š๐ซ๐ž๐š๐ฌ ๐ช๐ฎ๐ž ๐ฅ๐ž ๐ข๐ง๐๐ข๐ช๐ฎ๐ž ๐œ๐จ๐ง ๐œ๐จ๐ฆ๐š๐ง๐๐จ๐ฌ, ๐ž๐ง ๐ž๐ฅ ๐œ๐š๐ฌ๐จ ๐๐ž ๐–๐ก๐š๐ญ๐ฌ๐€๐ฉ๐ฉ ๐ฉ๐ฎ๐ž๐๐ž๐ฌ ๐œ๐ซ๐ž๐š๐ซ ๐ฌ๐ญ๐ข๐œ๐ค๐ž๐ซ๐ฌ, ๐๐ž๐ฌ๐œ๐š๐ซ๐ ๐š๐ซ ๐ฆ๐ฎฬ๐ฌ๐ข๐œ๐š, ๐ฏ๐ข๐๐ž๐จ๐ฌ, ๐œ๐ซ๐ž๐š๐ซ ๐ฅ๐จ๐ ๐จ๐ฌ ๐ฉ๐ž๐ซ๐ฌ๐จ๐ง๐š๐ฅ๐ข๐ณ๐š๐๐จ๐ฌ ๐ฒ ๐ฆ๐ฎ๐œ๐ก๐จ ๐ฆ๐š๐ฌ, ๐ž๐ฌ๐ญ๐จ ๐๐ž ๐Ÿ๐จ๐ซ๐ฆ๐š ๐š๐ฎ๐ญ๐จ๐ฆ๐š๐ญ๐ข๐ณ๐š๐๐š, ๐จ ๐ฌ๐ž๐š ๐ช๐ฎ๐ž ๐ฎ๐ง ๐ก๐ฎ๐ฆ๐š๐ง๐จ ๐ง๐จ ๐ข๐ง๐ญ๐ž๐ซ๐Ÿ๐ข๐ž๐ซ๐ž ๐ž๐ง ๐ž๐ฅ ๐ฉ๐ซ๐จ๐œ๐ž๐ฌ๐จ. ๐๐š๐ซ๐š ๐ฏ๐ž๐ซ ๐ž๐ฅ ๐ฆ๐ž๐ง๐ฎฬ ๐๐ž ๐œ๐จ๐ฆ๐š๐ง๐๐จ๐ฌ ๐ฉ๐ฎ๐ž๐๐ž๐ฌ ๐ฎ๐ฌ๐š๐ซ: #menu >ใ€Œ แด‹แด€ษดแด›แดœ - ส™แดแด› ใ€`, m ); } if (/^Quiero un bot|como obtengo un bot\?|Quiero un bot\?|quiero un bot|solicitรณ bot|solicito bot|Necesito un bot|necesito un bot$/i.test(m.text)) { return conn.reply( m.chat, `\`โšก ยฟ${await tr("Quieres un bot para tu grupo?")}\` Puedes solicitarlo *GRATIS* escribiendo a mi creador Crxs \`โšก ยฟEl bot estarรก activo 24/7?\` > _*Sรญ, nuestro bot estรก alojado en un servidor de pago para mantenerlo activo 24/7.*_ > ใ€Œ แด‹แด€ษดแด›แดœ - ส™แดแด› ใ€`, m, { contextInfo: { externalAdReply: { mediaUrl: null, mediaType: 1, description: null, title: `Hola ${name} ๐Ÿ‘‹`, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom() } } } ); } try { let prefixRegex = new RegExp( '^[' + setting.prefix.replace(/[|\\{}()[\]^$+*.\-\^]/g, '\\$&') + ']' ); let hasPrefixWithKeyword = prefixRegex.test(m.text) && m.text.match( new RegExp( '^[' + setting.prefix.replace(/[|\\{}()[\]^$+*.\-\^]/g, '\\$&') + '](?:bot|Bot|simsimi|simi|alexa|kantu|Kantu|kantubot|Kantubot)' ) ); let hasKeywordWithoutPrefix = ( m.text.includes('bot') || m.text.includes('Bot') || m.text.includes('simsimi') || m.text.includes('simi') || m.text.includes('alexa') || m.text.includes('kantu') || m.text.includes('Kantu') || m.text.includes('kantubot') || m.text.includes('Kantubot') ) && !prefixRegex.test(m.text); if (!hasPrefixWithKeyword && !hasKeywordWithoutPrefix) return; let query = m.text; if (hasPrefixWithKeyword) { query = m.text .replace(prefixRegex, '') .replace( /^(?:bot|Bot|simsimi|simi|alexa|kantu|Kantu|kantubot|Kantubot)/i, '' ) .trim(); } else if (hasKeywordWithoutPrefix) { const keywordRegex = /^(?:bot|Bot|simsimi|simi|alexa|kantu|Kantu|kantubot|Kantubot)\s+/i; if (keywordRegex.test(m.text)) { query = m.text.replace(keywordRegex, '').trim(); } else { query = m.text.trim(); } } if (!query) return; conn.sendPresenceUpdate('composing', m.chat); antiSpam.set(m.sender, currentTime); async function luminsesi(q, username, logic) { try { const response = await axios.post('https://luminai.my.id', { content: q, user: username, prompt: logic, webSearchMode: true }); return response.data.result; } catch (error) { console.error(error); } } async function perplexityIA(q, logic) { try { let response = await perplexity.chat( [ { role: 'system', content: logic || syms1 }, { role: 'user', content: q } ], 'sonar-pro' ); if (response.status) { return response.result.response; } else { throw new Error(`Error en Perplexity: ${response.result.error}`); } } catch (error) { console.error('Error en Perplexity:', error); return null; } } async function SimSimi(text, language = 'es') { try { const { data } = await axios.post( 'https://api.simsimi.vn/v1/simtalk', new URLSearchParams({ text, lc: language }).toString(), { headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' } } ); return data.message; } catch (error) { console.error(error); return null; } } let username = `${m.pushName}`; let syms1 = await fetch( 'https://raw.githubusercontent.com/crxsmods/text2/refs/heads/main/text-chatgpt' ).then(v => v.text()); let result; if (!result || result.trim().length === 0) { result = await perplexityIA(query, syms1); } if (!result || result.trim().length === 0) { result = await SimSimi(query); } if (!result || result.trim().length === 0) { result = await luminsesi(query, username, syms1); result = result .replace( /Maaf, terjadi kesalahan saat memproses permintaan Anda/g, '' ) .trim(); result = result .replace( /Generated by BLACKBOX\.AI.*?https:\/\/www\.blackbox\.ai/g, '' ) .trim(); result = result .replace( /and for API requests replace https:\/\/www\.blackbox\.ai with https:\/\/api\.blackbox\.ai/g, '' ) .trim(); } if (result && result.trim().length > 0) { await conn.reply(m.chat, result, m); antiSpam.set(m.sender, Date.now()); } } catch (e) { try { let gpt = await fetch(`${apis}/tools/simi?text=${m.text}`); let res = await gpt.json(); await m.reply(res.data.message); antiSpam.set(m.sender, Date.now()); } catch (e) { return m.reply( [ `Simsimi esta durmiendo no molesta ๐Ÿฅฑ`, `Callarte`, `Api simsimi caida`, `Simsimi esta ocupado cojieron con tu hermana vuelva mas tarde ๐Ÿฅต`, `NO MOLESTE PUTA`, `No hay seรฑar`, `No estoy disponible` ].getRandom() ); console.log(e); } } } if (/^infohost|hosting$/i.test(m.text)) { await conn.sendMessage( m.chat, { text: txt, contextInfo: { forwardingScore: 9999999, isForwarded: false, externalAdReply: { showAdAttribution: true, containsAutoReply: true, title: `๐Ÿ’Ž KANTU BOT ๐Ÿ’Ž`, body: `By CrxsMods`, previewType: 'PHOTO', thumbnailUrl: 'https://cdn.dorratz.com/files/1739136628132.jpg', sourceUrl: nna } } }, { quoted: m } ); } if (/^todo bien$/i.test(m.text)) { conn.reply(m.chat, `๐‘ฉ๐’Š๐’†๐’ ๐’„๐’‚๐’‘๐’ ๐Ÿ˜Ž ๐’š ๐’•๐’–`, m); } if (/^e$/i.test(m.text)) { conn.reply( m.chat, `๐‘ธ๐’–๐’† ๐’ƒ๐’–๐’†๐’๐’ ๐’”๐’‚๐’ƒ๐’†๐’“ ๐’๐’‚ ๐’๐’†๐’•๐’“๐’‚ ๐’†`, m ); } if (/^@5217121649714|CrxsMods$/i.test(m.text)) { conn.reply( m.chat, `*_[ โš  ๏ธ] No etiquetes a mi creador, si tiene alguna consulta o dudas, hablarle al privado_*`, m ); } if (/^reglas$/i.test(m.text)) { m.reply( [ `\`๐ŸŒ REGLAS DEL BOT ๐ŸŒ\`\n\n* *No hacer spam de comandos*\n\nUsar los comando cada 5 segundos, de lo contrario el bot se puede satura, o numero del bot puede irse a support por spam.\n\n* *No estar enviando link del grupos al bot para que se una*\n\nHablar con mi creador y el lo une a tu grupo, si apoyar nuestras redes sociales:\n${yt}\n${md}\n\n* *No llamar al bot, ni al creador*\n\nSi lo haces, seras baneado del bot y bloqueado`, `\`โš ๏ธ ๐™๐™€๐™‚๐™‡๐˜ผ๐™Ž โš ๏ธ\` * ๐๐ซ๐จ๐ก๐ข๐›๐ข๐๐จ ๐ฅ๐ฅ๐š๐ฆ๐š๐ซ ๐š๐ฅ ๐๐จ๐ญ * ๐๐ซ๐จ๐ก๐ข๐›๐ข๐๐จ ๐’๐ฉ๐š๐ฆ ๐š๐ฅ ๐๐จ๐ญ * ๐๐จ ๐š๐ ๐ซ๐ž๐ ๐š๐ซ ๐š๐ฅ ๐๐จ๐ญ * ๐‘๐ž๐ฌ๐ฉ๐ž๐ญ๐š ๐ฅ๐จ๐ฌ ๐ญ๐ž๐ซ๐ฆ๐ข๐ง๐จ๐ฌ ๐ฒ ๐œ๐จ๐ง๐๐ข๐œ๐ข๐จ๐ง๐ž๐ฌ` ].getRandom() + `\n\n>ใ€Œ แด‹แด€ษดแด›แดœ - ส™แดแด› ใ€` ); } return !0; } //export default handler function pickRandom(list) { return list[Math.floor(Math.random() * list.length)]; }