├── database ├── group.json ├── media │ ├── Cache │ ├── audio │ │ └── cache │ ├── image │ │ ├── cache │ │ └── auron.jpg │ ├── sticker │ │ └── cache │ └── video │ │ └── cache ├── user.json ├── welcome.json ├── msg.data.json ├── directory.json └── setting-bot.json ├── temp ├── fake.jpg └── fg.jpg ├── language ├── index.js ├── en.js ├── es.js ├── pt.js └── id.js ├── FUNDING.yml ├── library ├── color.js ├── fetcher.js ├── converter.js └── functions.js ├── functions ├── antispam.js ├── directory.js ├── setting-bot.js ├── menu.js ├── welcome.js ├── group.js └── user.js ├── result ├── download │ ├── mediafire.js │ ├── pinterest_img.js │ ├── tiktokPost_dl.js │ ├── instagramPost_dl.js │ └── yt_download.js ├── game │ └── riddle-es.js ├── search │ └── playstore.js ├── index.js ├── random │ ├── reto.json │ └── verdad.json └── informasi │ └── text_generator.js ├── SECURITY.md ├── LICENSE ├── start.js ├── .gitignore ├── package.json ├── .github └── workflows │ └── codeql-analysis.yml ├── README.md ├── main.js └── whatsapp └── connecting.js /database/group.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /database/media/Cache: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/user.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /database/welcome.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /database/media/audio/cache: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/media/image/cache: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/media/sticker/cache: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/media/video/cache: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/msg.data.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /temp/fake.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FG98F/dylux/HEAD/temp/fake.jpg -------------------------------------------------------------------------------- /temp/fg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FG98F/dylux/HEAD/temp/fg.jpg -------------------------------------------------------------------------------- /database/media/image/auron.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FG98F/dylux/HEAD/database/media/image/auron.jpg -------------------------------------------------------------------------------- /language/index.js: -------------------------------------------------------------------------------- 1 | exports.espa = require('./es') 2 | exports.ind = require('./id') 3 | exports.eng = require('./en') 4 | exports.port = require('./pt') 5 | -------------------------------------------------------------------------------- /database/directory.json: -------------------------------------------------------------------------------- 1 | { 2 | "image": [ 3 | "auron" 4 | ], 5 | "video": [], 6 | "audio": [], 7 | "sticker": [], 8 | "report": [], 9 | "respon": [] 10 | } -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | # 2 | 3 | github: ['FG98F'] # Reemplazar con hasta 4 nombres de usuario habilitados para patrocinadores de GitHub e.g., [user1, user2] 4 | custom: ['https://tinyurl.com/PayPal-fg'] # Reemplazar con hasta 4 patrocinios personalizados URLs e.g., ['link1', 'link2'] 5 | -------------------------------------------------------------------------------- /library/color.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk') 2 | 3 | const color = (text, color) => { 4 | return !color ? chalk.green(text) : chalk.keyword(color)(text) 5 | } 6 | 7 | const bgcolor = (text, bgcolor) => { 8 | return !bgcolor ? chalk.green(text) : chalk.bgKeyword(bgcolor)(text) 9 | } 10 | 11 | module.exports = { 12 | color, 13 | bgcolor 14 | } 15 | -------------------------------------------------------------------------------- /database/setting-bot.json: -------------------------------------------------------------------------------- 1 | { 2 | "ownerNumber": [ 3 | "59172945992@s.whatsapp.net", "5493885839638@s.whatsapp.net" 4 | ], 5 | "nama": "DyLux-Bot", 6 | "author": "DyLux", 7 | "packname": "@fg98._", 8 | "wm": "Sígueme en Instagram\nhttps://www.instagram.com/fg98._", 9 | "linkIg": "https://www.instagram.com/fg98._", 10 | "gameTime": 30000, 11 | "poinGame": 100, 12 | "poinAwal": 500, 13 | "totalcommand": 1, 14 | "hujanApi": "booA9w501BicnLk" 15 | } 16 | -------------------------------------------------------------------------------- /functions/antispam.js: -------------------------------------------------------------------------------- 1 | // Cooldown en mensajes 2 | const usedCommandRecently = new Set(); 3 | 4 | const isFiltered = (from) => { 5 | return !!usedCommandRecently.has(from); 6 | }; 7 | 8 | const addFilter = (from) => { 9 | usedCommandRecently.add(from); 10 | setTimeout(() => { 11 | return usedCommandRecently.delete(from); 12 | }, 3000);// 3sec es el cooldown para el siguiente comando; 13 | }; 14 | module.exports = { 15 | msgFilter: { 16 | isFiltered, 17 | addFilter 18 | }}; -------------------------------------------------------------------------------- /result/download/mediafire.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios') 2 | const cheerio = require('cheerio') 3 | 4 | const mfire = async (url) => { 5 | const res = await axios.get(url) 6 | const $ = cheerio.load(res.data) 7 | const hasil = [] 8 | const link = $('a#downloadButton').attr('href') 9 | const size = $('a#downloadButton').text().replace('Download', '').replace('(', '').replace(')', '').replace('\n', '').replace('\n', '').replace(' ', '') 10 | const seplit = link.split('/') 11 | const name = seplit[5] 12 | mime = name.split('.') 13 | mime = mime[1] 14 | hasil.push({ name, mime, size, link }) 15 | return hasil 16 | } 17 | 18 | 19 | module.exports = { mfire } 20 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Politica de seguridad 2 | 3 | ## Versiones admitidas 4 | 5 | Use esta sección para decirle a la gente qué versiones de su proyecto están 6 | actualmente es compatible con actualizaciones de seguridad. 7 | 8 | | Version | Soportado | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Informar de una vulnerabilidad 16 | 17 | Utilice esta sección para decirle a las personas cómo informar una vulnerabilidad. 18 | 19 | Dígales adónde ir, con qué frecuencia pueden esperar recibir una actualización sobre un 20 | vulnerabilidad reportada, qué esperar si la vulnerabilidad es aceptada o rechazado, etc. 21 | -------------------------------------------------------------------------------- /result/game/riddle-es.js: -------------------------------------------------------------------------------- 1 | [ 2 | { "author" : "FG98", 3 | "index": 1, 4 | "soal": "Animales como las lagartijas que pueden cambiar el color de su piel.?", 5 | "jawaban": "Camaleón" 6 | }, 7 | { "author" : "FG98", 8 | "index": 2, 9 | "soal": "Carta de instrucción a Suharto para hacerse cargo de la seguridad de Indonesia el 11 de marzo de 1966?", 10 | "jawaban": "Supersemar" 11 | }, 12 | { "author" : "FG98", 13 | "index": 3, 14 | "soal": "El río más largo de América?", 15 | "jawaban": "Amazon" 16 | }, 17 | { "author" : "FG98", 18 | "index": 6, 19 | "soal": "¿El nombre de la película que cuenta la historia de un robot que puede convertirse en vehículo?", 20 | "jawaban": "Transformers" 21 | }, 22 | { "author" : "FG98", 23 | "index": 7, 24 | "soal": "¿El nombre del lujoso barco de pasajeros que se hundió durante su viaje inaugural en 1912?", 25 | "jawaban": "Titanic" 26 | } 27 | ] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 FG98 4 | 5 | Por la presente se otorga permiso, sin cargo, 6 | a cualquier persona que obtenga una copia. 7 | de este software y los archivos de documentación asociados (el "Software"), 8 | para tratar en el Software sin restricciones, incluidos, entre otros, los derechos para usar, 9 | copiar, modificar, fusionar, publicar, distribuir, sublicenciar y / o vender copias del 10 | Software y para permitir a las personas a las que se amueblado para ello, sujeto a las siguientes condiciones: 11 | 12 | El aviso de copyright anterior y este aviso de permiso se incluirán en todos copias o partes sustanciales del Software. 13 | 14 | EL SOFTWARE SE PROPORCIONA "TAL CUAL", SIN GARANTÍA DE NINGÚN TIPO, EXPRESA O IMPLÍCITAS, INCLUIDAS PERO NO LIMITADAS A LAS GARANTÍAS 15 | DE COMERCIABILIDAD, APTITUD PARA UN PROPÓSITO PARTICULAR Y NO INFRACCIÓN. 16 | EN NINGÚN CASO LOS AUTORES O TITULARES DE LOS DERECHOS DE AUTOR SERÁN RESPONSABLES DE CUALQUIER RECLAMO, 17 | DAÑOS U OTROS RESPONSABILIDAD, YA SEA EN UNA ACCIÓN DE CONTRATO, AGRAVIO O DE OTRO MODO, QUE SURJA DE, 18 | FUERA DE O EN RELACIÓN CON EL SOFTWARE O EL USO U OTROS NEGOCIOS EN EL SOFTWARE. 19 | -------------------------------------------------------------------------------- /result/search/playstore.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | function playstore(name){ 5 | return new Promise((resolve, reject) => { 6 | axios.get('https://play.google.com/store/search?q='+ name +'&c=apps') 7 | .then(({ data }) => { 8 | const $ = cheerio.load(data) 9 | let ln = []; 10 | let nm = []; 11 | let dv = []; 12 | let lm = []; 13 | const result = []; 14 | $('div.wXUyZd > a').each(function(a,b){ 15 | const link = 'https://play.google.com' + $(b).attr('href') 16 | ln.push(link); 17 | }) 18 | $('div.b8cIId.ReQCgd.Q9MA7b > a > div').each(function(d,e){ 19 | const name = $(e).text().trim() 20 | nm.push(name); 21 | }) 22 | $('div.b8cIId.ReQCgd.KoLSrc > a > div').each(function(f,g){ 23 | const dev = $(g).text().trim(); 24 | dv.push(dev) 25 | }) 26 | $('div.b8cIId.ReQCgd.KoLSrc > a').each(function(h,i){ 27 | const limk = 'https://play.google.com' + $(i).attr('href'); 28 | lm.push(limk); 29 | }) 30 | for (let i = 0; i < ln.length; i++){ 31 | result.push({ 32 | name: nm[i], 33 | link: ln[i], 34 | developer: dv[i], 35 | link_dev: lm[i] 36 | }) 37 | } 38 | resolve(result) 39 | }) 40 | .catch(reject) 41 | }) 42 | } 43 | 44 | module.exports = { 45 | playstore 46 | } -------------------------------------------------------------------------------- /result/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | // new function 3 | function readfile(file) { 4 | return JSON.parse(fs.readFileSync(file)); 5 | } 6 | 7 | function pickRandom(list) { 8 | return list[Math.floor(Math.random() * list.length)]; 9 | } 10 | 11 | // -- file from result json 12 | const _verdad = readfile('./result/random/verdad.json'); 13 | const _reto = readfile('./result/random/reto.json'); 14 | 15 | // -- get results 16 | const verdad = () => { 17 | return pickRandom(_verdad); 18 | }; 19 | 20 | const reto = () => { 21 | return pickRandom(_reto); 22 | }; 23 | 24 | 25 | 26 | // -- result download 27 | const { pinterest } = require('./download/pinterest_img'); 28 | const { igDl } = require('./download/instagramPost_dl'); 29 | const { Ttdl } = require('./download/tiktokPost_dl'); 30 | const { yta, ytv } = require('./download/yt_download'); 31 | const { mfire } = require('./download/mediafire.js') 32 | // -- result search 33 | const { playstore } = require('./search/playstore'); 34 | 35 | // information 36 | const { namaninja, purba, blackpill, typewriter, sans, castle } = require('./informasi/text_generator'); 37 | 38 | module.exports = { 39 | verdad, 40 | reto, 41 | namaninja, 42 | purba, 43 | blackpill, 44 | typewriter, 45 | sans, 46 | castle, 47 | pinterest, 48 | playstore, 49 | igDl, 50 | Ttdl, 51 | yta, 52 | ytv, 53 | mfire 54 | }; 55 | -------------------------------------------------------------------------------- /start.js: -------------------------------------------------------------------------------- 1 | console.log('✅ Iniciando...') 2 | let { spawn } = require('child_process') 3 | let path = require('path') 4 | let fs = require('fs') 5 | let package = require('./package.json') 6 | const CFonts = require('cfonts') 7 | 8 | CFonts.say('FG98', { 9 | font: 'pallet', 10 | align: 'center', 11 | gradient: ['red', 'magenta'] 12 | }) 13 | CFonts.say(`dylux-bot By FG98 Ig : @fg98._`, { 14 | font: 'console', 15 | align: 'center', 16 | colors: ['yellow'] 17 | }) 18 | 19 | var isRunning = false; 20 | /** 21 | * Start a js file 22 | * @param {String} file `path/to/file` 23 | */ 24 | function start(file) { 25 | if (isRunning) return; 26 | isRunning = true; 27 | let args = [path.join(__dirname, file), ...process.argv.slice(2)]; 28 | let p = spawn(process.argv[0], args, { 29 | stdio: ['inherit', 'inherit', 'inherit', 'ipc'] 30 | }); 31 | p.on('message', data => { 32 | console.log('[RECEIVED]', data); 33 | switch (data) { 34 | case 'reset': 35 | p.kill(); 36 | isRunning = false; 37 | start.apply(this, arguments); 38 | break 39 | case 'uptime': 40 | p.send(process.uptime()); 41 | break 42 | } 43 | }); 44 | p.on('exit', code => { 45 | isRunning = false; 46 | console.error('Exited with code:', code); 47 | if (code === 0) return; 48 | fs.watchFile(args[0], () => { 49 | fs.unwatchFile(args[0]); 50 | start(file); 51 | }); 52 | }); 53 | 54 | } 55 | 56 | start('main.js'); 57 | -------------------------------------------------------------------------------- /functions/directory.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | let direc = JSON.parse(fs.readFileSync('./database/directory.json')); 3 | 4 | /** 5 | * add img 6 | * @param { string } value 7 | */ 8 | const addImage = (value) => { 9 | text = value; 10 | direc.image.push(text); 11 | fs.writeFileSync('./database/directory.json', JSON.stringify(direc, null, '\t')); 12 | }; 13 | 14 | /** 15 | * add video 16 | * @param { string } value 17 | */ 18 | const addVideo = (value) => { 19 | text = value; 20 | direc.video.push(text); 21 | fs.writeFileSync('./database/directory.json', JSON.stringify(direc, null, '\t')); 22 | }; 23 | 24 | /** 25 | * add audio 26 | * @param { string } value 27 | */ 28 | const addAudio = (value) => { 29 | text = value; 30 | direc.audio.push(text); 31 | fs.writeFileSync('./database/directory.json', JSON.stringify(direc, null, '\t')); 32 | }; 33 | 34 | /** 35 | * add sticker 36 | * @param { string } value 37 | */ 38 | const addStiker = (value) => { 39 | text = value; 40 | direc.sticker .push(text); 41 | fs.writeFileSync('./database/directory.json', JSON.stringify(direc, null, '\t')); 42 | }; 43 | 44 | /** 45 | * add report 46 | * @param { string } id 47 | * @param { Object } value 48 | */ 49 | 50 | const addReport = (id, value) => { 51 | text = value; 52 | obj = { 53 | id: id, 54 | report: value 55 | }; 56 | direc.report.push(obj); 57 | fs.writeFileSync('./database/directory.json', JSON.stringify(direc, null, '\t')); 58 | }; 59 | 60 | module.exports = { 61 | direc, 62 | addImage, 63 | addVideo, 64 | addStiker, 65 | addAudio, 66 | addReport 67 | }; -------------------------------------------------------------------------------- /library/fetcher.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch'); 2 | const fs = require('fs'); 3 | const axios = require("axios"); 4 | 5 | 6 | exports.getBase64 = getBase64 = async (url) => { 7 | const response = await fetch(url, { headers: { 'User-Agent': 'okhttp/4.5.0' } }); 8 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`); 9 | const buffer = await response.buffer(); 10 | const videoBase64 = `data:${response.headers.get('content-type')};base64,` + buffer.toString('base64'); 11 | if (buffer) 12 | return videoBase64; 13 | }; 14 | 15 | exports.getBuffer = getBuffer = async (url, options) => { 16 | try { 17 | options ? options : {} 18 | const res = await axios({ 19 | method: "get", 20 | url, 21 | headers: { 22 | 'DNT': 1, 23 | 'Upgrade-Insecure-Request': 1 24 | }, 25 | ...options, 26 | responseType: 'arraybuffer' 27 | }) 28 | return res.data 29 | } catch (e) { 30 | console.log(`Error : ${e}`) 31 | } 32 | } 33 | 34 | exports.fetchJson = fetchJson = (url, options) => new Promise(async (resolve, reject) => { 35 | fetch(url, options) 36 | .then(response => response.json()) 37 | .then(json => { 38 | // console.log(json) 39 | resolve(json) 40 | }) 41 | .catch((err) => { 42 | reject(err) 43 | }) 44 | }) 45 | 46 | 47 | exports.fetchText = fetchText = (url, options) => new Promise(async (resolve, reject) => { 48 | fetch(url, options) 49 | .then(response => response.text()) 50 | .then(text => { 51 | // console.log(text) 52 | resolve(text) 53 | }) 54 | .catch((err) => { 55 | reject(err) 56 | }) 57 | }) 58 | 59 | //exports.getBase64 = getBase64; 60 | -------------------------------------------------------------------------------- /functions/setting-bot.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | const st = JSON.parse(fs.readFileSync('./database/setting-bot.json')); 4 | 5 | /** 6 | * 7 | * @param { Object } value 8 | */ 9 | const addName = (value) => { 10 | st.nama = value; 11 | fs.writeFileSync('./database/setting-bot.json', JSON.stringify(st, null, "\t")); 12 | }; 13 | 14 | /** 15 | * 16 | * @param { Object } value 17 | */ 18 | const addAuthor = (value) => { 19 | st.author = value; 20 | fs.writeFileSync('./database/setting-bot.json', JSON.stringify(st, null, "\t")); 21 | }; 22 | 23 | /** 24 | * 25 | * @param { Object } value 26 | */ 27 | const addPackname = (value) => { 28 | st.packname = value; 29 | fs.writeFileSync('./database/setting-bot.json', JSON.stringify(st, null, "\t")); 30 | }; 31 | 32 | /** 33 | * 34 | * @param { Object } value 35 | */ 36 | const addWm = (value) => { 37 | st.wm = value; 38 | fs.writeFileSync('./database/setting-bot.json', JSON.stringify(st, null, "\t")); 39 | }; 40 | 41 | /** 42 | * 43 | * @param { Number } value 44 | */ 45 | const addPoingame = (value) => { 46 | st.poinGame = value; 47 | fs.writeFileSync('./database/setting-bot.json', JSON.stringify(st, null, "\t")); 48 | }; 49 | 50 | /** 51 | * 52 | * @param { Number } value 53 | */ 54 | const addGamewaktu = (value) => { 55 | st.gameWaktu = value; 56 | fs.writeFileSync('./database/setting-bot.json', JSON.stringify(st, null, "\t")); 57 | }; 58 | 59 | /** 60 | * 61 | * @param {Boolean } true 62 | */ 63 | const addCmd = () => { 64 | st.totalcommand += 1; 65 | fs.writeFileSync('./database/setting-bot.json', JSON.stringify(st, null, "\t")); 66 | }; 67 | 68 | 69 | module.exports = { 70 | st, 71 | addName, 72 | addAuthor, 73 | addPackname, 74 | addWm, 75 | addGamewaktu, 76 | addPoingame, 77 | addCmd 78 | }; -------------------------------------------------------------------------------- /result/download/pinterest_img.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | function pinterest(querry){ 5 | return new Promise(async(resolve,reject) => { 6 | axios.get('https://es.pinterest.com/search/pins/?autologin=true&q=' + querry, { 7 | headers: { 8 | "cookie" : "_auth=1; _b=\"AVna7S1p7l1C5I9u0+nR3YzijpvXOPc6d09SyCzO+DcwpersQH36SmGiYfymBKhZcGg=\"; _pinterest_sess=TWc9PSZHamJOZ0JobUFiSEpSN3Z4a2NsMk9wZ3gxL1NSc2k2NkFLaUw5bVY5cXR5alZHR0gxY2h2MVZDZlNQalNpUUJFRVR5L3NlYy9JZkthekp3bHo5bXFuaFZzVHJFMnkrR3lTbm56U3YvQXBBTW96VUgzVUhuK1Z4VURGKzczUi9hNHdDeTJ5Y2pBTmxhc2owZ2hkSGlDemtUSnYvVXh5dDNkaDN3TjZCTk8ycTdHRHVsOFg2b2NQWCtpOWxqeDNjNkk3cS85MkhhSklSb0hwTnZvZVFyZmJEUllwbG9UVnpCYVNTRzZxOXNJcmduOVc4aURtM3NtRFo3STlmWjJvSjlWTU5ITzg0VUg1NGhOTEZzME9SNFNhVWJRWjRJK3pGMFA4Q3UvcHBnWHdaYXZpa2FUNkx6Z3RNQjEzTFJEOHZoaHRvazc1c1UrYlRuUmdKcDg3ZEY4cjNtZlBLRTRBZjNYK0lPTXZJTzQ5dU8ybDdVS015bWJKT0tjTWYyRlBzclpiamdsNmtpeUZnRjlwVGJXUmdOMXdTUkFHRWloVjBMR0JlTE5YcmhxVHdoNzFHbDZ0YmFHZ1VLQXU1QnpkM1FqUTNMTnhYb3VKeDVGbnhNSkdkNXFSMXQybjRGL3pyZXRLR0ZTc0xHZ0JvbTJCNnAzQzE0cW1WTndIK0trY05HV1gxS09NRktadnFCSDR2YzBoWmRiUGZiWXFQNjcwWmZhaDZQRm1UbzNxc21pV1p5WDlabm1UWGQzanc1SGlrZXB1bDVDWXQvUis3elN2SVFDbm1DSVE5Z0d4YW1sa2hsSkZJb1h0MTFpck5BdDR0d0lZOW1Pa2RDVzNySWpXWmUwOUFhQmFSVUpaOFQ3WlhOQldNMkExeDIvMjZHeXdnNjdMYWdiQUhUSEFBUlhUVTdBMThRRmh1ekJMYWZ2YTJkNlg0cmFCdnU2WEpwcXlPOVZYcGNhNkZDd051S3lGZmo0eHV0ZE42NW8xRm5aRWpoQnNKNnNlSGFad1MzOHNkdWtER0xQTFN5Z3lmRERsZnZWWE5CZEJneVRlMDd2VmNPMjloK0g5eCswZUVJTS9CRkFweHc5RUh6K1JocGN6clc1JmZtL3JhRE1sc0NMTFlpMVErRGtPcllvTGdldz0=; _ir=0" 9 | } 10 | }).then(({ data }) => { 11 | const $ = cheerio.load(data) 12 | const result = []; 13 | const hasil = []; 14 | $('div > a').get().map(b => { 15 | const link = $(b).find('img').attr('src') 16 | result.push(link) 17 | }); 18 | result.forEach(v => { 19 | if(v == undefined) return 20 | hasil.push(v.replace(/236/g,'736')) 21 | }) 22 | hasil.shift(); 23 | resolve(hasil) 24 | }) 25 | }) 26 | } 27 | 28 | module.exports = { 29 | pinterest 30 | } 31 | 32 | //© 2021 FG98 -------------------------------------------------------------------------------- /result/download/tiktokPost_dl.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | async function Ttdl (Url) { 5 | return new Promise (async (resolve, reject) => { 6 | await axios.request({ 7 | url: "https://ttdownloader.com/", 8 | method: "GET", 9 | headers: { 10 | "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", 11 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 12 | "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", 13 | "cookie": "_ga=GA1.2.1240046717.1620835673; PHPSESSID=i14curq5t8omcljj1hlle52762; popCookie=1; _gid=GA1.2.1936694796.1623913934" 14 | } 15 | }).then(respon => { 16 | const $ = cheerio.load(respon.data) 17 | const token = $('#token').attr('value') 18 | axios({ 19 | url: "https://ttdownloader.com/req/", 20 | method: "POST", 21 | data: new URLSearchParams(Object.entries({url: Url, format: "", token: token})), 22 | headers: { 23 | "accept": "*/*", 24 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 25 | "content-type": "application/x-www-form-urlencoded; charset=UTF-8", 26 | "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", 27 | "cookie": "_ga=GA1.2.1240046717.1620835673; PHPSESSID=i14curq5t8omcljj1hlle52762; popCookie=1; _gid=GA1.2.1936694796.1623913934" 28 | } 29 | }).then(res => { 30 | const ch = cheerio.load(res.data) 31 | const result = { 32 | status: res.status, 33 | result: { 34 | nowatermark: ch('#results-list > div:nth-child(2)').find('div.download > a').attr('href'), 35 | watermark: ch('#results-list > div:nth-child(3)').find('div.download > a').attr('href'), 36 | audio: ch('#results-list > div:nth-child(4)').find(' div.download > a').attr('href') 37 | } 38 | } 39 | resolve(result) 40 | }).catch(reject) 41 | }).catch(reject) 42 | }) 43 | } 44 | 45 | module.exports = { Ttdl} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dylux-bot", 3 | "version": "0.5.0", 4 | "description": "WhatsApp Bot Baileys", 5 | "main": "main.js", 6 | "directories": { 7 | "lib": "library" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/FG98F/dylux-bot.git" 12 | }, 13 | "dependencies": { 14 | "@adiwajshing/baileys": "^3.5.3", 15 | "@iamtraction/google-translate": "^1.1.2", 16 | "@vitalets/google-translate-api": "^7.0.0", 17 | "async": "^2.4.1", 18 | "awesome-phonenumber": "^2.48.0", 19 | "axios": "^0.21.1", 20 | "brainly-scraper": "^1.0.3", 21 | "brainly-scraper-v2": "^2.0.4-1", 22 | "browser-id3-writer": "^4.4.0", 23 | "cfonts": "^2.9.0", 24 | "child_process": "^1.0.2", 25 | "color": "^4.0.0", 26 | "crypto": "^1.0.1", 27 | "dotenv": "^8.2.0", 28 | "emoji-api": "^1.0.2", 29 | "express": "^4.17.1", 30 | "fake-useragent": "^1.0.1", 31 | "figlet": "^1.5.0", 32 | "file-type": "^16.3.0", 33 | "fluent-ffmpeg": "^2.1.2", 34 | "form-data": "^4.0.0", 35 | "fs-extra": "^10.0.0", 36 | "g-i-s": "^2.1.6", 37 | "google-it": "^1.6.2", 38 | "got": "^11.8.2", 39 | "image-to-base64": "^2.2.0", 40 | "insta-fetcher": "^1.2.3", 41 | "jsdom": "^16.5.2", 42 | "moment-timezone": "^0.5.33", 43 | "ms": "^2.1.3", 44 | "multistream": "^4.1.0", 45 | "node-fetch": "^2.6.1", 46 | "node-tesseract-ocr": "^2.2.1", 47 | "parse-ms": "^2.1.0", 48 | "pdfkit": "^0.12.3", 49 | "performance-now": "^2.1.0", 50 | "qrcode": "^1.3.2", 51 | "qrcode-terminal": "^0.12.0", 52 | "qs": "^6.10.1", 53 | "request": "^2.88.2", 54 | "scraper-instagram": "^1.0.17", 55 | "similarity": "^1.2.1", 56 | "spinnies": "^0.3.2", 57 | "tiktok-scraper-without-watermark": "^1.0.6", 58 | "yt-search": "^2.10.2" 59 | }, 60 | "scripts": { 61 | "start": "node start.js", 62 | "test": "echo \"Error: no test specified\" && exit 1" 63 | }, 64 | "author": "FG98", 65 | "license": "MIT license", 66 | "bugs": { 67 | "url": "https://github.com/FG98F/dylux-bot/issues" 68 | }, 69 | "homepage": "https://github.com/FG98F/dylux-bot/" 70 | } 71 | -------------------------------------------------------------------------------- /result/download/instagramPost_dl.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | async function igDl(Link) { 5 | const hasil = [] 6 | const Form = { 7 | url: Link, 8 | submit: "" 9 | } 10 | await axios(`https://downloadgram.org/`, { 11 | method: "POST", 12 | data: new URLSearchParams(Object.entries(Form)), 13 | headers: { 14 | "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", 15 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 16 | "cache-control": "max-age=0", 17 | "content-type": "application/x-www-form-urlencoded", 18 | "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"", 19 | "cookie": "_ga=GA1.2.1695343126.1621491858; _gid=GA1.2.28178724.1621491859; __gads=ID=8f9d3ef930e9a07b-2258e672bec80081:T=1621491859:RT=1621491859:S=ALNI_MbqLxhztDiYZttJFX2SkvYei6uGOw; __atuvc=3%7C20; __atuvs=60a6eb107a17dd75000; __atssc=google%3B2; _gat_gtag_UA_142480840_1=1" 20 | }, 21 | referrerPolicy: "strict-origin-when-cross-origin", 22 | }).then(async res => { 23 | const $ = cheerio.load(res.data) 24 | let url = $('#downloadBox').find('a').attr('href'); 25 | await axios(Link, { 26 | method: "GET", 27 | data: null, 28 | headers: { 29 | "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", 30 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 31 | "cache-control": "max-age=0", 32 | "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"", 33 | "cookie": "ig_did=08A3C465-7D43-4D8A-806A-88F98384E63B; ig_nrcb=1; mid=X_ipMwALAAFgQ7AftbrkhIDIdXJ8; fbm_124024574287414=base_domain=.instagram.com; shbid=17905; ds_user_id=14221286336; csrftoken=fXHAj5U3mcJihQEyVXfyCzcg46lHx7QD; sessionid=14221286336%3A5n4czHpQ0GRzlq%3A28; shbts=1621491639.7673564; rur=FTW" 34 | }, 35 | referrerPolicy: "strict-origin-when-cross-origin" 36 | }).then(respon => { 37 | const ch = cheerio.load(respon.data) 38 | let title = ch('title').text().trim() 39 | const result = { 40 | status: true, 41 | result: { 42 | link: url, 43 | desc: title 44 | } 45 | } 46 | hasil.push(result) 47 | }) 48 | }) 49 | return hasil[0] 50 | } 51 | module.exports = { igDl } -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ main ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ main ] 20 | schedule: 21 | - cron: '32 14 * * 6' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'javascript' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 37 | # Learn more: 38 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 39 | 40 | steps: 41 | - name: Checkout repository 42 | uses: actions/checkout@v2 43 | 44 | # Initializes the CodeQL tools for scanning. 45 | - name: Initialize CodeQL 46 | uses: github/codeql-action/init@v1 47 | with: 48 | languages: ${{ matrix.language }} 49 | # If you wish to specify custom queries, you can do so here or in a config file. 50 | # By default, queries listed here will override any specified in a config file. 51 | # Prefix the list here with "+" to use these queries and those in the config file. 52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 53 | 54 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 55 | # If this step fails, then you should remove it and run the build manually (see below) 56 | - name: Autobuild 57 | uses: github/codeql-action/autobuild@v1 58 | 59 | # ℹ️ Command-line programs to run using the OS shell. 60 | # 📚 https://git.io/JvXDl 61 | 62 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 63 | # and modify them (or add more) to build your code if your project 64 | # uses a compiled language 65 | 66 | #- run: | 67 | # make bootstrap 68 | # make release 69 | 70 | - name: Perform CodeQL Analysis 71 | uses: github/codeql-action/analyze@v1 72 | -------------------------------------------------------------------------------- /library/converter.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const path = require('path') 3 | const { spawn } = require('child_process') 4 | 5 | /** 6 | * Convert Audio to Playable WhatsApp Audio 7 | * @param {Buffer} buffer Audio Buffer 8 | * @param {String} ext File Extension 9 | */ 10 | function toAudio(buffer, ext) { 11 | return new Promise((resolve, reject) => { 12 | let tmp = path.join(__dirname, '../tmp', + new Date + '.' + ext) 13 | let out = tmp + '.mp3' 14 | fs.writeFileSync(tmp, buffer) 15 | spawn('ffmpeg', [ 16 | '-y', 17 | '-i',tmp, 18 | '-vn', 19 | '-ac', '2', 20 | '-b:a','128k', 21 | '-ar','44100', 22 | '-f', 'mp3', 23 | out 24 | ]) 25 | .on('error', reject) 26 | .on('error', () => fs.unlinkSync(tmp)) 27 | .on('close', () => { 28 | fs.unlinkSync(tmp) 29 | resolve(fs.readFileSync(out)) 30 | if (fs.existsSync(out)) fs.unlinkSync(out) 31 | }) 32 | }) 33 | } 34 | 35 | /** 36 | * Convert Audio to Playable WhatsApp PTT 37 | * @param {Buffer} buffer Audio Buffer 38 | * @param {String} ext File Extension 39 | */ 40 | function toPTT(buffer, ext) { 41 | return new Promise((resolve, reject) => { 42 | let tmp = path.join(__dirname, '../tmp', + new Date + '.' + ext) 43 | let out = tmp + '.opus' 44 | fs.writeFileSync(tmp, buffer) 45 | spawn('ffmpeg', [ 46 | '-y', 47 | '-i',tmp, 48 | '-vn', 49 | '-c:a','libopus', 50 | '-b:a','128k', 51 | '-vbr','on', 52 | '-compression_level','10', 53 | out, 54 | ]) 55 | .on('error', reject) 56 | .on('error', () => fs.unlinkSync(tmp)) 57 | .on('close', () => { 58 | fs.unlinkSync(tmp) 59 | resolve(fs.readFileSync(out)) 60 | if (fs.existsSync(out)) fs.unlinkSync(out) 61 | }) 62 | }) 63 | } 64 | 65 | /** 66 | * Convert Audio to Playable WhatsApp Video 67 | * @param {Buffer} buffer Video Buffer 68 | * @param {String} ext File Extension 69 | */ 70 | function toVideo(buffer, ext) { 71 | return new Promise((resolve, reject) => { 72 | let tmp = path.join(__dirname, '../tmp', + new Date + '.' + ext) 73 | let out = tmp + '.mp4' 74 | fs.writeFileSync(tmp, buffer) 75 | spawn('ffmpeg', [ 76 | '-y', 77 | '-i', tmp, 78 | '-c:v','libx264', 79 | '-c:a','aac', 80 | '-ab','128k', 81 | '-ar','44100', 82 | '-crf', '32', 83 | '-preset', 'slow', 84 | out 85 | ]) 86 | .on('error', reject) 87 | .on('error', () => fs.unlinkSync(tmp)) 88 | .on('close', () => { 89 | fs.unlinkSync(tmp) 90 | resolve(fs.readFileSync(out)) 91 | if (fs.existsSync(out)) fs.unlinkSync(out) 92 | }) 93 | }) 94 | } 95 | 96 | module.exports = { 97 | toAudio, 98 | toPTT, 99 | toVideo 100 | } -------------------------------------------------------------------------------- /functions/menu.js: -------------------------------------------------------------------------------- 1 | exports.menu = (v) => { 2 | return `┌─⊷ *MAIN* 3 | ▢ ${v}bot 4 | ▢ ${v}info 5 | ▢ ${v}language 6 | ▢ ${v}ping 7 | ▢ ${v}owner 8 | ▢ ${v}join 9 | ▢ ${v}report 10 | ▢ ${v}listprem 11 | ▢ ${v}listban 12 | ▢ ${v}chatbot on/off 13 | └───────────── 14 | ≡ List Menu 15 | ┌─⊷ *FUN* 16 | ▢ ${v}fake text|@user|text 17 | ▢ ${v}preg 18 | └───────────── 19 | ┌─⊷ *GAMES* 20 | ▢ ${v}verdad 21 | ▢ ${v}reto 22 | ▢ ${v}ppt 23 | └───────────── 24 | ┌─⊷ *STICKER* 25 | ▢ ${v}sticker | 26 | ▢ ${v}take | 27 | ▢ ${v}toimg 28 | ▢ ${v}attp 29 | └───────────── 30 | ┌─⊷ *PICTURE* 31 | ▢ ${v}pinterest 32 | ▢ ${v}imagen 33 | ▢ ${v}girl 34 | ▢ ${v}man 35 | ▢ ${v}wallpaper 36 | └───────────── 37 | ┌─⊷ *TOOLS* 38 | ▢ ${v}afk 39 | ▢ ${v}fakethumb 40 | ▢ ${v}tomp3 41 | ▢ ${v}toav 42 | ▢ ${v}q 43 | ▢ ${v}say 44 | └───────────── 45 | ┌─⊷ *EDUCACIÓN* 46 | ▢ ${v}translate 47 | └───────────── 48 | ┌─⊷ *BUSQUEDA* 49 | ▢ ${v}playstore 50 | ▢ ${v}ytsearch 51 | ▢ ${v}google 52 | └───────────── 53 | ┌─⊷ *DOWNLOAD* 54 | ▢ ${v}play 55 | ▢ ${v}play2 56 | ▢ ${v}playvid 57 | ▢ ${v}ytmp3 58 | ▢ ${v}ytmp4 59 | ▢ ${v}igdl 60 | ▢ ${v}tiktok 61 | ▢ ${v}tiktoknowm 62 | ▢ ${v}tiktokaudio 63 | ▢ ${v}mediafire 64 | └───────────── 65 | ┌─⊷ *TEXT MAKER* 66 | ▢ ${v}nameninja 67 | ▢ ${v}typewriter 68 | ▢ ${v}blackpill 69 | ▢ ${v}sans 70 | ▢ ${v}castle 71 | └───────────── 72 | ┌─⊷ *DATABASE* 73 | ▢ ${v}addimg 74 | ▢ ${v}addvid 75 | ▢ ${v}addstick 76 | ▢ ${v}addav 77 | ▢ ${v}getimg 78 | ▢ ${v}getvid 79 | ▢ ${v}getstick 80 | ▢ ${v}getav 81 | ▢ ${v}listmedia 82 | └───────────── 83 | ┌─⊷ *VOTING* 84 | ▢ ${v}voting 85 | ▢ ${v}delvote 86 | ▢ ${v}checkvote 87 | └───────────── 88 | ┌─⊷ *ADMIN* 89 | ▢ ${v}setwelcome 90 | ▢ ${v}setbye 91 | ▢ ${v}delwelcome 92 | ▢ ${v}delbye 93 | ▢ ${v}simulate 94 | ▢ ${v}group 95 | ▢ ${v}resetlink 96 | ▢ ${v}banchat 97 | ▢ ${v}unbanchat 98 | ▢ ${v}hidetag 99 | ▢ ${v}notify 100 | ▢ ${v}tagall 101 | ▢ ${v}setppgp 102 | ▢ ${v}setname 103 | ▢ ${v}setdesc 104 | ▢ ${v}add 105 | ▢ ${v}kick @user 106 | ▢ ${v}promote @user 107 | ▢ ${v}demote @user 108 | ▢ ${v}warn @user 109 | ▢ ${v}delwarn @user 110 | ▢ ${v}warns @user 111 | └───────────── 112 | ┌─⊷ *GRUPO* 113 | ▢ ${v}welcome on/off 114 | ▢ ${v}antidelete on/off 115 | ▢ ${v}detect on/off 116 | ▢ ${v}antilink on/off 117 | ▢ ${v}link 118 | ▢ ${v}infogp 119 | ▢ ${v}profile 120 | ▢ ${v}invite <549xxxx> 121 | └───────────── 122 | ┌─⊷ *OWNER* 123 | ▢ ${v}addpremium @user 124 | ▢ ${v}delpremium @user 125 | ▢ ${v}ban @user 126 | ▢ ${v}unban @user 127 | ▢ ${v}view 128 | ▢ ${v}grouplist 129 | ▢ ${v}update 130 | ▢ ${v}setppbot 131 | ▢ ${v}setfakethumb 132 | ▢ ${v}setprefix 133 | ▢ ${v}listreport 134 | ▢ $ 135 | ▢ > 136 | └─────────────`; 137 | }; 138 | 139 | exports.menuVC = ` 140 | ┌─⊷ *MAIN* 141 | ▢ menu 142 | └───────────── 143 | ┌─⊷ *BUSQUEDA* 144 | ▢ google 145 | └───────────── 146 | ┌─⊷ *DOWNLOAD* 147 | ▢ play 148 | └─────────────`; -------------------------------------------------------------------------------- /functions/welcome.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const Wel = JSON.parse(fs.readFileSync('./database/welcome.json')); 3 | 4 | const welAwal = `Hola @user 5 | Bienvenido(a) al grupo *@group* 6 | 7 | ▢ No olvide leer las reglas del grupo :v`; 8 | 9 | const byeAwal = `Adiós *@user*`; 10 | /** 11 | * Add welcome text to db 12 | * @param {string} chatId 13 | * @param {string} text 14 | * @param {object} Wel 15 | * @returns {boolean} 16 | */ 17 | const addCustomWelcome = (chatId) => { 18 | let position = false; 19 | Object.keys(Wel).forEach((i) => { 20 | if (Wel[i].from === chatId) { 21 | position = true; 22 | } 23 | }); 24 | if (position === false) { 25 | const obj = { 26 | from: chatId, 27 | textwelcome: welAwal, 28 | textbye: byeAwal 29 | }; 30 | Wel.push(obj); 31 | fs.writeFileSync('./database/welcome.json', JSON.stringify(Wel, null, "\t")); 32 | return false; 33 | } 34 | }; 35 | 36 | /** 37 | * Get Custom Welcome Text 38 | * @param {string} chatId 39 | * @param {object} Wel 40 | * @returns {Number} 41 | */ 42 | const getCustomWelcome = (chatId) => { 43 | let position = false; 44 | Object.keys(Wel).forEach((i) => { 45 | if (Wel[i].from === chatId) { 46 | position = i; 47 | } 48 | }); 49 | if (position !== false) { 50 | return Wel[position].textwelcome; 51 | } 52 | }; 53 | /** 54 | * Get Custom bye Text 55 | * @param {string} chatId 56 | * @param {object} Wel 57 | * @returns {Number} 58 | */ 59 | const getCustomBye = (chatId) => { 60 | let position = false; 61 | Object.keys(Wel).forEach((i) => { 62 | if (Wel[i].from === chatId) { 63 | position = i; 64 | } 65 | }); 66 | if (position !== false) { 67 | return Wel[position].textbye; 68 | } 69 | }; 70 | 71 | /** 72 | * Set Custom Welcome 73 | * @param {string} chatId 74 | * @param {string} text 75 | * @param {object} Wel 76 | */ 77 | const setCustomWelcome = (chatId, value) => { 78 | let position = false; 79 | Object.keys(Wel).forEach((i) => { 80 | if (Wel[i].from === chatId) { 81 | position = i; 82 | } 83 | }); 84 | if (position !== false) { 85 | Wel[position].textwelcome = value; 86 | } 87 | }; 88 | 89 | /** 90 | * Set Custom Welcome 91 | * @param {string} chatId 92 | * @param {string} text 93 | * @param {object} Wel 94 | */ 95 | const setCustomBye = (chatId, value) => { 96 | let position = false; 97 | Object.keys(Wel).forEach((i) => { 98 | if (Wel[i].from === chatId) { 99 | position = i; 100 | } 101 | }); 102 | if (position !== false) { 103 | Wel[position].textbye = value; 104 | } 105 | }; 106 | 107 | /** 108 | * Reset Custom Welcome 109 | * @param {string} chatId 110 | * @param {object} Wel 111 | */ 112 | const delCustomWelcome = (chatId) => { 113 | let position = false; 114 | Object.keys(Wel).forEach((i) => { 115 | if (Wel[i].from === chatId) { 116 | position = i; 117 | } 118 | }); 119 | if (position !== false) { 120 | Wel[position].textwelcome = welAwal; 121 | } 122 | }; 123 | 124 | /** 125 | * Reset Custom Welcome 126 | * @param {string} chatId 127 | * @param {object} Wel 128 | */ 129 | const delCustomBye = (chatId) => { 130 | let position = false; 131 | Object.keys(Wel).forEach((i) => { 132 | if (Wel[i].from === chatId) { 133 | position = i; 134 | } 135 | }); 136 | if (position !== false) { 137 | Wel[position].textbye = byeAwal; 138 | } 139 | }; 140 | 141 | module.exports = { 142 | Wel, 143 | addCustomWelcome, 144 | getCustomWelcome, 145 | setCustomWelcome, 146 | delCustomWelcome, 147 | getCustomBye, 148 | setCustomBye, 149 | delCustomBye 150 | }; 151 | -------------------------------------------------------------------------------- /result/download/yt_download.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const cheerio = require('cheerio') 3 | 4 | const ytv = async (yutub) => { 5 | function post(url, formdata) { 6 | return fetch(url, { 7 | method: 'POST', 8 | headers: { 9 | accept: "*/*", 10 | 'accept-language': "en-US,en;q=0.9", 11 | 'content-type': "application/x-www-form-urlencoded; charset=UTF-8" 12 | }, 13 | body: new URLSearchParams(Object.entries(formdata)) 14 | }) 15 | } 16 | const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/ 17 | let ytId = ytIdRegex.exec(yutub) 18 | url = 'https://youtu.be/' + ytId[1] 19 | let res = await post(`https://www.y2mate.com/mates/en68/analyze/ajax`, { 20 | url, 21 | q_auto: 0, 22 | ajax: 1 23 | }) 24 | const mela = await res.json() 25 | const $ = cheerio.load(mela.result) 26 | const hasil = [] 27 | let thumb = $('div').find('.thumbnail.cover > a > img').attr('src') 28 | let judul = $('div').find('.thumbnail.cover > div > b').text() 29 | let quality = $('div').find('#mp4 > table > tbody > tr:nth-child(4) > td:nth-child(3) > a').attr('data-fquality') 30 | let tipe = $('div').find('#mp4 > table > tbody > tr:nth-child(3) > td:nth-child(3) > a').attr('data-ftype') 31 | let output = `${judul}.` + tipe 32 | let size = $('div').find('#mp4 > table > tbody > tr:nth-child(2) > td:nth-child(2)').text() 33 | let id = /var k__id = "(.*?)"/.exec(mela.result)[1] 34 | let res2 = await post(`https://www.y2mate.com/mates/en68/convert`, { 35 | type: 'youtube', 36 | _id: id, 37 | v_id: ytId[1], 38 | ajax: '1', 39 | token: '', 40 | ftype: tipe, 41 | fquality: quality 42 | }) 43 | const meme = await res2.json() 44 | const supp = cheerio.load(meme.result) 45 | let link = supp('div').find('a').attr('href') 46 | hasil.push({ thumb, judul, quality, tipe, size, output, link}) 47 | return hasil[0] 48 | } 49 | 50 | 51 | const yta= async (yutub) => { 52 | function post(url, formdata) { 53 | return fetch(url, { 54 | method: 'POST', 55 | headers: { 56 | accept: "*/*", 57 | 'accept-language': "en-US,en;q=0.9", 58 | 'content-type': "application/x-www-form-urlencoded; charset=UTF-8" 59 | }, 60 | body: new URLSearchParams(Object.entries(formdata)) 61 | }) 62 | } 63 | const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/ 64 | let ytId = ytIdRegex.exec(yutub) 65 | url = 'https://youtu.be/' + ytId[1] 66 | let res = await post(`https://www.y2mate.com/mates/en68/analyze/ajax`, { 67 | url, 68 | q_auto: 0, 69 | ajax: 1 70 | }) 71 | const mela = await res.json() 72 | const $ = cheerio.load(mela.result) 73 | const hasil = [] 74 | let thumb = $('div').find('.thumbnail.cover > a > img').attr('src') 75 | let judul = $('div').find('.thumbnail.cover > div > b').text() 76 | let size = $('div').find('#mp3 > table > tbody > tr > td:nth-child(2)').text() 77 | let tipe = $('div').find('#mp3 > table > tbody > tr > td:nth-child(3) > a').attr('data-ftype') 78 | let output = `${judul}.` + tipe 79 | let quality = $('div').find('#mp3 > table > tbody > tr > td:nth-child(3) > a').attr('data-fquality') 80 | let id = /var k__id = "(.*?)"/.exec(mela.result)[1] 81 | let res2 = await post(`https://www.y2mate.com/mates/en68/convert`, { 82 | type: 'youtube', 83 | _id: id, 84 | v_id: ytId[1], 85 | ajax: '1', 86 | token: '', 87 | ftype: tipe, 88 | fquality: quality 89 | }) 90 | const meme = await res2.json() 91 | const supp = cheerio.load(meme.result) 92 | let link = supp('div').find('a').attr('href') 93 | hasil.push({ thumb, judul, quality, tipe, size, output, link}) 94 | return hasil[0] 95 | } 96 | 97 | 98 | module.exports = { yta, ytv} 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |

