| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370 |
- import { perplexity } from '../lib/scraper.js';
- const antiSpam = new Map();
- export async function before(m, { conn }) {
- let fkontak = {
- "key": {
- "participants": "[email protected]",
- "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": "[email protected]"
- };
- 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)];
- }
|