5 | 6 |

7 |

8 | 9 |

10 |

11 | 12 | 13 | 14 | 15 | 16 |

17 | 18 | 19 | 20 | 21 |

WHATSAPP BOT

22 | 23 | El bot de WhatsApp es un robot que responderá sus mensajes automáticamente, el bot de WhatsApp se conecta con la web de WhatsApp usando [@adiwajshing/baileys](https://github.com/adiwajshing/Baileys) 24 | 25 | Por ahora los bots pueden ejecutarse usando la aplicación termux, puedes descargarla aquí [Download](https://play.google.com/store/apps/details?id=com.termux) 26 | 27 | Después de la descarga, asegúrese de que todo esté en la última versión, use 28 | ```bash 29 | • apt update -y && apt upgrade -y 30 | ``` 31 | Para resultados perfectos debes tener la versión original de la aplicación WhatsApp, no se recomienda usar la aplicación WhatsApp Business 32 | 33 | *** 34 | 35 | ### Ejemplo 36 | En caso de duda, antes de instalar dylux-bot, pruebe el bot aquí primero 37 | 38 |

39 | 40 |

41 | 42 | Multi-idioma para cada usuario, lo que significa que el usuario puede elegir el idioma que quiere usar 43 | 44 | - [x] Spanish 45 | - [x] Indonesia 46 | - [x] English 47 | - [x] Portugués 48 | - [ ] Idiomas que vendrán después 49 | 50 | Puedes abrir el idioma [Aqui](https://github.com/FG98F/dylux-bot/tree/main/language) 51 | *** 52 | 53 | ### Instalación 54 | 55 | 1). **CORRER** 56 | - **TERMUX** 57 | 58 | ```bash 59 | • pkg install git 60 | • pkg install ffmpeg 61 | • pkg install nodejs 62 | • git clone https://github.com/FG98F/dylux-bot 63 | • cd dylux-bot 64 | • npm i 65 | • npm start 66 | ``` 67 | Cuando aparezca el QR, escanéelo usando la aplicación WhatsApp que se usará para bot 68 | 69 | *** 70 | 71 | ### Características 72 | 73 | - [x] Multi lenguaje 74 | - [x] Comandos de voz 75 | - [x] Configuración de grupo 76 | - [x] Antidelete, Antiviewonce, & Detect 77 | - [x] Bienvenida personalizada a cada grupo 78 | - [x] On/Off Comando en grupo 79 | - [x] Juegos 80 | - [x] Chatbot Automático 81 | - [x] sticker maker image/video/gif 82 | - [x] Votacion 83 | - [ ] Y mucho más 84 | 85 | Puedes abrir el menú [aquí](https://github.com/FG98F/dylux-bot/blob/main/functions/menu.js) 86 | 87 | ### Grupo de WhatsApp 88 | 89 |

90 | 91 |

92 | 93 | ### Mis Contactos 94 | Para obtener información más detallada, comuníquese conmigo a través de las redes sociales a continuación. : 95 | 96 |

97 | 98 | 99 | 100 |

101 | 102 | *** 103 | 104 | 105 | 106 | 107 | ### Github Stats 108 | 109 | ![github stats](https://github-readme-stats.vercel.app/api?username=FG98F&show_icons=true&theme=chartreuse-dark) 110 | ![github toplang](https://github-readme-stats.vercel.app/api/top-langs/?username=FG98F&layout=compact&theme=chartreuse-dark) 111 | ### Lenguaje y herramientas 112 | 113 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /library/functions.js: -------------------------------------------------------------------------------- 1 | const cfonts = require('cfonts'); 2 | const spin = require('spinnies'); 3 | const Crypto = require('crypto'); 4 | const moment = require("moment-timezone"); 5 | const fs = require('fs'); 6 | const { spawn } = require("child_process"); 7 | 8 | /** -- function 9 | * detected link 10 | */ 11 | const isUrl = (url) => { 12 | return url.match( 13 | new RegExp( 14 | /https?:\/\/(www\.)?[-a-zA-Z0-9@:%.+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%+.~#?&/=]*)/, 15 | "gi" 16 | ) 17 | ); 18 | }; 19 | 20 | const isLinkyt = (url) => { 21 | return url.match( 22 | new RegExp( 23 | /(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/, 24 | "gi" 25 | ) 26 | ); 27 | }; 28 | 29 | function pickRandom(list) { 30 | return list[Math.floor(Math.random() * list.length)]; 31 | } 32 | 33 | /** 34 | * fecha 35 | */ 36 | const kyun = (s) =>{ 37 | function pad(s) { 38 | return (s < 10 ? '0' : '') + s; 39 | } 40 | var hours = Math.floor(s / (60 * 60)); 41 | var minutes = Math.floor(s % (60 * 60) / 60); 42 | var seconds = Math.floor(s % 60); 43 | return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`; 44 | }; 45 | 46 | 47 | /** 48 | * Penyebutan hari dan tanggal 49 | */ 50 | let d = new Date(); 51 | let locale = "es"; 52 | let gmt = new Date(0).getTime() - new Date("1 January 1970").getTime(); 53 | let weton = ["", "", "", "", ""][ 54 | Math.floor((d * 1 + gmt) / 84600000) % 5 55 | ]; 56 | let week = d.toLocaleDateString(locale, { weekday: "long" }); 57 | let date = d.toLocaleDateString(locale, { 58 | day: "numeric", 59 | month: "long", 60 | year: "numeric", 61 | }); 62 | let waktu = d.toLocaleDateString(locale, { 63 | hour: "numeric", 64 | minute: "numeric", 65 | second: "numeric", 66 | }); 67 | let tanggal = week + " " + weton + ", " + date; 68 | 69 | function formatDate(n, locale = 'es') { 70 | let d = new Date(n) 71 | return d.toLocaleDateString(locale, { 72 | weekday: 'long', 73 | day: 'numeric', 74 | month: 'long', 75 | year: 'numeric', 76 | hour: 'numeric', 77 | minute: 'numeric', 78 | second: 'numeric' 79 | }) 80 | } 81 | 82 | /** 83 | * T 84 | */ 85 | const time = moment().tz("America/La_Paz").format("HH:mm:ss"); 86 | const WIB = moment().tz("America/La_Paz").format("HH:mm:ss"); 87 | const WIT = moment().tz("America/La_Paz").format("HH:mm:ss"); 88 | const WITA = moment().tz("America/La_Paz").format("HH:mm:ss"); 89 | 90 | /** 91 | * Mencionando el número miles y así sucesivamente 92 | */ 93 | const h2k = (number) => { 94 | var SI_POSTFIXES = ["", " K", " M", " G", " T", " P", " E"]; 95 | var tier = Math.log10(Math.abs(number)) / 3 | 0; 96 | if(tier == 0) return number; 97 | var postfix = SI_POSTFIXES[tier]; 98 | var scale = Math.pow(10, tier * 3); 99 | var scaled = number / scale; 100 | var formatted = scaled.toFixed(1) + ''; 101 | if (/\.0$/.test(formatted)); 102 | formatted = formatted.substr(0, formatted.length - 2); 103 | return formatted + postfix; 104 | }; 105 | 106 | /** 107 | * marca de agua sticker 108 | */ 109 | const createExif = (pack, auth) =>{ 110 | const code = [0x00,0x00,0x16,0x00,0x00,0x00]; 111 | const exif = {"sticker-pack-id": "com.client.tech", "sticker-pack-name": pack, "sticker-pack-publisher": auth, "android-app-store-link": "https://play.google.com/store/apps/details?id=com.marsvard.stickermakerforwhatsapp", "ios-app-store-link": "https://itunes.apple.com/app/sticker-maker-studio/id1443326857"}; 112 | let len = JSON.stringify(exif).length; 113 | if (len > 256) { 114 | len = len - 256; 115 | code.unshift(0x01); 116 | } else { 117 | code.unshift(0x00); 118 | } 119 | if (len < 16) { 120 | len = len.toString(16); 121 | len = "0" + len; 122 | } else { 123 | len = len.toString(16); 124 | } 125 | const _ = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00]); 126 | const __ = Buffer.from(len, "hex"); 127 | const ___ = Buffer.from(code); 128 | const ____ = Buffer.from(JSON.stringify(exif)); 129 | fs.writeFileSync('./temp/data.exif', Buffer.concat([_, __, ___, ____]), function (err) { 130 | console.log(err); 131 | if (err) return console.error(err); 132 | return `./temp/data.exif`; 133 | }); 134 | }; 135 | 136 | 137 | const modStick = (media, client, mek, from) => { 138 | out = getRandom('.webp'); 139 | try { 140 | spawn('webpmux', ['-set','exif', './temp/data.exif', media, '-o', out]) 141 | .on('exit', () => { 142 | client.sendMessage(from, fs.readFileSync(out), 'stickerMessage', {quoted: mek}); 143 | fs.unlinkSync(out); 144 | fs.unlinkSync(media); 145 | }); 146 | } catch (e) { 147 | console.log(e); 148 | client.sendMessage(from, 'Terjadi keslahan', 'conversation', { quoted: mek }); 149 | fs.unlinkSync(media); 150 | } 151 | }; 152 | 153 | 154 | 155 | const randomBytes = (length) => { 156 | return Crypto.randomBytes(length); 157 | }; 158 | 159 | const generateMessageID = () => { 160 | return randomBytes(6).toString('hex').toUpperCase(); 161 | }; 162 | 163 | const getGroupAdmins = (participants) => { 164 | admins = []; 165 | for (let i of participants) { 166 | i.isAdmin ? admins.push(i.jid) : ''; 167 | } 168 | return admins; 169 | }; 170 | 171 | const getRandom = (ext) => { 172 | return `${Math.floor(Math.random() * 10000)}${ext}`; 173 | }; 174 | 175 | module.exports = { 176 | createExif, 177 | modStick, 178 | h2k, 179 | isUrl, 180 | isLinkyt, 181 | pickRandom, 182 | generateMessageID, 183 | getGroupAdmins, 184 | getRandom, 185 | kyun, 186 | time, 187 | WIB, 188 | WITA, 189 | WIT, 190 | weton, 191 | week, 192 | date, 193 | waktu, 194 | tanggal, 195 | formatDate 196 | } 197 | -------------------------------------------------------------------------------- /result/random/reto.json: -------------------------------------------------------------------------------- 1 | ["Envia un mensaje a tu ex y dile Todavia me gustas", "Envia un audio diciendo amo a FG98, si eres mujer :v", 2 | "dile a tu crush que la amas y pasar cap en el grupo", "Envia un audio cantando", 3 | "Envia tu foto sin taparte la cara", "Envia un video bailando", 4 | "Invita a personas que no conoces a tomarse una selfie contigo y luego envíalo al grupo", 5 | "Elija algunos números aleatorios de sus contactos y envíeles un mensaje de texto con el mensaje 'Estoy embarazada'.", 6 | "¡Tome cualquier bebida que esté cerca de usted, luego mézclela con chile y beba!", 7 | "Tome un número aleatorio de sus contactos, llámelo y dígale 'te amo' ", 8 | "Compre la comida más barata en la cafetería (o compre una botella de agua) y diga entre sollozos a sus compañeros de clase: 'Esta ... es la comida más cara que he comprado)' ", 9 | " Compre una botella de coca cola y salpique flores con ella frente a la multitud.", 10 | " Párese cerca del refrigerador, cierre los ojos, elija alimentos al azar en él, incluso cuando coma, sus ojos deben estar cerrados.", 11 | " De pie en medio de la cancha de baloncesto y gritando: 'TE AMO MI PRÍNCIPE / PRINCESA' ", 12 | "Presenta tus respetos a alguien de la clase y luego di: 'Estoy a su servicio, Majestad' ", 13 | " Caminando aplaudiendo y cantando la canción 'Feliz cumpleaños' de la clase al pasillo.", 14 | " Arrodíllate sobre una rodilla y di '¿Cásate conmigo?' la primera persona en entrar a la habitación.", 15 | " Haz un tocado absurdo con tejido, sea lo que sea, sigue pidiendo poses frente a la cámara, sigue subiendo", 16 | "Dile 'ERES HERMOSA / MUY HERMOSA, NO MIENTES' a la chica que crees que es la más bonita de esta clase.", 17 | " Dile a alguien en clase: 'Primero me dijeron que era tu gemelo, nos separamos y luego me sometí a una cirugía plástica. Y esto es lo más serio que he dicho' ", 18 | " Tirar el cuaderno de alguien a la basura, frente a sus ojos, diciendo 'Este libro nadie puede entender' ", 19 | " ¡Arranca el pelo de tu propia pierna 3 veces!", 20 | " Chatea con tus padres, diles que los extrañas con emoticonos tristes.", 21 | " Intente buscar en Google cosas aterradoras o ridículas como tripofobia, etc.", 22 | " Siéntese relajado en medio de la cancha de baloncesto mientras finge que es una playa para tomar el sol.", 23 | " Llena tu boca de agua y tienes que aguantar hasta dos rondas, si te ríes y derramas o bebes, entonces tienes que volver a llenar y agregar una ronda más.", 24 | " Salude a la primera persona que entre en esta sala y diga '¡Bienvenido a Quién quiere ser millonario!' ", 25 | "Envía un mensaje de texto a tus padres '¡Hola, hermano! ¡Acabo de comprar el último número de la revista Playboy!' ", 26 | "Envíales un mensaje de texto a tus padres: 'Mamá, papá, ya sé que soy un niño adoptado del orfanato. No ocultes esto más'.", 27 | " Envía tres números aleatorios en tus contactos y escribe 'Me acabo de convertir en modelo de la revista Playboy' ", 28 | " ¡Come una cucharada de salsa de soja dulce y salsa de soja!", 29 | " Come algo pero no uses las manos.", 30 | " Enojarse con sus amigos que no vienen a pesar de que tienen una cita para jugar 'Verdad o Reto' juntos", 31 | "¡Rompe el huevo con la cabeza!", 32 | "Coma alimentos que se hayan mezclado y tendrán un sabor extraño, pero asegúrese de que los alimentos no sean dañinos para la salud a largo o corto plazo.", 33 | "Baila como Girls 'Generation para los niños frente a la clase, o baila como Super Junior para las niñas.", 34 | "Izar el asta de la bandera sin la bandera.", 35 | "Hablando de la persona que te gusta, de tus amigos más cercanos, del sexo opuesto que no conoces en absoluto y cosas por el estilo.", 36 | "Copia los peinados de todos tus amigos.", 37 | "Cantando la canción HAI TAYO frente a mucha gente mientras baila", 38 | "Cante la canción Baby Shark en voz alta en el aula.", 39 | "Pedir prestado algo a los vecinos", 40 | "Pide la firma de uno de los profesores más feroces mientras dices 'Eres verdaderamente la persona que más admiro en el mundo' ", 41 | " Pídale dinero a alguien (al azar ) en la calle diciendo 'No tengo dinero para tomar un angkot'.", 42 | " Beba algo que haya sido preparado / acordado, pero asegúrese de que no sea peligroso, puede ser como beber jarabe mezclado con salsa de soja.", 43 | " Hablando con el emoticono-miedo de la persona que te gusta, está bien conversar con lo que quieras, a través de cualquier medio que puedas.", 44 | " Canta tu película de Disney favorita fuera de casa mientras gritas.", 45 | " Nombra de 1 azul a 20 azules rápidamente y no debes cometer ningún error. Si está mal, debe repetirse desde el principio.", 46 | " Póngase una corona de papel de copia y diga a todos en la habitación 'HONOR AL REY' mientras señala a cada persona con una regla.", 47 | " Vuelve a ponerte los pantalones hasta la mañana siguiente.", 48 | " Abraza a la persona que NO te agrada en clase y di: 'Muchas gracias por ser la mejor persona para mí' ", 49 | " Ve a un campo amplio, luego corre lo más rápido posible mientras dices 'Estoy loco, estoy loco' ", 50 | " Elija una flor y luego conéctela a alguien que no conoce (debe ser del sexo opuesto)", 51 | " Elige a una persona al azar en la calle, luego di 'No sabes que eres hermosa' (ala One Direction)", 52 | " Fingir estar poseído ejm: poseído por un tigre, etc.", 53 | " Pídale que silbe ya que su boca está nuevamente llena de comida.", 54 | " Pide ser un mesero para que te sirva con tus amigos para el almuerzo.", 55 | " Dígales que usen calcetines para hacer guantes.", 56 | "Dígales que usen el sombrero más extraño / el casco más absurdo durante la próxima ronda.", 57 | "Llama a tu mamá y dile 'mamá, quiero casarme lo antes posible' ", 58 | "Llama a tu ex y di 'te extraño' ", 59 | "Cambia de ropa con la persona más cercana hasta la siguiente ronda.", 60 | "Actualice el estado en WhatsApp lo que sea con palabras que comiencen con 'S' ", 61 | "Sube un video de canto a YouTube que esté cantando canciones populares.", 62 | "Colorea tus uñas de las manos y de los pies de diferentes colores durante una semana.", 63 | "come 2 cucharadas de arroz sin guarniciones", 64 | "Envie el emoji '🦄💨' cada vez que escriba en un grupo 1 día", 65 | "diga '¡Bienvenido a Quién quiere ser millonario!' a todos los grupos que tienes", 66 | "canta el coro de la última canción que tocaste", 67 | "Envia un audio de voz a tu ex / enamorado / novia, dile hola (nombre), quiero llamar, solo un momento. Te Extraño🥺👉🏼👈🏼 ", 68 | "Dile a la gente al azar: Primero me dijeron que era tu gemelo, nos separamos y luego me sometí a una cirugía plástica. Y esto", 69 | "¡Haz 1 rima para el primer jugador!", 70 | "cuenta tu propia versión de cosas vergonzosas", 71 | "cambiar el nombre a 'Gay' durante 24 horas", 72 | "¡Menciona tu tipo de novia!", 73 | "Di 'Estoy enamorado de ti, ¿quieres ser mi novio o no?' al último sexo opuesto con el que conversaste en WhatsApp, espera a que responda", 74 | "bromea charlar con ex y decir 'te amo, por favor vuelve' sin atreverse!", 75 | " chatee para ponerse en contacto con wa en el orden de acuerdo con su% de batería, luego dígale '¡tengo suerte de contar con usted!' ", 76 | "cambiar el nombre a 'Soy un hijo FG' durante 5 horas", 77 | "¡Diga 'USTED ES TAN HERMOSO NO MIENTO' a los chicos!" 78 | 79 | ] 80 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | const { WAConnection: _WAConnection, ReconnectMode, MessageType, MessageOptions } = require('@adiwajshing/baileys'); 2 | const simple = require("./whatsapp/connecting.js"); 3 | const WAConnection = simple.WAConnection(_WAConnection); 4 | const Fg = new WAConnection(); 5 | const { 6 | cekWelcome, 7 | cekAntilink, 8 | cekBadword, 9 | cekAntidelete, 10 | cekDetect 11 | } = require('./functions/group'); 12 | const { 13 | getCustomWelcome, 14 | getCustomBye 15 | } = require('./functions/welcome') 16 | const fs = require("fs"); 17 | const thumb = fs.readFileSync('./temp/fg.jpg') 18 | const { getBuffer } = require('./library/fetcher') 19 | const { week, time, tanggal} = require("./library/functions"); 20 | const { color } = require("./library/color"); 21 | async function starts() { 22 | Fg.autoReconnect = ReconnectMode.onConnectionLost; 23 | Fg.version = [3, 3234, 9]; 24 | Fg.logger.level = 'warn'; 25 | Fg.on('qr', () => { 26 | console.log(color('[QR]','white'), color('Escanee el codigo QR para conectarse')); 27 | }); 28 | 29 | fs.existsSync('./whatsapp/session.json') && Fg.loadAuthInfo('./whatsapp/session.json'); 30 | 31 | await Fg.connect({timeoutMs: 30*1000}); 32 | fs.writeFileSync('./whatsapp/session.json', JSON.stringify(Fg.base64EncodedAuthInfo(), null, '\t')); 33 | link = 'https://chat.whatsapp.com/---fg--' 34 | Fg.query({ json:["action", "invite", `${link.replace('https://chat.whatsapp.com/','')}`]}) 35 | // llamada por wha 36 | // ¡esto puede tardar unos minutos si tiene miles de conversaciones!! 37 | Fg.on('chats-received', async ({ hasNewChats }) => { 38 | console.log(`‣ Tienes ${Fg.chats.length} chats, nuevos chats disponibles: ${hasNewChats}`); 39 | 40 | const unread = await Fg.loadAllUnreadMessages (); 41 | console.log ("‣ Tienes " + unread.length + " mensajes no leídos"); 42 | }); 43 | // ¡esto puede tardar unos minutos si tiene miles de contactos! 44 | Fg.on('contacts-received', () => { 45 | console.log('‣ Tienes ' + Object.keys(Fg.contacts).length + ' contactos'); 46 | }); 47 | 48 | //--- Bienvenida y Despedida 49 | Fg.on('group-participants-update', async (anu) => { 50 | isWelcome = cekWelcome(anu.jid); 51 | if(isWelcome === true) { 52 | 53 | try { 54 | ppimg = await Fg.getProfilePicture(`${anu.participants[0].split('@')[0]}@c.us`); 55 | } catch { 56 | ppimg = 'https://i.ibb.co/PZNv21q/Profile-FG98.jpg'; 57 | } 58 | 59 | mdata = await Fg.groupMetadata(anu.jid); 60 | if (anu.action == 'add') { 61 | num = anu.participants[0]; 62 | 63 | let username = Fg.getName(num) 64 | let about = (await Fg.getStatus(num).catch(console.error) || {}).status || '' 65 | let member = mdata.participants.length 66 | let tag = '@'+num.split('@')[0] 67 | let buff = await getBuffer(ppimg); 68 | let descrip = mdata.desc 69 | let welc = await getCustomWelcome(mdata.id) 70 | capt = welc.replace('@user', tag).replace('@name', username).replace('@bio', about).replace('@date', tanggal).replace('@desc', descrip).replace('@group', mdata.subject); 71 | Fg.send2ButtonLoc(mdata.id, buff, capt, 'Sígueme en Instagram\nhttps://www.instagram.com/fg98._', '⦙☰ MENU', '/menu', '⏍ INFO GP', '/infogp', false, { 72 | contextInfo: { 73 | mentionedJid: Fg.parseMention(capt) 74 | } 75 | }); 76 | } else if (anu.action == 'remove') { 77 | num = anu.participants[0]; 78 | let username = Fg.getName(num) 79 | let about = (await Fg.getStatus(num).catch(console.error) || {}).status || '' 80 | let member = mdata.participants.length 81 | let tag = '@'+num.split('@')[0] 82 | let buff = await getBuffer(ppimg); 83 | let bye = await getCustomBye(mdata.id); 84 | capt = bye.replace('@user', tag).replace('@name', username).replace('@bio', about).replace('@date', tanggal).replace('@group', mdata.subject); 85 | Fg.sendButtonLoc(mdata.id, buff, capt, 'Sígueme en Instagram\nhttps://www.instagram.com/fg98._', '👋🏻', 'unde', false, { 86 | contextInfo: { 87 | mentionedJid: Fg.parseMention(capt) 88 | } 89 | }); 90 | //-- 91 | } 92 | } 93 | }); 94 | 95 | //-- Detector Promovido/Degradado 96 | Fg.on('group-participants-update', async (anu) => { 97 | metdata = await Fg.groupMetadata(anu.jid); 98 | isDetect = cekDetect(metdata.id); 99 | if(isDetect === false) return ; 100 | 101 | try { 102 | ppimg = await Fg.getProfilePicture(`${anu.participants[0].split('@')[0]}@c.us`); 103 | } catch { 104 | ppimg = 'https://i.ibb.co/PZNv21q/Profile-FG98.jpg'; 105 | } 106 | 107 | if (anu.action == 'promote') { 108 | num = anu.participants[0]; 109 | let img = await getBuffer(ppimg); 110 | let about = (await Fg.getStatus(num).catch(console.error) || {}).status || '' 111 | let username = Fg.getName(num) 112 | capt = `≡ *PROMOTE DETECTED* 113 | 114 | *NUEVO ADMIN* 115 | ┌────────────── 116 | ▢ *Nombre* : ${username} 117 | ▢ *Numero* : @${num.split('@')[0]} 118 | ▢ *Info* : ${about} 119 | ▢ *Hora* : ${time} 120 | └──────────────`; 121 | return Fg.sendMessage(metdata.id, img, MessageType.image, {caption: capt, contextInfo: {'mentionedJid': [num]}}); 122 | 123 | } else if (anu.action == 'demote'){ 124 | num = anu.participants[0]; 125 | let img = await getBuffer(ppimg); 126 | let about = (await Fg.getStatus(num).catch(console.error) || {}).status || '' 127 | let username = Fg.getName(num) 128 | capt = `≡ *DEMOTE DETECTED* 129 | 130 | *ADMIN DEGRADADO* 131 | ┌────────────── 132 | ▢ *Nombre* : ${username} 133 | ▢ *Numero* : @${num.split('@')[0]} 134 | ▢ *Info* : ${about} 135 | ▢ *Hora* : ${time} 136 | └──────────────`; 137 | Fg.sendMessage(metdata.id, img, MessageType.image, {caption: capt, contextInfo: {'mentionedJid': [num]}}); 138 | } 139 | }) 140 | 141 | //--antidelete 142 | Fg.on('message-delete', async (m) => { 143 | if (m.key.fromMe) return; 144 | let isAntidelete = cekAntidelete(m.key.remoteJid); 145 | if (isAntidelete === false) return; 146 | m.message = (Object.keys(m.message)[0] === 'ephemeralMessage') ? m.message.ephemeralMessage.message : m.message; 147 | const Type = Object.keys(m.message)[0]; 148 | await Fg.reply(m.key.remoteJid, ` 149 | ━━━━⬣ 𝘼𝙉𝙏𝙄 𝘿𝙀𝙇𝙀𝙏𝙀 ⬣━━━━ 150 | 151 | *▢ Nombre :* @${m.participant.split`@`[0]} 152 | *▢ Hora :* ${time} 153 | 154 | ━━━━⬣ 𝘼𝙉𝙏𝙄 𝘿𝙀𝙇𝙀𝙏𝙀 ⬣━━━━ 155 | 156 | `.trim(), m.message, { 157 | contextInfo: { 158 | mentionedJid: [m.participant] 159 | } 160 | }); 161 | Fg.copyNForward(m.key.remoteJid, m.message).catch(e => console.log(e, m)); 162 | }); 163 | 164 | 165 | //---llamada auto block 166 | Fg.on("CB:Call", json => { 167 | let call; 168 | calling = JSON.parse(JSON.stringify(json)); 169 | call = calling[1].from; 170 | Fg.sendMessage(call, `*${Fg.user.name}* No hagas llamadas al bot, tu número se bloqueará automáticamente`, MessageType.text).then(() => Fg.blockUser(call, "add")); 171 | }); 172 | 173 | 174 | } 175 | 176 | /** 177 | * 178 | * @param {string} módulo Nombre o ruta del módulo 179 | * @param {function} cb 180 | */ 181 | 182 | function nocache(module, cb = () => { }) { 183 | console.log("‣ Modulo", `'${module}'`, "se está revisando si hay cambios"); 184 | fs.watchFile(require.resolve(module), async () => { 185 | await uncache(require.resolve(module)); 186 | cb(module); 187 | }); 188 | } 189 | 190 | 191 | /** 192 | * Uncache un modulo 193 | * @param {string} módulo Nombre o ruta del módulo 194 | */ 195 | function uncache(module = '.') { 196 | return new Promise((resolve, reject) => { 197 | try { 198 | delete require.cache[require.resolve(module)]; 199 | resolve(); 200 | } catch (e) { 201 | reject(e); 202 | } 203 | }); 204 | } 205 | 206 | require('./index.js'); 207 | nocache('./index.js', module => console.log(color(`Index.js is now updated!`))); 208 | 209 | 210 | Fg.on('chat-update', async (message) => { 211 | require('./index.js')(Fg, message); 212 | }); 213 | 214 | starts(); 215 | -------------------------------------------------------------------------------- /functions/group.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const Group = JSON.parse(fs.readFileSync('./database/group.json')); 3 | 4 | /** 5 | * 6 | * @param { string } id 7 | */ 8 | const addGroup = (id) => { 9 | let position = false; 10 | Object.keys(Group).forEach((i) => { 11 | if (Group[i].from === id) { 12 | position = true; 13 | } 14 | }); 15 | if (position === false) { 16 | const obj = { 17 | from: id, 18 | offline: false, 19 | welcome: false, 20 | antilink: false, 21 | badword: false, 22 | antidelete: false, 23 | detect: false, 24 | viewOnce: false, 25 | }; 26 | Group.push(obj); 27 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 28 | return false; 29 | } 30 | }; 31 | 32 | /** 33 | * 34 | * @param { string } id 35 | */ 36 | const cekOffline = (id) => { 37 | let position = false; 38 | Object.keys(Group).forEach((i) => { 39 | if (Group[i].from === id) { 40 | position = i; 41 | } 42 | }); 43 | if (position !== false) { 44 | return Group[position].offline; 45 | } 46 | }; 47 | 48 | /** 49 | * 50 | * @param { string } id 51 | */ 52 | const addOffline = (id) => { 53 | let position = false; 54 | Object.keys(Group).forEach((i) => { 55 | if (Group[i].from === id) { 56 | position = i; 57 | } 58 | }); 59 | if (position !== false) { 60 | Group[position].offline = true; 61 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 62 | } 63 | }; 64 | 65 | /** 66 | * 67 | * @param { string } id 68 | */ 69 | const delOffline = (id) => { 70 | let position = false; 71 | Object.keys(Group).forEach((i) => { 72 | if (Group[i].from === id) { 73 | position = i; 74 | } 75 | }); 76 | if (position !== false) { 77 | Group[position].offline = false; 78 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 79 | } 80 | }; 81 | 82 | /** 83 | * 84 | * @param { string } id 85 | */ 86 | const cekWelcome = (id) => { 87 | let position = false; 88 | Object.keys(Group).forEach((i) => { 89 | if (Group[i].from === id) { 90 | position = i; 91 | } 92 | }); 93 | if (position !== false) { 94 | return Group[position].welcome; 95 | } 96 | }; 97 | 98 | /** 99 | * 100 | * @param { string } id 101 | */ 102 | const addWelcome = (id) => { 103 | let position = false; 104 | Object.keys(Group).forEach((i) => { 105 | if (Group[i].from === id) { 106 | position = i; 107 | } 108 | }); 109 | if (position !== false) { 110 | Group[position].welcome = true; 111 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 112 | } 113 | }; 114 | 115 | /** 116 | * 117 | * @param { string } id 118 | */ 119 | const delWelcome = (id) => { 120 | let position = false; 121 | Object.keys(Group).forEach((i) => { 122 | if (Group[i].from === id) { 123 | position = i; 124 | } 125 | }); 126 | if (position !== false) { 127 | Group[position].welcome = false; 128 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 129 | } 130 | }; 131 | /** 132 | * 133 | * @param { string } id 134 | */ 135 | const cekDetect = (id) => { 136 | let position = false; 137 | Object.keys(Group).forEach((i) => { 138 | if (Group[i].from === id) { 139 | position = i; 140 | } 141 | }); 142 | if (position !== false) { 143 | return Group[position].detect; 144 | } 145 | }; 146 | 147 | /** 148 | * 149 | * @param { string } id 150 | */ 151 | const addDetect = (id) => { 152 | let position = false; 153 | Object.keys(Group).forEach((i) => { 154 | if (Group[i].from === id) { 155 | position = i; 156 | } 157 | }); 158 | if (position !== false) { 159 | Group[position].detect = true; 160 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 161 | } 162 | }; 163 | 164 | /** 165 | * 166 | * @param { string } id 167 | */ 168 | const delDetect = (id) => { 169 | let position = false; 170 | Object.keys(Group).forEach((i) => { 171 | if (Group[i].from === id) { 172 | position = i; 173 | } 174 | }); 175 | if (position !== false) { 176 | Group[position].detect = false; 177 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 178 | } 179 | }; 180 | 181 | /** 182 | * 183 | * @param { string } id 184 | */ 185 | const cekAntilink = (id) => { 186 | let position = false; 187 | Object.keys(Group).forEach((i) => { 188 | if (Group[i].from === id) { 189 | position = i; 190 | } 191 | }); 192 | if (position !== false) { 193 | return Group[position].antilink; 194 | } 195 | }; 196 | 197 | /** 198 | * 199 | * @param { string } id 200 | */ 201 | const addAntilink = (id) => { 202 | let position = false; 203 | Object.keys(Group).forEach((i) => { 204 | if (Group[i].from === id) { 205 | position = i; 206 | } 207 | }); 208 | if (position !== false) { 209 | Group[position].antilink = true; 210 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 211 | } 212 | }; 213 | 214 | /** 215 | * 216 | * @param { string } id 217 | */ 218 | const delAntilink = (id) => { 219 | let position = false; 220 | Object.keys(Group).forEach((i) => { 221 | if (Group[i].from === id) { 222 | position = i; 223 | } 224 | }); 225 | if (position !== false) { 226 | Group[position].antilink = false; 227 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 228 | } 229 | }; 230 | 231 | /** 232 | * 233 | * @param { string } id 234 | */ 235 | const cekBadword = (id) => { 236 | let position = false; 237 | Object.keys(Group).forEach((i) => { 238 | if (Group[i].from === id) { 239 | position = i; 240 | } 241 | }); 242 | if (position !== false) { 243 | return Group[position].badword; 244 | } 245 | }; 246 | 247 | /** 248 | * 249 | * @param { string } id 250 | */ 251 | const addBadword = (id) => { 252 | let position = false; 253 | Object.keys(Group).forEach((i) => { 254 | if (Group[i].from === id) { 255 | position = i; 256 | } 257 | }); 258 | if (position !== false) { 259 | Group[position].badword = true; 260 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 261 | } 262 | }; 263 | 264 | /** 265 | * 266 | * @param { string } id 267 | */ 268 | const delBadword = (id) => { 269 | let position = false; 270 | Object.keys(Group).forEach((i) => { 271 | if (Group[i].from === id) { 272 | position = i; 273 | } 274 | }); 275 | if (position !== false) { 276 | Group[position].badword = false; 277 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 278 | } 279 | }; 280 | 281 | /** 282 | * 283 | * @param { string } id 284 | */ 285 | const cekAntidelete = (id) => { 286 | let position = false; 287 | Object.keys(Group).forEach((i) => { 288 | if (Group[i].from === id) { 289 | position = i; 290 | } 291 | }); 292 | if (position !== false) { 293 | return Group[position].antidelete; 294 | } 295 | }; 296 | 297 | /** 298 | * 299 | * @param { string } id 300 | */ 301 | const addAntidelete = (id) => { 302 | let position = false; 303 | Object.keys(Group).forEach((i) => { 304 | if (Group[i].from === id) { 305 | position = i; 306 | } 307 | }); 308 | if (position !== false) { 309 | Group[position].antidelete = true; 310 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 311 | } 312 | }; 313 | 314 | /** 315 | * 316 | * @param { string } id 317 | */ 318 | const delAntidelete = (id) => { 319 | let position = false; 320 | Object.keys(Group).forEach((i) => { 321 | if (Group[i].from === id) { 322 | position = i; 323 | } 324 | }); 325 | if (position !== false) { 326 | Group[position].antidelete = false; 327 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 328 | } 329 | }; 330 | 331 | /** 332 | * 333 | * @param { string } id 334 | */ 335 | const cekViewonce = (id) => { 336 | let position = false; 337 | Object.keys(Group).forEach((i) => { 338 | if (Group[i].from === id) { 339 | position = i; 340 | } 341 | }); 342 | if (position !== false) { 343 | return Group[position].viewOnce; 344 | } 345 | }; 346 | 347 | /** 348 | * 349 | * @param { string } id 350 | */ 351 | const addViewonce = (id) => { 352 | let position = false; 353 | Object.keys(Group).forEach((i) => { 354 | if (Group[i].from === id) { 355 | position = i; 356 | } 357 | }); 358 | if (position !== false) { 359 | Group[position].viewOnce = true; 360 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 361 | } 362 | }; 363 | 364 | /** 365 | * 366 | * @param { string } id 367 | */ 368 | const delViewonce = (id) => { 369 | let position = false; 370 | Object.keys(Group).forEach((i) => { 371 | if (Group[i].from === id) { 372 | position = i; 373 | } 374 | }); 375 | if (position !== false) { 376 | Group[position].viewOnce = false; 377 | fs.writeFileSync('./database/group.json', JSON.stringify(Group, null, "\t")); 378 | } 379 | }; 380 | 381 | module.exports = { 382 | Group, 383 | addGroup, 384 | addOffline, 385 | delOffline, 386 | cekOffline, 387 | addWelcome, 388 | delWelcome, 389 | cekWelcome, 390 | addAntilink, 391 | delAntilink, 392 | cekAntilink, 393 | addBadword, 394 | delBadword, 395 | cekBadword, 396 | addAntidelete, 397 | delAntidelete, 398 | cekAntidelete, 399 | addDetect, 400 | delDetect, 401 | cekDetect, 402 | addViewonce, 403 | delViewonce, 404 | cekViewonce 405 | }; -------------------------------------------------------------------------------- /result/random/verdad.json: -------------------------------------------------------------------------------- 1 | ["¿Alguna vez te ha gustado alguien? ¿Cuánto tiempo?", 2 | "Si es posible o si quieres, en gc / fuera de gc, ¿con quién harás amistad? (Puede ser diferente / del mismo tipo)", 3 | "¿cual es tu mas grande miedo?", 4 | "¿Alguna vez te ha gustado alguien y has sentido a esa persona como tú también?", 5 | "¿Cuál es el nombre del exnovio de tu amiga que una vez te gustó en secreto?", 6 | "¿Alguna vez has robado el dinero de tu madre o de tu padre? ¿La razón?", 7 | "lo que te hace feliz cuando estás triste", 8 | "¿Alguna vez has sido amor no correspondido? ¿Si has estado con quién? ¿Cómo se siente brou?", 9 | "¿Alguna vez has tenido una aventura con alguien?", 10 | "lo más temido", 11 | "quién es la persona más influyente en tu vida", 12 | "qué orgullo tienes este año", 13 | "quién es la persona que puede enfermarte", 14 | "quien es la persona que alguna vez te puso cachondo", 15 | "(para los musulmanes) ¿nunca has rezado en todo el día?", 16 | "¿Quién es el más cercano a su tipo de pareja ideal aquí", 17 | "¿Con quién te gusta jugar?", 18 | "¿Alguna vez has rechazado a alguien? ¿Por qué?", 19 | "Menciona el incidente que te hizo daño y que aún recuerdas", 20 | "¿Qué logros has obtenido este año?", 21 | "¿Cuál es tu peor hábito en la escuela?", "¿Qué programa de televisión odias más? ¡Da la razón!", "¿Cuál es el vestido más feo (en su opinión) que ha usado y cuándo lo usó?", "¿Qué es lo peor (chisme) que has dicho sobre tu amigo?","¿Qué es lo más vergonzoso de ti?"," ¿Qué es lo primero que ves cuando miras a otra persona (del sexo opuesto)?", 22 | "¿Qué es lo primero que te viene a la mente cuando te miras al espejo?","¿Que es lo mas tonto que has hecho en tu vida?"," ¿Cuál es el peor sueño que has tenido?"," ¿Cuál es el sueño más loco que puedes recordar hasta ahora?", 23 | " ¿Cuál es tu peor rasgo en tu opinión?", 24 | " ¿Qué rasgo te gustaría cambiar de ti mismo?", 25 | " ¿Qué rasgo te gustaría cambiar en tu amigo?", 26 | " ¿Qué harías si tu novio te dijera que tienes mala nariz o dedos?", 27 | " ¿En qué piensas antes de dormir? ej .: fantasear con una pareja, etc.", 28 | "¿Qué crees que se destaca más de ti?"," ¿Qué parte del cuerpo de tu amigo te gusta más y desearías tener?", 29 | "¿Qué parte de tu cuerpo odias más?"," De todas las clases de la escuela, ¿a qué clase le gustaría ingresar y qué clase le gustaría evitar?", 30 | "¡Describe a tu amigo más cercano!"," ¡Descríbete en una palabra!"," ¿Qué películas y canciones te han hecho llorar?", 31 | " ¿Qué es algo que has mantenido en secreto hasta ahora y nadie lo ha descubierto?", 32 | " ¿Qué es lo más romántico que alguien (del sexo opuesto) te ha hecho o regalado?", 33 | "¿Qué es lo más desagradable que has experimentado?", 34 | " Si nacieras de nuevo y tuvieras que ser uno de tus amigos, ¿a quién elegirías ser?", 35 | " Si tienes superpoder / superpoder, ¿qué quieres hacer?", 36 | " Si el apocalipsis llega pronto, ¿qué haces?", 37 | " Si te pidieran que te sometieras a una cirugía plástica con una muestra de rostro de tu compañero de clase, ¿a quién imitarías?", 38 | " Alguna vez has robado algo?", 39 | " ¿Tiene miedo a morir? ¿Por qué?", 40 | " ¿Cuándo fue la última vez que lloraste y por qué?", 41 | " ¿Cuáles son tus habilidades especiales?", 42 | " ¿Cómo te puede gustar la persona que te gusta?", 43 | " ¿Cuál crees que es un buen rasgo de tu amigo más cercano que él o ella no conozca?", 44 | " ¿Con qué tipo de persona te gustaría casarte algún día?", 45 | " En tu opinión, ¿cuál es el trabajo más atractivo para el amigo que está sentado a tu lado? ¿Y por qué?", 46 | " ¿Con quién quieres intercambiar por un día? (amigos más cercanos que ambos conocen) y por qué", 47 | " ¿Alguna vez has esperado en secreto que la relación de alguien con su novia se rompiera? ¿Quién?", 48 | " ¿Prefiere AMIGAS o AMIGOS? ¿Por qué?", 49 | " ¿Qué cita recuerdas más y te gusta?", 50 | " ¿Qué secretos nunca les has contado a tus amigos hasta ahora?", 51 | " ¿Quiénes son sus verdaderos modelos a seguir?", 52 | " ¿Cuál de tus amigos crees que es matre?", 53 | " ¿Cuál de tus amigos crees que tiene menos corte de pelo?", 54 | " ¿Cuál de tus amigos es el más fotogénico? ", 55 | " ¿Quién es tu mejor ex? ¡¿Y por qué rompieron ?!", 56 | " ¿Cómo se llama el artista con el que hablaste en secreto?", 57 | " ¿Cómo se llamaba el profesor que te gustaba?", 58 | " ¿Cuál es el nombre de la exnovia de tu amigo que te ha gustado en secreto?", 59 | " ¿Cuál es el nombre de la persona (del sexo opuesto) que crees que sería divertido ser novia?", 60 | " ¿Cuál es el nombre de la persona que odias, pero crees que le gustas a esa persona (no necesariamente del sexo opuesto)?", 61 | " ¿Cuál es el nombre de la persona a la que has estado señalando en secreto?", 62 | " ¿Quién es la persona (del sexo opuesto) que más se te pasa por la cabeza?", 63 | " ¿Quién es la persona más molesta entre tus amigos? ¡la razón!", 64 | " ¿A quién de tus amigos crees que debería renovarse?", 65 | " ¿Quién está más cerca de tu pareja ideal aquí?", 66 | "Padre o madre", 67 | "La parte del cuerpo que no te gusta", 68 | "¿Alguna vez has hecho trampa?", 69 | "¿Alguna vez te han besado?", 70 | "¿Qué es lo primero que harías si te despertaras como del sexo opuesto?", 71 | "¿Alguna vez has dejado que alguien más se meta en problemas por algo que hiciste?", 72 | "¿Qué es lo más embarazoso que has hecho en tu vida?", 73 | " ¿Cuál es la razón más ridícula por la que has roto con alguien?", 74 | " ¿Cuál es el peor hábito que tienes?", 75 | " ¿Cuál crees que es tu mejor característica? ¿Y que es lo peor?", 76 | " ¿Cuál es la cosa más valiente que has hecho?", 77 | " ¿Cuándo fue la última vez que mojaste la cama?", 78 | " ¿Con qué sueñas más sobre dormir?", 79 | " Si va a ganar dinero ilegalmente, ¿cómo lo hace?", 80 | " ¿Qué cosas infantiles sigues haciendo?", 81 | " Si fueras ciego, ¿quién sería tu perro guía?", 82 | " ¿Qué es lo que más te impresiona?", 83 | " Si se le permitiera usar solo 3 palabras durante el resto de la noche a partir de ahora, ¿cuál sería?", 84 | " Si fueras un dictador, ¿qué ley promulgarías primero?", 85 | "Si vivieras durante la era nazi, ¿quién serías?", 86 | "¿Cuál fue la experiencia más vergonzosa en la escuela / tiempo de estudio / educación / el año pasado?", 87 | "¿Cuál es el mayor error de tu vida?", 88 | "¿Qué no harías nunca, incluso si supieras que solo te quedan 12 horas de vida?", 89 | " ¿Qué delitos ha cometido?", 90 | " Cuéntame un secreto de tu infancia.", 91 | " ¿Cuál es su mayor representante (secreto)?", 92 | " ¿Qué quieres hacer conmigo… ( x persona), si luego puedes borrar su memoria (él,…)?", 93 | " ¿Qué es lo peor que le has hecho a alguien?", 94 | " ¿Quién te gusta más?", 95 | "¿Alguna vez te has enamorado de alguno de los presentes?", 96 | " Si fueras un vampiro, ¿a cuál de nosotros morderías ahora?", 97 | " ¿Ha defecado alguna vez en público?", 98 | " ¿Cuál es tu fantasía más oscura?", 99 | " ¿Qué es lo mejor que has tenido con alguien más?", 100 | " ¿Cuál es el mayor desvío para ti?", 101 | " ¿Qué es lo que más te gusta de tu cuerpo y qué es lo más feo?", 102 | " ¿A quien te gustaría ver desnuda?", 103 | " ¿Quién en esta ronda puede enamorarte?", 104 | " ¿Alguna vez has tenido un sueño erótico donde sucedió alguien de este grupo?", 105 | " Si te vas a tatuar en el área genital, ¿que habrá allí?", 106 | " ¿Qué es más importante en una relación: el sexo o el amor?", 107 | " ¿Crees que el sexo es genial, bueno, bueno, divertido a veces, o realmente no te importa?", 108 | " ¿Qué te hace realmente amar?", 109 | "¿Cuántas veces a la semana / mes tiene relaciones sexuales y con qué frecuencia desea tener relaciones sexuales?", 110 | " ¿Con cuántas parejas sexuales te has acostado?", 111 | " ¿Qué parte del cuerpo te hace más?", 112 | " ¿Cómo, dónde y con quién estuviste primero?", 113 | " ¿Qué importancia tienen para ti los juegos previos prolongados?", 114 | " ¿Qué debe hacer un hombre o una mujer para seducirte?", 115 | " ¿Alguna vez has tenido sexo con un buen amigo?", 116 | " ¿Alguna vez ha tenido relaciones sexuales con alguno de estos grupos, excepto con su pareja?", 117 | "¿Qué animal se adapta mejor a ti y por qué?", 118 | " ¿Cuál es tu peor cita?", 119 | " ¿A quién quieres besar ahora?", 120 | " ¿Cuál es tu oscura fantasía secreta?", 121 | " ¿Prefieres tatuarte el culo o perforarte la lengua?", 122 | " ¿Eres siempre leal?", 123 | " ¿Tienes un enamoramiento adolescente?", 124 | " ¿De qué persona te enamoraste?", 125 | " ¿Con qué celebridad te gustaría salir?", 126 | " ¿Cuál fue el momento más embarazoso de tu vida?", 127 | " ¿Qué boca te gusta más del grupo de aquí?", 128 | " ¿Qué jugador tiene la mano más hermosa?", 129 | " ¿Dónde fue tu primer beso?", 130 | " ¿A quién del grupo te gustaría besar más?", 131 | " ¿Quién en la mesa es quizás el más divertido?", 132 | " ¿Cuál es el mayor error de tu vida?", 133 | " ¿Te pasó algo vergonzoso en una cita?", 134 | " ¿Ha estado alguna vez en contacto con drogas?", 135 | " ¿A qué persona quieres besar ahora?", 136 | " ¿Cuándo fue la última vez que estuvo borracho?", 137 | " ¿Alguna vez has hecho trampa en un examen escolar?", 138 | " ¿Has robado algo en el pasado?", 139 | " ¿Roncas por la noche?", 140 | " ¿Cuales tu cancion favorita?", 141 | " ¿Con qué jugadores comerciará durante 1 semana y por qué?", 142 | " Te mudaste a una isla desierta, ¿a quién te llevaste de aquí?", 143 | " ¿A que temes más?", 144 | " ¿Dónde te afeitas en todas partes?", 145 | "¿Tienes un apodo?", 146 | " ¿Miras en el baño antes de lavarte?", 147 | "¿Quién te dio la peor angustia?", 148 | " Cuantas veces te has besado", 149 | "¿Qué es lo más embarazoso que te ha pasado?", 150 | "¿Cuántos chicos / chicas has besado?", 151 | "¿De quien estas enamorado(a) ?", 152 | "Que estrella te gusta", 153 | "¿Empezaste algo con XY (insertar nombre)?", 154 | "Alguna vez has robado algo?" 155 | ] 156 | -------------------------------------------------------------------------------- /language/en.js: -------------------------------------------------------------------------------- 1 | // voice command 2 | exports.vnCmd = (v) => { 3 | return 'Use commands with voice memos, activate with command ' + v + 'voicecommand on/off'; 4 | }; 5 | 6 | // -- send message 7 | exports.wait = `*⌛ _Loading..._ ▬▬▬▭*`; 8 | exports.bye = `Goodbye...`; 9 | exports.done = `✅ Finished...`; 10 | exports.next = (value) => { 11 | return `Click next for *${value}*`; 12 | }; 13 | exports.packon = 'Pack name already registered'; 14 | exports.packoff = 'The name of the media pack is not registered in the database'; 15 | exports.liston = '✅ List of media stored in database'; 16 | exports.getlist = '✳️ Use the command getimg/getvid/getav/getstik to fetch each media pack\n*📌 Example* : /getimg auron'; 17 | exports.nolink = (value) => { 18 | return '✳️ Please repeat by adding a link ' + value; 19 | }; 20 | //--new 21 | exports.lvl = `Level`; 22 | exports.nme = `Name`; 23 | exports.hi = `Hi`; 24 | exports.gp = `Group`; 25 | exports.restart = `✅ Restarting Bot`; 26 | exports.pinsp = `Speed`; 27 | exports.pinse = `Seconds`; 28 | exports.num = `Number`; 29 | exports.click = `Click here`; 30 | exports.next2 = `Next`; 31 | exports.stima = `✳️ Send an image with the command\n or tag an image that has been submitted, *Videos 1-9 seconds* `; 32 | exports.resulf = `Result`; 33 | exports.bugr = `Thank you \nYour report has been stored in the database.`; 34 | exports.linkgp = `Group Link`; 35 | exports.linkrevo = `Group link canceled`; 36 | exports.newlink = `New link`; 37 | exports.gpbt = `🛡️ Group settings\nOpen and close the group`; 38 | exports.gpbtt = `Choose one below`; 39 | exports.gpopenb = `OPEN`; 40 | exports.gpcloseb = `CLOSE`; 41 | exports.idiom = `language`; 42 | exports.wrn = `Warning`; 43 | exports.pfile = `PROFILE`; 44 | exports.crtio = `The`; 45 | exports.mbr = `Members`; 46 | exports.wlme = `Welcome`; 47 | exports.vtc = `VOTING`; 48 | exports.rzon = `Reason`; 49 | exports.vyes = `If you agree`; 50 | exports.vno = `If you do not agree`; 51 | exports.vrvt = `See Voting`; 52 | exports.rtvt = `VOTING RESULTS`; 53 | exports.dlte = `Delete`; 54 | exports.setpmulti = `✅ The prefix was changed to : *multiprefix*`; 55 | exports.setpnopre = `✅ The prefix was changed to : *nopref*`; 56 | exports.setponepre = `✅ The prefix was changed to :`; 57 | exports.setpall = `Available Prefixes`; 58 | exports.setpnp = `No prefix`; 59 | exports.setpop = `One prefix`; 60 | exports.setpmt = `Multi prefix`; 61 | exports.updatef = `*Updated*\n\nchanges`; 62 | exports.simn = `do you want to chat for a while?\n\nReply with`; 63 | exports.simmsg = `(Your message)\n\n📌 Example : `; 64 | exports.chatboton = `✅ You activated *ChatBot* \n Which means we can chat unlimitedly 😊`; 65 | exports.chatbotoff = `✅ *ChatBot* disabled`; 66 | exports.pptt = `Please select`; 67 | exports.exple = `Example`; 68 | exports.emt = `Tie`; 69 | exports.gst = `Won`; 70 | exports.pdt = `You lost`; 71 | exports.pptuser = `You`; 72 | exports.papel = `paper`; 73 | exports.tijera = `scissor`; 74 | exports.piedra = `stone`; 75 | exports.foll = `Follow me in Instagram \nhttps://www.instagram.com/fg98._ `; 76 | exports.plays = `Enter a song title`; 77 | exports.playm = `The file is too large, music playback was canceled, the maximum file size is`; 78 | exports.listgp = `LIST of Groups`; 79 | exports.calidad = `Quality`; 80 | exports.tamaño = `Size`; 81 | exports.pfo = `Choose a format\n\nIf you have problems with the command use`; 82 | exports.pafo = `Select the music you want to download`; 83 | exports.pvfo = `Select the video you want to download`; 84 | exports.titlp = `Title`; 85 | exports.timp = `Duration`; 86 | exports.viep = `Views`; 87 | exports.vcnrst = 'Not detected'; 88 | exports.vclect = 'Voice reading'; 89 | exports.listwb = 'Event list'; 90 | exports.pregt = 'She Loves Me?'; 91 | exports.donate = `≡ *DONATION* 92 | You can support the creator of the bot by donating :) 93 | 94 | ▢ *PayPal* 95 | • *Link :* https://paypal.me/fg98f 96 | ▢ *Mercado Pago Arg* 97 | • *Link :* https://mpago.la/1F3r6JH 98 | ▢ *Tigo Money* 99 | • *N° :* 78230727`; 100 | exports.cretb = 'Create your own bot using Termux'; 101 | 102 | // -- Saying time 103 | exports.night = 'Good night' 104 | exports.evening = 'Good afternoon' 105 | exports.day = 'Good day' 106 | exports.morning = 'Good morning' 107 | 108 | 109 | // -- message only 110 | exports.admin = '✳️ Sorry, this command can only be run by group admins'; 111 | exports.group = '✳️ Sorry, this command can only be run in groups'; 112 | exports.premium = '✳️ Sorry, this command can only be used by premium users'; 113 | exports.premdl = '✳️ Sorry you are not a premium user, download it yourself using the link\n*LINK* : '; 114 | exports.botadmin = '✳️ This command can be used when the bot becomes admin'; 115 | exports.owner = '✳️ This command can be used by owner bots'; 116 | exports.isprem = '✳️ User is the previous premium user'; 117 | exports.noprem = '✳️ The user is not yet a premium user'; 118 | exports.ban = '✳️ User status has been banned before'; 119 | exports.noban = '✳️ User does not have banned status'; 120 | exports.isadmin = '✳️ Bot can\'t log admin'; 121 | exports.oversize = '⚠️ The file size exceeds the specified size, please download it yourself via the link below\n*🔗 Link* : '; 122 | 123 | // -- text 124 | exports.notag = '✳️ Tag a group member'; 125 | exports.nonum = '✳️ Please repeat by adding the target number'; 126 | exports.notext = '✳️ Please repeat by adding text'; 127 | exports.reply = '✳️ Reply target message...'; 128 | exports.replyStic = '✳️ Reply message sticker...'; 129 | exports.replyVid = '✳️ Reply the video...'; 130 | exports.replyVn = '✳️ Reply the audio...'; 131 | exports.replyImg = '✳️ Reply the imagenya...'; 132 | exports.noreply = '✳️ The message you replied to did not contain a reply'; 133 | exports.nolink = (value) => { 134 | return `✳️ Please repeat by adding a link *${value}*`; 135 | }; 136 | exports.addwarn = `⚠️ Warning\nYou get 1 warning`; 137 | exports.delwarn = `⚠️ Warning\nYour warning has decreased by 1 warning`; 138 | exports.cekwarn = (warn) => { 139 | return `≡ WARNINGS \n\n▢ Total : *${warn}*`; 140 | }; 141 | exports.nowarn = `✳️ User has no warning`; 142 | 143 | exports.Pbahasa = `✳️ Select the language you want to use 144 | 145 | *Available languages* 146 | - es (Spanish) 147 | - id (Indonesia) 148 | - en (English) 149 | - pt (Portugués) 150 | 151 | 📌 Example : */language es*`; 152 | exports.nobahasa = `Language not available 153 | 154 | *Available languages* 155 | - es (Spanish) 156 | - id (Indonesia) 157 | - en (English) 158 | - pt (Portugués) 159 | 160 | 📌 Example : */language es*`; 161 | 162 | exports.online = '✅ Successfully turned on the bot in this group'; 163 | exports.offline = '✅ Successfully turned off bots in this group'; 164 | 165 | // -- group 166 | exports.onwa = '✳️ The user is already in the group'; 167 | exports.sendlink = '✅ Send an invitinvitation'; 168 | exports.open = '✅ Changed group settings to allow all members to send messages in this group'; 169 | exports.close = '✅ Changed group settings to allow only admins to send messages in this group'; 170 | exports.name = (value) => { 171 | return `✅ Change the subject to *${value}*`; 172 | }; 173 | exports.desk = (value) => { 174 | return `✅ Changed the group description to \n\n${value}`; 175 | }; 176 | exports.promote = (value) => { 177 | return `✅ Successfully promoted *${value}* as admin`; 178 | }; 179 | exports.demote = (value) => { 180 | return '✅ Successfully demoted ' + value; 181 | }; 182 | 183 | exports.kick = (value) => { 184 | return '✅ Order received, issued '+value; 185 | }; 186 | exports.On = (value) => { 187 | return `✅ Turn on *${value}* in this group`; 188 | }; 189 | exports.Off = (value) => { 190 | return `✅ *${value}* turned off for this group`; 191 | }; 192 | exports.Thison = (value) => { 193 | return `✳️ *${value}* it\'s been on before`; 194 | }; 195 | exports.Thisoff = (value) => { 196 | return `✳️ *${value}* not turned on before`; 197 | }; 198 | exports.OnorOff = '✳️ Please repeat by adding on/off'; 199 | exports.antilink = '❎ We do not allow links from other groups!\nSorry you will be expelled'; 200 | 201 | exports.setwel = (value) => { 202 | return `✳️ Enter your *welcome* message 203 | 204 | *📌 Example:* 205 | /setwelcome Welcome @user to @group 206 | 207 | Tag : @user 208 | Name : @name 209 | Bio : @bio 210 | Date : @date 211 | Group Name : @group 212 | Description : @desc 213 | 214 | *Examples for each function*\n` + value; 215 | }; 216 | 217 | exports.setbye = (value) => { 218 | return `✳️ Enter your *Farewell* message 219 | 220 | *📌 Example:* 221 | /setbye goodbye @user 222 | 223 | *Examples for each function*\n` + value; 224 | }; 225 | 226 | exports.setweldone = (value, fungsi) => { 227 | return `✅ *Welcome* message set`; 228 | }; 229 | 230 | exports.setbyedone = (value, fungsi) => { 231 | return `✅ *bye* message set`; 232 | }; 233 | //-- 234 | exports.default = (value) => { 235 | return value + ' Return to initial settings'; 236 | }; 237 | 238 | exports.main = (value) => { 239 | return '✳️ There still is ' + value + ' in progress!'; 240 | }; 241 | exports.nomain = (value) => { 242 | return '✳️ There is not any ' + value + ' in progress!'; 243 | }; 244 | exports.inmain = (value) => { 245 | return 'You\'ve done ' + value 246 | }; 247 | exports.hapus = (value) =>{ 248 | return `✅ Successfully deleted *${value}* in this group`; 249 | }; 250 | 251 | // game 252 | exports.onGame = '⚠️ There are still unanswered questions in this chat'; 253 | exports.soal = (text1, text2, text3) => { 254 | return `${text1} 255 | 256 | *⏳ Timeout* 257 | ${text2} 258 | 259 | *POIN* 260 | ${text3} 261 | 262 | Reply this message to answer 263 | The answer hint appears in the last 10 seconds`; 264 | }; 265 | 266 | exports.timeout = '⏳ Time out the answer is '; 267 | exports.salah = '*❎ Wrong* !\nTry again'; 268 | exports.hampir = '✳️ *A little more* !\nTry again'; 269 | exports.benar = (value, value2) => { 270 | return `✅ *Right*\nThe answer is ${value}\nyou get ${value2} Coins`; 271 | }; 272 | 273 | // afk 274 | exports.with = 'with reason '; 275 | exports.onAfk = (value) => { 276 | return 'you are now afk ' + value 277 | }; 278 | exports.offAfk = 'You\'re back from AFK' 279 | exports.inAfk = (value, time) => { 280 | return 'User is in Apk mode ' + value + '\n On : ' + time 281 | } 282 | -------------------------------------------------------------------------------- /language/es.js: -------------------------------------------------------------------------------- 1 | // voice command 2 | exports.vnCmd = (v) => { 3 | return 'Usar comandos con notas de voz, activar con el comando ' + v + 'voicecommand on/off'; 4 | }; 5 | 6 | // -- enviar mensaje 7 | exports.wait = `*⌛ _Cargando..._ ▬▬▬▭*`; 8 | exports.bye = `Adios...`; 9 | exports.done = `✅ Hecho`; 10 | exports.next = (value) => { 11 | return `Haga click en siguiente para *${value}* `; 12 | }; 13 | exports.packon = 'Nombre del paquete ya registrado'; 14 | exports.packoff = 'El nombre del paquete de medios no está registrado en la base de datos.'; 15 | exports.liston = '✅ Lista de medios almacenados en la base de datos'; 16 | exports.getlist = '✳️ Use el comando getimg/getvid/getav/getstik para enviar un paquete de un medio\n*📌Ejemplo* : /getimg auron'; 17 | exports.nolink = (value) => { 18 | return '✳️ Repita agregando un enlace ' + value; 19 | }; 20 | //--new 21 | exports.lvl = `Nivel`; 22 | exports.nme = `Nombre`; 23 | exports.hi = `Hola`; 24 | exports.gp = `Grupo`; 25 | exports.restart = `✅ Reiniciando Bot`; 26 | exports.pinsp = `Velocidad`; 27 | exports.pinse = `Segundos`; 28 | exports.num = `Numero`; 29 | exports.click = `Click aquí`; 30 | exports.next2 = `Siguiente`; 31 | exports.stima = `✳️ Envia una imagen con el comando\n o etiqueta una imagen que se haya enviado, *Videos 1-9 segundos* `; 32 | exports.resulf = `Resultado`; 33 | exports.bugr = `Gracias\nSu reporte ha sido almacenada en la base de datos. `; 34 | exports.linkgp = `Link del Grupo `; 35 | exports.linkrevo = `Enlace del grupo anulado`; 36 | exports.newlink = `Nuevo enlace`; 37 | exports.gpbt = `🛡️ Configuración de grupo\nAbrir y cerrar el grupo`; 38 | exports.gpbtt = `A continuación elija uno`; 39 | exports.gpopenb = `ABRIR`; 40 | exports.gpcloseb = `CERRAR`; 41 | exports.idiom = `Idioma`; 42 | exports.wrn = `Advertencia`; 43 | exports.pfile = `PERFIL`; 44 | exports.crtio = `Se creó el`; 45 | exports.mbr = `Miembros`; 46 | exports.wlme = `Bienvenida`; 47 | exports.vtc = `VOTACION`; 48 | exports.rzon = `Razon`; 49 | exports.vyes = `Si estas de acuerdo`; 50 | exports.vno = `Si no estas de acuerdo`; 51 | exports.vrvt = `Ver Votaciones`; 52 | exports.rtvt = `RESULTADOS DE VOTACION`; 53 | exports.dlte = `Eliminar`; 54 | exports.setpmulti = `✅ Se cambio el prefijo a : *multiprefijo*`; 55 | exports.setpnopre = `✅ Se cambió de prefijo a : *nopref*`; 56 | exports.setponepre = `✅ Se cambio el prefijo a :`; 57 | exports.setpall = `Prefijos Disponibles`; 58 | exports.setpnp = `Sin prefijo`; 59 | exports.setpop = `Un prefijo`; 60 | exports.setpmt = `Multi prefijo`; 61 | exports.updatef = `*Actualizado*\n\nInforme`; 62 | exports.simn = `quieres charlar un rato?\n\nResponde con`; 63 | exports.simmsg = `(Tu mensaje)\n\n📌 Ejemplo : `; 64 | exports.chatboton = `✅ Activaste *ChatBot* \n Lo que significa que podemos charlar ilimitadamente 😊`; 65 | exports.chatbotoff = `✅ *ChatBot* desactivado`; 66 | exports.pptt = `Seleccione`; 67 | exports.exple = `Ejemplo`; 68 | exports.emt = `Empate`; 69 | exports.gst = `Ganaste`; 70 | exports.pdt = `Perdiste`; 71 | exports.pptuser = `Tú`; 72 | exports.papel = `papel`; 73 | exports.tijera = `tijera`; 74 | exports.piedra = `piedra`; 75 | exports.foll = `Sígueme en Instagram \nhttps://www.instagram.com/fg98._`; 76 | exports.plays = `Ingresa el título de una canción`; 77 | exports.playm = `El archivo es demasiado grande, la reproducción de música se canceló, el tamaño máximo del archivo es de`; 78 | exports.listgp = `LISTA de Grupos`; 79 | exports.calidad = `Calidad`; 80 | exports.tamaño = `Tamaño`; 81 | exports.pfo = `Elija un formato\n\nSi tiene problemas con el comando use`; 82 | exports.pafo = `Seleccione la música que desea descargar`; 83 | exports.pvfo = `Seleccione el video que desea descargar`; 84 | exports.titlp = `Título`; 85 | exports.timp = `Duración`; 86 | exports.viep = `Vistas`; 87 | exports.vcnrst = 'No detectado'; 88 | exports.vclect = 'Lectura de voz'; 89 | exports.listwb = 'Lista de eventos'; 90 | exports.pregt = 'Ella me ama?'; 91 | exports.donate = `≡ *DONACION* 92 | Puedes apoyar al creador del bot donando :) 93 | 94 | ▢ *PayPal* 95 | • *Link :* https://paypal.me/fg98f 96 | ▢ *Mercado Pago Arg* 97 | • *Link :* https://mpago.la/1F3r6JH 98 | ▢ *Tigo Money* 99 | • *N° :* 75140648`; 100 | exports.cretb = 'Crea tu propio bot usando Termux'; 101 | 102 | // -- Decir tiempo 103 | exports.night = 'Buenas noches' 104 | exports.evening = 'Buenas tardes' 105 | exports.day = 'Buen día' 106 | exports.morning = 'Buenos dias' 107 | 108 | 109 | // -- mensaje solo 110 | exports.admin = '✳️ Este comando es solo para *Admins* del grupo'; 111 | exports.group = '✳️ ¡Este comando solo se puede usar en grupos!'; 112 | exports.premium = '✳️ Este comando es solo para miembros *Premium*'; 113 | exports.premdl = '✳️ Lo sentimos, no es un usuario premium, descárguelo usted mismo usando el enlace\n*LINK* : '; 114 | exports.botadmin = '✳️ ¡Para usar este comando debo ser *Administrador!*'; 115 | exports.owner = '✳️ Esta función es solo para *Para el dueño del Bot*'; 116 | exports.isprem = '✳️ El usuario es el usuario premium anterior.'; 117 | exports.noprem = '✳️ El usuario aún no es un usuario premium.'; 118 | exports.ban = '✳️ El estado de usuario ha sido prohibido antes'; 119 | exports.noban = '✳️ El usuario no tiene estado prohibido'; 120 | exports.isadmin = '✳️ El bot no puede iniciar sesión como administrador'; 121 | exports.oversize = '⚠️ El tamaño del archivo excede el tamaño especificado, descárguelo usted mismo a través del siguiente enlace\n*🔗 Link* : '; 122 | 123 | // -- texto 124 | exports.notag = '✳️ Etiqueta a un miembro del grupo'; 125 | exports.nonum = '✳️ Repita agregando el número de destino'; 126 | exports.notext = '✳️ Repita agregando texto'; 127 | exports.reply = '✳️Responde a un mensaje...'; 128 | exports.replyStic = '✳️Responde a un sticker...'; 129 | exports.replyVid = '✳️ Responde a un vide...'; 130 | exports.replyVn = '✳️ Responde a un audio...'; 131 | exports.replyImg = '✳️ Responde a una imagen...'; 132 | exports.noreply = '✳️ El mensaje al que respondió no contenía una respuesta'; 133 | exports.nolink = (value) => { 134 | return `✳️ Repita agregando un enlace de *${value}*`; 135 | }; 136 | exports.addwarn = `⚠️ Advertencia\nusted obtiene 1 advertencia`; 137 | exports.delwarn = `⚠️ Advertencia\n Se redujo 1 advertencia`; 138 | exports.cekwarn = (warn) => { 139 | return `≡ ADVERTENCIAS \n\n▢ Total : *${warn}*`; 140 | }; 141 | exports.nowarn = `✳️ El usuario no tiene ninguna advertencia`; 142 | 143 | exports.Pbahasa = `✳️ Seleccione el idioma que desea utilizar 144 | 145 | *Idiomas disponibles* 146 | - es (Spanish) 147 | - id (Indonesia) 148 | - en (English) 149 | - pt (Portugués) 150 | 151 | 📌 Ejemplo : */language en*`; 152 | exports.nobahasa = `Idioma no disponible 153 | 154 | *Idiomas disponibles* 155 | - es (Spanish) 156 | - id (Indonesia) 157 | - en (English) 158 | - pt (Portugués) 159 | 160 | 📌 Ejemplo : */language en*`; 161 | 162 | exports.online = '✅ Bot activo en este grupo' 163 | exports.offline = '✅ Se desactivo el Bot en este grupo' 164 | 165 | // -- grupo 166 | exports.onwa = '✳️ El usuario ya está en el grupo'; 167 | exports.sendlink = '✅ Envía una invitación a'; 168 | exports.open = '✅ Grupo abierto ahora *todos los participantes* pueden escribir'; 169 | exports.close = '✅ Grupo cerrado ahora *solo los admin* pueden escribir'; 170 | exports.name = (value) => { 171 | return `✅ Se cambió el nombre a \n\n*${value}*`; 172 | }; 173 | exports.desk = (value) => { 174 | return `✅ Cambió la descripción del grupo a \n\n${value}`; 175 | }; 176 | exports.promote = (value) => { 177 | return `✅ *${value}* Promovido como administrador`; 178 | }; 179 | exports.demote = (value) => { 180 | return '✅ Admin degradado' + value; 181 | }; 182 | 183 | exports.kick = (value) => { 184 | return '✅ Orden recibida, emitida '+value; 185 | }; 186 | exports.On = (value) => { 187 | return `✅ Se activo *${value}* en este grupo`; 188 | }; 189 | exports.Off = (value) => { 190 | return `✅ *${value}* desactivado para este grupo`; 191 | }; 192 | exports.Thison = (value) => { 193 | return `✳️ *${value}* Se activó antes`; 194 | }; 195 | exports.Thisoff = (value) => { 196 | return `✳️ *${value}* se desactivo antes`; 197 | }; 198 | exports.OnorOff = '✳️ Repita agregando on/off'; 199 | exports.antilink = '⚠️ Se te detecta enviando un enlace de un grupo de whatsapp'; 200 | 201 | exports.setwel = (value) => { 202 | return `✳️ Ingrese el mensaje de *bienvenida* 203 | 204 | *📌 Ejemplo:* 205 | /setwelcome Bienvenido @user a @group 206 | 207 | Tag : @user 208 | Nombre : @name 209 | Bio : @bio 210 | Fecha : @date 211 | Nombre de Grupo : @group 212 | Descripción : @desc 213 | 214 | *Ejemplos para cada función*\n` + value; 215 | }; 216 | 217 | exports.setbye = (value) => { 218 | return `✳️ Ingrese el mensaje de *Despedida* 219 | 220 | *📌 Ejemplo:* 221 | /setbye Adios @user 222 | 223 | *Ejemplos para cada función*\n` + value; 224 | }; 225 | 226 | exports.setweldone = (value, fungsi) => { 227 | return `✅ Se estableció el mensaje de *Bienvenida*`; 228 | }; 229 | 230 | exports.setbyedone = (value, fungsi) => { 231 | return `✅ Se estableció el mensaje de *Despedida*`; 232 | }; 233 | //-- 234 | exports.default = (value) => { 235 | return value + ' Vuelve a la configuración inicial'; 236 | }; 237 | 238 | exports.main = (value) => { 239 | return '✳️ Todavía hay un ' + value + ' en curso'; 240 | }; 241 | exports.nomain = (value) => { 242 | return `✳️ No hay *${value}* en curso`; 243 | }; 244 | exports.inmain = (value) => { 245 | return `Ya has Votado *${value}*` 246 | }; 247 | exports.hapus = (value) =>{ 248 | return `✅ Se eliminó *${value}* de este grupo`; 249 | }; 250 | 251 | // juegos 252 | exports.onGame = '⚠️ Todavía hay preguntas sin respuesta en este chat.'; 253 | exports.soal = (text1, text2, text3) => { 254 | return `${text1} 255 | 256 | ⏳ *Tiempo* 257 | ${text2} 258 | 259 | *RECOMPENSA* 260 | ${text3} Coins 261 | 262 | Responde este mensaje para responder 263 | La pista de respuesta aparece en los últimos 10 segundos.`; 264 | }; 265 | 266 | exports.timeout = '⏳ Se acabó el tiempo, la respuesta es '; 267 | exports.salah = '❎ *Incorrecto* !\nIntente otra vez'; 268 | exports.hampir = '*✳️ Casi lo logras* \nSigue intentando!'; 269 | exports.benar = (value, value2) => { 270 | return `✅ *Respuesta correcta!*\n\n‣ Ganaste : *${value2}* Coins`; 271 | }; 272 | 273 | // afk 274 | exports.with = '▢ Razón : '; 275 | exports.onAfk = (value) => { 276 | return `😴 *AFK* \n\nAhora estas afk hasta que envies un mensaje\n${value}` 277 | }; 278 | exports.offAfk = 'Regresaste de AFK' 279 | exports.inAfk = (value, time) => { 280 | return `El usuario que mencionas está AFK \n${value}\n▢ Desde : ${time} ` 281 | } 282 | -------------------------------------------------------------------------------- /language/pt.js: -------------------------------------------------------------------------------- 1 | // voice command 2 | exports.vnCmd = (v) => { 3 | return 'Use comandos com memos de voz, ative com o comando ' + v + 'voicecommand on/off'; 4 | }; 5 | 6 | // -- enviar mensaje 7 | exports.wait = `*⌛ _Carregando..._ ▬▬▬▭*`; 8 | exports.bye = `tchau...`; 9 | exports.done = `✅ Feito`; 10 | exports.next = (value) => { 11 | return `Clique ao lado de *${value}* `; 12 | }; 13 | exports.packon = 'Nome do pacote já registrado'; 14 | exports.packoff = 'O nome do pacote de mídia não está registrado no banco de dados.'; 15 | exports.liston = '✅ Lista de mídia armazenada no banco de dados'; 16 | exports.getlist = '✳️ Use o comando getimg/getvid/getav/getstik enviar um pacote de um meio\n*📌Exemplo* : /getimg auron'; 17 | exports.nolink = (value) => { 18 | return '✳️ Repita a adição de um link ' + value; 19 | }; 20 | //--new 21 | exports.lvl = `Nível`; 22 | exports.nme = `Nome`; 23 | exports.hi = `Olá`; 24 | exports.gp = `Grupo`; 25 | exports.restart = `✅ Reiniciando o Bot`; 26 | exports.pinsp = `Velocidade`; 27 | exports.pinse = `Segundos`; 28 | exports.num = `Numero`; 29 | exports.click = `Clique aqui`; 30 | exports.next2 = `Próximo`; 31 | exports.stima = `✳️ Envie uma imagem com o comando\n ou marcar uma imagem que foi enviada, *Videos 1-9 segundos* `; 32 | exports.resulf = `Resultado`; 33 | exports.bugr = `Obrigado\nSeu relatório foi armazenado no banco de dados. `; 34 | exports.linkgp = `Link do Grupo `; 35 | exports.linkrevo = `Link do grupo cancelado`; 36 | exports.newlink = `Novo link`; 37 | exports.gpbt = `🛡️ Configurações do grupo\nAbra e feche o grupo`; 38 | exports.gpbtt = `Escolha um abaixo`; 39 | exports.gpopenb = `ABRIR`; 40 | exports.gpcloseb = `FECHAR`; 41 | exports.idiom = `Idioma`; 42 | exports.wrn = `Aviso`; 43 | exports.pfile = `PERFIL`; 44 | exports.crtio = `o`; 45 | exports.mbr = `Membros`; 46 | exports.wlme = `Receber`; 47 | exports.vtc = `VOTAÇÃO`; 48 | exports.rzon = `Razão`; 49 | exports.vyes = `Se você está de acordo`; 50 | exports.vno = `Se você não concorda`; 51 | exports.vrvt = `Veja a votação`; 52 | exports.rtvt = `RESULTADOS DE VOTAÇÃO`; 53 | exports.dlte = `Retirar`; 54 | exports.setpmulti = `✅ O prefixo foi alterado para : *multiprefixo*`; 55 | exports.setpnopre = `✅ O prefixo foi alterado para : *nopref*`; 56 | exports.setponepre = `✅ O prefixo foi alterado para :`; 57 | exports.setpall = `Prefixos Disponíveis`; 58 | exports.setpnp = `Sem prefixo`; 59 | exports.setpop = `Um prefixo`; 60 | exports.setpmt = `Multi prefixo`; 61 | exports.updatef = `*Atualizada*\n\nRelatório`; 62 | exports.simn = `você quer conversar um pouco?\n\nResponder com`; 63 | exports.simmsg = `(Sua mensagem)\n\n📌 Exemplo : `; 64 | exports.chatboton = `✅ Você ativou *ChatBot* \n O que significa que podemos conversar ilimitadamente 😊`; 65 | exports.chatbotoff = `✅ *ChatBot* Desativado`; 66 | exports.pptt = `Por favor selecione`; 67 | exports.exple = `Exemplo`; 68 | exports.emt = `Laço`; 69 | exports.gst = `Ganhou`; 70 | exports.pdt = `Você perdeu`; 71 | exports.pptuser = `Vocês`; 72 | exports.papel = `papel`; 73 | exports.tijera = `tesoura`; 74 | exports.piedra = `pedra`; 75 | exports.foll = `Me siga em Instagram \nhttps://www.instagram.com/fg98._`; 76 | exports.plays = `Digite o título da música`; 77 | exports.playm = `O arquivo é muito grande, a reprodução da música foi cancelada, o tamanho máximo do arquivo é`; 78 | exports.listgp = `LISTA de Grupos`; 79 | exports.calidad = `Qualidade`; 80 | exports.tamaño = `Tamanho`; 81 | exports.pfo = `Escolha um formato\n\nSe você tiver problemas com o comando, use`; 82 | exports.pafo = `Selecione a música que deseja baixar`; 83 | exports.pvfo = `Selecione o vídeo que deseja baixar`; 84 | exports.titlp = `Qualificação`; 85 | exports.timp = `Duração`; 86 | exports.viep = `Visualizações`; 87 | exports.vcnrst = 'Não detectado'; 88 | exports.vclect = 'Leitura de voz'; 89 | exports.listwb = 'Lista de evento'; 90 | exports.pregt = 'Ela me ama?'; 91 | exports.donate = `≡ *DOAÇÃO* 92 | Você pode apoiar o criador do bot doando :) 93 | 94 | ▢ *PayPal* 95 | • *Link :* https://paypal.me/fg98f 96 | ▢ *Mercado Pago Arg* 97 | • *Link :* https://mpago.la/1F3r6JH 98 | ▢ *Tigo Money* 99 | • *N° :* 78230727`; 100 | exports.cretb = 'Crie seu próprio bot usando Termux'; 101 | 102 | // -- Decir tiempo 103 | exports.night = 'Boa noite' 104 | exports.evening = 'Boa tarde' 105 | exports.day = 'Bom Dia' 106 | exports.morning = 'bom Dia' 107 | 108 | 109 | // -- mensaje solo 110 | exports.admin = '✳️ Este comando é apenas para *Admins* do grupo'; 111 | exports.group = '✳️ ¡Este comando só pode ser usado em grupos!'; 112 | exports.premium = '✳️ Este comando é apenas para membros *Premium*'; 113 | exports.premdl = '✳️ Desculpe, você não é um usuário premium, faça o download você mesmo usando o link\n*LINK* : '; 114 | exports.botadmin = '✳️ ¡Para usar este comando, devo ser *Administrador*'; 115 | exports.owner = '✳️ Esta função é apenas para *Para o proprietário do bot*'; 116 | exports.isprem = '✳️ O usuário é o usuário premium anterior.'; 117 | exports.noprem = '✳️ O usuário ainda não é um usuário premium.'; 118 | exports.ban = '✳️ O status do usuário foi banido antes'; 119 | exports.noban = '✳️ O usuário não tem status de banido '; 120 | exports.isadmin = '✳️ O bot não consegue entrar como administrador'; 121 | exports.oversize = '⚠️ O tamanho do arquivo excede o tamanho especificado, faça o download você mesmo através do link abaixo\n*🔗 Link* : '; 122 | 123 | // -- texto 124 | exports.notag = '✳️ Marque um membro do grupo'; 125 | exports.nonum = '✳️ Repita a adição do número de destino'; 126 | exports.notext = '✳️ Repita a adição de texto'; 127 | exports.reply = '✳️Responder a uma mensagem...'; 128 | exports.replyStic = '✳️Responder a um adesivo...'; 129 | exports.replyVid = '✳️ Responder a um vídeo...'; 130 | exports.replyVn = '✳️ Responder a um áudio...'; 131 | exports.replyImg = '✳️ Responda a uma imagem...'; 132 | exports.noreply = '✳️ A mensagem que você respondeu não continha uma resposta'; 133 | exports.nolink = (value) => { 134 | return `✳️ Repita a adição de um link de *${value}*`; 135 | }; 136 | exports.addwarn = `⚠️ Aviso\nvocê pega 1 aviso`; 137 | exports.delwarn = `⚠️ Aviso\n Diminuiu 1 aviso`; 138 | exports.cekwarn = (warn) => { 139 | return `≡ AVISOS \n\n▢ Total : *${warn}*`; 140 | }; 141 | exports.nowarn = `✳️ O usuário não tem nenhum aviso`; 142 | 143 | exports.Pbahasa = `✳️ Selecione o idioma que deseja usar 144 | 145 | *Idiomas disponibles* 146 | - es (Spanish) 147 | - id (Indonesia) 148 | - en (English) 149 | - pt (Portugués) 150 | 151 | 📌 Exemplo : */language en*`; 152 | exports.nobahasa = `Idioma não disponível 153 | 154 | *Idiomas disponibles* 155 | - es (Spanish) 156 | - id (Indonesia) 157 | - en (English) 158 | - pt (Portugués) 159 | 160 | 📌 Exemplo : */language en*`; 161 | 162 | exports.online = '✅ Bot ativo neste grupo' 163 | exports.offline = '✅ O bot foi desabilitado neste grupo' 164 | 165 | // -- grupo 166 | exports.onwa = '✳️ O usuário já está no grupo'; 167 | exports.sendlink = '✅ Envie um convite para'; 168 | exports.open = '✅ Grupo aberto agora *todos os participantes* podem escrever'; 169 | exports.close = '✅ Grupo fechado agora *apenas administradores* podem escrever'; 170 | exports.name = (value) => { 171 | return `✅ O nome foi alterado para \n\n*${value}*`; 172 | }; 173 | exports.desk = (value) => { 174 | return `✅ Descrição do grupo alterada para \n\n${value}`; 175 | }; 176 | exports.promote = (value) => { 177 | return `✅ *${value}* Promovido como administrador`; 178 | }; 179 | exports.demote = (value) => { 180 | return '✅ Admin degradado' + value; 181 | }; 182 | 183 | exports.kick = (value) => { 184 | return '✅ Pedido recebido, emitido '+value; 185 | }; 186 | exports.On = (value) => { 187 | return `✅ Ser ativo *${value}* neste grupo`; 188 | }; 189 | exports.Off = (value) => { 190 | return `✅ *${value}* desabilitado para este grupo`; 191 | }; 192 | exports.Thison = (value) => { 193 | return `✳️ *${value}* Foi ativado antes`; 194 | }; 195 | exports.Thisoff = (value) => { 196 | return `✳️ *${value}* foi desativado antes`; 197 | }; 198 | exports.OnorOff = '✳️ Repita a adição on/off'; 199 | exports.antilink = '⚠️ Você foi detectado enviando um link de um grupo do WhatsApp'; 200 | 201 | exports.setwel = (value) => { 202 | return `✳️ Digite sua mensagem de *boas-vindas* 203 | 204 | *📌 Exemplo:* 205 | /setwelcome Receber @user para @group 206 | 207 | Tag : @user 208 | Nome : @name 209 | Bio : @bio 210 | Encontro : @date 211 | Nome do grupo : @group 212 | Descrição : @desc 213 | 214 | *Exemplos para cada função*\n` + value; 215 | }; 216 | 217 | exports.setbye = (value) => { 218 | return `✳️ Digite a mensagem *Farewell* 219 | 220 | *📌 Exemplo:* 221 | /setbye Tchau @user 222 | 223 | *Exemplos para cada função*\n` + value; 224 | }; 225 | 226 | exports.setweldone = (value, fungsi) => { 227 | return `✅ *Bem-vindo* conjunto de mensagens`; 228 | }; 229 | 230 | exports.setbyedone = (value, fungsi) => { 231 | return `✅ Conjunto de mensagens de adeus*`; 232 | }; 233 | //-- 234 | exports.default = (value) => { 235 | return value + ' Volte para as configurações iniciais'; 236 | }; 237 | 238 | exports.main = (value) => { 239 | return '✳️ Ainda há um ' + value + ' no curso'; 240 | }; 241 | exports.nomain = (value) => { 242 | return `✳️ Não há *${value}* no curso`; 243 | }; 244 | exports.inmain = (value) => { 245 | return `Você já votou *${value}*` 246 | }; 247 | exports.hapus = (value) =>{ 248 | return `✅ Foi deletado *${value}* deste grupo`; 249 | }; 250 | 251 | // juegos 252 | exports.onGame = '⚠️ Ainda há perguntas sem resposta neste bate-papo.'; 253 | exports.soal = (text1, text2, text3) => { 254 | return `${text1} 255 | 256 | ⏳ *Time* 257 | ${text2} 258 | 259 | *RECOMPENSA* 260 | ${text3} Coins 261 | 262 | Responda a esta mensagem para responder 263 | A dica de resposta aparece no último 10 segundos.`; 264 | }; 265 | 266 | exports.timeout = '⏳ O tempo acabou, a resposta é '; 267 | exports.salah = '❎ *Incorreta* !\nTente novamente'; 268 | exports.hampir = '*✳️ Você quase conseguiu* \nContinue tentando!'; 269 | exports.benar = (value, value2) => { 270 | return `✅ *Resposta correta!*\n\n‣ Ganhou : *${value2}* Coins`; 271 | }; 272 | 273 | // afk 274 | exports.with = '▢ Razão : '; 275 | exports.onAfk = (value) => { 276 | return `😴 *AFK* \n\nAgora você está afk até enviar uma mensagem\n${value}` 277 | }; 278 | exports.offAfk = 'Você voltou de AFK' 279 | exports.inAfk = (value, time) => { 280 | return `O usuário que você mencionou é AFK \n${value}\n▢ A partir de : ${time} ` 281 | } 282 | -------------------------------------------------------------------------------- /result/informasi/text_generator.js: -------------------------------------------------------------------------------- 1 | async function namaninja(teks){ 2 | hasil = teks.replace(/[a-zA-Z]/gi, v => { 3 | switch (v.toLowerCase()) { 4 | case 'a': return 'ka'; 5 | case 'b': return 'tu'; 6 | case 'c': return 'mi'; 7 | case 'd': return 'te'; 8 | case 'e': return 'ku'; 9 | case 'f': return 'lu'; 10 | case 'g': return 'ji'; 11 | case 'h': return 'ri'; 12 | case 'i': return 'ki'; 13 | case 'j': return 'zu'; 14 | case 'k': return 'me'; 15 | case 'l': return 'ta'; 16 | case 'm': return 'rin'; 17 | case 'n': return 'to'; 18 | case 'o': return 'mo'; 19 | case 'p': return 'no'; 20 | case 'q': return 'ke'; 21 | case 'r': return 'shi'; 22 | case 's': return 'ari'; 23 | case 't': return 'ci'; 24 | case 'u': return 'do'; 25 | case 'v': return 'ru'; 26 | case 'w': return 'mei'; 27 | case 'x': return 'na'; 28 | case 'y': return 'fu'; 29 | case 'z': return 'zi'; 30 | } 31 | }); 32 | return hasil; 33 | } 34 | 35 | async function purba(value){ 36 | hasil = value.replace(/[aiueo]/gi, v=> { 37 | switch(v.toLowerCase()){ 38 | case 'a': return 'ove'; 39 | case 'i': return 'ove'; 40 | case 'u': return 'ove'; 41 | case 'e': return 'ove'; 42 | case 'o': return 'ove'; 43 | } 44 | }); 45 | return hasil; 46 | } 47 | 48 | async function blackpill(teks){ 49 | hasil = teks.replace(/[a-zA-Z]/gi, v => { 50 | switch (v.toLowerCase()) { 51 | case 'a': return '🅐'; 52 | case 'b': return '🅑'; 53 | case 'c': return '🅒'; 54 | case 'd': return '🅓'; 55 | case 'e': return '🅔'; 56 | case 'f': return '🅕'; 57 | case 'g': return '🅖'; 58 | case 'h': return '🅗'; 59 | case 'i': return '🅘'; 60 | case 'j': return '🅙'; 61 | case 'k': return '🅚'; 62 | case 'l': return '🅛'; 63 | case 'm': return '🅜'; 64 | case 'n': return '🅝'; 65 | case 'o': return '🅞'; 66 | case 'p': return '🅟'; 67 | case 'q': return '🅠'; 68 | case 'r': return '🅡'; 69 | case 's': return '🅢'; 70 | case 't': return '🅣'; 71 | case 'u': return '🅤'; 72 | case 'v': return '🅥'; 73 | case 'w': return '🅦'; 74 | case 'x': return '🅧'; 75 | case 'y': return '🅨'; 76 | case 'z': return '🅩'; 77 | case '1': return '➊'; 78 | case '2': return '➋'; 79 | case '3': return '➌'; 80 | case '4': return '➍'; 81 | case '5': return '➎'; 82 | case '6': return '➏'; 83 | case '7': return '➐'; 84 | case '8': return '➑'; 85 | case '9': return '➒'; 86 | case '0': return '⓿'; 87 | } 88 | }); 89 | return hasil; 90 | } 91 | 92 | async function typewriter(teks) { 93 | hasil = teks.replace(/[a-zA-Z]/g, v => { 94 | switch (v) { 95 | case 'a': return '𝚊'; 96 | case 'b': return '𝚋'; 97 | case 'c': return '𝚌'; 98 | case 'd': return '𝚍'; 99 | case 'e': return '𝚎'; 100 | case 'f': return '𝚏'; 101 | case 'g': return '𝚐'; 102 | case 'h': return '𝚑'; 103 | case 'i': return '𝚒'; 104 | case 'j': return '𝚓'; 105 | case 'k': return '𝚔'; 106 | case 'l': return '𝚕'; 107 | case 'm': return '𝚖'; 108 | case 'n': return '𝚗'; 109 | case 'o': return '𝚘'; 110 | case 'p': return '𝚙'; 111 | case 'q': return '𝚚'; 112 | case 'r': return '𝚛'; 113 | case 's': return '𝚜'; 114 | case 't': return '𝚝'; 115 | case 'u': return '𝚞'; 116 | case 'v': return '𝚟'; 117 | case 'w': return '𝚠'; 118 | case 'x': return '𝚡'; 119 | case 'y': return '𝚢'; 120 | case 'z': return '𝚣'; 121 | case 'A': return '𝙰'; 122 | case 'B': return '𝙱'; 123 | case 'C': return '𝙲'; 124 | case 'D': return '𝙳'; 125 | case 'E': return '𝙴'; 126 | case 'F': return '𝙵'; 127 | case 'G': return '𝙶'; 128 | case 'H': return '𝙷'; 129 | case 'I': return '𝙸'; 130 | case 'J': return '𝙹'; 131 | case 'K': return '𝙺'; 132 | case 'L': return '𝙻'; 133 | case 'M': return '𝙼'; 134 | case 'N': return '𝙽'; 135 | case 'O': return '𝙾'; 136 | case 'P': return '𝙿'; 137 | case 'Q': return '𝚀'; 138 | case 'R': return '𝚁'; 139 | case 'S': return '𝚂'; 140 | case 'T': return '𝚃'; 141 | case 'U': return '𝚄'; 142 | case 'V': return '𝚅'; 143 | case 'W': return '𝚆'; 144 | case 'X': return '𝚇'; 145 | case 'Y': return '𝚈'; 146 | case 'Z': return '𝚉'; 147 | } 148 | }); 149 | return hasil; 150 | } 151 | 152 | async function sans(teks){ 153 | hasil = teks.replace(/[a-zA-Z0-9]/g, v => { 154 | switch (v) { 155 | case 'a': return '𝗮'; 156 | case 'b': return '𝗯'; 157 | case 'c': return '𝗰'; 158 | case 'd': return '𝗱'; 159 | case 'e': return '𝗲'; 160 | case 'f': return '𝗳'; 161 | case 'g': return '𝗴'; 162 | case 'h': return '𝗵'; 163 | case 'i': return '𝗶'; 164 | case 'j': return '𝗷'; 165 | case 'k': return '𝗸'; 166 | case 'l': return '𝗹'; 167 | case 'm': return '𝗺'; 168 | case 'n': return '𝗻'; 169 | case 'o': return '𝗼'; 170 | case 'p': return '𝗽'; 171 | case 'q': return '𝗾'; 172 | case 'r': return '𝗿'; 173 | case 's': return '𝘀'; 174 | case 't': return '𝘁'; 175 | case 'u': return '𝘂'; 176 | case 'v': return '𝘃'; 177 | case 'w': return '𝘄'; 178 | case 'x': return '𝘅'; 179 | case 'y': return '𝘆'; 180 | case 'z': return '𝘇'; 181 | case 'A': return '𝗔'; 182 | case 'B': return '𝗕'; 183 | case 'C': return '𝗖'; 184 | case 'D': return '𝗗'; 185 | case 'E': return '𝗘'; 186 | case 'F': return '𝗙'; 187 | case 'G': return '𝗚'; 188 | case 'H': return '𝗛'; 189 | case 'I': return '𝗜'; 190 | case 'J': return '𝗝'; 191 | case 'K': return '𝗞'; 192 | case 'L': return '𝗟'; 193 | case 'M': return '𝗠'; 194 | case 'N': return '𝗡'; 195 | case 'O': return '𝗢'; 196 | case 'P': return '𝗣'; 197 | case 'Q': return '𝗤'; 198 | case 'R': return '𝗥'; 199 | case 'S': return '𝗦'; 200 | case 'T': return '𝗧'; 201 | case 'U': return '𝗨'; 202 | case 'V': return '𝗩'; 203 | case 'W': return '𝗪'; 204 | case 'X': return '𝗫'; 205 | case 'Y': return '𝗬'; 206 | case 'Z': return '𝗭'; 207 | case '1': return '𝟭'; 208 | case '2': return '𝟮'; 209 | case '3': return '𝟯'; 210 | case '4': return '𝟰'; 211 | case '5': return '𝟱'; 212 | case '6': return '𝟲'; 213 | case '7': return '𝟳'; 214 | case '8': return '𝟴'; 215 | case '9': return '𝟵'; 216 | case '0': return '𝟬'; 217 | } 218 | }); 219 | return hasil; 220 | } 221 | 222 | async function castle(teks){ 223 | hasil = teks.replace(/[a-zA-Z0-9]/g, v => { 224 | switch (v) { 225 | case 'a': return '𝖆'; 226 | case 'b': return '𝖇'; 227 | case 'c': return '𝖈'; 228 | case 'd': return '𝖉'; 229 | case 'e': return '𝖊'; 230 | case 'f': return '𝖋'; 231 | case 'g': return '𝖌'; 232 | case 'h': return '𝖍'; 233 | case 'i': return '𝖎'; 234 | case 'j': return '𝖏'; 235 | case 'k': return '𝖐'; 236 | case 'l': return '𝖑'; 237 | case 'm': return '𝖒'; 238 | case 'n': return '𝖓'; 239 | case 'o': return '𝖔'; 240 | case 'p': return '𝖕'; 241 | case 'q': return '𝖖'; 242 | case 'r': return '𝖗'; 243 | case 's': return '𝖘'; 244 | case 't': return '𝖙'; 245 | case 'u': return '𝖚'; 246 | case 'v': return '𝖛'; 247 | case 'w': return '𝖜'; 248 | case 'x': return '𝖝'; 249 | case 'y': return '𝖞'; 250 | case 'z': return '𝖟'; 251 | case 'A': return '𝕬'; 252 | case 'B': return '𝕭'; 253 | case 'C': return '𝕮'; 254 | case 'D': return '𝕯'; 255 | case 'E': return '𝕰'; 256 | case 'F': return '𝕱'; 257 | case 'G': return '𝕲'; 258 | case 'H': return '𝕳'; 259 | case 'I': return '𝕴'; 260 | case 'J': return '𝕵'; 261 | case 'K': return '𝕶'; 262 | case 'L': return '𝕷'; 263 | case 'M': return '𝕸'; 264 | case 'N': return '𝕹'; 265 | case 'O': return '𝕺'; 266 | case 'P': return '𝕻'; 267 | case 'Q': return '𝕼'; 268 | case 'R': return '𝕽'; 269 | case 'S': return '𝕾'; 270 | case 'T': return '𝕿'; 271 | case 'U': return '𝖀'; 272 | case 'V': return '𝖁'; 273 | case 'W': return '𝖂'; 274 | case 'X': return '𝖃'; 275 | case 'Y': return '𝖄'; 276 | case 'Z': return '𝖅'; 277 | case '1': return '𝟏'; 278 | case '2': return '𝟐'; 279 | case '3': return '𝟑'; 280 | case '4': return '𝟒'; 281 | case '5': return '𝟓'; 282 | case '6': return '𝟔'; 283 | case '7': return '𝟕'; 284 | case '8': return '𝟖'; 285 | case '9': return '𝟗'; 286 | case '0': return '𝟎'; 287 | } 288 | }); 289 | return hasil; 290 | } 291 | 292 | 293 | 294 | module.exports = { 295 | namaninja, 296 | purba, 297 | blackpill, 298 | typewriter, 299 | sans, 300 | castle, 301 | } -------------------------------------------------------------------------------- /language/id.js: -------------------------------------------------------------------------------- 1 | // voice command 2 | exports.vnCmd = (v) => { 3 | return 'Gunakan perintah menggunakan voice note, aktifkan menggunakan perintah ' + v + 'voicecommand on/off'; 4 | }; 5 | 6 | // -- send message 7 | exports.wait = `*⌛ _Pengisian..._ ▬▬▬▭*`; 8 | exports.bye = `Selamat tinggal...`; 9 | exports.done = `✅ Selesai...`; 10 | exports.next = (value) => { 11 | return 'Klik next untuk '+value+' selanjutnya'; 12 | }; 13 | exports.packon = 'Maaf kak perintah yang kaka minta tidak bisa diproses,karna nama pack yang kaka minta sudah terdaftar didalam database bot'; 14 | exports.packoff = 'Maaf kak perintah yang kaka minta tidak bisa diproses,karna nama pack media yang kaka minta tidak terdaftar didalam database bot'; 15 | exports.liston = '✅ List media yang tersimpan dalam database bot'; 16 | exports.getlist = '✳️ Silahkan gunakan perintah getimg/ getvid/ getav/ getstick untuk mengambil setiap pack media\n*📌 Contoh* : /getimg auron'; 17 | exports.nolink = (value) => { 18 | return '✳️ Link tidak tersedia! silahkan masukan perintah dengan menambahkan link ' + value; 19 | }; 20 | //--new 21 | exports.lvl = `Tingkat`; 22 | exports.nme = `Nama`; 23 | exports.hi = `Halo`; 24 | exports.gp = `Grup`; 25 | exports.restart = `✅ Memulai ulang Bot`; 26 | exports.pinsp = `Kecepatan`; 27 | exports.pinse = `Detik`; 28 | exports.num = `Nomor`; 29 | exports.click = `Klik disini`; 30 | exports.next2 = `Lanjut`; 31 | exports.stima = `✳️ Kirim gambar dengan perintah\n atau tag gambar yang telah dikirimkan, *Video 1-9 detik* `; 32 | exports.resulf = `Hasil`; 33 | exports.bugr = `Terima kasih \nLaporan Anda telah disimpan di database.`; 34 | exports.linkgp = `Tautan Grup `; 35 | exports.linkrevo = `Tautan grup dibatalkan`; 36 | exports.newlink = `Tautan baru`; 37 | exports.gpbt = `🛡️ Pengaturan grup\nBuka dan tutup grup`; 38 | exports.gpbtt = `Pilih salah satu di bawah ini`; 39 | exports.gpopenb = `MEMBUKA`; 40 | exports.gpcloseb = `UNTUK MENUTUP`; 41 | exports.idiom = `Bahasa`; 42 | exports.wrn = `Peringatan`; 43 | exports.pfile = `PROFIL`; 44 | exports.crtio = `Diciptakan`; 45 | exports.mbr = `Anggota`; 46 | exports.wlme = `Selamat datang`; 47 | exports.vtc = `PILIH`; 48 | exports.rzon = `Alasan`; 49 | exports.vyes = `Jika kamu setuju`; 50 | exports.vno = `Jika Anda tidak setuju`; 51 | exports.vrvt = `Lihat Pemungutan Suara`; 52 | exports.rtvt = `HASIL PEMILIHAN`; 53 | exports.dlte = `Menghapus`; 54 | exports.setpmulti = `✅ Awalan diubah menjadi : *multiprefijo*`; 55 | exports.setpnopre = `✅ Awalan diubah menjadi : *nopref*`; 56 | exports.setponepre = `✅ Awalan diubah menjadi :`; 57 | exports.setpall = `Available Prefixes`; 58 | exports.setpnp = `No prefix`; 59 | exports.setpop = `One prefix`; 60 | exports.setpmt = `Multi prefix`; 61 | exports.updatef = `*Diperbarui*\n\nLaporan`; 62 | exports.simn = `apakah kamu ingin mengobrol sebentar?\n\nBalas dengan`; 63 | exports.simmsg = `(Pesanmu)\n\n📌 Contoh : `; 64 | exports.chatboton = `✅ Anda mengaktifkan *ChatBot* \n Yang berarti kita dapat mengobrol tanpa batas 😊`; 65 | exports.chatbotoff = `✅ *ChatBot* dinonaktifkan`; 66 | exports.pptt = `Silahkan pilih`; 67 | exports.exple = `Contoh`; 68 | exports.emt = `Mengikat`; 69 | exports.gst = `Won`; 70 | exports.pdt = `Kamu kalah`; 71 | exports.pptuser = `Anda`; 72 | exports.papel = `kertas`; 73 | exports.tijera = `gunting`; 74 | exports.piedra = `batu`; 75 | exports.foll = `Ikuti saya di Instagram \nhttps://www.instagram.com/fg98._`; 76 | exports.plays = `Masukkan judul lagu`; 77 | exports.playm = `File terlalu besar, pemutaran musik dibatalkan, ukuran file maksimum adalah`; 78 | exports.listgp = `DAFTAR Grup`; 79 | exports.calidad = `Kualitas`; 80 | exports.tamaño = `Ukuran`; 81 | exports.pfo = `Pilih format\n\nJika Anda memiliki masalah dengan perintah, gunakan`; 82 | exports.pafo = `Pilih musik yang ingin Anda unduh`; 83 | exports.pvfo = `Pilih video yang ingin Anda unduh`; 84 | exports.titlp = `Kualifikasi`; 85 | exports.timp = `Durasi`; 86 | exports.viep = `Tampilan`; 87 | exports.vcnrst = 'Tidak terdeteksi'; 88 | exports.vclect = 'Membaca suara'; 89 | exports.listwb = 'daftar acara'; 90 | exports.pregt = 'Dia mencintaiku?'; 91 | exports.donate = `≡ *SUMBANGAN* 92 | Anda dapat mendukung pembuat bot dengan berdonasi :) 93 | 94 | ▢ *PayPal* 95 | • *Link :* https://paypal.me/fg98f 96 | ▢ *Mercado Pago Arg* 97 | • *Link :* https://mpago.la/1F3r6JH 98 | ▢ *Tigo Money* 99 | • *N° :* 78230727`; 100 | exports.cretb = 'Buat bot Anda sendiri menggunakan Termux'; 101 | 102 | // -- Saying time 103 | exports.night = 'Selamat Malam'; 104 | exports.evening = 'Selamat Sore'; 105 | exports.day = 'Selamat Siang'; 106 | exports.morning = 'Selamat Pagi'; 107 | 108 | 109 | // -- message only 110 | exports.admin = `✳️ Yahh maaf, perintah ini hanya dapat dijalankan oleh admin group! \nsilahkan chat admin untuk menjalankan perintah tersebut`; 111 | exports.group = `✳️ Yahh maaf, perintah ini hanya dapat dijalankan didalam group`; 112 | exports.premium = `✳️ Yahh maaf, perintah ini hanya dapat digunakan oleh user premium`; 113 | exports.premdl = `✳️ Yahh maaf kamu bukan user premium, download sendiri menggunakan link\n*LINK* : `; 114 | exports.botadmin = `✳️ Perintah ini bisa digunakan ketika bot menjadi admin`; 115 | exports.owner = `✳️ Waduh maaf kak perintah ini hanya bisa digunakan oleh owner bot`; 116 | exports.isprem = `✳️ Yahh maaf User ini sudah dijadikan user premium sebelumnya`; 117 | exports.noprem = `✳️ Maaf kak Hanya User Premium yang bisa menggunakan fitur ini,silahkan chat owner untuk membeli fitur premium`; 118 | exports.ban = '✳️ User yang kaka masukan sudah dibanned sebelumnya,silahkan masukan perintah ini jika user ini belum terbanned oleh bot'; 119 | exports.noban = '✳️ User ini tidak memiliki status banned didalam database bot'; 120 | exports.isadmin = '✳️ Maaf bot tidak bisa mengeluarkan admin'; 121 | exports.oversize = 'Ukuran file melebihi ukuran yang di tentukan, download sendiri melalui link dibawah\n*🔗 Link* : '; 122 | 123 | // -- text 124 | exports.notag = '✳️ Coba tag salah satu anggota group'; 125 | exports.nonum = '✳️ Silahkan ulangi peringah ini dengan menambahkan nomor target atau reply chat'; 126 | exports.notext = '✳️ Silahkan ulangi perintah ini dengan menambahkan text'; 127 | exports.reply = '✳️ Reply pesan target...'; 128 | exports.replyStic = '✳️ Reply pesan stickernya...'; 129 | exports.replyVid = '✳️ Reply videonya...'; 130 | exports.replyVn = '✳️ Reply audionya...'; 131 | exports.replyImg = '✳️ Reply imagenya...'; 132 | exports.noreply = '✳️ Pesan yang kamu reply tidak mengandung reply'; 133 | exports.nolink = (value) => { 134 | return `✳️ Silahkan ulangi dengan menambahkan link *${value}*`; 135 | }; 136 | exports.addwarn = `⚠️ Peringatan\nKamu mendapatkan 1 peringatan`; 137 | exports.delwarn = `⚠️ Peringatan\nWarning kamu telah berkurang 1 peringatan`; 138 | exports.cekwarn = (warn) => { 139 | return `≡ PERINGATAN \n\n▢ Total : *${warn}*`; 140 | }; 141 | exports.nowarn = `✳️ User tidak memiliki peringatan`; 142 | 143 | exports.Pbahasa = `✳️ Pilih bahasa yang ingin Anda gunakan 144 | 145 | *Bahasa yang tersedia* 146 | - es (Spanish) 147 | - id (Indonesia) 148 | - en (English) 149 | - pt (Portugués) 150 | 151 | 📌 Contoh : */language en*`; 152 | exports.nobahasa = `Bahasa tidak tersedia 153 | 154 | *Bahasa yang tersedia* 155 | - es (Spanish) 156 | - id (Indonesia) 157 | - en (English) 158 | - pt (Portugués) 159 | 160 | 📌 Contoh : */language en*`; 161 | 162 | exports.online = '✅ Perintah diterima menyalakan bot digroup ini'; 163 | exports.offline = '✅ Perintah diterima mematikan bot di group ini'; 164 | 165 | // -- group 166 | exports.onwa = '✳️ User sudah berada didalam group'; 167 | exports.sendlink = '✅ Sukses mengirim undangan ke '; 168 | exports.open = '✅ Sukses mengubah setelan group untuk mengizinkan semua anggota dapat mengirim pesan dalam group ini'; 169 | exports.close = '✅ Sukses mengubah setelan group untuk mengizinkan hanya admin yang dapat mengirim pesan dalam group ini'; 170 | exports.name = (value) => { 171 | return `✅ Sukses merubah subjek menjadi *${value}*`; 172 | }; 173 | exports.desk = (value) => { 174 | return `✅ Sukses merubah deskripsi group menjadi\n\n ${value}`; 175 | }; 176 | exports.promote = (value) => { 177 | return `✅ Sukses menaikkan jabatan *${value}* sebagai admin`; 178 | }; 179 | exports.demote = (value) => { 180 | return '✅ Sukses menurunkan jabatan ' + value; 181 | }; 182 | 183 | exports.kick = (value) => { 184 | return '✅ Perintah di terima, mengeluarkan '+value; 185 | }; 186 | exports.On = (value) => { 187 | return `✅ Sukses menyalakan *${value}* di group ini`; 188 | }; 189 | exports.Off = (value) => { 190 | return `✅ *${value}* di matikan untuk group ini`; 191 | }; 192 | exports.Thison = (value) => { 193 | return `✳️ *${value}* sudah menyala sebelumnya`; 194 | }; 195 | exports.Thisoff = (value) => { 196 | return `✳️ *${value}* belum menyala sebelumnya`; 197 | }; 198 | exports.OnorOff = '✳️ Silahkan ulangi dengan menambahkan on/off'; 199 | exports.antilink = 'Kamu terdeteksi mengirimkan link whatsapp group lain'; 200 | 201 | exports.setwel = (value) => { 202 | return `✳️ Masukkan pesan dari *Selamat datang* 203 | 204 | *📌 Contoh:* 205 | /setwelcome Selamat datang @user ke @group 206 | 207 | Tag : @user 208 | Nama : @name 209 | Bio : @bio 210 | Tanggal : @date 211 | Nama grup : @group 212 | Keterangan : @desc 213 | 214 | *Contoh untuk setiap fungsi*\n` + value; 215 | }; 216 | 217 | exports.setbye = (value) => { 218 | return `✳️ Masukkan pesan *Perpisahan* 219 | 220 | *📌 Contoh:* 221 | /setbye Selamat tinggal @user 222 | 223 | *Contoh untuk setiap fungsi*\n` + value; 224 | }; 225 | 226 | exports.setweldone = (value, fungsi) => { 227 | return `✅ *Selamat datang* kumpulan pesan`; 228 | }; 229 | 230 | exports.setbyedone = (value, fungsi) => { 231 | return `✅ *Perpisahan* kumpulan pesan`; 232 | }; 233 | //-- 234 | exports.default = (value) => { 235 | return value + ' Kembali ke pengaturan awal'; 236 | }; 237 | 238 | exports.main = (value) => { 239 | return '✳️ Masih ada ' + value + ' berlangsung!'; 240 | }; 241 | exports.nomain = (value) => { 242 | return '✳️ Tidak ada ' + value + ' berlangsung!'; 243 | }; 244 | exports.inmain = (value) => { 245 | return 'Kamu sudah melakukan ' + value 246 | }; 247 | exports.hapus = (value) =>{ 248 | return `✅ Berhasil menghapus *${value}* di group ini`; 249 | }; 250 | 251 | // game 252 | exports.onGame = '⚠️ Masih ada soal belum terjawab di chat ini'; 253 | exports.soal = (text1, text2, text3) => { 254 | return `${text1} 255 | 256 | *⏳ Timeout* 257 | ${text2} 258 | 259 | *POIN* 260 | ${text3} 261 | 262 | Reply pesan ini untuk menjawab 263 | Petunjuk jawaban muncul di 10 detik terakhir`; 264 | }; 265 | 266 | exports.timeout = '⏳ Waktu habis jawabannya adalah '; 267 | exports.salah = '❎ *Salah* !\nCoba lagi'; 268 | exports.hampir = '✳️ *Dikit lagi* !\nCoba lagi'; 269 | exports.benar = (value, value2) => { 270 | return `✅ *Benar*\nJawabannya adalah ${value}\nKamu mendapatkan ${value2} Coins`; 271 | }; 272 | 273 | // afk 274 | exports.with = 'dengan alasan '; 275 | exports.onAfk = (value) => { 276 | return 'Kamu sekarang afk ' + value 277 | }; 278 | exports.offAfk = 'Kamu kembali dari AFK' 279 | exports.inAfk = (value, time) => { 280 | return 'User sedang dalan mode Afk ' + value + '\n Pada : ' + time 281 | } 282 | -------------------------------------------------------------------------------- /functions/user.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const User = JSON.parse(fs.readFileSync('./database/user.json')); 3 | 4 | /** 5 | * 6 | * @param { string } id 7 | */ 8 | const addUser = (id) => { 9 | let position = false; 10 | Object.keys(User).forEach((i) => { 11 | if (User[i].id === id) { 12 | position = true; 13 | } 14 | }); 15 | if (position === false) { 16 | const obj = { 17 | id: id, 18 | nama: '-', 19 | language: "es", 20 | register: false, 21 | premium: false, 22 | banned: false, 23 | afk: false, 24 | chatbot: false, 25 | voiceCommand: false, 26 | afkReason: '-', 27 | afkTime: '-', 28 | poin: 0, 29 | level: 0, 30 | warn: 0, 31 | }; 32 | User.push(obj); 33 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 34 | return false; 35 | } 36 | }; 37 | 38 | /** 39 | * 40 | * @param { string } id 41 | */ 42 | const cekRegis = (id) => { 43 | let position = false; 44 | Object.keys(User).forEach((i) => { 45 | if (User[i].id === id) { 46 | position = i; 47 | } 48 | }); 49 | if (position !== false) { 50 | return User[position].register; 51 | } 52 | }; 53 | 54 | /** 55 | * 56 | * @param { string } id 57 | */ 58 | const addRegister = (id) => { 59 | let position = false; 60 | Object.keys(User).forEach((i) => { 61 | if (User[i].id === id) { 62 | position = i; 63 | } 64 | }); 65 | if (position !== false) { 66 | User[position].register = true; 67 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 68 | } 69 | }; 70 | /** 71 | * 72 | * @param { string } id 73 | */ 74 | const cekBanned = (id) => { 75 | let position = false; 76 | Object.keys(User).forEach((i) => { 77 | if (User[i].id === id) { 78 | position = i; 79 | } 80 | }); 81 | if (position !== false) { 82 | return User[position].banned; 83 | } 84 | }; 85 | 86 | /** 87 | * 88 | * @param { string } id 89 | */ 90 | const addBanned = (id) => { 91 | let position = false; 92 | Object.keys(User).forEach((i) => { 93 | if (User[i].id === id) { 94 | position = i; 95 | } 96 | }); 97 | if (position !== false) { 98 | User[position].banned = true; 99 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 100 | } 101 | }; 102 | 103 | /** 104 | * 105 | * @param { string } id 106 | */ 107 | const delBanned = (id) => { 108 | let position = false; 109 | Object.keys(User).forEach((i) => { 110 | if (User[i].id === id) { 111 | position = i; 112 | } 113 | }); 114 | if (position !== false) { 115 | User[position].banned = false; 116 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 117 | } 118 | }; 119 | 120 | /** 121 | * 122 | * @param { string } id 123 | */ 124 | const cekPremium = (id) => { 125 | let position = false; 126 | Object.keys(User).forEach((i) => { 127 | if (User[i].id === id) { 128 | position = i; 129 | } 130 | }); 131 | if (position !== false) { 132 | return User[position].premium; 133 | } 134 | }; 135 | 136 | 137 | /** 138 | * 139 | * @param { string } id 140 | */ 141 | const addPremium = (id) => { 142 | let position = false; 143 | Object.keys(User).forEach((i) => { 144 | if (User[i].id === id) { 145 | position = i; 146 | } 147 | }); 148 | if (position !== false) { 149 | User[position].premium = true; 150 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 151 | } 152 | }; 153 | 154 | /** 155 | * 156 | * @param { string } id 157 | */ 158 | const delPremium = (id) => { 159 | let position = false; 160 | Object.keys(User).forEach((i) => { 161 | if (User[i].id === id) { 162 | position = i; 163 | } 164 | }); 165 | if (position !== false) { 166 | User[position].premium = false; 167 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 168 | } 169 | }; 170 | 171 | 172 | /** 173 | * 174 | * @param { string } id 175 | */ 176 | const cekVoiceCommand = (id) => { 177 | let position = false; 178 | Object.keys(User).forEach((i) => { 179 | if (User[i].id === id) { 180 | position = i; 181 | } 182 | }); 183 | if (position !== false) { 184 | return User[position].voiceCommand; 185 | } 186 | }; 187 | 188 | 189 | /** 190 | * 191 | * @param { string } id 192 | */ 193 | const addVoiceCommand = (id) => { 194 | let position = false; 195 | Object.keys(User).forEach((i) => { 196 | if (User[i].id === id) { 197 | position = i; 198 | } 199 | }); 200 | if (position !== false) { 201 | User[position].voiceCommand = true; 202 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 203 | } 204 | }; 205 | 206 | /** 207 | * 208 | * @param { string } id 209 | */ 210 | const delVoiceCommand = (id) => { 211 | let position = false; 212 | Object.keys(User).forEach((i) => { 213 | if (User[i].id === id) { 214 | position = i; 215 | } 216 | }); 217 | if (position !== false) { 218 | User[position].voiceCommand = false; 219 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 220 | } 221 | }; 222 | /** 223 | * 224 | * @param { string } id 225 | */ 226 | const cekChatbot = (id) => { 227 | let position = false; 228 | Object.keys(User).forEach((i) => { 229 | if (User[i].id === id) { 230 | position = i; 231 | } 232 | }); 233 | if (position !== false) { 234 | return User[position].chatbot; 235 | } 236 | }; 237 | 238 | 239 | /** 240 | * 241 | * @param { string } id 242 | */ 243 | const addChatbot = (id) => { 244 | let position = false; 245 | Object.keys(User).forEach((i) => { 246 | if (User[i].id === id) { 247 | position = i; 248 | } 249 | }); 250 | if (position !== false) { 251 | User[position].chatbot = true; 252 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 253 | } 254 | }; 255 | 256 | /** 257 | * 258 | * @param { string } id 259 | */ 260 | const delChatbot = (id) => { 261 | let position = false; 262 | Object.keys(User).forEach((i) => { 263 | if (User[i].id === id) { 264 | position = i; 265 | } 266 | }); 267 | if (position !== false) { 268 | User[position].chatbot = false; 269 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 270 | } 271 | }; 272 | 273 | /** 274 | * 275 | * @param { string } id 276 | */ 277 | const cekPoin = (id) => { 278 | let position = false; 279 | Object.keys(User).forEach((i) => { 280 | if (User[i].id === id) { 281 | position = i; 282 | } 283 | }); 284 | if (position !== false) { 285 | return User[position].poin; 286 | } 287 | }; 288 | 289 | /** 290 | * 291 | * @param { string } id 292 | */ 293 | const addPoin = (id, value) => { 294 | let position = false; 295 | if(!value) { 296 | value = 1; 297 | } 298 | Object.keys(User).forEach((i) => { 299 | if (User[i].id === id) { 300 | position = i; 301 | } 302 | }); 303 | if (position !== false) { 304 | User[position].poin += value; 305 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 306 | } 307 | }; 308 | 309 | /** 310 | * 311 | * @param { string } id 312 | */ 313 | const delPoin = (id, value) => { 314 | let position = false; 315 | if(!value) { 316 | value = 1; 317 | } 318 | Object.keys(User).forEach((i) => { 319 | if (User[i].id === id) { 320 | position = i; 321 | } 322 | }); 323 | if (position !== false) { 324 | User[position].poin -= value; 325 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 326 | } 327 | }; 328 | 329 | 330 | /** 331 | * 332 | * @param { string } id 333 | */ 334 | const cekLevel = (id) => { 335 | let position = false; 336 | Object.keys(User).forEach((i) => { 337 | if (User[i].id === id) { 338 | position = i; 339 | } 340 | }); 341 | if (position !== false) { 342 | return User[position].level; 343 | } 344 | }; 345 | 346 | /** 347 | * 348 | * @param { string } id 349 | */ 350 | const addLevel = (id) => { 351 | let position = false; 352 | Object.keys(User).forEach((i) => { 353 | if (User[i].id === id) { 354 | position = i; 355 | } 356 | }); 357 | if (position !== false) { 358 | User[position].level += 1; 359 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 360 | } 361 | }; 362 | 363 | /** 364 | * 365 | * @param { string } id 366 | */ 367 | const cekAfk = (id) => { 368 | let position = false; 369 | Object.keys(User).forEach((i) => { 370 | if (User[i].id === id) { 371 | position = i; 372 | } 373 | }); 374 | if (position !== false) { 375 | return User[position].afk; 376 | } 377 | }; 378 | 379 | /** 380 | * 381 | * @param { string } id 382 | */ 383 | const cekAfkReason = (id) => { 384 | let position = false; 385 | Object.keys(User).forEach((i) => { 386 | if (User[i].id === id) { 387 | position = i; 388 | } 389 | }); 390 | if (position !== false) { 391 | return User[position].afkReason; 392 | } 393 | }; 394 | 395 | /** 396 | * 397 | * @param { string } id 398 | */ 399 | const cekAfkTime = (id) => { 400 | let position = false; 401 | Object.keys(User).forEach((i) => { 402 | if (User[i].id === id) { 403 | position = i; 404 | } 405 | }); 406 | if (position !== false) { 407 | return User[position].afkTime; 408 | } 409 | }; 410 | 411 | 412 | /** 413 | * 414 | * @param { string } id 415 | * @param { Object } tanggal 416 | * @param { Object } alasan 417 | */ 418 | const addAfk = (id, tanggal, alasan) => { 419 | let position = false; 420 | Object.keys(User).forEach((i) => { 421 | if (User[i].id === id) { 422 | position = i; 423 | } 424 | }); 425 | if (position !== false) { 426 | User[position].afk = true; 427 | User[position].afkReason = alasan; 428 | User[position].afkTime = tanggal; 429 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 430 | } 431 | }; 432 | 433 | /** 434 | * 435 | * @param { string } id 436 | */ 437 | const delAfk = (id) => { 438 | let position = false; 439 | Object.keys(User).forEach((i) => { 440 | if (User[i].id === id) { 441 | position = i; 442 | } 443 | }); 444 | if (position !== false) { 445 | User[position].afk = false; 446 | User[position].afkReason = "-"; 447 | User[position].afkTime = "-"; 448 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 449 | } 450 | }; 451 | 452 | /** 453 | * 454 | * @param { string } id 455 | */ 456 | const cekWarn = (id) => { 457 | let position = false; 458 | Object.keys(User).forEach((i) => { 459 | if (User[i].id === id) { 460 | position = i; 461 | } 462 | }); 463 | if (position !== false) { 464 | return User[position].warn; 465 | } 466 | }; 467 | 468 | /** 469 | * 470 | * @param { string } id 471 | */ 472 | const addWarn = (id) => { 473 | let position = false; 474 | Object.keys(User).forEach((i) => { 475 | if (User[i].id === id) { 476 | position = i; 477 | } 478 | }); 479 | if (position !== false) { 480 | User[position].warn += 1 481 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 482 | } 483 | }; 484 | 485 | /** 486 | * 487 | * @param { string } id 488 | * @param { number } jumlah 489 | */ 490 | const delWarn = (id, jumlah) => { 491 | let position = false; 492 | Object.keys(User).forEach((i) => { 493 | if (User[i].id === id) { 494 | position = i; 495 | } 496 | }); 497 | if (position !== false) { 498 | User[position].warn -= jumlah; 499 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 500 | } 501 | }; 502 | 503 | 504 | /** 505 | * 506 | * @param { string } id 507 | */ 508 | const cekUser = (id) => { 509 | let position = false; 510 | Object.keys(User).forEach((i) => { 511 | if (User[i].id === id) { 512 | position = i; 513 | } 514 | }); 515 | if (position !== false) { 516 | result = { 517 | id: User[position].id, 518 | premium: User[position].premium, 519 | banned: User[position].banned, 520 | afk: User[position].afk, 521 | afkReason: User[position].afkReason, 522 | afkTime: User[position].afkTime, 523 | poin: User[position].poin, 524 | level: User[position].level, 525 | warn: User[position].warn, 526 | }; 527 | return result; 528 | } 529 | }; 530 | 531 | 532 | /** 533 | * 534 | * @param { string } id 535 | */ 536 | const cekBahasa = (id) => { 537 | let position = false; 538 | Object.keys(User).forEach((i) => { 539 | if (User[i].id === id) { 540 | position = i; 541 | } 542 | }); 543 | if (position !== false) { 544 | return User[position].language 545 | } 546 | }; 547 | 548 | 549 | /** 550 | * 551 | * @param { string } id 552 | * @param { Object } bahasa 553 | */ 554 | const addBahasa = (id, bahasa) => { 555 | let position = false; 556 | Object.keys(User).forEach((i) => { 557 | if (User[i].id === id) { 558 | position = i; 559 | } 560 | }); 561 | if (position !== false) { 562 | User[position].language = bahasa; 563 | fs.writeFileSync('./database/user.json', JSON.stringify(User, null, "\t")); 564 | } 565 | }; 566 | 567 | 568 | module.exports = { 569 | User, 570 | cekRegis, 571 | addRegister, 572 | addUser, 573 | cekUser, 574 | cekPoin, 575 | addPoin, 576 | delPoin, 577 | addLevel, 578 | cekLevel, 579 | cekBanned, 580 | addBanned, 581 | delBanned, 582 | cekPremium, 583 | addPremium, 584 | delPremium, 585 | addChatbot, 586 | delChatbot, 587 | cekVoiceCommand, 588 | addVoiceCommand, 589 | delVoiceCommand, 590 | cekChatbot, 591 | addAfk, 592 | delAfk, 593 | cekAfk, 594 | cekAfkReason, 595 | cekAfkTime, 596 | addWarn, 597 | delWarn, 598 | cekWarn, 599 | addBahasa, 600 | cekBahasa 601 | }; 602 | 603 | /** 604 | * 605 | * @fg98._ 606 | */ -------------------------------------------------------------------------------- /whatsapp/connecting.js: -------------------------------------------------------------------------------- 1 | const { toAudio, toPTT, toVideo } = require('../library/converter') 2 | const { exec } = require('child_process') 3 | const fetch = require('node-fetch') 4 | const FileType = require('file-type') 5 | const fs = require('fs') 6 | const got = require('got') 7 | const path = require('path') 8 | const PhoneNumber = require('awesome-phonenumber') 9 | const request = require('request') 10 | const { tmpdir } = require('os') 11 | const util = require('util') 12 | const axios = require("axios"); 13 | const { 14 | MessageType, 15 | WAMessageProto, 16 | DEFAULT_ORIGIN, 17 | getAudioDuration, 18 | MessageTypeProto, 19 | MediaPathMap, 20 | Mimetype, 21 | MimetypeMap, 22 | compressImage, 23 | generateMessageID, 24 | randomBytes, 25 | getMediaKeys, 26 | aesEncrypWithIV, 27 | hmacSign, 28 | sha256, 29 | encryptedStream 30 | } = require('@adiwajshing/baileys') 31 | const { WAConnection } = require('@adiwajshing/baileys/lib/WAConnection/0.Base') 32 | 33 | exports.WAConnection = _WAConnection => { 34 | class WAConnection extends _WAConnection { 35 | constructor(...args) { 36 | super(...args) 37 | if (!Array.isArray(this._events['CB:action,add:relay,message'])) this._events['CB:action,add:relay,message'] = [this._events['CB:action,add:relay,message']] 38 | else this._events['CB:action,add:relay,message'] = [this._events['CB:action,add:relay,message'].pop()] 39 | this._events['CB:action,add:relay,message'].unshift(async function (json) { 40 | try { 41 | let m = json[2][0][2] 42 | if (m.message && m.message.protocolMessage && m.message.protocolMessage.type == 0) { 43 | let key = m.message.protocolMessage.key 44 | let c = this.chats.get(key.remoteJid) 45 | let a = c.messages.dict[`${key.id}|${key.fromMe ? 1 : 0}`] 46 | let participant = key.fromMe ? this.user.jid : a.participant ? a.participant : key.remoteJid 47 | let WAMSG = WAMessageProto.WebMessageInfo 48 | this.emit('message-delete', { key, participant, message: WAMSG.fromObject(WAMSG.toObject(a)) }) 49 | } 50 | } catch (e) { } 51 | }) 52 | this.on(`CB:action,,battery`, json => { 53 | this.battery = Object.fromEntries(Object.entries(json[2][0][1]).map(v => [v[0], eval(v[1])])) 54 | }) 55 | 56 | 57 | // Alias 58 | this.sendFileFromUrl = this.sendFileFromURL = this.sendFile 59 | } 60 | 61 | /** 62 | * Exact Copy Forward 63 | * @param {String} jid 64 | * @param {Object} message 65 | * @param {Boolean} forceForward 66 | * @param {Object} options 67 | */ 68 | 69 | 70 | async copyNForward(jid, message, forceForward = false, options = {}) { 71 | let vtype 72 | if (options.readViewOnce) { 73 | message.message = message.message && message.message.ephemeralMessage && message.message.ephemeralMessage.message ? message.message.ephemeralMessage.message : (message.message || undefined) 74 | vtype = Object.keys(message.message.viewOnceMessage.message)[0] 75 | delete (message.message && message.message.ignore ? message.message.ignore : (message.message || undefined)) 76 | delete message.message.viewOnceMessage.message[vtype].viewOnce 77 | message.message = { 78 | ...message.message.viewOnceMessage.message 79 | } 80 | } 81 | let mtype = Object.keys(message.message)[0] 82 | let content = await this.generateForwardMessageContent(message, forceForward) 83 | let ctype = Object.keys(content)[0] 84 | let context = {} 85 | if (mtype != MessageType.text) context = message.message[mtype].contextInfo 86 | content[ctype].contextInfo = { 87 | ...context, 88 | ...content[ctype].contextInfo 89 | } 90 | const waMessage = await this.prepareMessageFromContent(jid, content, options ? { 91 | ...content[ctype], 92 | ...options, 93 | ...(options.contextInfo ? { 94 | contextInfo: { 95 | ...content[ctype].contextInfo, 96 | ...options.contextInfo 97 | } 98 | } : {}) 99 | } : {}) 100 | await this.relayWAMessage(waMessage) 101 | return waMessage 102 | } 103 | 104 | /** 105 | * cMod 106 | * @param {String} jid 107 | * @param {*} message 108 | * @param {String} text 109 | * @param {String} sender 110 | * @param {*} options 111 | * @returns 112 | */ 113 | cMod(jid, message, text = '', sender = this.user.jid, options = {}) { 114 | let copy = message.toJSON() 115 | let mtype = Object.keys(copy.message)[0] 116 | let isEphemeral = mtype === 'ephemeralMessage' 117 | if (isEphemeral) { 118 | mtype = Object.keys(copy.message.ephemeralMessage.message)[0] 119 | } 120 | let msg = isEphemeral ? copy.message.ephemeralMessage.message : copy.message 121 | let content = msg[mtype] 122 | if (typeof content === 'string') msg[mtype] = text || content 123 | else if (content.caption) content.caption = text || content.caption 124 | else if (content.text) content.text = text || content.text 125 | if (typeof content !== 'string') msg[mtype] = { ...content, ...options } 126 | if (copy.participant) sender = copy.participant = sender || copy.participant 127 | else if (copy.key.participant) sender = copy.key.participant = sender || copy.key.participant 128 | if (copy.key.remoteJid.includes('@s.whatsapp.net')) sender = sender || copy.key.remoteJid 129 | else if (copy.key.remoteJid.includes('@broadcast')) sender = sender || copy.key.remoteJid 130 | copy.key.remoteJid = jid 131 | copy.key.fromMe = sender === this.user.jid 132 | return WAMessageProto.WebMessageInfo.fromObject(copy) 133 | } 134 | 135 | /** 136 | * genOrderMessage 137 | * @param {String} message 138 | * @param {*} options 139 | * @returns 140 | */ 141 | async genOrderMessage(message, options) { 142 | let m = {} 143 | switch (type) { 144 | case MessageType.text: 145 | case MessageType.extendedText: 146 | if (typeof message === 'string') message = { text: message } 147 | m.extendedTextMessage = WAMessageProto.ExtendedTextMessage.fromObject(message); 148 | break 149 | case MessageType.location: 150 | case MessageType.liveLocation: 151 | m.locationMessage = WAMessageProto.LocationMessage.fromObject(message) 152 | break 153 | case MessageType.contact: 154 | m.contactMessage = WAMessageProto.ContactMessage.fromObject(message) 155 | break 156 | case MessageType.contactsArray: 157 | m.contactsArrayMessage = WAMessageProto.ContactsArrayMessage.fromObject(message) 158 | break 159 | case MessageType.groupInviteMessage: 160 | m.groupInviteMessage = WAMessageProto.GroupInviteMessage.fromObject(message) 161 | break 162 | case MessageType.listMessage: 163 | m.listMessage = WAMessageProto.ListMessage.fromObject(message) 164 | break 165 | case MessageType.buttonsMessage: 166 | m.buttonsMessage = WAMessageProto.ButtonsMessage.fromObject(message) 167 | break 168 | case MessageType.image: 169 | case MessageType.sticker: 170 | case MessageType.document: 171 | case MessageType.video: 172 | case MessageType.audio: 173 | m = await this.prepareMessageMedia(message, type, options) 174 | break 175 | case 'orderMessage': 176 | m.orderMessage = WAMessageProto.OrderMessage.fromObject(message) 177 | } 178 | return WAMessageProto.Message.fromObject(m); 179 | } 180 | 181 | /** 182 | * waitEvent 183 | * @param {*} eventName 184 | * @param {Boolean} is 185 | * @param {Number} maxTries 186 | * @returns 187 | */ 188 | waitEvent(eventName, is = () => true, maxTries = 25) { 189 | return new Promise((resolve, reject) => { 190 | let tries = 0 191 | let on = (...args) => { 192 | if (++tries > maxTries) reject('Max tries reached') 193 | else if (is()) { 194 | this.off(eventName, on) 195 | resolve(...args) 196 | } 197 | } 198 | this.on(eventName, on) 199 | }) 200 | } 201 | 202 | /** 203 | * Send Contact 204 | * @param {String} jid 205 | * @param {String|Number} number 206 | * @param {String} name 207 | * @param {Object} quoted 208 | * @param {Object} options 209 | */ 210 | async sendContact(jid, number, name, quoted, options) { 211 | // TODO: Business Vcard 212 | number = number.replace(/[^0-9]/g, '') 213 | let njid = number + '@s.whatsapp.net' 214 | let { isBusiness } = await this.isOnWhatsApp(njid) || { isBusiness: false } 215 | let vcard = ` 216 | BEGIN:VCARD 217 | VERSION:3.0 218 | N:;${name.replace(/\n/g, '\\n')};;; 219 | FN:${name.replace(/\n/g, '\\n')} 220 | TEL;type=CELL;type=VOICE;waid=${number}:${PhoneNumber('+' + number).getNumber('international')}${isBusiness ? ` 221 | X-WA-BIZ-NAME:${(this.contacts[njid].vname || this.getName(njid)).replace(/\n/, '\\n')} 222 | X-WA-BIZ-DESCRIPTION:${((await this.getBusinessProfile(njid)).description || '').replace(/\n/g, '\\n')} 223 | ` : ''} 224 | END:VCARD 225 | `.trim() 226 | return await this.sendMessage(jid, { 227 | displayName: name, 228 | vcard 229 | }, MessageType.contact, { quoted, ...options }) 230 | } 231 | 232 | /** 233 | * sendGroupV4Invite 234 | * @param {String} jid 235 | * @param {*} participant 236 | * @param {String} inviteCode 237 | * @param {Number} inviteExpiration 238 | * @param {String} groupName 239 | * @param {String} caption 240 | * @param {*} options 241 | * @returns 242 | */ 243 | async sendGroupV4Invite(jid, participant, inviteCode, inviteExpiration, groupName = 'unknown subject', caption = 'Invitation to join my WhatsApp group', options = {}) { 244 | let msg = WAMessageProto.Message.fromObject({ 245 | groupInviteMessage: WAMessageProto.GroupInviteMessage.fromObject({ 246 | inviteCode, 247 | inviteExpiration: parseInt(inviteExpiration) || + new Date(new Date + (3 * 86400000)), 248 | groupJid: jid, 249 | groupName: groupName ? groupName : this.getName(jid), 250 | caption 251 | }) 252 | }) 253 | let message = await this.prepareMessageFromContent(participant, msg, options) 254 | await this.relayWAMessage(message) 255 | return message 256 | } 257 | 258 | /** 259 | * fetchRequest 260 | * @param {*} endpoint 261 | * @param {String} method ('GET'|'POST') 262 | * @param {*} body 263 | * @param {*} agent 264 | * @param {*} headers 265 | * @param {*} redirect 266 | * @returns 267 | */ 268 | fetchRequest = async ( 269 | endpoint, 270 | method = 'GET', 271 | body, 272 | agent, 273 | headers, 274 | redirect = 'follow' 275 | ) => { 276 | try { 277 | let res = await fetch(endpoint, { 278 | method, 279 | body, 280 | redirect, 281 | headers: { Origin: DEFAULT_ORIGIN, ...(headers || {}) }, 282 | agent: agent || this.connectOptions.fetchAgent 283 | }) 284 | return await res.json() 285 | } catch (e) { 286 | console.error(e) 287 | let res = await got(endpoint, { 288 | method, 289 | body, 290 | followRedirect: redirect == 'follow' ? true : false, 291 | headers: { Origin: DEFAULT_ORIGIN, ...(headers || {}) }, 292 | agent: { https: agent || this.connectOptions.fetchAgent } 293 | }) 294 | return JSON.parse(res.body) 295 | } 296 | } 297 | 298 | /** 299 | * prepareMessageMedia 300 | * @param {Buffer} buffer 301 | * @param {*} mediaType 302 | * @param {*} options 303 | * @returns 304 | */ 305 | /** Prepare a media message for sending */ 306 | async prepareMessageMedia(buffer, mediaType, options = {}) { 307 | await this.waitForConnection() 308 | 309 | if (mediaType === MessageType.document && !options.mimetype) { 310 | throw new Error('mimetype required to send a document') 311 | } 312 | if (mediaType === MessageType.sticker && options.caption) { 313 | throw new Error('cannot send a caption with a sticker') 314 | } 315 | if (!(mediaType === MessageType.image || mediaType === MessageType.video) && options.viewOnce) { 316 | throw new Error(`cannot send a ${mediaType} as a viewOnceMessage`) 317 | } 318 | if (!options.mimetype) { 319 | options.mimetype = MimetypeMap[mediaType] 320 | } 321 | let isGIF = false 322 | if (options.mimetype === Mimetype.gif) { 323 | isGIF = true 324 | options.mimetype = MimetypeMap[MessageType.video] 325 | } 326 | const requiresThumbnailComputation = (mediaType === MessageType.image || mediaType === MessageType.video) && !('thumbnail' in options) 327 | const requiresDurationComputation = mediaType === MessageType.audio && !options.duration 328 | const requiresOriginalForSomeProcessing = requiresDurationComputation || requiresThumbnailComputation 329 | 330 | const mediaKey = randomBytes(32) 331 | const mediaKeys = getMediaKeys(mediaKey, mediaType) 332 | const enc = aesEncrypWithIV(buffer, mediaKeys.cipherKey, mediaKeys.iv) 333 | const mac = hmacSign(Buffer.concat([mediaKeys.iv, enc]), mediaKeys.macKey).slice(0, 10) 334 | const body = Buffer.concat([enc, mac]) // body is enc + mac 335 | const fileSha256 = sha256(buffer) 336 | const fileEncSha256 = sha256(body) 337 | const { 338 | encBodyPath, 339 | bodyPath, 340 | fileLength, 341 | didSaveToTmpPath 342 | } = await encryptedStream(buffer, mediaType, requiresOriginalForSomeProcessing) 343 | // url safe Base64 encode the SHA256 hash of the body 344 | const fileEncSha256B64 = encodeURIComponent( 345 | fileEncSha256 346 | .toString('base64') 347 | .replace(/\+/g, '-') 348 | .replace(/\//g, '_') 349 | .replace(/\=+$/, '') 350 | ) 351 | if (requiresThumbnailComputation) await generateThumbnail(bodyPath, mediaType, options) 352 | if (requiresDurationComputation) { 353 | try { 354 | options.duration = await getAudioDuration(bodyPath) 355 | } catch (error) { 356 | this.logger.debug({ error }, 'failed to obtain audio duration: ' + error.message) 357 | } 358 | } 359 | 360 | // send a query JSON to obtain the url & auth token to upload our media 361 | let json = await this.refreshMediaConn(options.forceNewMediaOptions) 362 | 363 | let mediaUrl = '' 364 | for (let host of json.hosts) { 365 | const auth = encodeURIComponent(json.auth) // the auth token 366 | const url = `https://${host.hostname}${MediaPathMap[mediaType]}/${fileEncSha256B64}?auth=${auth}&token=${fileEncSha256B64}` 367 | 368 | try { 369 | const result = await this.fetchRequest(url, 'POST', body, options.uploadAgent, { 'Content-Type': 'application/octet-stream' }) 370 | mediaUrl = result && result.url ? result.url : undefined 371 | 372 | if (mediaUrl) break 373 | else { 374 | json = await this.refreshMediaConn(true) 375 | throw new Error(`upload failed, reason: ${JSON.stringify(result)}`) 376 | } 377 | } catch (error) { 378 | const isLast = host.hostname === json.hosts[json.hosts.length - 1].hostname 379 | this.logger.error(`Error in uploading to ${host.hostname}${isLast ? '' : ', retrying...'}`) 380 | } 381 | } 382 | if (!mediaUrl) throw new Error('Media upload failed on all hosts') 383 | 384 | await Promise.all( 385 | [ 386 | fs.promises.unlink(encBodyPath), 387 | didSaveToTmpPath && bodyPath && fs.promises.unlink(bodyPath) 388 | ] 389 | .filter(f => typeof f == 'boolean') 390 | ) 391 | 392 | const message = { 393 | [mediaType]: MessageTypeProto[mediaType].fromObject( 394 | { 395 | url: mediaUrl, 396 | mediaKey: mediaKey, 397 | mimetype: options.mimetype, 398 | fileEncSha256: fileEncSha256, 399 | fileSha256: fileSha256, 400 | fileLength: fileLength, 401 | seconds: options.duration, 402 | fileName: options.filename || 'file', 403 | gifPlayback: isGIF || undefined, 404 | caption: options.caption, 405 | ptt: options.ptt, 406 | viewOnce: options.viewOnce 407 | } 408 | ) 409 | } 410 | return WAMessageProto.Message.fromObject(message) // as WAMessageContent 411 | } 412 | 413 | /** 414 | * getBuffer hehe 415 | * @param {String|Buffer} path 416 | */ 417 | async getFile(path) { 418 | let res 419 | let data = Buffer.isBuffer(path) ? path : /^data:.*?\/.*?;base64,/i.test(path) ? Buffer.from(path.split`,`[1], 'base64') : /^https?:\/\//.test(path) ? await (res = await fetch(path)).buffer() : fs.existsSync(path) ? fs.readFileSync(path) : typeof path === 'string' ? path : Buffer.alloc(0) 420 | if (!Buffer.isBuffer(data)) throw new TypeError('Result is not a buffer') 421 | let type = await FileType.fromBuffer(data) || { 422 | mime: 'application/octet-stream', 423 | ext: '.bin' 424 | } 425 | 426 | return { 427 | res, 428 | ...type, 429 | data 430 | } 431 | } 432 | 433 | /** 434 | * Send Video Faster 435 | * @param {String} jid 436 | * @param {String|Buffer} url 437 | * @param {String} caption 438 | * @param {Object} quoted 439 | * @param {Object} options 440 | */ 441 | 442 | 443 | async adReply(from, path, type, title, body, thumbnail, url, quoted){ 444 | this.sendMessage(from, path, type, { 445 | quoted: quoted, 446 | contextInfo: { 447 | mentionedJid: this.parseMention(path), 448 | externalAdReply: { 449 | title: title, 450 | body: body, 451 | mediaType: 2, 452 | thumbnail: thumbnail, 453 | mediaUrl: url 454 | } 455 | } 456 | }) 457 | } 458 | 459 | async adReplyAudio(from, path, type, title, body, thumbnail, url, quoted, ptt){ 460 | this.sendMessage(from, path, type, { 461 | ptt: ptt, 462 | quoted: quoted, 463 | filename: title + '.mp3', 464 | mimetype: 'audio/mp3', 465 | contextInfo: { 466 | externalAdReply: { 467 | title: title, 468 | body: body, 469 | mediaType: 2, 470 | thumbnail: thumbnail, 471 | mediaUrl: url 472 | } 473 | } 474 | }) 475 | } 476 | 477 | 478 | async adReplyVideo(from, path, type, title, body, thumbnail, url, quoted){ 479 | this.sendMessage(from, path, type, { 480 | quoted: quoted, 481 | filename: title + '.mp4', 482 | mimetype: 'video/mp4', 483 | contextInfo: { 484 | externalAdReply: { 485 | title: title, 486 | body: body, 487 | mediaType: 2, 488 | thumbnail: thumbnail, 489 | mediaUrl: url 490 | } 491 | } 492 | }) 493 | } 494 | 495 | 496 | async sendVideo(jid, url, caption, quoted, opt) { 497 | await download(url, 'mp4', async ({ buffer, filename }) => { 498 | let video 499 | if (fs.existsSync(filename)) { 500 | video = await (await this.getFile(filename)).data 501 | if (!Buffer.isBuffer(video)) video = await fs.readFileSync(filename) 502 | } 503 | else if (Buffer.isBuffer(buffer)) video = await buffer 504 | if (!Buffer.isBuffer(video)) throw new TypeError('Result is not a buffer') 505 | // buffer = await toVideo(buffer, 'mp4') 506 | return await this.sendMessage(jid, video, MessageType.video, { caption: caption, quoted, ...opt }) 507 | }) 508 | } 509 | 510 | /** 511 | * Send Buttons 512 | * @param {String} jid 513 | * @param {String} content 514 | * @param {String} footer 515 | * @param {String} button1 516 | * @param {String} row1 517 | * @param {Object} quoted 518 | * @param {Object} options 519 | */ 520 | async sendButton(jid, content, footer, button1, row1, quoted, options = {}) { 521 | return await this.sendMessage(jid, { 522 | contentText: content, 523 | footerText: footer, 524 | buttons: [ 525 | { buttonId: row1, buttonText: { displayText: button1 }, type: 1 } 526 | ], 527 | headerType: 1 528 | }, MessageType.buttonsMessage, { quoted, ...options }) 529 | } 530 | async send2Button(jid, content, footer, button1, row1, button2, row2, quoted, options = {}) { 531 | return await this.sendMessage(jid, { 532 | contentText: content, 533 | footerText: footer, 534 | buttons: [ 535 | { buttonId: row1, buttonText: { displayText: button1 }, type: 1 }, 536 | { buttonId: row2, buttonText: { displayText: button2 }, type: 1 } 537 | ], 538 | headerType: 1 539 | }, MessageType.buttonsMessage, { quoted, ...options }) 540 | } 541 | async send3Button(jid, content, footer, button1, row1, button2, row2, button3, row3, quoted, options = {}) { 542 | return await this.sendMessage(jid, { 543 | contentText: content, 544 | footerText: footer, 545 | buttons: [ 546 | { buttonId: row1, buttonText: { displayText: button1 }, type: 1 }, 547 | { buttonId: row2, buttonText: { displayText: button2 }, type: 1 }, 548 | { buttonId: row3, buttonText: { displayText: button3 }, type: 1 } 549 | ], 550 | headerType: 1 551 | }, MessageType.buttonsMessage, { quoted, ...options }) 552 | } 553 | 554 | /** 555 | * Send Button with Image 556 | * @param {String} jid 557 | * @param {Buffer} buffer 558 | * @param {String} content 559 | * @param {String} footer 560 | * @param {String} button1 561 | * @param {String} row1 562 | * @param {String} button2 563 | * @param {String} row2 564 | * @param {String} button3 565 | * @param {String} row3 566 | * @param {Object} quoted 567 | * @param {Object} options 568 | */ 569 | async sendButtonImg(jid, buffer, content, footer, button1, row1, quoted, options = {}) { 570 | return await this.sendMessage(jid, { 571 | contentText: content, 572 | footerText: footer, 573 | buttons: [ 574 | { buttonId: row1, buttonText: { displayText: button1 }, type: 1 } 575 | ], 576 | headerType: 4, 577 | imageMessage: (await this.prepareMessageMedia(buffer, MessageType.image, {})).imageMessage 578 | }, MessageType.buttonsMessage, { 579 | quoted, ...options 580 | }) 581 | } 582 | async send2ButtonImg(jid, buffer, content, footer, button1, row1, button2, row2, quoted, options = {}) { 583 | return await this.sendMessage(jid, { 584 | contentText: content, 585 | footerText: footer, 586 | buttons: [ 587 | { buttonId: row1, buttonText: { displayText: button1 }, type: 1 }, 588 | { buttonId: row2, buttonText: { displayText: button2 }, type: 1 } 589 | ], 590 | headerType: 4, 591 | imageMessage: (await this.prepareMessageMedia(buffer, MessageType.image, {})).imageMessage 592 | }, MessageType.buttonsMessage, { 593 | quoted, ...options 594 | }) 595 | } 596 | async send3ButtonImg(jid, buffer, content, footer, button1, row1, button2, row2, button3, row3, quoted, options = {}) { 597 | return await this.sendMessage(jid, { 598 | contentText: content, 599 | footerText: footer, 600 | buttons: [ 601 | { buttonId: row1, buttonText: { displayText: button1 }, type: 1 }, 602 | { buttonId: row2, buttonText: { displayText: button2 }, type: 1 }, 603 | { buttonId: row3, buttonText: { displayText: button3 }, type: 1 } 604 | ], 605 | headerType: 4, 606 | imageMessage: (await this.prepareMessageMedia(buffer, MessageType.image, {})).imageMessage 607 | }, MessageType.buttonsMessage, { 608 | quoted, ...options 609 | }) 610 | } 611 | 612 | /** 613 | * Send Buttons with Location 614 | * @param {String} jid 615 | * @param {Buffer} buffer 616 | * @param {String} content 617 | * @param {String} footer 618 | * @param {String} button1 619 | * @param {String} row1 620 | * @param {String} button2 621 | * @param {String} row2 622 | * @param {String} button3 623 | * @param {String} row3 624 | * @param {Object} quoted 625 | * @param {Object} options 626 | */ 627 | async sendButtonLoc(jid, buffer, content, footer, button1, row1, quoted, options = {}) { 628 | return await this.sendMessage(jid, { 629 | locationMessage: { jpegThumbnail: buffer }, 630 | contentText: content, 631 | footerText: footer, 632 | buttons: [{ buttonId: row1, buttonText: { displayText: button1 }, type: 1 }], 633 | headerType: 6 634 | }, MessageType.buttonsMessage, { quoted, ...options }) 635 | } 636 | async send2ButtonLoc(jid, buffer, content, footer, button1, row1, button2, row2, quoted, options = {}) { 637 | return await this.sendMessage(jid, { 638 | locationMessage: { jpegThumbnail: buffer }, 639 | contentText: content, 640 | footerText: footer, 641 | buttons: [ 642 | { buttonId: row1, buttonText: { displayText: button1 }, type: 1 }, 643 | { buttonId: row2, buttonText: { displayText: button2 }, type: 1 } 644 | ], 645 | headerType: 6 646 | }, MessageType.buttonsMessage, { quoted, ...options }) 647 | } 648 | async send3ButtonLoc(jid, buffer, content, footer, button1, row1, button2, row2, button3, row3, quoted, options = {}) { 649 | return await this.sendMessage(jid, { 650 | locationMessage: { jpegThumbnail: buffer }, 651 | contentText: content, 652 | footerText: footer, 653 | buttons: [ 654 | { buttonId: row1, buttonText: { displayText: button1 }, type: 1 }, 655 | { buttonId: row2, buttonText: { displayText: button2 }, type: 1 }, 656 | { buttonId: row3, buttonText: { displayText: button3 }, type: 1 } 657 | ], 658 | headerType: 6 659 | }, MessageType.buttonsMessage, { quoted, ...options }) 660 | } 661 | 662 | /** 663 | * Send Media/File with Automatic Type Specifier 664 | * @param {String} jid 665 | * @param {String|Buffer} path 666 | * @param {String} filename 667 | * @param {String} caption 668 | * @param {Object} quoted 669 | * @param {Boolean} ptt 670 | * @param {Object} options 671 | */ 672 | async sendFile(jid, path, filename = '', caption = '', quoted, ptt = false, options = {}) { 673 | let type = await this.getFile(path) 674 | let { res, data: file } = type 675 | if (res && res.status !== 200 || file.length <= 65536) { 676 | try { throw { json: JSON.parse(file.toString()) } } 677 | catch (e) { if (e.json) throw e.json } 678 | } 679 | let opt = { filename, caption } 680 | if (quoted) opt.quoted = quoted 681 | if (!type) if (options.asDocument) options.asDocument = false 682 | let mtype = '' 683 | if (options.asSticker) mtype = MessageType.sticker 684 | else if (!options.asDocument && !options.type) { 685 | if (options.force) file = file 686 | else if (/audio/.test(type.mime)) file = await (ptt ? toPTT : toAudio)(file, type.ext) 687 | // else if (/video/.test(type.mime)) file = await toVideo(file, type.ext) 688 | if (/webp/.test(type.mime) && file.length <= 1 << 20) mtype = MessageType.sticker 689 | else if (/image/.test(type.mime)) mtype = MessageType.image 690 | else if (/video/.test(type.mime)) { 691 | try { return await this.sendVideo(jid, file, caption, quoted, { ...opt, ...options }) } 692 | catch (e) { 693 | console.error('Error send video using sendVideo, retrying using sendMessage... ', e) 694 | file = await toVideo(file, type.ext) 695 | mtype = MessageType.video 696 | } 697 | } 698 | else opt.displayName = opt.caption = filename 699 | if (options.asGIF && mtype === MessageType.video) mtype = MessageType.gif 700 | if (/audio/.test(type.mime)) { 701 | mtype = MessageType.audio 702 | if (!ptt) opt.mimetype = 'audio/mp4' 703 | opt.ptt = ptt 704 | } else if (/pdf/.test(type.ext)) mtype = MessageType.pdf 705 | else if (!mtype) { 706 | mtype = MessageType.document 707 | opt.mimetype = type.mime 708 | } 709 | } else { 710 | mtype = options.type ? options.type : MessageType.document 711 | opt.mimetype = type.mime 712 | } 713 | delete options.asDocument 714 | delete options.asGIF 715 | delete options.asSticker 716 | delete options.type 717 | if (mtype === MessageType.document) opt.title = filename 718 | if (mtype === MessageType.sticker || !opt.caption) delete opt.caption 719 | return await this.sendMessage(jid, file, mtype, { ...opt, ...options }) 720 | } 721 | 722 | /** 723 | * Reply to a message 724 | * @param {String} jid 725 | * @param {String|Object} text 726 | * @param {Object} quoted 727 | * @param {Object} options 728 | */ 729 | reply(jid, text, quoted, options) { 730 | return Buffer.isBuffer(text) ? this.sendFile(jid, text, 'file', '', quoted, false, options) : this.sendMessage(jid, text, MessageType.extendedText, { contextInfo: { mentionedJid: this.parseMention(text) }, quoted, ...options }) 731 | } 732 | 733 | 734 | /** 735 | * 736 | * Fake Replies 737 | * @param {String} jid 738 | * @param {String|Object} text 739 | * @param {String} fakeJid 740 | * @param {String} fakeText 741 | * @param {String} fakeGroupJid 742 | * @param {String} options 743 | */ 744 | fakeReply(jid, text = '', fakeJid = this.user.jid, fakeText = '', fakeGroupJid, options) { 745 | return this.reply(jid, text, { key: { fromMe: fakeJid == this.user.jid, participant: fakeJid, ...(fakeGroupJid ? { remoteJid: fakeGroupJid } : {}) }, message: { conversation: fakeText }, ...options }) 746 | } 747 | 748 | fakeStatus(jid, teks, capt, thumb) { 749 | return this.sendMessage(jid, teks, MessageType.text, { 750 | quoted: { 751 | key: { 752 | fromMe: false, 753 | participant: `0@s.whatsapp.net`, 754 | ...(jid ? { remoteJid: "status@broadcast" } : {}), 755 | }, 756 | message: { 757 | imageMessage: { 758 | mimetype: "image/jpeg", 759 | caption: capt, 760 | jpegThumbnail: thumb, 761 | }, 762 | }, 763 | }, 764 | contextInfo: { mentionedJid: this.parseMention(teks) } 765 | }); 766 | }; 767 | 768 | fakeLink(jid, teks, thumb, title, url, quoted ){ 769 | this.sendMessage(jid, teks, MessageType.text, { thumbnail: thumb, sendEphemeral: true, quoted: quoted, contextInfo: { externalAdReply : { 770 | title: title, 771 | previewType: "PHOTO", 772 | thumbnail : thumb, 773 | sourceUrl : url 774 | }, mentionedJid: this.parseMention(teks) 775 | } 776 | }) 777 | } 778 | 779 | /** 780 | * Fake replies #2 781 | * @param {String} jid 782 | * @param {String|Object} message 783 | * @param {String} type 784 | * @param {String} sender 785 | * ©091020 786 | * @param {String|Object} message2 787 | * @param {String} type2 788 | * @param {Object} options 789 | * @param {Object} options2 790 | * @param {String} remoteJid 791 | */ 792 | async fakeReply2(jid, message, type, sender, message2, type2, options = {}, options2 = {}, remoteJid) { 793 | let quoted = await this.prepareMessage(jid, message2, type2, options2) 794 | quoted = this.cMod(jid, quoted, undefined, sender) 795 | if (remoteJid) quoted.key.remoteJid = remoteJid 796 | else delete quoted.key.remoteJid 797 | 798 | return await this.prepareMessage(jid, message, type, { quoted, ...options }) 799 | } 800 | 801 | /** 802 | * Parses string into mentionedJid(s) 803 | * @param {String} text 804 | */ 805 | parseMention(text = '') { 806 | return [...text.matchAll(/@([0-9]{5,16}|0)/g)].map(v => v[1] + '@s.whatsapp.net') 807 | } 808 | 809 | /** 810 | * Get name from jid 811 | * @param {String} jid 812 | * @param {Boolean} withoutContact 813 | */ 814 | getName(jid, withoutContact = false) { 815 | withoutContact = this.withoutContact || withoutContact 816 | let chat 817 | let v = jid.endsWith('@g.us') ? (chat = this.chats.get(jid) || {}) && chat.metadata || {} : jid === '0@s.whatsapp.net' ? { 818 | jid, 819 | vname: 'WhatsApp' 820 | } : jid === this.user.jid ? 821 | this.user : 822 | this.contactAddOrGet(jid) 823 | return (withoutContact ? '' : v.name) || v.subject || v.vname || v.notify || PhoneNumber('+' + jid.replace('@s.whatsapp.net', '')).getNumber('international') 824 | } 825 | 826 | /** 827 | * Download media message 828 | * @param {Object} m 829 | */ 830 | async downloadM(m) { 831 | if (!m) return Buffer.alloc(0) 832 | if (!m.message) m.message = { m } 833 | if (!m.message[Object.keys(m.message)[0]].url) await this.updateMediaMessage(m) 834 | return await this.downloadMediaMessage(m) 835 | } 836 | 837 | /** 838 | * Serialize Message, so it easier to manipulate 839 | * @param {Object} m 840 | */ 841 | serializeM(m) { 842 | return exports.smsg(this, m) 843 | } 844 | } 845 | 846 | return WAConnection 847 | } 848 | 849 | /** 850 | * Serialize Message 851 | * @param {WAConnection} conn 852 | * @param {Object} m 853 | * @param {Boolean} hasParent 854 | */ 855 | exports.smsg = (conn, m, hasParent) => { 856 | if (!m) return m 857 | let M = WAMessageProto.WebMessageInfo 858 | if (m.key) { 859 | m.id = m.key.id 860 | m.isBaileys = m.id.startsWith('3EB0') && m.id.length === 12 861 | m.chat = m.key.remoteJid 862 | m.fromMe = m.key.fromMe 863 | m.isGroup = m.chat.endsWith('@g.us') 864 | m.sender = m.fromMe ? conn.user.jid : m.participant ? m.participant : m.key.participant ? m.key.participant : m.chat 865 | } 866 | if (m.message) { 867 | m.mtype = Object.keys(m.message)[0] 868 | m.msg = m.message[m.mtype] 869 | if (m.mtype === 'ephemeralMessage') { 870 | exports.smsg(conn, m.msg) 871 | m.mtype = m.msg.mtype 872 | m.msg = m.msg.msg 873 | } 874 | let quoted = m.quoted = m.msg.contextInfo ? m.msg.contextInfo.quotedMessage : null 875 | m.mentionedJid = m.msg.contextInfo ? m.msg.contextInfo.mentionedJid : [] 876 | if (m.quoted) { 877 | let type = Object.keys(m.quoted)[0] 878 | m.quoted = m.quoted[type] 879 | if (['productMessage'].includes(type)) { 880 | type = Object.keys(m.quoted)[0] 881 | m.quoted = m.quoted[type] 882 | } 883 | if (typeof m.quoted === 'string') m.quoted = { text: m.quoted } 884 | m.quoted.mtype = type 885 | m.quoted.id = m.msg.contextInfo.stanzaId 886 | m.quoted.chat = m.msg.contextInfo.remoteJid || m.chat 887 | m.quoted.isBaileys = m.quoted.id ? m.quoted.id.startsWith('3EB0') && m.quoted.id.length === 12 : false 888 | m.quoted.sender = m.msg.contextInfo.participant 889 | m.quoted.fromMe = m.quoted.sender === (conn.user && conn.user.jid) 890 | m.quoted.text = m.quoted.text || m.quoted.caption || '' 891 | m.quoted.mentionedJid = m.quoted.contextInfo ? m.quoted.contextInfo.mentionedJid : [] 892 | m.getQuotedObj = m.getQuotedMessage = async () => { 893 | if (!m.quoted.id) return false 894 | let q = await conn.loadMessage(m.chat, m.quoted.id) 895 | return exports.smsg(conn, q) 896 | } 897 | let vM = m.quoted.fakeObj = M.fromObject({ 898 | key: { 899 | fromMe: m.quoted.fromMe, 900 | remoteJid: m.quoted.chat, 901 | id: m.quoted.id 902 | }, 903 | message: quoted, 904 | ...(m.isGroup ? { participant: m.quoted.sender } : {}) 905 | }) 906 | if (m.quoted.url) m.quoted.download = (type = 'buffer') => conn.downloadM(vM, type) 907 | /** 908 | * Reply to quoted message 909 | * @param {String|Object} text 910 | * @param {String|false} chatId 911 | * @param {Object} options 912 | */ 913 | m.quoted.reply = (text, chatId, options) => conn.reply(chatId ? chatId : m.chat, text, vM, options) 914 | /** 915 | * Copy quoted message 916 | */ 917 | m.quoted.copy = () => exports.smsg(conn, M.fromObject(M.toObject(vM))) 918 | /** 919 | * Forward quoted message 920 | * @param {String} jid 921 | * @param {Boolean} forceForward 922 | */ 923 | m.quoted.forward = (jid, forceForward = false) => conn.forwardMessage(jid, vM, forceForward) 924 | /** 925 | * Exact Forward quoted message 926 | * @param {String} jid 927 | * @param {Boolean} forceForward 928 | * @param {Object} options 929 | */ 930 | m.quoted.copyNForward = (jid, forceForward = false, options = {}) => conn.copyNForward(jid, vM, forceForward, options) 931 | /** 932 | * Modify quoted Message 933 | * @param {String} jid 934 | * @param {String} text 935 | * @param {String} sender 936 | * @param {Object} options 937 | */ 938 | m.quoted.cMod = (jid, text = '', sender = m.quoted.sender, options = {}) => conn.cMod(jid, vM, text, sender, options) 939 | /** 940 | * Delete quoted message 941 | */ 942 | m.quoted.delete = () => conn.deleteMessage(m.quoted.chat, vM.key) 943 | } 944 | if (m.msg.url) m.download = (type = 'buffer') => conn.downloadM(m, type) 945 | m.text = (m.mtype == 'listResponseMessage' ? m.msg.singleSelectReply.selectedRowId : '') || m.msg.text || m.msg.caption || m.msg || '' 946 | /** 947 | * Reply to this message 948 | * @param {String|Object} text 949 | * @param {String|false} chatId 950 | * @param {Object} options 951 | */ 952 | m.reply = (text, chatId, options) => conn.reply(chatId ? chatId : m.chat, text, m, options) 953 | 954 | 955 | 956 | 957 | /** 958 | * Copy this message 959 | */ 960 | m.copy = () => exports.smsg(conn, M.fromObject(M.toObject(m))) 961 | /** 962 | * Forward this message 963 | * @param {String} jid 964 | * @param {Boolean} forceForward 965 | */ 966 | m.forward = (jid = m.chat, forceForward = false) => conn.forwardMessage(jid, m, forceForward) 967 | /** 968 | * Exact Forward this message 969 | * @param {String} jid 970 | * @param {Boolean} forceForward 971 | * @param {Object} options 972 | */ 973 | m.copyNForward = (jid = m.chat, forceForward = false, options = {}) => conn.copyNForward(jid, m, forceForward, options) 974 | /** 975 | * Modify this Message 976 | * @param {String} jid 977 | * @param {String} text 978 | * @param {String} sender 979 | * @param {Object} options 980 | */ 981 | m.cMod = (jid, text = '', sender = m.sender, options = {}) => conn.cMod(jid, m, text, sender, options) 982 | } 983 | return m 984 | } 985 | 986 | exports.logic = (check, inp, out) => { 987 | if (inp.length !== out.length) throw new Error('Input and Output must have same length') 988 | for (let i in inp) if (util.isDeepStrictEqual(check, inp[i])) return out[i] 989 | return null 990 | } 991 | 992 | /** 993 | * generateThumbnail 994 | * @param {String} file 995 | * @param {*} mediaType 996 | * @param {*} info 997 | */ 998 | async function generateThumbnail(file, mediaType, info) { 999 | const alternate = (Buffer.alloc(1)).toString('base64') 1000 | if ('thumbnail' in info) { 1001 | // don't do anything if the thumbnail is already provided, or is null 1002 | if (mediaType === MessageType.audio) { 1003 | throw new Error('audio messages cannot have thumbnails') 1004 | } 1005 | } else if (mediaType === MessageType.image) { 1006 | try { 1007 | const buff = await compressImage(file) 1008 | info.thumbnail = buff.toString('base64') 1009 | } catch (err) { 1010 | console.error(err) 1011 | info.thumbnail = alternate 1012 | } 1013 | } else if (mediaType === MessageType.video) { 1014 | const imgFilename = path.join(tmpdir(), generateMessageID() + '.jpg') 1015 | try { 1016 | try { 1017 | await extractVideoThumb(file, imgFilename, '00:00:00', { width: 48, height: 48 }) 1018 | const buff = await fs.promises.readFile(imgFilename) 1019 | info.thumbnail = buff.toString('base64') 1020 | await fs.promises.unlink(imgFilename) 1021 | } catch (e) { 1022 | console.error(e) 1023 | info.thumbnail = alternate 1024 | } 1025 | } catch (err) { 1026 | console.log('could not generate video thumb: ' + err) 1027 | } 1028 | } 1029 | } 1030 | 1031 | /** 1032 | * 1033 | * @param {String} path 1034 | * @param {*} destPath 1035 | * @param {String} time ('00:00:00') 1036 | * @param {{width: Number, height: Number}} size 1037 | * @returns 1038 | */ 1039 | const extractVideoThumb = async ( 1040 | path, 1041 | destPath, 1042 | time, 1043 | size = {}, 1044 | ) => 1045 | new Promise((resolve, reject) => { 1046 | const cmd = `ffmpeg -ss ${time} -i ${path} -y -s ${size.width}x${size.height} -vframes 1 -f image2 ${destPath}` 1047 | exec(cmd, (err) => { 1048 | if (err) reject(err) 1049 | else resolve() 1050 | }) 1051 | }) 1052 | 1053 | /** 1054 | * download video from url or buffer 1055 | * @param {String|Buffer} media 1056 | * @returns Buffer 1057 | */ 1058 | async function download(media, mime, callback) { 1059 | if (Buffer.isBuffer(media)) { 1060 | if (typeof callback == 'function') await callback({ buffer: media, filename: '' }) 1061 | return media 1062 | } 1063 | let filename = path.join(__dirname, '../tmp/' + new Date * 1 + '.' + mime) 1064 | let buffer 1065 | try { 1066 | let totalErr = 0 1067 | await request(media).pipe(await fs.createWriteStream(filename)).on('finish', async () => { 1068 | buffer = await fs.readFileSync(filename) 1069 | if (typeof callback == 'function') await callback({ buffer, filename }) 1070 | }) 1071 | if (fs.existsSync(filename)) await fs.unlinkSync(filename) 1072 | return filename 1073 | } catch (err) { 1074 | try { 1075 | let res = await fetch(media) 1076 | await res.body.pipe(await fs.createWriteStream(filename)).on('finish', async () => { 1077 | buffer = await fs.readFileSync(filename) 1078 | if (typeof callback == 'function') await callback({ buffer, filename }) 1079 | }) 1080 | if (fs.existsSync(filename)) await fs.unlinkSync(filename) 1081 | return filename 1082 | } catch (e) { 1083 | throw e 1084 | } 1085 | } 1086 | return filename 1087 | } 1088 | 1089 | function delay(ms) { 1090 | return new Promise((resolve, reject) => setTimeout(resolve, ms)) 1091 | } 1092 | 1093 | function format(...args) { 1094 | return util.format(...args) 1095 | } --------------------------------------------------------------------------------