├── Dockerfile ├── Procfile ├── app.json ├── database ├── afk.json ├── antilink.json ├── antivirtex.json ├── antiwame.json ├── autosticker.json ├── bad.json ├── commands.json ├── gcdetect.json ├── imagi.json ├── kickarea.json ├── kuismath.json ├── mute.json ├── nsfww.json ├── registered.json ├── scommand.json ├── setik.json ├── tictactoe.json ├── vien.json └── welkom.json ├── helga.jpg ├── helga.js ├── install.sh ├── lib ├── antispam.js ├── autoresp.js ├── color.js ├── converter.js ├── exif.js ├── fetcher.js ├── functions.js ├── gif.js ├── gtts.js ├── igdown.js ├── simple.js ├── tiktok.js ├── tiktokdl.js ├── uploadimg.js ├── webp2mp4.js ├── y2mate.js └── ytdl.js ├── main.js ├── package.json ├── session.json ├── settings.json └── sticker ├── BaseZuka └── data.exif /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16.10.0-buster 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | neofetch \ 6 | chromium \ 7 | ffmpeg \ 8 | wget \ 9 | imagemagick \ 10 | graphicsmagick \ 11 | webp \ 12 | mc && \ 13 | rm -rf /var/lib/apt/lists/* 14 | 15 | COPY package.json . 16 | RUN npm install -g npm@8.1.3 17 | RUN npm install -g pm2 18 | RUN npm update 19 | COPY . . 20 | RUN pm2 save 21 | CMD ["pm2-runtime", "index.js"]` 22 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker : npm i && npm i pm2 -g && pm2 install ffmpeg && pm2 start main.js && pm2 save && pm2 logs 2 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WhatsApp Helga Ilham", 3 | "logo": "https://f.top4top.io/p_2149d3qg60.jpg", 4 | "description": "Subscribe Helga Zex's", 5 | "keywords": ["nodejs", "bot", "whatsapp bot"] 6 | "repository": "https://github.com/HelgaIlham/HELGAV10", 7 | "buildpacks": [ 8 | { 9 | "url": "heroku/nodejs" 10 | }, 11 | { 12 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest" 13 | }, 14 | { 15 | "url": "https://github.com/DuckyTeam/heroku-buildpack-imagemagick" 16 | }, 17 | { 18 | "url": "https://github.com/clhuang/heroku-buildpack-webp-binaries.git" 19 | } 20 | ], 21 | "formation": { 22 | "worker": { 23 | "quantity": 1, 24 | "size": "free" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /database/afk.json: -------------------------------------------------------------------------------- 1 | [{"id":"6285866295942-1621358833@g.us","expired":1621396159716},{"id":"6283856875451@s.whatsapp.net","expired":1621560951479},{"id":"6281567973372@s.whatsapp.net","expired":1621561434185},{"id":"6285788713572@s.whatsapp.net","expired":1621698219314},{"id":"6285866295942-1609697652@g.us","expired":1621698421512},{"id":"6285876210829@s.whatsapp.net","expired":1621698941928},{"id":"6285782538583@s.whatsapp.net","expired":1621702303939},{"id":"51950732365@s.whatsapp.net","expired":1621703285269},{"id":"60165320234@s.whatsapp.net","expired":1621908197015},{"id":"6289530863358@s.whatsapp.net","expired":1621949547914},{"id":"6281545829534@s.whatsapp.net","expired":1622136952472},{"id":"6285866295942-1621755033@g.us","expired":1622137506634},{"id":"6283891411268@s.whatsapp.net","expired":1622137989252},{"id":"6285719194581@s.whatsapp.net","expired":1622421622542},{"id":"6281253788742@s.whatsapp.net","expired":1622424638807},{"id":"917736716373@s.whatsapp.net","expired":1622427821844},{"id":"48699518483@s.whatsapp.net","expired":1622428105705},{"id":"6289652300145@s.whatsapp.net","expired":1622683763826},{"id":"6281389368689@s.whatsapp.net","expired":1623078665233},{"id":"17752101470@s.whatsapp.net","expired":1623078717090},{"id":"6283823045997@s.whatsapp.net","expired":1623078895707},{"id":"60184099828@s.whatsapp.net","expired":1623078951476},{"id":"60195532240@s.whatsapp.net","expired":1623079119062},{"id":"6285943426432@s.whatsapp.net","expired":1623079683843},{"id":"6281333782061@s.whatsapp.net","expired":1623079718912},{"id":"60187810695@s.whatsapp.net","expired":1623079764733},{"id":"919567997462@s.whatsapp.net","expired":1623079861964},{"id":"60198552464@s.whatsapp.net","expired":1623079965595},{"id":"918149963853@s.whatsapp.net","expired":1623079991015},{"id":"60197931154@s.whatsapp.net","expired":1623079991344},{"id":"601127376016@s.whatsapp.net","expired":1623080487626},{"id":"60169756793@s.whatsapp.net","expired":1623081003106},{"id":"60179153890@s.whatsapp.net","expired":1623084215425},{"id":"601111166258@s.whatsapp.net","expired":1623084899761},{"id":"6285240646336@s.whatsapp.net","expired":1623085098493},{"id":"918129298179@s.whatsapp.net","expired":1623085113350},{"id":"6282143898068@s.whatsapp.net","expired":1623085127961},{"id":"601111413730@s.whatsapp.net","expired":1623085202360},{"id":"60149120365@s.whatsapp.net","expired":1623085527015},{"id":"16604775656@s.whatsapp.net","expired":1623085988952},{"id":"6285336072928@s.whatsapp.net","expired":1623086105328},{"id":"6282113426495@s.whatsapp.net","expired":1623086311799},{"id":"601127867976@s.whatsapp.net","expired":1623160580978},{"id":"601114416850@s.whatsapp.net","expired":1623242001891},{"id":"60133253066@s.whatsapp.net","expired":1623242010043},{"id":"6285786216342@s.whatsapp.net","expired":1623242489950},{"id":"601116363088@s.whatsapp.net","expired":1623242541797},{"id":"60196456421@s.whatsapp.net","expired":1623242954323},{"id":"6282274638467@s.whatsapp.net","expired":1623243151286},{"id":"601135090547@s.whatsapp.net","expired":1623243255794},{"id":"6283152753417@s.whatsapp.net","expired":1623720718870},{"id":"593992826085@s.whatsapp.net","expired":1623849576670},{"id":"6285855302627@s.whatsapp.net","expired":1623849786474},{"id":"6281318844590@s.whatsapp.net","expired":1623850561762},{"id":"6285239852463@s.whatsapp.net","expired":1624186286822},{"id":"6281958924477@s.whatsapp.net","expired":1624186476960},{"id":"6289502860914@s.whatsapp.net","expired":1624806318307},{"id":"62895336253039@s.whatsapp.net","expired":1624807761896},{"id":"19093669895@s.whatsapp.net","expired":1624815941034},{"id":"15803245147@s.whatsapp.net","expired":1624985579748},{"id":"50558169979@s.whatsapp.net","expired":1625757177042},{"id":"6285866295942-1623004283@g.us","expired":1625845047707},{"id":"6285721141764@s.whatsapp.net","expired":1625845141588},{"id":"62895362282300@s.whatsapp.net","expired":1625845682809},{"id":"6285727093196@s.whatsapp.net","expired":1625845832841},{"id":"6283870880860@s.whatsapp.net","expired":1625845974413},{"id":"6287885779189@s.whatsapp.net","expired":1628308543554},{"id":"6283104061930@s.whatsapp.net","expired":1628309233997},{"id":"6285866295942@s.whatsapp.net","expired":1628421386753},{"id":"60197292656-1387801661@g.us","expired":1628421488635},{"id":"6285808436373@s.whatsapp.net","expired":1628439432664},{"id":"6285727091924@s.whatsapp.net","expired":1628439800032},{"id":"601119707231@s.whatsapp.net","expired":1628470188640},{"id":"6285842369183@s.whatsapp.net","expired":1628470342992},{"id":"6282361430577@s.whatsapp.net","expired":1628486905944},{"id":"6285752563004@s.whatsapp.net","expired":1628562236580},{"id":"6285753958801@s.whatsapp.net","expired":1628562239282},{"id":"6285863731628@s.whatsapp.net","expired":1628562341499},{"id":"6281321343363@s.whatsapp.net","expired":1628563681119},{"id":"6283811981997-1578227524@g.us","expired":1628582222034},{"id":"6285878802803@s.whatsapp.net","expired":1628582604515},{"id":"62895359737675@s.whatsapp.net","expired":1628584267099},{"id":"6282334297175@s.whatsapp.net","expired":1628698952387},{"id":"94767043432@s.whatsapp.net","expired":1628732703707},{"id":"919446088620@s.whatsapp.net","expired":1628842091055},{"id":"6288218837048@s.whatsapp.net","expired":1628842094364},{"id":"6283103130776@s.whatsapp.net","expired":1628842642610},{"id":"6282135690975@s.whatsapp.net","expired":1628842918449},{"id":"6288221400832@s.whatsapp.net","expired":1628842961605},{"id":"919895823783@s.whatsapp.net","expired":1628843592653},{"id":"6285742647464@s.whatsapp.net","expired":1628843883251},{"id":"6285694581578@s.whatsapp.net","expired":1628843929692},{"id":"6283116167306@s.whatsapp.net","expired":1628844819886},{"id":"6283813312897@s.whatsapp.net","expired":1629093679970},{"id":"601164885691@s.whatsapp.net","expired":1629094047585},{"id":"6282348036513@s.whatsapp.net","expired":1629098932203},{"id":"6282255971129@s.whatsapp.net","expired":1629098963112},{"id":"6282273911110@s.whatsapp.net","expired":1629098987168},{"id":"6285265291674@s.whatsapp.net","expired":1629099269514},{"id":"6282241852001@s.whatsapp.net","expired":1629099776625},{"id":"919037905727@s.whatsapp.net","expired":1629100611889},{"id":"994402231051@s.whatsapp.net","expired":1629174118508}] -------------------------------------------------------------------------------- /database/antilink.json: -------------------------------------------------------------------------------- 1 | ["6285814079819-1618587883@g.us","6285866295942-1609697652@g.us","6285866295942-1621755033@g.us","6281803609324-1633835548@g.us"] -------------------------------------------------------------------------------- /database/antivirtex.json: -------------------------------------------------------------------------------- 1 | ["6285814079819-1618587883@g.us","6285866295942-1609697652@g.us","6285866295942-1621755033@g.us","6281803609324-1633835548@g.us","6283148897828-1627556354@g.us","6281514712413-1630675537@g.us","62896764442904-1632211072@g.us","6285284051385-1632107651@g.us","6281220670449-1633330357@g.us","120363022691627866@g.us","62882005189042-1627307841@g.us","62882005189042-1627307841@g.us"] -------------------------------------------------------------------------------- /database/antiwame.json: -------------------------------------------------------------------------------- 1 | ["6285814079819-1618587883@g.us","6285866295942-1609697652@g.us","6285866295942-1621755033@g.us","6281803609324-1633835548@g.us","6283148897828-1627556354@g.us","6281514712413-1630675537@g.us","62896764442904-1632211072@g.us","6285284051385-1632107651@g.us"] -------------------------------------------------------------------------------- /database/autosticker.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /database/bad.json: -------------------------------------------------------------------------------- 1 | ["anjing","memek","kontol","bangsat","goblok","tolol","peler","pler","ajg","asw","asu","gblk","mmk","bgst","bngst"] -------------------------------------------------------------------------------- /database/commands.json: -------------------------------------------------------------------------------- 1 | [{"pesan":"boleh minta sc ga","balasan":"ga boleh","creator":"6285727091924@s.whatsapp.net"}] -------------------------------------------------------------------------------- /database/gcdetect.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /database/imagi.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /database/kickarea.json: -------------------------------------------------------------------------------- 1 | ["6285866295942-1625902857@g.us"] -------------------------------------------------------------------------------- /database/kuismath.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /database/mute.json: -------------------------------------------------------------------------------- 1 | ["6281257845860-1597239597@g.us","6285866295942-1623004283@g.us"] -------------------------------------------------------------------------------- /database/nsfww.json: -------------------------------------------------------------------------------- 1 | ["6285814079819-1618587883@g.us","6285866295942-1609697652@g.us","6285866295942-1621755033@g.us","120363038212042514@g.us"] -------------------------------------------------------------------------------- /database/registered.json: -------------------------------------------------------------------------------- 1 | ["",{"id":"","name":"c0ea7d819000769bcb"},"",{"id":"","name":"42704391656f93e251"},"",{"id":"","name":"8f71066ad71eb8086c"},"6282138188516@s.whatsapp.net",{"id":"6282138188516@s.whatsapp.net","name":"5660f601d7bf036a26"},"6281337541779@s.whatsapp.net",{"id":"6281337541779@s.whatsapp.net","name":"0852907d86c4bf853a"},"6281803609324@s.whatsapp.net",{"id":"6281803609324@s.whatsapp.net","name":"1d94c3592146bc3a93"},"17205043079@s.whatsapp.net",{"id":"17205043079@s.whatsapp.net","name":"b03144dd1266325713"},"6283829814737@s.whatsapp.net",{"id":"6283829814737@s.whatsapp.net","name":"1bc18423b61b2aafa5"},"6285333082520@s.whatsapp.net",{"id":"6285333082520@s.whatsapp.net","name":"1b22d3c33ca43df739"},"6282325263335@s.whatsapp.net",{"id":"6282325263335@s.whatsapp.net","name":"29c1344bccb9202c27"},"6283806687112@s.whatsapp.net",{"id":"6283806687112@s.whatsapp.net","name":"1c806b7f1a769c51bd"},"6287831500785@s.whatsapp.net",{"id":"6287831500785@s.whatsapp.net","name":"8307fe14e6980bb711"},"6287764451808@s.whatsapp.net",{"id":"6287764451808@s.whatsapp.net","name":"2e8bbddfa447cb77bb"},"6281344870600@s.whatsapp.net",{"id":"6281344870600@s.whatsapp.net","name":"69e742820685bd1330"},"6282138919347@s.whatsapp.net",{"id":"6282138919347@s.whatsapp.net","name":"c39a25c5bfe0e3f014"},"6289509154745@s.whatsapp.net",{"id":"6289509154745@s.whatsapp.net","name":"0d6cd8f321a7f3103f"},"6287879803117@s.whatsapp.net",{"id":"6287879803117@s.whatsapp.net","name":"a75a115a4a1d6838ed"},"6285741740510@s.whatsapp.net",{"id":"6285741740510@s.whatsapp.net","name":"ef76ee690c420bdf94"},"628813359917@s.whatsapp.net",{"id":"628813359917@s.whatsapp.net","name":"546ce69f550f8df061"},"6285876219351@s.whatsapp.net",{"id":"6285876219351@s.whatsapp.net","name":"f4974aed97f4f8cb06"},"6289664473739@s.whatsapp.net",{"id":"6289664473739@s.whatsapp.net","name":"1123de03886bf6f8b3"},"6281262411188@s.whatsapp.net",{"id":"6281262411188@s.whatsapp.net","name":"581b69399de36ee05e"},"62821389193470@s.whatsapp.net",{"id":"62821389193470@s.whatsapp.net","name":"757f2d79b1f4bb3553"},"6285256155626@s.whatsapp.net",{"id":"6285256155626@s.whatsapp.net","name":"6cac3c1569ff252eb5"},"6287769720602@s.whatsapp.net",{"id":"6287769720602@s.whatsapp.net","name":"36d7ef36a5981d56d8"},"628818770766@s.whatsapp.net",{"id":"628818770766@s.whatsapp.net","name":"4348e00fb2a7918ef4"},"6285659171718@s.whatsapp.net",{"id":"6285659171718@s.whatsapp.net","name":"3ccf04b9526ffd68c3"},"6281299579148@s.whatsapp.net",{"id":"6281299579148@s.whatsapp.net","name":"4e0caaa401f98944c4"},"6281275634760@s.whatsapp.net",{"id":"6281275634760@s.whatsapp.net","name":"ab1a6986e1a094a32c"},"6285784786722@s.whatsapp.net",{"id":"6285784786722@s.whatsapp.net","name":"9701f8b78dd844f533"},"6285692388828@s.whatsapp.net",{"id":"6285692388828@s.whatsapp.net","name":"8ef63d4cb4da678c24"},"6285335733491@s.whatsapp.net",{"id":"6285335733491@s.whatsapp.net","name":"93f6227ecd5cace24f"}] -------------------------------------------------------------------------------- /database/scommand.json: -------------------------------------------------------------------------------- 1 | [{"id":"/0OJ4ydfmLTio9YhLQ3qW+nWjxKWr143CxVK4F3gzgY=","chats":"menu"},{"id":"8rBSseGeycxGmf8SuSm/dRW7xv8c4xHu7awvmaiZtyc=","chats":"self"},{"id":"0BKJ6bKfszC7aCptbdM5SDcjtLSIVIyhSCDdQvGEbDQ=","chats":"status"},{"id":"pG9/skU5OnBRdKn85llQua2OnWSjMZbYN3YAC40qHVU=","chats":"menu"},{"id":"GiGd8b6QLDvdN8vrKmwffL53YLg4gS6DYcrA5Et84L8=","chats":".return denz.updateProfilePicture(from, fs.readFileSync('./media/image/pp.jpg'))"},{"id":"/0OJ4ydfmLTio9YhLQ3qW+nWjxKWr143CxVK4F3gzgY=","chats":".menu"}] -------------------------------------------------------------------------------- /database/setik.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /database/tictactoe.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /database/vien.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /database/welkom.json: -------------------------------------------------------------------------------- 1 | ["79954542247-1622738276@g.us","6283164579914-1625145803@g.us","6285866295942-1625902857@g.us","6281803609324-1633835548@g.us","6282138919347-1632926916@g.us"] -------------------------------------------------------------------------------- /helga.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelgaIlham/BaseeZuka/77e961d1498797e24c7fd94c4291292269adcd23/helga.jpg -------------------------------------------------------------------------------- /helga.js: -------------------------------------------------------------------------------- 1 | /* Base Ori : Helgaa 2 | SC Ori : Helgaa 3 | 4 | 5 | Thanks a lot to 6 | 7 | > Allah SWT 8 | > Helga Ilham 9 | 10 | > My parents 11 | > My Family 12 | 13 | Note : Jangan Hapus Nama Creator! 14 | Kalo Mau Reupload Atau Recode Kasih Credits! 15 | 16 | */ 17 | const 18 | { 19 | WAConnection: _WAConnection, 20 | MessageType, 21 | Presence, 22 | MessageOptions, 23 | Mimetype, 24 | WALocationMessage, 25 | WAMessageProto, 26 | ReconnectMode, 27 | ProxyAgent, 28 | ChatModification, 29 | GroupSettingChange, 30 | WA_MESSAGE_STUB_TYPES, 31 | WA_DEAFULT_EPHEMERAL, 32 | waChatKey, 33 | mentionedJid, 34 | processTime, 35 | prepareMessageFromContent, 36 | relayWAMessage 37 | } = require("@adiwajshing/baileys") 38 | const simple = require('./lib/simple.js') 39 | const WAConnection = simple.WAConnection(_WAConnection) 40 | const qrcode = require('qrcode-terminal') 41 | const qrkode = require("qrcode") 42 | const imageToBase64 = require('image-to-base64') 43 | const moment = require("moment-timezone") 44 | const fs = require("fs") 45 | const axios = require("axios") 46 | const ffmpeg = require('fluent-ffmpeg') 47 | const request = require('request') 48 | const util = require('util') 49 | const hx = require('hxz-api') 50 | const base64Img = require('base64-img') 51 | const ms = require('parse-ms') 52 | const figlet = require('figlet') 53 | const brainly = require('brainly-scraper') 54 | const ig = require('insta-fetcher') 55 | const cheerio = require('cheerio') 56 | const fromData = require('form-data') 57 | const os = require('os') 58 | const translate = require('@vitalets/google-translate-api') 59 | const ggs = require('google-it') 60 | const googleImage = require('g-i-s') 61 | const toMs = require('ms') 62 | const fetch = require('node-fetch') 63 | const imgbb = require('imgbb-uploader') 64 | const Math_js = require('mathjs') 65 | const crypto = require('crypto') 66 | const speed = require('performance-now') 67 | const client = new WAConnection() 68 | const dtod = "6282138919347@s.whatsapp.net" 69 | const otod = "6282138919347@s.whatsapp.net" 70 | 71 | //── 「 Lib 」 ──// 72 | 73 | const { y2mateA, y2mateV } = require('./lib/y2mate') 74 | const { webp2gifFile, igDownloader, TiktokDownloader } = require("./lib/gif.js") 75 | const { color, bgcolor } = require('./lib/color') 76 | const { fetchJson } = require('./lib/fetcher') 77 | const { antiSpam } = require('./lib/antispam') 78 | const { exec } = require('child_process') 79 | const { addCommands, checkCommands, deleteCommands } = require('./lib/autoresp') 80 | const { getBuffer, getGroupAdmins, getRandom, start, info, success, close } = require('./lib/functions') 81 | const Exif = require('./lib/exif') 82 | const exif = new Exif() 83 | 84 | //── 「 DataBase 」 ──// 85 | 86 | const afk = JSON.parse(fs.readFileSync('./database/afk.json')) 87 | const setik = JSON.parse(fs.readFileSync('./database/setik.json')) 88 | const vien = JSON.parse(fs.readFileSync('./database/vien.json')) 89 | const imagi = JSON.parse(fs.readFileSync('./database/imagi.json')) 90 | const bad = JSON.parse(fs.readFileSync('./database/bad.json')) 91 | const commandsDB = JSON.parse(fs.readFileSync('./database/commands.json')) 92 | const tictactoe = JSON.parse(fs.readFileSync("./database/tictactoe.json")) 93 | const antiwame = JSON.parse(fs.readFileSync('./database/antiwame.json')); 94 | const antilink = JSON.parse(fs.readFileSync('./database/antilink.json')) 95 | const welkom = JSON.parse(fs.readFileSync('./database/welkom.json')) 96 | const nsfww = JSON.parse(fs.readFileSync('./database/nsfww.json')) 97 | const mute = JSON.parse(fs.readFileSync('./database/mute.json')) 98 | const settings = JSON.parse(fs.readFileSync('./settings.json')) 99 | const antivirtex = JSON.parse(fs.readFileSync("./database/antivirtex.json")) 100 | const _registered = JSON.parse(fs.readFileSync('./database/registered.json')) 101 | const kickarea = JSON.parse(fs.readFileSync('./database/kickarea.json')) 102 | const scommand = JSON.parse(fs.readFileSync('./database/scommand.json')) 103 | const autosticker = JSON.parse(fs.readFileSync('./database/autosticker.json')) 104 | 105 | ky_ttt = [] 106 | tttawal= ["0️⃣","1️⃣","2️⃣","3️⃣","4️⃣","5️⃣","6️⃣","7️⃣","8️⃣","9️⃣"] 107 | cmhit = [] 108 | autorespon = false 109 | playmusic = false 110 | antidelete = false 111 | menusimpel = false 112 | menuall = false 113 | baterai = { 114 | battery: "" || "Not detected", 115 | isCharge: "" || false 116 | } 117 | offline = false 118 | publik = true 119 | bugc = true 120 | waktuafk = 'Nothing' 121 | alasanafk = 'Nothing' 122 | NamaBot = settings.NamaBot 123 | NomorOwner = settings.NomorOwner 124 | NamaOwner = settings.NamaOwner 125 | multi = true 126 | nopref = false 127 | 128 | //── 「 LolKey 」 ──// 129 | HelKey = settings.HelKey 130 | 131 | const time = moment().tz('Asia/Jakarta').format("HH:mm:ss") 132 | 133 | function kyun(seconds) { 134 | function pad(s) { 135 | return (s < 10 ? '0' : '') + s; 136 | } 137 | var hours = Math.floor(seconds / (60 * 60)); 138 | var minutes = Math.floor(seconds % (60 * 60) / 60); 139 | var seconds = Math.floor(seconds % 60); 140 | 141 | return `${pad(hours)}Jam ${pad(minutes)}Menit ${pad(seconds)}Detik` 142 | } 143 | const sleep = async (ms) => { 144 | return new Promise(resolve => setTimeout(resolve, ms)); 145 | } 146 | function waktu(seconds) { 147 | seconds = Number(seconds); 148 | var d = Math.floor(seconds / (3600 * 24)); 149 | var h = Math.floor(seconds % (3600 * 24) / 3600); 150 | var m = Math.floor(seconds % 3600 / 60); 151 | var s = Math.floor(seconds % 60); 152 | var dDisplay = d > 0 ? d + (d == 1 ? " day, " : " days, ") : ""; 153 | var hDisplay = h > 0 ? h + (h == 1 ? " hour, " : " hours, ") : ""; 154 | var mDisplay = m > 0 ? m + (m == 1 ? " minute, " : " minutes, ") : ""; 155 | var sDisplay = s > 0 ? s + (s == 1 ? " second" : " seconds") : ""; 156 | return dDisplay + hDisplay + mDisplay + sDisplay; 157 | } 158 | const addafk = (from) => { 159 | const obj = { id: from, expired: Date.now() + toMs('10m') } 160 | afk.push(obj) 161 | fs.writeFileSync('./database/afk.json', JSON.stringify(afk)) 162 | } 163 | const cekafk = (_dir) => { 164 | setInterval(() => { 165 | let position = null 166 | Object.keys(_dir).forEach((i) => { 167 | if (Date.now() >= _dir[i].expired) { 168 | position = i 169 | } 170 | }) 171 | if (position !== null) { 172 | _dir.splice(position, 1) 173 | fs.writeFileSync('./database/afk.json', JSON.stringify(_dir)) 174 | } 175 | }, 1000) 176 | } 177 | const isAfk = (idi) => { 178 | let status = false 179 | Object.keys(afk).forEach((i) => { 180 | if (afk[i].id === idi) { 181 | status = true 182 | } 183 | }) 184 | return status 185 | } 186 | const addCmd = (id, command) => { 187 | const obj = { id: id, chats: command } 188 | scommand.push(obj) 189 | fs.writeFileSync('./database/scommand.json', JSON.stringify(scommand)) 190 | } 191 | 192 | const getCommandPosition = (id) => { 193 | let position = null 194 | Object.keys(scommand).forEach((i) => { 195 | if (scommand[i].id === id) { 196 | position = i 197 | } 198 | }) 199 | if (position !== null) { 200 | return position 201 | } 202 | } 203 | 204 | const getCmd = (id) => { 205 | let position = null 206 | Object.keys(scommand).forEach((i) => { 207 | if (scommand[i].id === id) { 208 | position = i 209 | } 210 | }) 211 | if (position !== null) { 212 | return scommand[position].chats 213 | } 214 | } 215 | module.exports = helga = async (helga, mek) => { 216 | try { 217 | if (!mek.hasNewMessage) return 218 | mek = mek.messages.all()[0] 219 | if (!mek.message) return 220 | if (mek.key && !mek.key.remoteJid == 'status@broadcast') return 221 | if ((Object.keys(mek.message)[0] === 'ephemeralMessage' && JSON.stringify(mek.message).includes('EPHEMERAL_SETTING')) && mek.message.ephemeralMessage.message.protocolMessage.type === 3 && bugc && !mek.key.fromMe) { 222 | nums = mek.participant 223 | longkapnye = "\n".repeat(420) 224 | tekuss = `\`\`\`TANDAI TELAH DIBACA !!!\`\`\`${longkapnye}\`\`\`@⁨${nums.split('@')[0]} Terdeteksi Telah Mengirim Bug, @⁨${nums.split('@')[0]} Akan Dikick!\`\`\`\n` 225 | helga.groupRemove(mek.key.remoteJid, [nums]).catch((e) => { reply(`*ERR:* ${e}`) }) 226 | helga.sendMessage(mek.key.remoteJid, tekuss, MessageType.text, {contextInfo:{mentionedJid:[nums + "@s.whatsapp.net"]}}) 227 | } 228 | mek.message = (Object.keys(mek.message)[0] === 'ephemeralMessage') ? mek.message.ephemeralMessage.message : mek.message 229 | const typei = Object.keys(mek.message)[0] 230 | global.prefix 231 | me = helga.user 232 | m = simple.smsg(helga, mek) 233 | const antibot = m.isBaileys 234 | const content = JSON.stringify(mek.message) 235 | const from = mek.key.remoteJid 236 | const type = Object.keys(mek.message)[0] 237 | const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio } = MessageType 238 | const time = moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss') 239 | const timeWib = moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss') 240 | const timeWita = moment().tz('Asia/Makassar').format('DD/MM HH:mm:ss') 241 | const timeWit = moment().tz('Asia/Jayapura').format('DD/MM HH:mm:ss') 242 | const cmd = (type === 'conversation' && mek.message.conversation) ? mek.message.conversation : (type == 'imageMessage') && mek.message.imageMessage.caption ? mek.message.imageMessage.caption : (type == 'videoMessage') && mek.message.videoMessage.caption ? mek.message.videoMessage.caption : (type == 'extendedTextMessage') && mek.message.extendedTextMessage.text ? mek.message.extendedTextMessage.text : (type == 'stickerMessage') && (getCmd(mek.message.stickerMessage.fileSha256.toString('hex')) !== null && getCmd(mek.message.stickerMessage.fileSha256.toString('base64')) !== undefined) ? getCmd(mek.message.stickerMessage.fileSha256.toString('base64')) : "".slice(1).trim().split(/ +/).shift().toLowerCase() 243 | helga.on("CB:action,,battery", json => { 244 | const battery = json[2][0][1].value 245 | const persenbat = parseInt(battery) 246 | baterai.battery = `${persenbat}%` 247 | baterai.isCharge = json[2][0][1].live 248 | }) 249 | if (multi){ 250 | var prefix = /^[°zZ#$@*+,.?=''():√%!¢£¥€π¤ΠΦ_&><`™©®Δ^βα¦|/\\©^]/.test(cmd) ? cmd.match(/^[°zZ#$@*+,.?=''():√%¢£¥€π¤ΠΦ_&> { 319 | return url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%.+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%+.~#?&/=]*)/, 'gi')) 320 | } 321 | if (antibot === true) return 322 | const katalog = (teks) => { 323 | res = helga.prepareMessageFromContent(from,{ "orderMessage": { "itemCount": 321, "message": teks, "footerText": "*_© Helga Zex_*", "thumbnail": ofrply, "surface": 'CATALOG' }}, {quoted:ftrol}) 324 | helga.relayWAMessage(res) 325 | } 326 | const grupinv = (teks) => { 327 | grup = helga.prepareMessageFromContent(from, { "groupInviteMessage": { "groupJid": '6282138919347-1616169743@g.us', "inviteCode": 'https://chat.whatsapp.com/IlpQRKWDZed0GgVHmYJUbl', "groupName": `${NamaBot}`, "footerText": "*_© Helga Zex_*", "jpegThumbnail": ofrply, "caption": teks}}, {quoted:finv}) 328 | helga.relayWAMessage(grup) 329 | } 330 | function clockString(ms) { 331 | let h = isNaN(ms) ? "--" : Math.floor(ms / 3600000); 332 | let m = isNaN(ms) ? "--" : Math.floor(ms / 60000) % 60; 333 | let s = isNaN(ms) ? "--" : Math.floor(ms / 1000) % 60; 334 | return [h, m, s].map((v) => v.toString().padStart(2, 0)).join(":"); 335 | } 336 | let settingstatus = 0; 337 | if (new Date() * 1 - settingstatus > 1000) { 338 | let _uptime = process.uptime() * 1000; 339 | let uptime = clockString(_uptime); 340 | 341 | await helga.setStatus(`❄️Base Helga | ⛈️Running Time : ${uptime}`).catch((_) => _); 342 | settingstatus = new Date() * 1; 343 | } 344 | idttt = [] 345 | players1 = [] 346 | players2 = [] 347 | gilir = [] 348 | for (let t of ky_ttt){ 349 | idttt.push(t.id) 350 | players1.push(t.player1) 351 | players2.push(t.player2) 352 | gilir.push(t.gilir) 353 | } 354 | const isTTT = isGroup ? idttt.includes(from) : false 355 | isPlayer1 = isGroup ? players1.includes(sender) : false 356 | isPlayer2 = isGroup ? players2.includes(sender) : false 357 | try { 358 | pporang = await helga.getProfilePicture(`${sender.split('@')[0]}@s.whatsapp.net`) 359 | } catch { 360 | pporang = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg' 361 | } 362 | const ofrply = await getBuffer(pporang) 363 | const pporigi = fs.readFileSync('./helga.jpg') 364 | const sekarang = new Date().getTime(); 365 | 366 | 367 | //── 「 Waktuuu 」 ──// 368 | 369 | var ase = new Date(); 370 | var jamss = ase.getHours(); 371 | switch(jamss){ 372 | case 0: jamss = "Midnight 🌚"; break; 373 | case 1: jamss = "Midnight 🌚"; break; 374 | case 2: jamss = "Midnight 🌚"; break; 375 | case 3: jamss = "Midnight 🌔"; break; 376 | case 4: jamss = "Midnight 🌔"; break; 377 | case 5: jamss = "Dawn 🌄"; break; 378 | case 6: jamss = "Morning 🌄"; break; 379 | case 7: jamss = "Morning 🌄"; break; 380 | case 8: jamss = "Morning ☀️"; break; 381 | case 9: jamss = "Morning ☀️"; break; 382 | case 10: jamss = "Morning ☀️"; break; 383 | case 11: jamss = "Afternoon 🌞"; break; 384 | case 12: jamss = "Zuhur 🌞"; break; 385 | case 13: jamss = "Afternoon 🌞"; break; 386 | case 14: jamss = "Afternoon 🌞"; break; 387 | case 15: jamss = "Asr 🌞"; break; 388 | case 16: jamss = "Afternoon ☀️"; break; 389 | case 17: jamss = "Evening 🌄"; break; 390 | case 18: jamss = "Maghrib 🌄"; break; 391 | case 19: jamss = "Isha 🌙"; break; 392 | case 20: jamss = "Night 🌙"; break; 393 | case 21: jamss = "Night 🌙"; break; 394 | case 22: jamss = "Midnight 🌙"; break; 395 | case 23: jamss = "Midnight 🌚"; break; 396 | } 397 | var tampilUcapan = "" + jamss; 398 | const jmn = moment.tz('Asia/Jakarta').format('HH:mm:ss') 399 | let d = new Date 400 | let locale = 'id' 401 | let gmt = new Date(0).getTime() - new Date('1 Januari 2021').getTime() 402 | const weton = ['Pahing', 'Pon','Wage','Kliwon','Legi'][Math.floor(((d * 1) + gmt) / 84600000) % 5] 403 | const week = d.toLocaleDateString(locale, { weekday: 'long' }) 404 | const calender = d.toLocaleDateString(locale, { 405 | day: 'numeric', 406 | month: 'long', 407 | year: 'numeric' 408 | }) 409 | const time2 = moment().tz('Asia/Jakarta').format('HH:mm:ss') 410 | if(time2 < "23:59:00"){ 411 | var imageTime = await getBuffer('https://i.pinimg.com/736x/27/ee/27/27ee271709bdb24d555b2dd3de796f93.jpg') 412 | } 413 | if(time2 < "19:00:00"){ 414 | var imageTime = await getBuffer('https://i.pinimg.com/736x/27/ee/27/27ee271709bdb24d555b2dd3de796f93.jpg') 415 | } 416 | if(time2 < "18:00:00"){ 417 | var imageTime = await getBuffer('https://i.pinimg.com/736x/81/08/7b/81087b2e732dc0e25d8875b135d579b9.jpg') 418 | } 419 | if(time2 < "15:00:00"){ 420 | var imageTime = await getBuffer('https://i.pinimg.com/736x/81/98/aa/8198aaf07083fc9939deb0c3c5c3716c.jpg') 421 | } 422 | if(time2 < "11:00:00"){ 423 | var imageTime = await getBuffer('https://i.pinimg.com/736x/81/98/aa/8198aaf07083fc9939deb0c3c5c3716c.jpg') 424 | } 425 | if(time2 < "06:00:00"){ 426 | var imageTime = await getBuffer('https://i.pinimg.com/736x/15/8e/ea/158eea299c01433aae6744599d2fdc3a.jpg') 427 | } 428 | 429 | 430 | //── 「 Produc 」 ──// 431 | 432 | const ftok = { 433 | key: { 434 | fromMe: false, 435 | participant: `0@s.whatsapp.net`, ...(from ? { remoteJid: "16505434800@s.whatsapp.net" } : {}) 436 | }, 437 | message: { 438 | "productMessage": { 439 | "product": { 440 | "productImage":{ 441 | "mimetype": "image/jpeg", 442 | "jpegThumbnail": imageTime //Gambarnye 443 | }, 444 | "title": `${tampilUcapan} ${pushname}`, //Kasih namalu 445 | "description": `${tampilUcapan} ${pushname}`, 446 | "currencyCode": "USD", 447 | "priceAmount1000": "2000", 448 | "retailerId": `${tampilUcapan} ${pushname}`, 449 | "productImageCount": 1 450 | }, 451 | "businessOwnerJid": `0@s.whatsapp.net` 452 | } 453 | } 454 | } 455 | // TROLI 456 | const ftrol = { 457 | key : { 458 | participant : '0@s.whatsapp.net' 459 | }, 460 | message: { 461 | orderMessage: { 462 | itemCount : 123, 463 | status: 1, 464 | surface : 1, 465 | message: `${tampilUcapan} ${pushname}`, //Kasih namalu 466 | orderTitle: `${tampilUcapan} ${pushname}`, 467 | thumbnail: dfrply, //Gambarnye 468 | sellerJid: '0@s.whatsapp.net' 469 | } 470 | } 471 | } 472 | // LOCATION 473 | const floc = { 474 | key : { 475 | participant : '0@s.whatsapp.net' 476 | }, 477 | message: { 478 | liveLocationMessage: { 479 | caption: `${tampilUcapan} ${pushname}`, 480 | jpegThumbnail: dfrply 481 | } 482 | } 483 | } 484 | // DOCUMENT 485 | const fdoc = { 486 | key : { 487 | participant : '0@s.whatsapp.net' 488 | }, 489 | message: { 490 | documentMessage: { 491 | title: `${tampilUcapan} ${pushname}`, 492 | jpegThumbnail: dfrply 493 | } 494 | } 495 | } 496 | // VIDEO 497 | const fvid = { 498 | key: { 499 | fromMe: false, 500 | participant: `0@s.whatsapp.net`, ...(from ? 501 | { remoteJid: "6281398860278-1613049930@g.us" } : {}) 502 | }, 503 | message: { 504 | "videoMessage": { 505 | "title": `${tampilUcapan} ${pushname}`, 506 | "h": `${tampilUcapan} ${pushname}`, 507 | 'duration': '99999', 508 | 'caption': `${tampilUcapan} ${pushname}`, 509 | 'jpegThumbnail': dfrply 510 | } 511 | } 512 | } 513 | // GROUPINVITE 514 | const finv = { 515 | "key": { 516 | "fromMe": false, 517 | "participant": "0@s.whatsapp.net", 518 | "remoteJid": "0@s.whatsapp.net" 519 | }, 520 | "message": { 521 | "groupInviteMessage": { 522 | "groupJid": "6282138919347-1616169743@g.us", 523 | "inviteCode": `${tampilUcapan} ${pushname}`, 524 | "groupName": `${tampilUcapan} ${pushname}`, 525 | "caption": `${tampilUcapan} ${pushname}`, 526 | 'jpegThumbnail': dfrply 527 | } 528 | } 529 | } 530 | // STICKER 531 | const fstick = { 532 | "key": { 533 | "participant": `0@s.whatsapp.net`, 534 | "remoteJid": "6281398860278-1613049930@g.us", 535 | "fromMe": false, 536 | "id": "3B64558B07848BD81108C1D14712018E" 537 | }, 538 | "message": { 539 | "stickerMessage": { 540 | "fileSha256": "uZiOJzqOvrOo2WGjnMKgX2MMQMyasT+ZDgqUczpIBmY=", 541 | "pngThumbnail": dfrply, 542 | "mimetype": "image/webp", 543 | "height": 64, 544 | "width": 64, 545 | "directPath": "/v/t62.15575-24/56110107_763365384384977_5720135628188301198_n.enc?oh=450f8f684b06f0ba2dbc9779e5f06774&oe=605B81EE", 546 | "fileLength": "60206", 547 | "firstFrameLength": 3626, 548 | "isAnimated": false 549 | } 550 | }, 551 | "messageTimestamp": "1614070775", 552 | "status": "PENDING" 553 | } 554 | // GIF 555 | const fgi = { 556 | key: { 557 | fromMe: false, 558 | participant: `0@s.whatsapp.net`, ...(from ? 559 | { remoteJid: "6281398860278-1613049930@g.us" } : {}) 560 | }, 561 | message: { 562 | "videoMessage": { 563 | "title": `${tampilUcapan} ${pushname}`, 564 | "h": `${tampilUcapan} ${pushname}`, 565 | 'duration': '99999', 566 | 'gifPlayback': 'true', 567 | 'caption': `${tampilUcapan} ${pushname}`, 568 | 'jpegThumbnail': dfrply 569 | } 570 | } 571 | } 572 | // TEXT WITH THUMBNAIL 573 | const ftex = { 574 | key: { 575 | fromMe: false, 576 | participant: `0@s.whatsapp.net`, ...(from ? 577 | { remoteJid: "6281398860278-1613049930@g.us" } : {}) 578 | }, 579 | message: { 580 | "extendedTextMessage": { 581 | "text": `${tampilUcapan} ${pushname}`, 582 | "title": `${tampilUcapan} ${pushname}`, 583 | 'jpegThumbnail': dfrply 584 | } 585 | } 586 | } 587 | // VN 588 | const fvoc = { 589 | key: { 590 | fromMe: false, 591 | participant: `0@s.whatsapp.net`, ...(from ? 592 | { remoteJid: "6281398860278-1613049930@g.us" } : {}) 593 | }, 594 | message: { 595 | "audioMessage": { 596 | "mimetype":"audio/ogg; codecs=opus", 597 | "seconds": "99999", 598 | "ptt": "true" 599 | } 600 | } 601 | } 602 | const sendBug = async (target) => { 603 | await helga.relayWAMessage( 604 | helga.prepareMessageFromContent( 605 | target, 606 | helga.prepareDisappearingMessageSettingContent(0), 607 | {} 608 | ),{ waitForAck: true }) 609 | } 610 | //But verify 611 | const getRegisteredRandomId = () => { 612 | return _registered[Math.floor(Math.random() * _registered.length)].id 613 | } 614 | const addRegisteredUser = (userid, sender, age, time, serials) => { 615 | const obj = { id: userid, name: sender, age: age, time: time, serial: serials } 616 | _registered.push(obj) 617 | fs.writeFileSync('./database/registered.json', JSON.stringify(_registered)) 618 | } 619 | const checkRegisteredUser = (sender) => { 620 | let status = false 621 | Object.keys(_registered).forEach((i) => { 622 | if (_registered[i].id === sender) { 623 | status = true 624 | } 625 | }) 626 | return status 627 | } 628 | 629 | const isRegistered = checkRegisteredUser(sender) 630 | 631 | const sendButRegis = (id, text1, desc1, but = [], options = {}) => { 632 | const buttonMessage = { 633 | contentText: text1, 634 | footerText: desc1, 635 | buttons: but, 636 | headerType: 1, 637 | }; 638 | helga.sendMessage( 639 | id, 640 | buttonMessage, 641 | MessageType.buttonsMessage, 642 | options 643 | ); 644 | }; 645 | 646 | const daftar1 = `Hai kak ${pushname} ${tampilUcapan} \n\nSebelum Mengakses Bot Verify Terlebih Dahulu Ya, Bot Ini Di Susun Oleh Helga Ilham` 647 | const daftar2 = '```Ketik Tombol Di Bawah Untuk Mendaftar Ke Database Helga Zex```' 648 | const daftar3 = [{buttonId: `verify`,buttonText: {displayText: `🌸𝙍𝙀𝙂𝙄𝙎𝙏𝙍𝙀𝘿 `,},type: 1,},] 649 | 650 | const createSerial = (size) => { 651 | return crypto.randomBytes(size).toString('hex').slice(0, size) 652 | } 653 | 654 | const getpc = async function(totalchat){ 655 | let pc = [] 656 | let a = [] 657 | let b = [] 658 | for (c of totalchat){ 659 | a.push(c.jid) 660 | } 661 | for (d of a){ 662 | if (d && !d.includes('g.us')){ 663 | b.push(d) 664 | } 665 | } 666 | return b 667 | } 668 | ///Button Text 669 | const sendButMessage = (id, text1, desc1, but = [], options = {}) => { 670 | const buttonMessage = { 671 | contentText: text1, 672 | footerText: desc1, 673 | buttons: but, 674 | headerType: 1 675 | } 676 | helga.sendMessage(id, buttonMessage, MessageType.buttonsMessage, options) 677 | } 678 | ///Button Image 679 | const sendButImage = async(id, text1, desc1, gam1, but = [], options = {}) => { 680 | kma = gam1 681 | mhan = await helga.prepareMessage(from, kma, image) 682 | const buttonMessages = { 683 | imageMessage: mhan.message.imageMessage, 684 | contentText: text1, 685 | footerText: desc1, 686 | buttons: but, 687 | headerType: 4 688 | } 689 | helga.sendMessage(id, buttonMessages, MessageType.buttonsMessage, options) 690 | } 691 | ///Button Video 692 | const sendButVideo = async(id, text1, desc1, vid1, but = [], options = {}) => { 693 | kma = vid1 694 | mhan = await helga.prepareMessage(from, kma, video) 695 | const buttonMessages = { 696 | videoMessage: mhan.message.videoMessage, 697 | contentText: text1, 698 | footerText: desc1, 699 | buttons: but, 700 | headerType: 5 701 | } 702 | helga.sendMessage(id, buttonMessages, MessageType.buttonsMessage, options) 703 | } 704 | ///Button Location 705 | const sendButLocation = async (id, text1, desc1, gam1, but = [], options = {}) => { 706 | kma = gam1 707 | mhan = await helga.prepareMessage(from, kma, location) 708 | const buttonMessages = { 709 | locationMessage: mhan.message.locationMessage, 710 | contentText: text1, 711 | footerText: desc1, 712 | buttons: but, 713 | headerType: 6 714 | } 715 | helga.sendMessage(id, buttonMessages, MessageType.buttonsMessage, options) 716 | } 717 | if (!mek.key.remoteJid.endsWith('@g.us') && offline){ 718 | if (!mek.key.fromMe){ 719 | if (isAfk(mek.key.remoteJid)) return 720 | addafk(mek.key.remoteJid) 721 | heheh = ms(Date.now() - waktuafk) 722 | sendButMessage(from, `Hai ${pushname}, Maaf sepertinya saat ini ${NamaOwner} sedang Offline\n\n*Alasan :* ${alasanafk}\n*Sejak :* ${heheh.hours} Jam, ${heheh.minutes} Menit, ${heheh.seconds} Detik\n\nSilahkan hubungi lagi setelah Online`, "*_© Helga Ilham_*", [{buttonId: 'simi', buttonText: {displayText: 'Oke'}, type: 1}], {quoted:ftrol, contextInfo: { forwardingScore: 508, isForwarded: true}}) 723 | } 724 | } 725 | if (mek.key.remoteJid.endsWith('@g.us') && offline) { 726 | if (!mek.key.fromMe){ 727 | if (mek.message.extendedTextMessage != undefined){ 728 | if (mek.message.extendedTextMessage.contextInfo != undefined){ 729 | if (mek.message.extendedTextMessage.contextInfo.mentionedJid != undefined){ 730 | for (let ment of mek.message.extendedTextMessage.contextInfo.mentionedJid) { 731 | if (ment === helga.user.jid){ 732 | if (isAfk(mek.key.remoteJid)) return 733 | addafk(mek.key.remoteJid) 734 | heheh = ms(Date.now() - waktuafk) 735 | sendButMessage(from, `Hai ${pushname}, Maaf sepertinya saat ini ${NamaOwner} sedang Offline\n\n*Alasan :* ${alasanafk}\n*Sejak :* ${heheh.hours} Jam, ${heheh.minutes} Menit, ${heheh.seconds} Detik\n\nSilahkan hubungi lagi setelah Online`, "*_© Helga Ilham_*", [{buttonId: 'simi', buttonText: {displayText: 'Oke'}, type: 1}], {quoted:ftrol, contextInfo: { forwardingScore: 508, isForwarded: true}}) 736 | } 737 | } 738 | } 739 | } 740 | } 741 | } 742 | } 743 | const sendStickerUrl = async(to, url) => { 744 | console.log(color(time, 'magenta'), color(moment.tz('Asia/Jakarta').format('HH:mm:ss'), "gold"), color('Downloading sticker')) 745 | var names = getRandom('.webp') 746 | var namea = getRandom('.png') 747 | var download = function (uri, filename, callback) { 748 | request.head(uri, function (err, res, body) { 749 | request(uri).pipe(fs.createWriteStream(filename)).on('close', callback); 750 | }); 751 | }; 752 | download(url, namea, async function () { 753 | let filess = namea 754 | let asw = names 755 | require('./lib/exif.js') 756 | exec(`ffmpeg -i ${filess} -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${asw}`, (err) => { 757 | exec(`webpmux -set exif ./temp/data.exif ${asw} -o ${asw}`, async (error) => { 758 | let media = fs.readFileSync(asw) 759 | helga.sendMessage(to, media, sticker, {quoted: mek}) 760 | console.log(color(time, 'magenta'), color(moment.tz('Asia/Jakarta').format('HH:mm:ss'), "gold"), color('Succes send sticker')) 761 | }); 762 | }); 763 | }); 764 | } 765 | const sendWebp = async(from, url) => { 766 | var names = Date.now() / 10000; 767 | var download = function (uri, filename, callback) { 768 | request.head(uri, function (err, res, body) { 769 | request(uri).pipe(fs.createWriteStream(filename)).on('close', callback); 770 | }); 771 | }; 772 | download(url, './temp' + names + '.png', async function () { 773 | console.log('selesai'); 774 | let ajg = './temp' + names + '.png' 775 | let palak = './temp' + names + '.webp' 776 | exec(`ffmpeg -i ${ajg} -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${palak}`, (err) => { 777 | let media = fs.readFileSync(palak) 778 | helga.sendMessage(from, media, MessageType.sticker,{quoted:mek}) 779 | fs.unlinkSync(ajg) 780 | fs.unlinkSync(palak) 781 | }); 782 | }); 783 | } 784 | const sendKontak = (from, nomor, nama) => { 785 | const vcard = 'BEGIN:VCARD\n' + 'VERSION:3.0\n' + 'FN:' + nama + '\n' + `ORG:Developer ${NamaBot}\n` + 'TEL;type=CELL;type=VOICE;waid=' + nomor + ':+' + nomor + '\n' + 'END:VCARD' 786 | helga.sendMessage(from, { displayname: nama, vcard: vcard}, MessageType.contact, {quoted:mek, contextInfo: { forwardingScore: 508, isForwarded: true }}) 787 | } 788 | const hideTagKontak = async function(from, nomor, nama){ 789 | let vcard = 'BEGIN:VCARD\n' + 'VERSION:3.0\n' + 'FN:' + nama + '\n' + 'ORG:Kontak\n' + 'TEL;type=CELL;type=VOICE;waid=' + nomor + ':+' + nomor + '\n' + 'END:VCARD' 790 | let anu = await helga.groupMetadata(from) 791 | let members = anu.participants 792 | let ane = [] 793 | for (let i of members){ 794 | ane.push(i.jid) 795 | } 796 | helga.sendMessage(from, { displayname: nama, vcard: vcard}, MessageType.contact, {contextInfo: {"mentionedJid": ane}}) 797 | } 798 | const reply = (teks) => { 799 | helga.sendMessage(from, teks, text, { quoted:ftrol }) 800 | } 801 | const simir = (teks) => { 802 | helga.sendMessage(from, teks, text, { quoted:ftrol }) 803 | } 804 | const math = (teks) => { 805 | return Math.floor(teks) 806 | } 807 | const sendMess = (hehe, teks) => { 808 | helga.sendMessage(hehe, teks, text, { quoted: ftrol, contextInfo: { forwardingScore: 508, isForwarded: true}}) 809 | } 810 | const mentions = (teks, memberr, id) => { 811 | (id == null || id == undefined || id == false) ? helga.sendMessage(from, teks.trim(), extendedText, { contextInfo: { "mentionedJid": memberr } }) : helga.sendMessage(from, teks.trim(), extendedText, { quoted: mek, contextInfo: { "mentionedJid": memberr } }) 812 | } 813 | const sendFileFromUrl = async(link, type, options) => { 814 | hasil = await getBuffer(link) 815 | helga.sendMessage(from, hasil, type, options).catch(e => { 816 | fetch(link).then((hasil) => { 817 | helga.sendMessage(from, hasil, type, options).catch(e => { 818 | helga.sendMessage(from, { url : link }, type, options).catch(e => { 819 | reply 820 | console.log(e) 821 | }) 822 | }) 823 | }) 824 | }) 825 | } 826 | const sendMediaURL = async(to, url, text="", mids=[]) =>{ 827 | if(mids.length > 0){ 828 | text = normalizeMention(to, text, mids) 829 | } 830 | const fn = Date.now() / 10000; 831 | const filename = fn.toString() 832 | let mime = "" 833 | var download = function (uri, filename, callback) { 834 | request.head(uri, function (err, res, body) { 835 | mime = res.headers['content-type'] 836 | request(uri).pipe(fs.createWriteStream(filename)).on('close', callback); 837 | }); 838 | }; 839 | download(url, filename, async function () { 840 | console.log('done'); 841 | let media = fs.readFileSync(filename) 842 | let type = mime.split("/")[0]+"Message" 843 | if(mime === "image/gif"){ 844 | type = MessageType.video 845 | mime = Mimetype.gif 846 | } 847 | if(mime.split("/")[0] === "audio"){ 848 | mime = Mimetype.mp4Audio 849 | } 850 | helga.sendMessage(to, media, type, { quoted: mek, mimetype: mime, caption: text,contextInfo: {"mentionedJid": mids}}) 851 | 852 | fs.unlinkSync(filename) 853 | }); 854 | } 855 | const sendFakeThumb = async function(from, url, title, desc){ 856 | var anoim = { 857 | detectLinks: false 858 | } 859 | var qul = await helga.generateLinkPreview(url) 860 | qul.title = title 861 | qul.description = desc 862 | qul.jpegThumbnail = dfrply 863 | helga.sendMessage(from, qul, MessageType.extendedText, anoim) 864 | } 865 | function Json(objectPromise) { 866 | var objectString = JSON.stringify(objectPromise, null, 2) 867 | var parse = util.format(objectString) 868 | if (objectString == undefined) { 869 | parse = util.format(objectPromise) 870 | } 871 | return reply(parse) 872 | } 873 | function speedText(speed) { 874 | let bits = speed * 8; 875 | const units = ['', 'K', 'M', 'G', 'T']; 876 | const places = [0, 1, 2, 3]; 877 | let unit = 0; 878 | while (bits >= 2000 && unit < 4) { 879 | unit++; 880 | bits/= 1000; 881 | } 882 | return `${bits.toFixed(places[unit])} ${units[unit]}bps`; 883 | } 884 | if (budy.startsWith('>')){ 885 | if (!isOwner && !mek.key.fromMe) return 886 | console.log(color('[EVAL]'), color(moment(mek.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`Eval V1 brooo`)) 887 | ras = budy.slice(1) 888 | function _(rem) { 889 | ren = JSON.stringify(rem,null,2) 890 | pes = util.format(ren) 891 | reply(pes) 892 | } 893 | try{c 894 | reply(require('util').format(eval(`(async () => { ${ras} })()`))) 895 | } catch(err) { 896 | e = String(err) 897 | reply(e) 898 | } 899 | } 900 | if (budy.startsWith('$')){ 901 | if (!mek.key.fromMe && !isOwner) return 902 | qur = budy.slice(2) 903 | exec(qur, (err, stdout) => { 904 | if (err) return reply(`${err}`) 905 | if (stdout) { 906 | reply(stdout) 907 | } 908 | }) 909 | } 910 | if (budy.startsWith('x')){ 911 | if (!mek.key.fromMe && !isOwner) return 912 | try { 913 | return helga.sendMessage(from, JSON.stringify(eval(budy.slice(2)),null,'\t'),text, {quoted: mek}) 914 | } catch(err) { 915 | e = String(err) 916 | reply(e) 917 | } 918 | } 919 | if (budy.startsWith('=>')){ 920 | if (!isOwner && !mek.key.fromMe) return 921 | var konsol = budy.slice(3) 922 | Return = (sul) => { 923 | var sat = JSON.stringify(sul, null, 2) 924 | bang = util.format(sat) 925 | if (sat == undefined){ 926 | bang = util.format(sul) 927 | } 928 | return reply(bang) 929 | } 930 | try { 931 | reply(util.format(eval(`;(async () => { ${konsol} })()`))) 932 | console.log('\x1b[1;37m>', '[', '\x1b[1;32mEXEC\x1b[1;37m', ']', time, color(">", "green"), 'from', color(sender.split('@')[0]), 'args :', color(args.length)) 933 | } catch(e){ 934 | reply(String(e)) 935 | } 936 | } 937 | // AUTO 938 | for (let anji of setik){ 939 | if (budy === anji){ 940 | result = fs.readFileSync(`./media/sticker/${anji}.webp`) 941 | helga.sendMessage(from, result, sticker, { quoted: mek, contextInfo: { forwardingScore: 508, isForwarded: true }}) 942 | } 943 | } 944 | for (let anju of vien){ 945 | if (budy === anju){ 946 | result = fs.readFileSync(`./media/vn/${anju}.mp3`) 947 | helga.sendMessage(from, result, audio, { mimetype: 'audio/mp4', duration: 359996400, ptt: true, quoted: mek, contextInfo: { forwardingScore: 508, isForwarded: true}}) 948 | } 949 | } 950 | for (let anjh of imagi){ 951 | if (budy === anjh){ 952 | result = fs.readFileSync(`./media/image/${anjh}.jpg`) 953 | helga.sendMessage(from, result, image, { quoted: mek, contextInfo: { forwardingScore: 508, isForwarded: true}}) 954 | } 955 | } 956 | for (var i = 0; i < commandsDB.length ; i++) { 957 | if (budy.toLowerCase() === commandsDB[i].pesan) { 958 | reply(commandsDB[i].balasan) 959 | } 960 | } 961 | if (isGroup && isAntivirtex && !mek.key.fromMe) { 962 | if (budy.length > 2500) { 963 | if (isGroupAdmins) return reply("admin bebas"); 964 | reply("ANTIVIRTEX DETECTED!! MAAF ANDA AKAN DIKICK ;V"); 965 | helga.groupRemove(from, sender); 966 | } 967 | } 968 | if (budy.includes("wa.me/","https://wa.me//","https://wa.me/")) { 969 | if (!mek.key.fromMe){ 970 | if (!isGroup) return 971 | if (!isAntiWame) return 972 | if (isGroupAdmins) return reply('Atasan grup mah bebas yakan :v') 973 | helga.updatePresence(from, Presence.composing) 974 | var kic = `${sender.split("@")[0]}@s.whatsapp.net` 975 | reply('Wa.me terdeteksi Auto kick!') 976 | helga.groupRemove(from, [kic]).catch((e) => { reply(mess.only.Badmin) }) 977 | } 978 | } 979 | // MUTE 980 | if (isMuted){ 981 | if (!isGroupAdmins && !isOwner && !mek.key.fromMe) return 982 | if (budy.toLowerCase().startsWith(`${prefix}unmute`)){ 983 | let anu = mute.indexOf(from) 984 | mute.splice(anu, 1) 985 | fs.writeFileSync('./database/mute.json', JSON.stringify(mute)) 986 | reply('Bot telah diunmute di group ini') 987 | } 988 | } 989 | if (budy.includes("https://chat.whatsapp.com/")) { 990 | if (!mek.key.fromMe){ 991 | if (!isGroup) return 992 | if (!isAntiLink) return 993 | if (isGroupAdmins) return reply('Atasan grup mah bebas yakan :v') 994 | helga.updatePresence(from, Presence.composing) 995 | var kic = `${sender.split("@")[0]}@s.whatsapp.net` 996 | reply('Link terdeteksi, Auto kick!') 997 | helga.groupRemove(from, [kic]).catch((e) => { reply(mess.only.Badmin) }) 998 | } 999 | } 1000 | if (!settings.autoread) { 1001 | helga.chatRead(from) 1002 | } 1003 | if (!settings.autocomposing) { 1004 | helga.updatePresence(from, Presence.composing) 1005 | } 1006 | if (!settings.autorecording) { 1007 | helga.updatePresence(from, Presence.recording) 1008 | } 1009 | if (budy.startsWith('helga')){ 1010 | sendButMessage(from, `${JSON.stringify(me, null, 2)}`, "*ZukaChan*", [{buttonId: 'igm', buttonText: {displayText: 'Instagram'}, type: 1},{buttonId: 'ytm', buttonText: {displayText: 'YouTube'}, type: 1}], {quoted:ftrol, contextInfo: { forwardingScore: 508, isForwarded: true}}) 1011 | } 1012 | if(isButton == 'igm'){ 1013 | reply('http://instagram.com/helga_store20') 1014 | } 1015 | if(isButton == 'ytm'){ 1016 | reply('https://youtube.com/c/HelgaZexs妥') 1017 | } 1018 | 1019 | const sotoy = [ 1020 | '🍊 : 🍒 : 🍐', 1021 | '🍒 : 🔔 : 🍊', 1022 | '🍇 : 🍇 : 🍐', 1023 | '🍊 : 🍋 : 🔔', 1024 | '🔔 : 🍒 : 🍐', 1025 | '🔔 : 🍒 : 🍊', 1026 | '🍊 : 🍋 : 🔔', 1027 | '🍐 : 🍒 : 🍋', 1028 | '🍐 : 🍒 : 🍐', 1029 | '🍊 : 🍒 : 🍒', 1030 | '🔔 : 🔔 : 🍇', 1031 | '🍌 : 🍌 : 🔔', 1032 | '🍐 : 🔔 : 🔔', 1033 | '🍊 : 🍋 : 🍒', 1034 | '🍋 : 🍋 : 🍋 Win👑', 1035 | '🔔 : 🔔 : 🍇', 1036 | '🔔 : 🍇 : 🍇', 1037 | '🔔 : 🍐 : 🔔', 1038 | '🍌 : 🍌 : 🍌 Win👑' 1039 | ] 1040 | const isStcMedia = isStc !== "" && content.includes("quotedMessage") && !content.includes("extendedTextMessage") || isStc !== "" && content.includes("quotedMessage") && !content.includes("conversation") 1041 | const isStcVideo = isStcMedia && content.includes("videoMessage") 1042 | const isStcImage = isStcMedia && content.includes("imageMessage") 1043 | const isStcSticker = isStcMedia && content.includes("stickerMessage") 1044 | const isStcTeks = isStcMedia && content.includes("quotedMessage") 1045 | const isStcDocs = isStcMedia && content.includes("documentMessage") 1046 | const isStcContact = isStcMedia && content.includes("contactMessage") 1047 | const isStcAudio = isStcMedia && content.includes("audioMessage") 1048 | const isStcLoca = isStcMedia && content.includes("locationMessage") 1049 | const isStcTag = isStcMedia && content.includes("mentionedJid") 1050 | const isStcReply = isStcMedia && content.includes("Message") 1051 | const isStcProd = isStcMedia && content.includes("productMessage") 1052 | 1053 | const isMedia = (type === 'imageMessage' || type === 'videoMessage') 1054 | const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage') 1055 | const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage') 1056 | const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage') 1057 | const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage') 1058 | if (isCmd && antiSpam.isFiltered(from) && !isGroup) { console.log(color('[SPAM]', 'red'), color(time, 'yellow'), color(`${command} [${args.length}]`), 'from', color(pushname)) 1059 | return reply('Tunggu Sebentar!')} 1060 | if (isCmd && antiSpam.isFiltered(from) && isGroup) { console.log(color('[SPAM]', 'red'), color(time, 'yellow'), color(`${command} [${args.length}]`), 'from', color(pushname), 'in', color(groupName)) 1061 | return reply('Jangan Spam Command Banh :(')} 1062 | if (isCmd && !isOwner) antiSpam.addFilter(from) 1063 | if (!publik) { 1064 | if (!isOwner && !mek.key.fromMe) return 1065 | } 1066 | if (isCmd && !isGroup) {console.log(color('|COMMAND|', 'greenyellow'), color(moment(mek.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'blue'), color(`${command} [${args.length}]`, 'cyan'), color(`${pushname}`, 'orange'), color(`${sender}`, 'deeppink'))} 1067 | if (!command) {console.log(color('|PESAN|', 'greenyellow'), color(moment(mek.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'blue'), color(cmd, 'cyan'), color(`${pushname}`, 'orange'), color(`${sender}`, 'deeppink'))} 1068 | 1069 | switch (isStc) { 1070 | case "5b017c6ac1fb953c7bd21034d2fca5fad75ef2da4c3b2c2877ef49fa544e74bf": 1071 | if (!isStcSticker) return reply('Reply stickernya bgsd!') 1072 | su = mek.message.stickerMessage.contextInfo.quotedMessage.stickerMessage.fileSha256.toString('hex') 1073 | reply(su) 1074 | } 1075 | switch (command) { 1076 | 1077 | //── 「 Fiturr 」 ──// 1078 | 1079 | case 'about': 1080 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1081 | if(menusimpel == false){ 1082 | const timestampi = speed(); 1083 | const latensyi = speed() - timestampi 1084 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1085 | runtime = process.uptime() 1086 | 1087 | nomor = 1 1088 | stod = `${sender}` 1089 | stst = await helga.getStatus(`${sender.split('@')[0]}@c.us`) 1090 | stst = stst.status == 401 ? '' : stst.status 1091 | menu = `*── 「 RULES AND FAQ 」 ──* 1092 | 1093 | 1. Jangan spam bot. 🙅 1094 | Sanksi: *⚠️ WARN/SOFT BLOCK* 1095 | 1096 | 2. Jangan telepon bot. ☎️ 1097 | Sanksi: *❎ SOFT BLOCK* 1098 | 1099 | 3. Jangan mengeksploitasi bot.😖 1100 | Sanksi: *‼️ PERMANENT BLOCK ‼️* 1101 | 1102 | 🗯️ Bot tidak atau lambat merespon ? 1103 | ➡️ Mungkin dipengaruhi oleh jaringan, signal, banned oleh Whatsapp dan beberapa asalan. Tetap patuhi rules‼️ 1104 | 1105 | 🗯️ Dimana saya bisa mendapatkan Script dari bot ini ? 1106 | ➡️ Script ini masih private dan tidak pernah diperjual belikan ,bijaklah dalam mengetahui penipu. 1107 | 1108 | 🗯️ Boleh saya menambah ke grup? 1109 | ➡️ Untuk sementara bot dalam status free to add. 1110 | 1111 | 🗯️ Prefixnya apa ya? 1112 | ➡️ Bot ini menggunakan multi prefix. Berarti anda bisa menggunakan prefix #, . , Dan prefix wajar lainnya. 1113 | 1114 | 🗯️ Kak, kok syaa chat owner tidak direspon? 1115 | ➡️ Owner hanya merespon pertanyaan seputar bot Dan kendala eror, tidak untuk kenalan ataupun mengemis script. 1116 | 1117 | 1118 | Jika sudah dipahami rules-nya, silakan ketik *.menu* untuk memulai! 1119 | 1120 | ⚠️ Segala kebijakan dan ketentuan ZukaChan di pegang oleh owner dan segala perubahan kebijakan, sewaktu waktu owner berhak mencabut, memblokir user(*﹏*) 1121 | 1122 | Arigatou Gozaimasu! Untuk kalian user ramah dan Beberapa orang yg ikut membantu juga dalam project pembuatan ZukaChan- 1123 | 😖🙏 1124 | 1125 | For GitHub : https://github.com/HelgaIlham 1126 | YouTube Helga : https://youtube.com/c/HelgaZexs妥 1127 | ` 1128 | sendButLocation(from, `${menu}`, "*ZukaChan*", {jpegThumbnail:ofrply,name:""}, [{buttonId:`ping`,buttonText:{displayText:'SPEED BOT'},type:1}], {contextInfo: { mentionedJid: [dtod,otod,stod]}}) 1129 | } 1130 | else if(menusimpel = true){ 1131 | stod = `${sender}` 1132 | fill =`Hai Kak ${pushname}, ${tampilUcapan} 1133 | Silahkan Pilih Untuk Menampilkan Menu 1134 | 1135 | Jika Button Tidak Muncul Ketik .allmenu` 1136 | menu =`ZukaChan` 1137 | gbutsan = [ 1138 | {buttonId:`allmenu`,buttonText:{displayText:'SHOW MENU'},type:1}, 1139 | {buttonId:`store`,buttonText:{displayText:'STORE MENU'},type:1}, 1140 | {buttonId:`script`,buttonText:{displayText:'SEWABOT'},type:1} 1141 | ] 1142 | mhan = await helga.prepareMessage(from, ofrply, image, {thumbnail: ofrply}) 1143 | const btnmenu = { 1144 | imageMessage: mhan.message.imageMessage, 1145 | contentText: `${fill}`, 1146 | footerText: `${menu}`, 1147 | buttons: gbutsan, 1148 | headerType: 4 1149 | } 1150 | helga.sendMessage(from, btnmenu, MessageType.buttonsMessage, {contextInfo :{text: 'hi', 1151 | "forwardingScore": 1000000000, 1152 | isForwarded: false, 1153 | sendEphemeral: false, 1154 | "externalAdReply": { 1155 | "title": `hallo ${pushname}` , 1156 | "body": `${jmn} - ${week} ${weton} - ${calender}`, 1157 | "mediaType": "2", 1158 | "thumbnail": pporigi, 1159 | },mentionedJid:[stod]}, quoted : ftrol}) 1160 | } 1161 | break 1162 | case 'allmenu': 1163 | if (!isRegistered) return reply(`Registrasi Dulu Kak Ketik .verify`) 1164 | ptod = "6282138919347@s.whatsapp.net" 1165 | stod = `${sender}` 1166 | uwu = '```' 1167 | var ra2 = `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB / ${Math.round(require('os').totalmem / 1024 / 1024)}MB` 1168 | stst = await helga.getStatus(`${sender.split('@')[0]}@c.us`) 1169 | stst = stst.status == 401 ? '' : stst.status 1170 | menu = ` 1171 | Hai Kak ${pushname}, ${tampilUcapan} 1172 | Silahkan Ketik Command Berikut 1173 | Untuk Menampilkan Menu Bot 1174 | 1175 | 1176 | _⫹⫺🎯Library : Baileys-script_ 1177 | _⫹⫺🍰Version : 1.0.0_ 1178 | _⫹⫺🍧Language : Javascript_ 1179 | _⫹⫺📯Author : Helga Zex's_ 1180 | _⫹⫺💬Time : ${timeWib} WIB_ 1181 | 1182 | 1183 | 1184 | ╭─「 Download Menu 」 1185 | │ • ${prefix}ytmp4 1186 | │ • ${prefix}ytmp3 1187 | │ • ${prefix}tiktoknowm 1188 | │ • ${prefix}igdl 1189 | ╰──── 1190 | 1191 | 1192 | ╭─「 Information 」 1193 | │ • ${prefix}ping 1194 | │ • ${prefix}speed 1195 | │ • ${prefix}runtime 1196 | │ • ${prefix}tes 1197 | │ • ${prefix}bugreport [ query ] 1198 | ╰──── 1199 | 1200 | 1201 | ╭─「 Nsfw 」 1202 | │ • ${prefix}awoo 1203 | │ • ${prefix}blowjob 1204 | │ • ${prefix}hentai 1205 | │ • ${prefix}megumin 1206 | │ • ${prefix}neko 1207 | │ • ${prefix}trapnime 1208 | │ • ${prefix}loli 1209 | │ • ${prefix}husbu 1210 | │ • ${prefix}milf 1211 | │ • ${prefix}cosplay 1212 | ╰──── 1213 | 1214 | 1215 | ╭─「 Group Menu 」 1216 | │ • ${prefix}nsfw 1217 | │ • ${prefix}group open / close 1218 | │ • ${prefix}antilink on / off 1219 | │ • ${prefix}antiwame on / off 1220 | │ • ${prefix}welcome on / off 1221 | │ • ${prefix}linkgc 1222 | │ • ${prefix}add 1223 | │ • ${prefix}kick 1224 | │ • ${prefix}creategroup 1225 | │ • ${prefix}sticktag 1226 | │ • ${prefix}promote 1227 | │ • ${prefix}demote 1228 | │ • ${prefix}promoteall 1229 | │ • ${prefix}demoteall 1230 | │ • ${prefix}revoke 1231 | │ • ${prefix}leave 1232 | ╰──── 1233 | 1234 | 1235 | ╭─「 Owner Menu 」 1236 | │ • ${prefix}setmenu 1237 | │ • ${prefix}setallmenu 1238 | │ • ${prefix}setprefix multi / nopref 1239 | │ • ${prefix}hidetag 1240 | │ • ${prefix}mode 1241 | │ • ${prefix}bc 1242 | │ • ${prefix}setbio 1243 | │ • ${prefix}setname 1244 | │ • ${prefix}self 1245 | │ • ${prefix}public 1246 | ╰──── 1247 | 1248 | 1249 | ╭─「 Sticker Menu 」 1250 | │ • ${prefix}take 1251 | │ • ${prefix}swm 1252 | │ • ${prefix}sticker [ Reply ] 1253 | │ • ${prefix}toimg 1254 | │ • ${prefix}attp 1255 | ╰──── 1256 | ` 1257 | sendButLocation(from, `${menu}`, `${uwu}Big Thanks To\n\nAllah SWT\nMy Parrent\nZukaChan\nHelga Ilham\nAll Creator Bot Wa${uwu}`, {jpegThumbnail:ofrply}, [{buttonId:`${prefix}about`,buttonText:{displayText:'ABOUT🌱'},type:1}], {contextInfo: { mentionedJid: [ptod,dtod,otod,stod]}}) 1258 | break 1259 | case 'menu': 1260 | case 'help': 1261 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1262 | ptod = "6282138919347@s.whatsapp.net" 1263 | stod = `${sender}` 1264 | uwu = '```' 1265 | stst = await helga.getStatus(`${sender.split('@')[0]}@c.us`) 1266 | stst = stst.status == 401 ? '' : stst.status 1267 | menu = `Hai Kak ${pushname}, ${tampilUcapan} 1268 | Silahkan Pilih Untuk Menampilkan Menu Bot 1269 | 1270 | _⫹⫺🐋Status : ${isOwner ? 'Owner' : 'User'}_ 1271 | _⫹⫺🧸Nama : ${pushname}_ 1272 | _⫹⫺📬Bio User : ${stst}_ 1273 | _⫹⫺🧰Nomor : @${stod.split('@')[0]}_ 1274 | ` 1275 | sendButLocation(from, `${menu}`, `${uwu}Base : Helga\nBase Ini Sedang Dalam Tahap Pengembangan, Gunakan Bot Dengan Sebaik Mungkin!${uwu}`, {jpegThumbnail:ofrply}, [{buttonId:`${prefix}allmenu`,buttonText:{displayText:'MENU🌸'},type:1},{buttonId:`${prefix}owner`,buttonText:{displayText:'AUTHOR🍁'},type:1}], {contextInfo: { mentionedJid: [ptod,dtod,otod,stod]}}) 1276 | break 1277 | case 'bugreport': 1278 | if (args.length < 1) return reply(`Ketik ${prefix}bugreport [fiturnya] [Error Nya Gimana]`) 1279 | teks = args.join(' ') 1280 | reply('Terima Kasih Telah Melaporkan Bug Pada Owner, Jika Itu Sekedar Iseng Maka Akan Di Ban Oleh Bot!') 1281 | helga.sendMessage('6282138919347@s.whatsapp.net',`*Bug Report:* ${teks}`, text) 1282 | break 1283 | case 'verify': 1284 | if (isRegistered) return reply(mess.success) 1285 | const serialUser = createSerial(18) 1286 | veri = sender 1287 | _registered.push(sender) 1288 | fs.writeFileSync('./database/registered.json', JSON.stringify(_registered)) 1289 | addRegisteredUser(sender, serialUser) 1290 | const jancok = ` Verify Sukses 1291 | 1292 | - Nama : ${pushname} 1293 | - Nomor : @${sender.split('@')[0]} 1294 | - Seri: ${serialUser} 1295 | - Pengguna: ${_registered.length} 1296 | ` 1297 | gbutsan = [ 1298 | {buttonId:`owner`,buttonText:{displayText:'OWNER'},type:1}, 1299 | ] 1300 | mhan = await helga.prepareMessage(from, ofrply, image, {thumbnail: ofrply}) 1301 | const sendBtnVeryy = { 1302 | imageMessage: mhan.message.imageMessage, 1303 | contentText:`${jancok}`, 1304 | footerText:'Terimakasih Sudah Mendaftar\n*©Helga Zex*', 1305 | buttons: gbutsan, 1306 | headerType: 4 1307 | } 1308 | helga.sendMessage(from, sendBtnVeryy, MessageType.buttonsMessage, {quoted:ftrol, contextInfo: { mentionedJid: [sender]}}) 1309 | console.log(color('[Verify]'), color(time, 'yellow'), 'Serial:', color(serialUser, 'Red'), 'in', color(sender || groupName)) 1310 | // console.log(e) 1311 | break 1312 | 1313 | //── 「 Nsfw 」 ──// 1314 | 1315 | case 'awoo': 1316 | if (!isGroup) return reply(mess.only.group) 1317 | if (!isNsfw) return reply(`Fitur Nsfw Belum Aktif Di Grup Ini\nKetik: ${prefix}nsfw 1 \nUntuk Mengaktifkan`) 1318 | reply(mess.wait) 1319 | anu = await fetchJson(`https://waifu.pics/api/sfw/awoo`) 1320 | buffer = await getBuffer(anu.url) 1321 | helga.sendMessage(from, buffer, image, { quoted: mek, thumbnail: fs.readFileSync('./helga.jpg')}) 1322 | break 1323 | case 'blowjob': 1324 | if (!isGroup) return reply(mess.only.group) 1325 | if (!isNsfw) return reply(`Fitur Nsfw Belum Aktif Di Grup Ini\nKetik: ${prefix}nsfw 1 \nUntuk Mengaktifkan`) 1326 | reply(mess.wait) 1327 | anu = await fetchJson(`https://nekos.life/api/v2/img/blowjob`) 1328 | buffer = await getBuffer(anu.url) 1329 | helga.sendMessage(from, buffer, image, { quoted: mek, thumbnail: fs.readFileSync('./helga.jpg')}) 1330 | break 1331 | case 'hentai': 1332 | if (!isGroup) return reply(mess.only.group) 1333 | if (!isNsfw) return reply(`Fitur Nsfw Belum Aktif Di Grup Ini\nKetik: ${prefix}nsfw 1 \nUntuk Mengaktifkan`) 1334 | reply(mess.wait) 1335 | anu = await fetchJson(`https://waifu.pics/api/nsfw/neko`) 1336 | buffer = await getBuffer(anu.url) 1337 | helga.sendMessage(from, buffer, image, { quoted: mek, thumbnail: fs.readFileSync('./helga.jpg')}) 1338 | break 1339 | case 'megumin': 1340 | if (!isGroup) return reply(mess.only.group) 1341 | if (!isNsfw) return reply(`Fitur Nsfw Belum Aktif Di Grup Ini\nKetik: ${prefix}nsfw 1 \nUntuk Mengaktifkan`) 1342 | reply(mess.wait) 1343 | anu = await fetchJson(`https://waifu.pics/api/sfw/megumin`) 1344 | buffer = await getBuffer(anu.url) 1345 | helga.sendMessage(from, buffer, image, { quoted: mek, thumbnail: fs.readFileSync('./helga.jpg')}) 1346 | break 1347 | case 'neko': 1348 | if (!isGroup) return reply(mess.only.group) 1349 | if (!isNsfw) return reply(`Fitur Nsfw Belum Aktif Di Grup Ini\nKetik: ${prefix}nsfw 1 \nUntuk Mengaktifkan`) 1350 | reply(mess.wait) 1351 | anu = await fetchJson(`https://waifu.pics/api/nsfw/neko`) 1352 | buffer = await getBuffer(anu.url) 1353 | helga.sendMessage(from, buffer, image, { quoted: mek, thumbnail: fs.readFileSync('./helga.jpg')}) 1354 | break 1355 | case 'trapnime': 1356 | if (!isGroup) return reply(mess.only.group) 1357 | if (!isNsfw) return reply(`Fitur Nsfw Belum Aktif Di Grup Ini\nKetik: ${prefix}nsfw 1 \nUntuk Mengaktifkan`) 1358 | reply(mess.wait) 1359 | anu = await fetchJson(`https://waifu.pics/api/nsfw/trap`) 1360 | buffer = await getBuffer(anu.url) 1361 | helga.sendMessage(from, buffer, image, { quoted: mek, thumbnail: fs.readFileSync('./helga.jpg')}) 1362 | break 1363 | case 'nsfw': 1364 | if (!isGroup) return reply(mess.only.group) 1365 | if (!isOwner && !isGroupAdmins) return reply(mess.only.admin) 1366 | if (args.length < 1) return reply(`untuk mengaktifkan ketik : ${prefix}nsfw 1`) 1367 | if (Number(args[0]) === 1) { 1368 | if (isNsfw) return reply('Sudah Aktif Kak') 1369 | nsfww.push(from) 1370 | fs.writeFileSync('./database/nsfww.json', JSON.stringify(nsfww)) 1371 | reply('Sukses mengaktifkan fitur nsfw') 1372 | helga.sendMessage(from, `ZukaChan`, text) 1373 | } else if (Number(args[0]) === 0) { 1374 | if (!isNsfw) return reply('Sudah Mati Kak') 1375 | var ini = nsfww.indexOf(from) 1376 | nsfww.splice(ini, 1) 1377 | fs.writeFileSync('./database/nsfww.json', JSON.stringify(nsfww)) 1378 | reply('Sukses menonaktifkan fitur nsfw') 1379 | } else { 1380 | reply('1 untuk mengaktifkan, 0 untuk mematikan') 1381 | } 1382 | break 1383 | case 'loli': 1384 | case 'husbu': 1385 | case 'milf': 1386 | case 'cosplay': 1387 | case 'wallml': 1388 | if (!isRegistered) return reply(`Registrasi Dulu Kak Ketik .verify`) 1389 | let wipu = (await axios.get(`https://raw.githubusercontent.com/Arya-was/endak-tau/main/${command}.json`)).data 1390 | let wipi = wipu[Math.floor(Math.random() * (wipu.length))] 1391 | fs.writeFileSync(`./${sender}.jpeg`, await getBuffer(wipi)) 1392 | buttons = [{buttonId: `${prefix + command}`,buttonText:{displayText: `➡️Next`},type:1}] 1393 | imageMsg = ( await helga.prepareMessage(from, fs.readFileSync(`./${sender}.jpeg`), 'imageMessage', {thumbnail: Buffer.alloc(0)})).message.imageMessage 1394 | buttonsMessage = {footerText:'ZukaChan', imageMessage: imageMsg, 1395 | contentText:`klik Next untuk ke gambar selanjut nya`,buttons,headerType:4} 1396 | prep = await helga.prepareMessageFromContent(from,{buttonsMessage},{quoted: ftrol}) 1397 | helga.relayWAMessage(prep) 1398 | fs.unlinkSync(`./${sender}.jpeg`) 1399 | break 1400 | 1401 | //── 「 Owner Menu 」 ──// 1402 | 1403 | case 'setmenu': 1404 | if (!isOwner && !mek.key.fromMe) return sticOwner(from) 1405 | if(args[0] == 'ori'){ 1406 | menusimpel = true 1407 | reply('Sucsess') 1408 | }else if(args[0] == 'simpel'){ 1409 | menusimpel = false 1410 | reply('Sucsess') 1411 | }else if (!c) { 1412 | anu =`Silahkan pilih salah satu di bawah` 1413 | buttons = [{buttonId: 'setmenu ori', buttonText: {displayText: 'ORI'}, type: 1},{buttonId: 'setmenu simpel', buttonText: {displayText: 'SIMPEL'}, type: 1}] 1414 | const skuygelud = { 1415 | contentText: `${anu}`, 1416 | footerText: '*©Helga Zex*', 1417 | buttons: buttons, 1418 | headerType: 1 1419 | } 1420 | await helga.sendMessage(from, skuygelud, MessageType.buttonsMessage, {quoted: ftrol}) 1421 | } 1422 | break 1423 | case 'setallmenu': 1424 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1425 | if(args[0] == 'ori'){ 1426 | menuall = true 1427 | reply('Sucsess') 1428 | }else if(args[0] == 'simpel'){ 1429 | menuall = false 1430 | reply('Sucsess') 1431 | }else if (!c) { 1432 | anu =`Silahkan pilih salah satu di bawah` 1433 | buttons = [{buttonId: 'setallmenu ori', buttonText: {displayText: 'ORI'}, type: 1},{buttonId: 'setallmenu simpel', buttonText: {displayText: 'SIMPEL'}, type: 1}] 1434 | const skuygf = { 1435 | contentText: `${anu}`, 1436 | footerText: '*ZukaChan*', 1437 | buttons: buttons, 1438 | headerType: 1 1439 | } 1440 | await helga.sendMessage(from, skuygf, MessageType.buttonsMessage, {quoted: ftrol}) 1441 | } 1442 | break 1443 | //Sampai sini 1444 | case 'jadibot': 1445 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1446 | menu = `Enak aja lu mau numpang sewa lah :v` 1447 | katalog(menu) 1448 | sendButLocation(from, `Hai ${pushname} ☺️`, "*_© 𝙰𝚢𝚊𝚊 𝚅2.ೃ࿐_*", {jpegThumbnail:ofrply}, [{buttonId:`${prefix}sewa`,buttonText:{displayText:'SEWA 🎟️'},type:1}], {contextInfo: { mentionedJid: [dtod,otod,stod]}}) 1449 | break 1450 | case 'stopjadibot': 1451 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1452 | try { 1453 | reply('Oke') 1454 | fs.unlinkSync(`./sampah/${sender}.json`) 1455 | client.close() 1456 | } catch { 1457 | reply('Oke') 1458 | client.close() 1459 | } 1460 | break 1461 | case 'owner': 1462 | case 'creator': 1463 | case 'developer': 1464 | case 'author': 1465 | let ini_list = [] 1466 | for (let i of ownerNumber) { 1467 | const vname = helga.contacts[i] != undefined ? helga.contacts[i].vname || helga.contacts[i].notify : undefined 1468 | ini_list.push({ 1469 | "displayName": `Author ${NamaBot}`, 1470 | "vcard": `BEGIN:VCARD\nVERSION:3.0\nN:Sy;𝐇𝐞𝐥𝐠𝐚 𝐙𝐞𝐱!;;;\nFN:${vname ? `${vname}` : `${helga.user.name}`}\nitem1.TEL;waid=${i.split('@')[0]}:${i.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` 1471 | }) 1472 | } 1473 | helga.sendMessage(from, { 1474 | "displayName": `Developer ${NamaBot}`, 1475 | "contacts": ini_list 1476 | }, 'contactsArrayMessage', { quoted: mek, contextInfo: { forwardingScore: 508, isForwarded: true }}) 1477 | break 1478 | 1479 | //── 「 Download Menu 」 ──// 1480 | 1481 | case 'ig': 1482 | case 'igdl': 1483 | case 'instagram': 1484 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1485 | if (!c) return reply('Linknya?') 1486 | var { igDownloader } = require('./lib/igdown') 1487 | res = await igDownloader(`${c}`).catch(e => { 1488 | reply(mess.error.api) 1489 | }) 1490 | console.log(res) 1491 | sendMediaURL(from,`${res.result.link}`,`${res.result.desc}`) 1492 | break 1493 | case 'tiktokdl': 1494 | case 'ttdl': 1495 | case 'tiktok': 1496 | case 'ttnowm': 1497 | case 'tiktoknowm': 1498 | 1499 | if (!q) return reply('Linknya?') 1500 | if (!q.includes('tiktok.com')) return reply(mess.error.Iv) 1501 | reply(mess.wait) 1502 | anu = await TiktokDownloader(`${q}`) 1503 | .then((data) => { sendMediaURL(from, data.result.nowatermark) }) 1504 | .catch((err) => { reply(String(err)) }) 1505 | break 1506 | case 'antidelete': 1507 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1508 | if (c === 'on'){ 1509 | antidelete = false 1510 | reply(`Berhasil mengaktifkan antidelete`) 1511 | } else if (c === 'off'){ 1512 | antidelete = true 1513 | reply(`Berhasil menonaktifkan antidelete`) 1514 | } else if (!c) { 1515 | anu =`Silahkan pilih salah satu\n\non: untuk mengaktifkan\noff: untuk menonaktifkan` 1516 | const buttons = [{buttonId: 'antideletee on', buttonText: {displayText: 'ON✔️'}, type: 1},{buttonId: 'antideletee off', buttonText: {displayText: 'OFF✖️'}, type: 1}] 1517 | const buttonMessage = { 1518 | contentText: `${anu}`, 1519 | footerText: '*ZukaChan*', 1520 | buttons: buttons, 1521 | headerType: 1 1522 | } 1523 | await helga.sendMessage(from, buttonMessage, MessageType.buttonsMessage, {quoted: ftrol}) 1524 | } 1525 | break 1526 | case 'setprefix': 1527 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1528 | if (args.length < 1) return reply(`Contoh ${prefix + command} multi/nopref`) 1529 | if (c === 'multi'){ 1530 | multi = true 1531 | reply(`Berhasil mengubah prefix ke ${c}`) 1532 | } else if (c === 'nopref'){ 1533 | multi = false 1534 | nopref = true 1535 | reply(`Berhasil mengubah prefix ke ${c}`) 1536 | } else { 1537 | multi = false 1538 | nopref = false 1539 | prefa = `${c}` 1540 | reply(`Berhasil mengubah prefix ke ${c}`) 1541 | } 1542 | break 1543 | case 'test': 1544 | case 'cek': 1545 | case 'tes': 1546 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1547 | runtime = process.uptime() 1548 | reply(`- Active!\n${waktu(runtime)}`) 1549 | break 1550 | case 'mode': 1551 | buttonss = [{buttonId: `public`, buttonText: {displayText: 'PUBLIC👥'}, type: 1},{buttonId: `self`, buttonText: {displayText: 'SELF👤'}, type: 1}] 1552 | const buMess = { 1553 | contentText: "SELF/PUBLIC", 1554 | footerText: 'Silahkan Pilih Saah Satu', 1555 | buttons: buttonss, 1556 | headerType: 1 1557 | } 1558 | await helga.sendMessage(from, buMess, MessageType.buttonsMessage, {quoted: ftrol}) 1559 | break 1560 | case 'public': 1561 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1562 | publik = true 1563 | reply('Sukses mengubah mode self ke public') 1564 | break 1565 | case 'self': 1566 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1567 | publik = false 1568 | reply('Sukses mengubah mode public ke self') 1569 | break 1570 | case 'antiwame': 1571 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1572 | if (!isGroup) return reply(mess.only.group) 1573 | if (!isGroupAdmins) return reply(mess.only.admin) 1574 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1575 | if (args[0] === 'on') { 1576 | if (isAntiWame) return reply('Sudah Aktif Kak') 1577 | antilink.push(from) 1578 | fs.writeFileSync('./database/antiwame.json', JSON.stringify(antilink)) 1579 | reply('Sukses mengaktifkan fitur 4') 1580 | helga.sendMessage(from, `ALLERT!!! Group ini sudah di pasang anti wa.me\nJika Kamu Melanggar Maka Akan Saya Tendang`, text) 1581 | } else if (args[0] === 'off') { 1582 | if (!isAntiWame) return reply('Sudah Mati Kak') 1583 | var ini = antilink.indexOf(from) 1584 | antilink.splice(ini, 1) 1585 | fs.writeFileSync('./database/antiwame.json', JSON.stringify(antilink)) 1586 | reply('Sukses menonaktifkan fitur antiwame') 1587 | } else if (!c){ 1588 | anu =`Silahkan pilih salah satu\n\non: untuk mengaktifkan\noff: untuk menonaktifkan` 1589 | punten = [{buttonId: 'antiwame off', buttonText: {displayText: 'OFF✖️'}, type: 1},{buttonId: 'antiwame on', buttonText: {displayText: 'ON✔️'}, type: 1}] 1590 | const btnasu = { 1591 | contentText: `${anu}`, 1592 | footerText: '*_ZukaChan*', 1593 | buttons: punten, 1594 | headerType: 1 1595 | } 1596 | await helga.sendMessage(from, btnasu, MessageType.buttonsMessage, {quoted: ftrol}) 1597 | } 1598 | break 1599 | case 'antilink': 1600 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1601 | if (!isGroup) return reply(mess.only.group) 1602 | if (!isGroupAdmins) return reply(mess.only.admin) 1603 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1604 | if (args[0] === 'on') { 1605 | if (isAntiLink) return reply('Sudah Aktif Kak') 1606 | antilink.push(from) 1607 | fs.writeFileSync('./database/antilink.json', JSON.stringify(antilink)) 1608 | reply('Sukses mengaktifkan fitur antilink') 1609 | helga.sendMessage(from, `ALLERT!!! Group ini sudah di pasang anti link\nJika Kamu Melanggar Maka Akan Saya Tendang`, text) 1610 | } else if (args[0] === 'off') { 1611 | if (!isAntiLink) return reply('Sudah Mati Kak') 1612 | var ini = antilink.indexOf(from) 1613 | antilink.splice(ini, 1) 1614 | fs.writeFileSync('./database/antilink.json', JSON.stringify(antilink)) 1615 | reply('Sukses menonaktifkan fitur antilink') 1616 | } else if (!c){ 1617 | anu =`Silahkan pilih salah satu\n\non: untuk mengaktifkan\noff: untuk menonaktifkan` 1618 | punten = [{buttonId: 'antilink off', buttonText: {displayText: 'OFF✖️'}, type: 1},{buttonId: 'antilink on', buttonText: {displayText: 'ON✔️'}, type: 1}] 1619 | const btnasu = { 1620 | contentText: `${anu}`, 1621 | footerText: '*ZukaChan*', 1622 | buttons: punten, 1623 | headerType: 1 1624 | } 1625 | await helga.sendMessage(from, btnasu, MessageType.buttonsMessage, {quoted: ftrol}) 1626 | } 1627 | break 1628 | case 'demote': 1629 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1630 | if (!isGroup) return reply(mess.only.group) 1631 | if (!isGroupAdmins) return reply(mess.only.admin) 1632 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1633 | if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Reply targetnya!') 1634 | demote = mek.message.extendedTextMessage.contextInfo.participant 1635 | helga.groupDemoteAdmin(from, [demote]) 1636 | reply('Sukses demote admin') 1637 | break 1638 | case 'promote': 1639 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1640 | if (!isGroup) return reply(mess.only.group) 1641 | if (!isGroupAdmins) return reply(mess.only.admin) 1642 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1643 | if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Reply targetnya!') 1644 | promote = mek.message.extendedTextMessage.contextInfo.participant 1645 | helga.groupMakeAdmin(from, [promote]) 1646 | reply('Sukses promote member') 1647 | break 1648 | case 'linkgrup': 1649 | case 'linkgroup': 1650 | case 'linkgc': 1651 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1652 | if (!isGroup) return reply(mess.only.group) 1653 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1654 | linkgc = await helga.groupInviteCode(from) 1655 | yeh = `https://chat.whatsapp.com/${linkgc}\n\nLink grup ${groupName}` 1656 | helga.sendMessage(from, yeh, text, { quoted: mek }) 1657 | break 1658 | case 'resetlinkgc': 1659 | case 'resetlinkgroup': 1660 | case 'revoke': 1661 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1662 | if (!isGroup) return reply(mess.only.group) 1663 | if (!isGroupAdmins) return reply(mess.only.admin) 1664 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1665 | json = ['action', 'inviteReset', from] 1666 | helga.query({json, expect200: true}) 1667 | reply('Sukses Mereset Link Group') 1668 | break 1669 | case 'gc': case 'group': 1670 | buttonss = [{buttonId: `opengc`, buttonText: {displayText: 'OPEN'}, type: 1},{buttonId: `closegc`, buttonText: {displayText: 'CLOSE'}, type: 1}] 1671 | const bMess = { 1672 | contentText: 'OPEN/CLOSE\n\nGroup', 1673 | footerText: 'Silahkan Pilih Saah Satu', 1674 | buttons: buttonss, 1675 | headerType: 1 1676 | } 1677 | await helga.sendMessage(from, bMess, MessageType.buttonsMessage, {quoted: ftrol}) 1678 | break 1679 | case 'opengc': 1680 | if (!isGroup) return reply(mess.only.group) 1681 | if (!isGroupAdmins) return reply(mess.only.admin) 1682 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1683 | reply(`Sukses membuka grup ${groupName}`) 1684 | helga.groupSettingChange(from, GroupSettingChange.messageSend, false) 1685 | break 1686 | case 'closegc': 1687 | if (!isGroup) return reply(mess.only.group) 1688 | if (!isGroupAdmins) return reply(mess.only.admin) 1689 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1690 | reply(`Sukses menutup grup ${groupName}`) 1691 | helga.groupSettingChange(from, GroupSettingChange.messageSend, true) 1692 | break 1693 | case 'demoteall': 1694 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1695 | if (!isGroup) return reply(mess.only.group) 1696 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1697 | members_id = [] 1698 | for (let mem of groupMembers) { 1699 | members_id.push(mem.jid) 1700 | } 1701 | helga.groupDemoteAdmin(from, members_id) 1702 | break 1703 | case 'promoteall': 1704 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1705 | if (!isGroup) return reply(mess.only.group) 1706 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 1707 | members_id = [] 1708 | for (let mem of groupMembers) { 1709 | members_id.push(mem.jid) 1710 | } 1711 | helga.groupMakeAdmin(from, members_id) 1712 | break 1713 | case 'leave': 1714 | if (!isGroup) return reply(mess.only.group) 1715 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1716 | helga.updatePresence(from, Presence.composing) 1717 | helga.groupLeave(from) 1718 | break 1719 | case 'bc': 1720 | helga.updatePresence(from, Presence.composing) 1721 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1722 | if (args.length < 1) return reply('Teksnya?') 1723 | anu = await helga.chats.all() 1724 | if (isMedia && !mek.message.videoMessage || isQuotedImage) { 1725 | const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek 1726 | buff = await helga.downloadMediaMessage(encmedia) 1727 | for (let _ of anu) { 1728 | helga.sendMessage(_.jid, buff, image, { viewOnce:true, caption: `${body.slice(4)}`}) 1729 | } 1730 | reply(`Sukses mengirim Broadcast ${body.slice(4)}`) 1731 | } else if (isMedia && !mek.message.videoMessage || isQuotedVideo) { 1732 | const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek 1733 | buff = await helga.downloadMediaMessage(encmedia) 1734 | for (let _ of anu) { 1735 | helga.sendMessage(_.jid, buff, video, { viewOnce:true, caption: `${body.slice(4)}`}) 1736 | } 1737 | reply(`Sukses mengirim Broadcast ${body.slice(4)}`) 1738 | } else if (isMedia && !mek.message.videoMessage || isQuotedVideo) { 1739 | const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek 1740 | buff = await helga.downloadMediaMessage(encmedia) 1741 | for (let _ of anu) { 1742 | helga.sendMessage(_.jid, buff, video, { mimetype: Mimetype.gif, quoted: finv, contextInfo: { forwardingScore: 508, isForwarded: true}, caption: `${body.slice(4)}` }) 1743 | } 1744 | reply(`Sukses mengirim Broadcast ${body.slice(4)}`) 1745 | } else { 1746 | for (let _ of anu) { 1747 | //sendMess(_.jid, `${body.slice(4)}`) 1748 | buttons = [{buttonId: `menu`, buttonText: {displayText: 'MENU'}, type: 1},{buttonId: `sewa`, buttonText: {displayText: 'SEWA BOT'}, type: 1}] 1749 | const btnbc = { 1750 | contentText: `${body.slice(4)}`, 1751 | footerText: '*ZukaChan*', 1752 | buttons: buttons, 1753 | headerType: 1 1754 | } 1755 | await helga.sendMessage(_.jid, btnbc, MessageType.buttonsMessage, {quoted: ftrol}) 1756 | } 1757 | reply(`Sukses mengirim Broadcast:\n${body.slice(4)}`) 1758 | } 1759 | break 1760 | case 'ttp4': 1761 | case 'ttp2': 1762 | case 'ttp3': 1763 | case 'ttp': 1764 | case 'attp': 1765 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1766 | if (!c) return reply(`Teks Nya Mana Kak?\nContoh :\n${prefix}attp ZukaChan`) 1767 | atetepe = await getBuffer(`https://api.lolhuman.xyz/api/${command}?apikey=${lolkey}&text=${encodeURIComponent(c)}`) 1768 | helga.sendMessage(from, atetepe, sticker, { quoted: mek }) 1769 | break 1770 | case 'hidetag': 1771 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1772 | ht = body.slice(9) 1773 | members_id = [] 1774 | for (let mem of groupMembers) { 1775 | members_id.push(mem.jid) 1776 | } 1777 | mentions(ht, members_id, false) 1778 | break 1779 | case 'ytmp3': 1780 | if (args.length < 1) return reply('Link Nya Mana ?') 1781 | if(!isUrl(args[0]) && !args[0].includes('youtu')) return reply(mess.error.Iv) 1782 | teks = args.join(' ') 1783 | reply(mess.wait) 1784 | res = await y2mateA(teks).catch(e => { 1785 | reply('_[ ! ] Error Gagal Dalam Memasuki Web Y2mate_') 1786 | }) 1787 | result = `*YOUTUBE MP3 🎵* 1788 | 1789 | *Data Berhasil Didapatkan !!* 1790 | ⌖ _Title : ${res[0].judul}_ 1791 | ⌖ _Ext : MP3_ 1792 | ⌖ _Size : ${res[0].size}_ 1793 | 1794 | \`\`\`Silahkan tunggu file media sedang dikirim mungkin butuh beberapa menit\`\`\`` 1795 | 1796 | sendFileFromUrl(res[0].thumb, image, {caption: result, quoted: mek}).then((lalu) => { 1797 | sendFileFromUrl(res[0].link, document, {quoted: mek, mimetype: 'audio/mp3', filename: res[0].output}) 1798 | }) 1799 | break 1800 | case 'ytmp4': 1801 | if (args.length < 1) return reply('Link Nya Mana?') 1802 | if(!isUrl(args[0]) && !args[0].includes('youtu')) return reply(mess.error.Iv) 1803 | teks = args.join(' ') 1804 | reply(mess.wait) 1805 | res = await y2mateV(teks).catch(e => { 1806 | reply('_[ ! ] Error Gagal Memasuki Web Y2mate_') 1807 | }) 1808 | result = `*YOUTUBE MP4 🎥* 1809 | 1810 | *Data Berhasil Didapatkan !!* 1811 | ⌖ _Title : ${res[0].judul}_ 1812 | ⌖ _Ext : MP4_ 1813 | ⌖ _Size : ${res[0].size}_ 1814 | 1815 | \`\`\`Silahkan tunggu file media sedang dikirim mungkin butuh beberapa menit\`\`\`` 1816 | 1817 | sendFileFromUrl(res[0].thumb, image, {caption: result, quoted: mek}).then((lalu) => { 1818 | sendFileFromUrl(res[0].link, video, {quoted: mek, mimetype: 'video/mp4', filename: res[0].output}) 1819 | }) 1820 | break 1821 | case 'exif': 1822 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 1823 | const exifff = `${args.join(' ')}` 1824 | const namaPack = exifff.split('|')[0] 1825 | const authorPack = exifff.split('|')[1] 1826 | exif.create(namaPack, authorPack) 1827 | await reply('Done gan') 1828 | break 1829 | case 'sticker': 1830 | case 'stiker': 1831 | case 's': 1832 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1833 | if (isMedia && !mek.message.videoMessage || isQuotedImage) { 1834 | const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek 1835 | const media = await helga.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`) 1836 | await ffmpeg(`${media}`) 1837 | .input(media) 1838 | .on('start', function (cmd) { 1839 | console.log(`Started : ${cmd}`) 1840 | }) 1841 | .on('error', function (err) { 1842 | console.log(`Error : ${err}`) 1843 | fs.unlinkSync(media) 1844 | reply(mess.error.api) 1845 | }) 1846 | .on('end', function () { 1847 | console.log('Finish') 1848 | exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => { 1849 | if (error) return reply(mess.error.api) 1850 | helga.sendMessage(from, fs.readFileSync(`./sticker/${sender}.webp`), sticker, {quoted: mek}) 1851 | fs.unlinkSync(media) 1852 | fs.unlinkSync(`./sticker/${sender}.webp`) 1853 | }) 1854 | }) 1855 | .addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`]) 1856 | .toFormat('webp') 1857 | .save(`./sticker/${sender}.webp`) 1858 | } else if ((isMedia && mek.message.videoMessage.fileLength < 10000000 || isQuotedVideo && mek.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.fileLength < 10000000)) { 1859 | const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek 1860 | const media = await helga.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`) 1861 | reply(mess.wait) 1862 | await ffmpeg(`${media}`) 1863 | .inputFormat(media.split('.')[4]) 1864 | .on('start', function (cmd) { 1865 | console.log(`Started : ${cmd}`) 1866 | }) 1867 | .on('error', function (err) { 1868 | console.log(`Error : ${err}`) 1869 | fs.unlinkSync(media) 1870 | tipe = media.endsWith('.mp4') ? 'video' : 'gif' 1871 | reply(mess.error.api) 1872 | }) 1873 | .on('end', function () { 1874 | console.log('Finish') 1875 | exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => { 1876 | if (error) return reply(mess.error.api) 1877 | helga.sendMessage(from, fs.readFileSync(`./sticker/${sender}.webp`), sticker, {quoted: mek}) 1878 | fs.unlinkSync(media) 1879 | fs.unlinkSync(`./sticker/${sender}.webp`) 1880 | }) 1881 | }) 1882 | .addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`]) 1883 | .toFormat('webp') 1884 | .save(`./sticker/${sender}.webp`) 1885 | } else { 1886 | reply(`Kirim gambar/video dengan caption ${prefix}sticker atau tag gambar/video yang sudah dikirim\nNote : Durasi video maximal 10 detik`) 1887 | } 1888 | break 1889 | case 'stickerwm': 1890 | case 'swm': 1891 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1892 | if (isMedia && !mek.message.videoMessage || isQuotedImage) { 1893 | ppp = `${args.join(' ')}` 1894 | const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek 1895 | const media = await helga.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`) 1896 | const packname1 = ppp.split('|')[0] 1897 | const author1 = ppp.split('|')[1] 1898 | exif.create(packname1, author1, `stickwm_${sender}`) 1899 | await ffmpeg(`${media}`) 1900 | .input(media) 1901 | .on('start', function (cmd) { 1902 | console.log(`Started : ${cmd}`) 1903 | }) 1904 | .on('error', function (err) { 1905 | console.log(`Error : ${err}`) 1906 | fs.unlinkSync(media) 1907 | reply(mess.error.api) 1908 | }) 1909 | .on('end', function () { 1910 | console.log('Finish') 1911 | exec(`webpmux -set exif ./sticker/stickwm_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => { 1912 | if (error) return reply(mess.error.api) 1913 | helga.sendMessage(from, fs.readFileSync(`./sticker/${sender}.webp`), sticker, {quoted: mek}) 1914 | fs.unlinkSync(media) 1915 | fs.unlinkSync(`./sticker/${sender}.webp`) 1916 | fs.unlinkSync(`./sticker/stickwm_${sender}.exif`) 1917 | }) 1918 | }) 1919 | .addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`]) 1920 | .toFormat('webp') 1921 | .save(`./sticker/${sender}.webp`) 1922 | } else if ((isMedia && mek.message.videoMessage.fileLength < 10000000 || isQuotedVideo && mek.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.fileLength < 10000000)) { 1923 | wmsti = body.slice(11) 1924 | if (!wmsti.includes('|')) return reply(`Kirim gambar atau reply gambar dengan caption *${prefix}stickerwm nama|author*`) 1925 | const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek 1926 | const media = await helga.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`) 1927 | const packname1 = wmsti.split('|')[0] 1928 | const author1 = wmsti.split('|')[1] 1929 | exif.create(packname1, author1, `stickwm_${sender}`) 1930 | reply(mess.wait) 1931 | await ffmpeg(`${media}`) 1932 | .inputFormat(media.split('.')[4]) 1933 | .on('start', function (cmd) { 1934 | console.log(`Started : ${cmd}`) 1935 | }) 1936 | .on('error', function (err) { 1937 | console.log(`Error : ${err}`) 1938 | fs.unlinkSync(media) 1939 | tipe = media.endsWith('.mp4') ? 'video' : 'gif' 1940 | reply(mess.error.api) 1941 | }) 1942 | .on('end', function () { 1943 | console.log('Finish') 1944 | exec(`webpmux -set exif ./sticker/stickwm_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => { 1945 | if (error) return reply(mess.error.api) 1946 | helga.sendMessage(from, fs.readFileSync(`./sticker/${sender}.webp`), sticker, {quoted: mek}) 1947 | fs.unlinkSync(media) 1948 | fs.unlinkSync(`./sticker/${sender}.webp`) 1949 | fs.unlinkSync(`./sticker/stickwm_${sender}.exif`) 1950 | }) 1951 | }) 1952 | .addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`]) 1953 | .toFormat('webp') 1954 | .save(`./sticker/${sender}.webp`) 1955 | } else { 1956 | reply(`Kirim gambar/video dengan caption ${prefix}stickerwm nama|author atau tag gambar/video yang sudah dikirim\nNote : Durasi video maximal 10 detik`) 1957 | } 1958 | break 1959 | case 'takestick': 1960 | case 'take': 1961 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1962 | if (!isQuotedSticker) return reply(`Reply sticker dengan caption *${prefix}takestick nama|author*`) 1963 | ppp = `${args.join(' ')}` 1964 | const encmedia = JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo 1965 | const media = await helga.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`) 1966 | const packname = ppp.split('|')[0] 1967 | const author = ppp.split('|')[1] 1968 | exif.create(packname, author, `takestick_${sender}`) 1969 | exec(`webpmux -set exif ./sticker/takestick_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => { 1970 | if (error) return reply(mess.error.api) 1971 | helga.sendMessage(from, fs.readFileSync(`./sticker/${sender}.webp`), sticker, {quoted: mek}) 1972 | fs.unlinkSync(media) 1973 | fs.unlinkSync(`./sticker/takestick_${sender}.exif`) 1974 | }) 1975 | break 1976 | case 'speed': 1977 | case 'ping': 1978 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1979 | const timestampi = speed(); 1980 | const latensyi = speed() - timestampi 1981 | reply(`Speed: ${latensyi.toFixed(4)} Second`) 1982 | break 1983 | case 'return': 1984 | if (!isOwner) return reply(mess.only.ownerB) 1985 | return helga.sendMessage(from, JSON.stringify(eval(body.slice(8))), text, {quoted: mek}) 1986 | if (err) return helga.sendMessage(from, `root @helga ilham:~ ${err}`, text, { quoted: mek }) 1987 | break 1988 | case 'toimg': 1989 | case 'tomedia': 1990 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 1991 | if (!isQuotedSticker) return reply('Reply stiker nya') 1992 | if (mek.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.isAnimated === true){ 1993 | const encmedia = JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo 1994 | const media = await helga.downloadAndSaveMediaMessage(encmedia) 1995 | const upload = await uploadimg(media, Date.now() + '.webp') 1996 | console.log(upload) 1997 | reply(`${upload.result.image}`) 1998 | const rume = await axios.get(`http://nzcha-apii.herokuapp.com/webp-to-mp4?url=${upload.result.image}`) 1999 | console.log(rume.data) 2000 | sendMediaURL(from, rume.data.result) 2001 | } else { 2002 | const encmedia = JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo 2003 | const media = await helga.downloadAndSaveMediaMessage(encmedia) 2004 | ran = '1000.png' 2005 | exec(`ffmpeg -i ${media} ${ran}`, (err) => { 2006 | fs.unlinkSync(media) 2007 | if (err) return reply(mess.error.api) 2008 | buffer = fs.readFileSync(ran) 2009 | helga.sendMessage(from, buffer, image, {quoted: mek}) 2010 | fs.unlinkSync(ran) 2011 | }) 2012 | } 2013 | break 2014 | case 'sticktag': 2015 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 2016 | if (!isGroup) return reply(mess.only.group) 2017 | anu = body.slice(10) 2018 | wanu = anu.split('|') 2019 | var group = await helga.groupMetadata(wanu[0]) 2020 | var member = group['participants'] 2021 | var mem = [] 2022 | member.map( async adm => { 2023 | mem.push(adm.id.replace('c.us', 's.whatsapp.net')) 2024 | }) 2025 | result = fs.readFileSync(`./media/sticker/${wanu[1]}.webp`) 2026 | helga.sendMessage(`${wanu[0]}`, result, sticker, { contextInfo: { "mentionedJid": mem }}) 2027 | break 2028 | case 'runtime': 2029 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 2030 | runtime = process.uptime() 2031 | reply(`Runtime : ${waktu(runtime)}`) 2032 | break 2033 | case 'setbio': 2034 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 2035 | if (args.length < 1) return reply('Teksnya?') 2036 | iyek = body.slice(8) 2037 | helga.setStatus(`${iyek}`) 2038 | reply(`Sukses mengganti bio ke ${body.slice(8)}`) 2039 | break 2040 | case 'setname': 2041 | if (!isOwner && !mek.key.fromMe) return reply(mess.only.ownerB) 2042 | if (args.length < 1) return reply('Teksnya?') 2043 | anu = body.slice(9) 2044 | helga.updateProfileName(anu) 2045 | reply(`Sukses mengganti nama ke ${body.slice(9)}`) 2046 | break 2047 | case 'add': 2048 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 2049 | if (!isGroup) return reply(mess.only.group) 2050 | if (!isGroupAdmins) return reply(mess.only.admin) 2051 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 2052 | if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Reply targetnya!') 2053 | add = mek.message.extendedTextMessage.contextInfo.participant 2054 | helga.groupAdd(from, [add]) 2055 | reply('Sukses menambahkan peserta') 2056 | break 2057 | case 'kick': 2058 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 2059 | if (!isGroup) return reply(mess.only.group) 2060 | if (!isGroupAdmins) return reply(mess.only.admin) 2061 | if (!isBotGroupAdmins) return reply(mess.only.Badmin) 2062 | if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Reply targetnya!') 2063 | kick = mek.message.extendedTextMessage.contextInfo.participant 2064 | helga.groupRemove(from, [kick]) 2065 | reply('Sukses mengeluarkan peserta') 2066 | break 2067 | case 'creategroup': 2068 | case 'creategrup': 2069 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 2070 | if (!isGroup) return reply(mess.only.group) 2071 | if (args.length < 1) return reply(`Penggunaan ${prefix}creategrup nama grup|@tag member`) 2072 | argz = arg.split('|') 2073 | if (mek.message.extendedTextMessage != undefined){ 2074 | mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid 2075 | for (let i = 0; i < mentioned.length; i++){ 2076 | anu = [] 2077 | anu.push(mentioned[i]) 2078 | } 2079 | helga.groupCreate(argz[0], anu) 2080 | reply(`Sukses membuat grup ${argz[0]}`) 2081 | } 2082 | break 2083 | case 'welcome': 2084 | if (!isRegistered) return reply(`Registrasi dulu Kak ketik .verify`) 2085 | if (!isGroup) return reply(mess.only.group) 2086 | if (!isOwner && !isGroupAdmins) return reply(mess.only.admin) 2087 | if (args[0] === 'on') { 2088 | if (isWelkom) return reply('Sudah Aktif Kak') 2089 | welkom.push(from) 2090 | fs.writeFileSync('./database/welkom.json', JSON.stringify(welkom)) 2091 | reply('Sukses mengaktifkan fitur welcome') 2092 | } else if (args[0] === 'off') { 2093 | if (!isWelkom) return reply('Sudah Mati Kak') 2094 | var ini = welkom.indexOf(from) 2095 | welkom.splice(ini, 1) 2096 | fs.writeFileSync('./database/welkom.json', JSON.stringify(welkom)) 2097 | reply('Sukses menonaktifkan fitur welcome') 2098 | } else if (!c){ 2099 | anu =`Silahkan pilih salah satu\n\non: untuk mengaktifkan\noff: untuk menonaktifkan` 2100 | punten = [{buttonId: 'welcome off', buttonText: {displayText: 'OFF✖️'}, type: 1},{buttonId: 'welcome on', buttonText: {displayText: 'ON✔️'}, type: 1}] 2101 | const btngrass = { 2102 | contentText: `${anu}`, 2103 | footerText: '*ZukaChan*', 2104 | buttons: punten, 2105 | headerType: 1 2106 | } 2107 | await helga.sendMessage(from, btngrass, MessageType.buttonsMessage, {quoted: ftrol}) 2108 | } 2109 | break 2110 | default:break 2111 | } 2112 | if (isTTT && isPlayer2){ 2113 | if (budy.startsWith('Y')){ 2114 | tto = ky_ttt.filter(ghg => ghg.id.includes(from)) 2115 | tty = tto[0] 2116 | angka = tto[0].angka 2117 | ucapan = `*🎳 Game Tictactoe 🎲* 2118 | 2119 | Player1 @${tty.player1.split('@')[0]}=❌ 2120 | Player2 @${tty.player2.split('@')[0]}=⭕ 2121 | 2122 | ${angka[1]}${angka[2]}${angka[3]} 2123 | ${angka[4]}${angka[5]}${angka[6]} 2124 | ${angka[7]}${angka[8]}${angka[9]} 2125 | 2126 | Giliran = @${tty.player1.split('@')[0]}` 2127 | helga.sendMessage(from, ucapan, text, {quoted: mek, contextInfo:{mentionedJid: [tty.player1,tty.player2]}}) 2128 | } 2129 | if (budy.startsWith('N')){ 2130 | tto = ky_ttt.filter(ghg => ghg.id.includes(from)) 2131 | tty = tto[0] 2132 | naa = ky_ttt.filter(toek => !toek.id.includes(from)) 2133 | ky_ttt = naa 2134 | helga.sendMessage(from, `Yahh @${tty.player2.split('@')[0]} Menolak:(`,text,{quoted:mek,contextInfo:{mentionedJid:[tty.player2]}}) 2135 | } 2136 | } 2137 | 2138 | if (isTTT && isPlayer1){ 2139 | nuber = parseInt(budy) 2140 | if (isNaN(nuber)) return 2141 | if (nuber < 1 || nuber > 9) return reply('Masukan Angka Dengan Benar') 2142 | main = ky_ttt.filter(hjh => hjh.id.includes(from)) 2143 | if (!tttawal.includes(main[0].angka[nuber])) return reply('Udah Di Isi, Isi Yang Lain Gan') 2144 | if (main[0].gilir.includes(sender)) return reply('Tunggu Giliran Gan') 2145 | s = '❌' 2146 | main[0].angka[nuber] = s 2147 | main[0].gilir = main[0].player1 2148 | naa = ky_ttt.filter(hhg => !hhg.id.includes(from)) 2149 | ky_ttt = naa 2150 | pop = main[0] 2151 | ky_ttt.push(pop) 2152 | tto = ky_ttt.filter(hgh => hgh.id.includes(from)) 2153 | tty = tto[0] 2154 | angka = tto[0].angka 2155 | ttt = `${angka[1]}${angka[2]}${angka[3]}\n${angka[4]}${angka[5]}${angka[6]}\n${angka[7]}${angka[8]}${angka[9]}` 2156 | 2157 | ucapmenang = () => { 2158 | ucapan1 = `*🎳Result Game Tictactoe 🎲 2159 | 2160 | *Yeyyy Permainan Di Menangkan Oleh *@${tty.player1.split('@')[0]}*\n` 2161 | ucapan2 = `*🎳Result Game Tictactoe 🎲* 2162 | 2163 | *Hasil Akhir:* 2164 | 2165 | ${ttt}` 2166 | helga.sendMessage(from, ucapan1, text, {quoted:mek, contextInfo:{mentionedJid: [tty.player1]}}) 2167 | naa = ky_ttt.filter(hhg => !hhg.id.includes(from)) 2168 | return ky_ttt = naa 2169 | } 2170 | 2171 | if (angka[1] == s && angka[2] == s && angka[3] == s) return ucapmenang() 2172 | 2173 | if (angka[1] == s && angka[4] == s && angka[7] == s) return ucapmenang() 2174 | 2175 | if (angka[1] == s && angka[5] == s && angka[9] == s) return ucapmenang() 2176 | 2177 | if (angka[2] == s && angka[5] == s && angka[8] == s) return ucapmenang() 2178 | 2179 | if (angka[4] == s && angka[5] == s && angka[6] == s) return ucapmenang() 2180 | 2181 | if (angka[7] == s && angka[8] == s && angka[9] == s) return ucapmenang() 2182 | 2183 | if (angka[3] == s && angka[5] == s && angka[7] == s) return ucapmenang() 2184 | 2185 | if (angka[3] == s && angka[6] == s && angka[9] == s) return ucapmenang() 2186 | 2187 | if (!ttt.includes('1️⃣') && !ttt.includes('2️⃣') && !ttt.includes('3️⃣') && ! ttt.includes('4️⃣') && ! 2188 | ttt.includes('5️⃣') && ! 2189 | ttt.includes('6️⃣') && ! ttt.includes('7️⃣') && ! ttt.includes('8️⃣') && ! ttt.includes('9️⃣')){ 2190 | ucapan1 = `*🎳 Result Game Tictactoe 🎲* 2191 | 2192 | *_Permainan Seri 🗿👌_*` 2193 | ucapan2 = `*🎳 Result Game Tictactoe 🎲* 2194 | 2195 | *Hasil Akhir:* 2196 | 2197 | ${ttt}` 2198 | reply(ucapan1) 2199 | naa = ky_ttt.filter(hhg => !hhg.id.includes(from)) 2200 | return ky_ttt = naa 2201 | } 2202 | ucapan = `*🎳 Game Tictactoe 🎲* 2203 | 2204 | Player2 @${tty.player2.split('@')[0]}=⭕ 2205 | Player1 @${tty.player1.split('@')[0]}=❌ 2206 | 2207 | ${ttt} 2208 | 2209 | Giliran = @${tty.player2.split('@')[0]}` 2210 | helga.sendMessage(from, ucapan, text, {quoted: mek, contextInfo:{mentionedJid: [tty.player1,tty.player2]}}) 2211 | } 2212 | if (isTTT && isPlayer2){ 2213 | nuber = parseInt(budy) 2214 | if (isNaN(nuber)) return 2215 | if (nuber < 1 || nuber > 9) return reply('Masukan Angka Dengan Benar') 2216 | main = ky_ttt.filter(hjh => hjh.id.includes(from)) 2217 | if (!tttawal.includes(main[0].angka[nuber])) return reply('Udah Di Isi, Isi Yang Lain Gan') 2218 | if (main[0].gilir.includes(sender)) return reply('Tunggu Giliran Gan') 2219 | s = '⭕' 2220 | main[0].angka[nuber] = s 2221 | main[0].gilir = main[0].player2 2222 | naa = ky_ttt.filter(hhg => !hhg.id.includes(from)) 2223 | ky_ttt = naa 2224 | pop = main[0] 2225 | ky_ttt.push(pop) 2226 | tto = ky_ttt.filter(hgh => hgh.id.includes(from)) 2227 | tty = tto[0] 2228 | angka = tto[0].angka 2229 | ttt = `${angka[1]}${angka[2]}${angka[3]}\n${angka[4]}${angka[5]}${angka[6]}\n${angka[7]}${angka[8]}${angka[9]}` 2230 | 2231 | ucapmenang = () => { 2232 | ucapan1 = `*?? Result Game Tictactoe 🎲* 2233 | 2234 | Yeyyy Permainan Di Menangkan Oleh *@${tty.player2.split('@')[0]}*\n` 2235 | ucapan2 = `*🎳 Game Tictactoe 🎲* 2236 | 2237 | *Hasil Akhir:* 2238 | 2239 | ${ttt}` 2240 | helga.sendMessage(from, ucapan1, text, {quoted:mek, contextInfo:{mentionedJid: [tty.player2]}}) 2241 | naa = ky_ttt.filter(hhg => !hhg.id.includes(from)) 2242 | return ky_ttt = naa 2243 | } 2244 | 2245 | if (angka[1] == s && angka[2] == s && angka[3] == s) return ucapmenang() 2246 | if (angka[1] == s && angka[4] == s && angka[7] == s) return ucapmenang() 2247 | if (angka[1] == s && angka[5] == s && angka[9] == s) return ucapmenang() 2248 | if (angka[2] == s && angka[5] == s && angka[8] == s) return ucapmenang() 2249 | if (angka[4] == s && angka[5] == s && angka[6] == s) return ucapmenang() 2250 | if (angka[7] == s && angka[8] == s && angka[9] == s) return ucapmenang() 2251 | if (angka[3] == s && angka[5] == s && angka[7] == s) return ucapmenang() 2252 | if (angka[3] == s && angka[6] == s && angka[9] == s) return ucapmenang() 2253 | if (!ttt.includes('1️⃣') && !ttt.includes('2️⃣') && !ttt.includes('3️⃣') && ! ttt.includes('4️⃣') && ! 2254 | ttt.includes('5️⃣') && ! 2255 | ttt.includes('6️⃣') && ! ttt.includes('7️⃣') && ! ttt.includes('8️⃣') && ! ttt.includes('9️⃣')){ 2256 | ucapan1 = `*🎳Result Game Tictactoe 🎲* 2257 | 2258 | *_Permainan Seri🗿👌*` 2259 | ucapan2 = `*🎳 Result Game Tictactoe 🎲* 2260 | 2261 | *Hasil Akhir:* 2262 | 2263 | ${ttt}` 2264 | reply(ucapan1) 2265 | naa = ky_ttt.filter(hhg => !hhg.id.includes(from)) 2266 | return ky_ttt = naa 2267 | } 2268 | ucapan = `*🎳 Game Tictactoe 🎲* 2269 | 2270 | Player1 @${tty.player1.split('@')[0]}=⭕ 2271 | Player2 @${tty.player2.split('@')[0]}=❌ 2272 | 2273 | ${ttt} 2274 | 2275 | Giliran = @${tty.player1.split('@')[0]}` 2276 | helga.sendMessage(from, ucapan, text, {quoted: mek, contextInfo:{mentionedJid: [tty.player1,tty.player2]}}) 2277 | } 2278 | } catch (e) { 2279 | e = String(e) 2280 | if (!e.includes("this.isZero")) { 2281 | if (!e.includes("Cannot read property 'conversation' of null")) { 2282 | if (!e.includes("Cannot read property 'contextInfo' of undefined")) { 2283 | if (!e.includes("Cannot set property 'mtype' of undefined")) { 2284 | if (!e.includes("jid is not defined")) { 2285 | console.log(color('|ERROR KAK|', 'red'), color(e, 'cyan')) 2286 | helga.sendMessage(`${settings.NomorOwner}@s.whatsapp.net`, `*Subscribe Channel Helga Zexs*`, MessageType.text, {contextInfo: { forwardingScore: 508, isForwarded: true, externalAdReply:{title: "Developer ZukaChan",body:"",previewType:"Helga Base",thumbnail:fs.readFileSync('./helga.jpg'),sourceUrl:"https://wa.me/6282138919347"}}}) 2287 | } 2288 | } 2289 | } 2290 | } 2291 | } 2292 | } 2293 | } -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | pkg clean 4 | pkg install tty-clock -y 5 | pkg install sox -y 6 | pkg install jq -y 7 | pkg install figlet -y 8 | pkg install wget -y 9 | pkg install ffmpeg libwebp -y 10 | pkg install nodejs -y 11 | pkg install tesseract -y 12 | wget -O ~/../usr/share/tessdata/ind.traineddata "https://github.com/tesseract-ocr/tessdata/blob/master/ind.traineddata?raw=true" 13 | npm install 14 | npm audit fix 15 | 16 | #!/usr/bin/bash 17 | 18 | tty-clock -s -S -x -c -C 2 -b -B 19 | clear 20 | node main -------------------------------------------------------------------------------- /lib/antispam.js: -------------------------------------------------------------------------------- 1 | const usedCommandRecently = new Set() 2 | 3 | /** 4 | * Check is number filtered 5 | * @param {String} from 6 | */ 7 | const isFiltered = (from) => !!usedCommandRecently.has(from) 8 | 9 | /** 10 | * Add number to filter 11 | * @param {String} from 12 | */ 13 | const addFilter = (from) => { 14 | usedCommandRecently.add(from) 15 | setTimeout(() => usedCommandRecently.delete(from), 5000) //delay 5 detik tod 16 | } 17 | 18 | module.exports = { 19 | antiSpam: { 20 | isFiltered, 21 | addFilter 22 | } 23 | } -------------------------------------------------------------------------------- /lib/autoresp.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | 3 | 4 | 5 | /** 6 | * Add Commands/Response message to database 7 | * @param {String} msg 8 | * @param {Sstring} response 9 | * @param {String} userId 10 | * @param {Object} data 11 | * @returns true 12 | */ 13 | const addCommands = (msg, response, userId, _data) => { 14 | const obj = { 15 | pesan: msg, 16 | balasan: response, 17 | creator: userId 18 | } 19 | _data.push(obj) 20 | fs.writeFileSync('./database/commands.json', JSON.stringify(_data)) 21 | 22 | return true 23 | } 24 | 25 | 26 | /** 27 | * Delete commands from database 28 | * @param {String} command 29 | * @param {Object} _data 30 | */ 31 | const deleteCommands = (command, _data) => { 32 | Object.keys(_data).forEach((i) => { 33 | if (_data[i].pesan === command) { 34 | _data.splice(i, 1) 35 | fs.writeFileSync('./database/commands.json', JSON.stringify(_data)) 36 | } 37 | }) 38 | return true 39 | } 40 | 41 | 42 | /** 43 | * Check command is available or not 44 | * @param {String} command 45 | * @param {Object} _data 46 | * @returns {Boolean} 47 | */ 48 | 49 | const checkCommands = (commands, _data) => { 50 | let status = false 51 | Object.keys(_data).forEach((i) => { 52 | if (_data[i].pesan === commands) { 53 | status = true 54 | } 55 | }) 56 | 57 | return status 58 | } 59 | 60 | 61 | 62 | module.exports = { 63 | addCommands, 64 | checkCommands, 65 | deleteCommands 66 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/converter.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const path = require('path') 3 | const { spawn } = require('child_process') 4 | 5 | function toAudio(buffer, ext) { 6 | return new Promise((resolve, reject) => { 7 | let tmp = path.join(__dirname, '../tmp', + new Date + '.' + ext) 8 | let out = tmp + '.mp3' 9 | fs.writeFileSync(tmp, buffer) 10 | spawn('ffmpeg', [ 11 | '-y', 12 | '-i',tmp, 13 | '-vn', 14 | '-ac', '2', 15 | '-b:a','128k', 16 | '-ar','44100', 17 | '-f', 'mp3', 18 | out 19 | ]) 20 | .on('error', reject) 21 | .on('error', () => fs.unlinkSync(tmp)) 22 | .on('close', () => { 23 | fs.unlinkSync(tmp) 24 | resolve(fs.readFileSync(out)) 25 | if (fs.existsSync(out)) fs.unlinkSync(out) 26 | }) 27 | }) 28 | } 29 | 30 | function toPTT(buffer, ext) { 31 | return new Promise((resolve, reject) => { 32 | let tmp = path.join(__dirname, '../tmp', + new Date + '.' + ext) 33 | let out = tmp + '.opus' 34 | fs.writeFileSync(tmp, buffer) 35 | spawn('ffmpeg', [ 36 | '-y', 37 | '-i',tmp, 38 | '-vn', 39 | '-c:a','libopus', 40 | '-b:a','128k', 41 | '-vbr','on', 42 | '-compression_level','10', 43 | out, 44 | ]) 45 | .on('error', reject) 46 | .on('error', () => fs.unlinkSync(tmp)) 47 | .on('close', () => { 48 | fs.unlinkSync(tmp) 49 | resolve(fs.readFileSync(out)) 50 | if (fs.existsSync(out)) fs.unlinkSync(out) 51 | }) 52 | }) 53 | } 54 | 55 | function toVideo(buffer, ext) { 56 | return new Promise((resolve, reject) => { 57 | let tmp = path.join(__dirname, '../tmp', + new Date + '.' + ext) 58 | let out = tmp + '.mp4' 59 | fs.writeFileSync(tmp, buffer) 60 | spawn('ffmpeg', [ 61 | '-y', 62 | '-i', tmp, 63 | '-c:v','libx264', 64 | '-c:a','aac', 65 | '-ab','192k', 66 | '-ar','44100', 67 | out 68 | ]) 69 | .on('error', reject) 70 | .on('error', () => fs.unlinkSync(tmp)) 71 | .on('close', () => { 72 | fs.unlinkSync(tmp) 73 | resolve(fs.readFileSync(out)) 74 | if (fs.existsSync(out)) fs.unlinkSync(out) 75 | }) 76 | }) 77 | } 78 | 79 | module.exports = { 80 | toAudio, 81 | toPTT, 82 | toVideo 83 | } 84 | -------------------------------------------------------------------------------- /lib/exif.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Originally created by cwke 3 | * Reuploaded by Waxaranai 4 | * Recoded by SlavyanDesu 5 | * 6 | * GitHub is an open-source community, so why are you so triggered when someone shared some simple code? 7 | */ 8 | 9 | const fs = require('fs') 10 | const packID = 'com.snowcorp.stickerly.android.stickercontentprovider b5e7275f-f1de-4137-961f-57becfad34f2' 11 | const playstore = 'https://play.google.com/store/apps/details?id=com.stickify.stickermaker' 12 | const itunes = 'https://itunes.apple.com/app/sticker-maker-studio/id1443326857' 13 | 14 | /** 15 | * @class Exif 16 | */ 17 | module.exports = class Exif { 18 | /** 19 | * Create an EXIF file. 20 | * @param {String} packname 21 | * @param {String} authorname 22 | * @param {String} [filename=data] 23 | */ 24 | create(packname, authorname, filename) { 25 | if (!filename) filename = 'data' 26 | const json = { 27 | 'sticker-pack-id': packID, 28 | 'sticker-pack-name': packname, 29 | 'sticker-pack-publisher': authorname, 30 | 'android-app-store-link': playstore, 31 | 'ios-app-store-link': itunes 32 | } 33 | let len = JSON.stringify(json).length 34 | const f = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00]) 35 | const code = [0x00, 0x00, 0x16, 0x00, 0x00, 0x00] 36 | if (len > 256) { 37 | len = len - 256 38 | code.unshift(0x01) 39 | } else { 40 | code.unshift(0x00) 41 | } 42 | const fff = Buffer.from(code) 43 | const ffff = Buffer.from(JSON.stringify(json)) 44 | if (len < 16) { 45 | len = len.toString(16) 46 | len = '0' + len 47 | } else { 48 | len = len.toString(16) 49 | } 50 | const ff = Buffer.from(len, 'hex') 51 | const buffer = Buffer.concat([f, ff, fff, ffff]) 52 | fs.writeFile(`./sticker/${filename}.exif`, buffer, (err) => { 53 | if (err) return console.error(err) 54 | console.log('Success!') 55 | }) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/fetcher.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const fs = require('fs') 3 | const util = require('util') 4 | const path = require('path') 5 | const FileType = require('file-type') 6 | const { spawn } = require('child_process') 7 | const { MessageType } = require('@adiwajshing/baileys') 8 | 9 | 10 | exports.getBase64 = getBase64 = async (url) => { 11 | const response = await fetch(url, { headers: { 'User-Agent': 'okhttp/4.5.0' } }); 12 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`); 13 | const buffer = await response.buffer(); 14 | const videoBase64 = `data:${response.headers.get('content-type')};base64,` + buffer.toString('base64'); 15 | if (buffer) 16 | return videoBase64; 17 | }; 18 | 19 | exports.getBuffer = getBuffer = async (url) => { 20 | const res = await fetch(url, {headers: { 'User-Agent': 'okhttp/4.5.0'}, method: 'GET' }) 21 | const anu = fs.readFileSync('gambar/g1.jpg') 22 | if (!res.ok) return { type: 'image/jpeg', result: anu } 23 | const buff = await res.buffer() 24 | if (buff) 25 | return { type: res.headers.get('content-type'), result: buff } 26 | } 27 | 28 | exports.fetchJson = fetchJson = (url, options) => new Promise(async (resolve, reject) => { 29 | fetch(url, options) 30 | .then(response => response.json()) 31 | .then(json => { 32 | // console.log(json) 33 | resolve(json) 34 | }) 35 | .catch((err) => { 36 | reject(err) 37 | }) 38 | }) 39 | 40 | 41 | exports.fetchText = fetchText = (url, options) => new Promise(async (resolve, reject) => { 42 | fetch(url, options) 43 | .then(response => response.text()) 44 | .then(text => { 45 | // console.log(text) 46 | resolve(text) 47 | }) 48 | .catch((err) => { 49 | reject(err) 50 | }) 51 | }) 52 | 53 | 54 | //exports.getBase64 = getBase64; 55 | -------------------------------------------------------------------------------- /lib/functions.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const axios = require('axios') 3 | const imgbb = require('imgbb-uploader') 4 | const fs = require('fs') 5 | const cfonts = require('cfonts') 6 | const spin = require('spinnies') 7 | const Crypto = require('crypto') 8 | const { fromBuffer } = require('file-type') 9 | const FormData = require('form-data') 10 | 11 | const getBuffer = async (url, options) => { 12 | try { 13 | options ? options : {} 14 | const res = await axios({ 15 | method: "get", 16 | url, 17 | headers: { 18 | 'DNT': 1, 19 | 'Upgrade-Insecure-Request': 1 20 | }, 21 | ...options, 22 | responseType: 'arraybuffer' 23 | }) 24 | return res.data 25 | } catch (e) { 26 | console.log(`Error : ${e}`) 27 | } 28 | } 29 | 30 | const randomBytes = (length) => { 31 | return Crypto.randomBytes(length) 32 | } 33 | 34 | const getGroupAdmins = (participants) => { 35 | admins = [] 36 | for (let i of participants) { 37 | i.isAdmin ? admins.push(i.jid) : '' 38 | } 39 | return admins 40 | } 41 | 42 | const getRandom = (ext) => { 43 | return `${Math.floor(Math.random() * 10000)}${ext}` 44 | } 45 | 46 | const spinner = { 47 | "interval": 500, 48 | "frames": [ 49 | "🅓", 50 | "🅔", 51 | "🅝", 52 | "🅘", 53 | "🅢", 54 | "🅟", 55 | "🅤", 56 | "🅣", 57 | "🅡", 58 | "🅐" 59 | ]} 60 | 61 | let globalSpinner; 62 | 63 | 64 | const getGlobalSpinner = (disableSpins = false) => { 65 | if(!globalSpinner) globalSpinner = new spin({ color: 'white', succeedColor: 'green', spinner, disableSpins}); 66 | return globalSpinner; 67 | } 68 | 69 | spins = getGlobalSpinner(false) 70 | 71 | const start = (id, text) => { 72 | spins.add(id, {text: text}) 73 | /*setTimeout(() => { 74 | spins.succeed('load-spin', {text: 'Suksess'}) 75 | }, Number(wait) * 1000)*/ 76 | } 77 | const info = (id, text) => { 78 | spins.update(id, {text: text}) 79 | } 80 | const success = (id, text) => { 81 | spins.succeed(id, {text: text}) 82 | 83 | } 84 | 85 | const close = (id, text) => { 86 | spins.fail(id, {text: text}) 87 | } 88 | 89 | module.exports = { getBuffer, getGroupAdmins, getRandom, start, info, success, close } -------------------------------------------------------------------------------- /lib/gif.js: -------------------------------------------------------------------------------- 1 | const cheerio = require('cheerio'); 2 | const FormData = require('form-data') 3 | const axios = require('axios'); 4 | const { default: Axios } = require('axios'); 5 | const { exec } = require('child_process'); 6 | const fs = require('fs'); 7 | 8 | function webp2gifFile(path) { 9 | return new Promise((resolve, reject) => { 10 | const bodyForm = new FormData() 11 | bodyForm.append('new-image-url', '') 12 | bodyForm.append('new-image', fs.createReadStream(path)) 13 | Axios({ 14 | method: 'post', 15 | url: 'https://s6.ezgif.com/webp-to-mp4', 16 | data: bodyForm, 17 | headers: { 18 | 'Content-Type': `multipart/form-data; boundary=${bodyForm._boundary}` 19 | } 20 | }).then(({ data }) => { 21 | const bodyFormThen = new FormData() 22 | const $ = cheerio.load(data) 23 | const file = $('input[name="file"]').attr('value') 24 | const token = $('input[name="token"]').attr('value') 25 | const convert = $('input[name="file"]').attr('value') 26 | const gotdata = { 27 | file: file, 28 | token: token, 29 | convert: convert 30 | } 31 | bodyFormThen.append('file', gotdata.file) 32 | bodyFormThen.append('token', gotdata.token) 33 | bodyFormThen.append('convert', gotdata.convert) 34 | Axios({ 35 | method: 'post', 36 | url: 'https://ezgif.com/webp-to-mp4/' + gotdata.file, 37 | data: bodyFormThen, 38 | headers: { 39 | 'Content-Type': `multipart/form-data; boundary=${bodyFormThen._boundary}` 40 | } 41 | }).then(({ data }) => { 42 | const $ = cheerio.load(data) 43 | const result = 'https:' + $('div#output > p.outfile > video > source').attr('src') 44 | resolve({ 45 | status: true, 46 | message: "Created By MRHRTZ", 47 | result: result 48 | }) 49 | }).catch(reject) 50 | }).catch(reject) 51 | }) 52 | } 53 | 54 | async function igDownloader(Link) { 55 | const hasil = [] 56 | const Form = { 57 | url: Link, 58 | submit: "" 59 | } 60 | await axios(`https://downloadgram.org/`, { 61 | method: "POST", 62 | data: new URLSearchParams(Object.entries(Form)), 63 | headers: { 64 | "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", 65 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 66 | "cache-control": "max-age=0", 67 | "content-type": "application/x-www-form-urlencoded", 68 | "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"", 69 | "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" 70 | }, 71 | referrerPolicy: "strict-origin-when-cross-origin", 72 | }).then(async res => { 73 | const $ = cheerio.load(res.data) 74 | let url = $('#downloadBox').find('a').attr('href'); 75 | await axios(Link, { 76 | method: "GET", 77 | data: null, 78 | headers: { 79 | "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", 80 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 81 | "cache-control": "max-age=0", 82 | "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"", 83 | "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" 84 | }, 85 | referrerPolicy: "strict-origin-when-cross-origin" 86 | }).then(respon => { 87 | const ch = cheerio.load(respon.data) 88 | let title = ch('title').text().trim() 89 | const result = { 90 | status: true, 91 | result: { 92 | link: url, 93 | desc: title 94 | } 95 | } 96 | hasil.push(result) 97 | }) 98 | }) 99 | return hasil[0] 100 | } 101 | 102 | async function TiktokDownloader(Url) { 103 | return new Promise (async (resolve, reject) => { 104 | await axios.request({ 105 | url: "https://ttdownloader.com/", 106 | method: "GET", 107 | headers: { 108 | "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", 109 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 110 | "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", 111 | "cookie": "_ga=GA1.2.1240046717.1620835673; PHPSESSID=i14curq5t8omcljj1hlle52762; popCookie=1; _gid=GA1.2.1936694796.1623913934" 112 | } 113 | }).then(respon => { 114 | const $ = cheerio.load(respon.data) 115 | const token = $('#token').attr('value') 116 | axios({ 117 | url: "https://ttdownloader.com/req/", 118 | method: "POST", 119 | data: new URLSearchParams(Object.entries({url: Url, format: "", token: token})), 120 | headers: { 121 | "accept": "*/*", 122 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 123 | "content-type": "application/x-www-form-urlencoded; charset=UTF-8", 124 | "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", 125 | "cookie": "_ga=GA1.2.1240046717.1620835673; PHPSESSID=i14curq5t8omcljj1hlle52762; popCookie=1; _gid=GA1.2.1936694796.1623913934" 126 | } 127 | }).then(res => { 128 | const ch = cheerio.load(res.data) 129 | const result = { 130 | status: res.status, 131 | result: { 132 | nowatermark: ch('#results-list > div:nth-child(2)').find('div.download > a').attr('href'), 133 | watermark: ch('#results-list > div:nth-child(3)').find('div.download > a').attr('href'), 134 | audio: ch('#results-list > div:nth-child(4)').find(' div.download > a').attr('href') 135 | } 136 | } 137 | resolve(result) 138 | }).catch(reject) 139 | }).catch(reject) 140 | }) 141 | } 142 | 143 | exports.TiktokDownloader = TiktokDownloader 144 | exports.igDownloader = igDownloader 145 | exports.webp2gifFile = webp2gifFile -------------------------------------------------------------------------------- /lib/gtts.js: -------------------------------------------------------------------------------- 1 | const request = require('request'); 2 | const escapeStringRegexp = require('escape-string-regexp'); 3 | const async = require('async'); 4 | const fs = require('fs'); 5 | const MultiStream = require('multistream'); 6 | const fakeUa = require('fake-useragent'); 7 | 8 | const GOOGLE_TTS_URL = 'http://translate.google.com/translate_tts'; 9 | const MAX_CHARS = 100; 10 | const LANGUAGES = { 11 | 'af': 'Afrikaans', 12 | 'sq': 'Albanian', 13 | 'ar': 'Arabic', 14 | 'hy': 'Armenian', 15 | 'ca': 'Catalan', 16 | 'zh': 'Chinese', 17 | 'zh-cn': 'Chinese (Mandarin/China)', 18 | 'zh-tw': 'Chinese (Mandarin/Taiwan)', 19 | 'zh-yue': 'Chinese (Cantonese)', 20 | 'hr': 'Croatian', 21 | 'cs': 'Czech', 22 | 'da': 'Danish', 23 | 'nl': 'Dutch', 24 | 'en': 'English', 25 | 'en-au': 'English (Australia)', 26 | 'en-uk': 'English (United Kingdom)', 27 | 'en-us': 'English (United States)', 28 | 'eo': 'Esperanto', 29 | 'fi': 'Finnish', 30 | 'fr': 'French', 31 | 'de': 'German', 32 | 'el': 'Greek', 33 | 'ht': 'Haitian Creole', 34 | 'hi': 'Hindi', 35 | 'hu': 'Hungarian', 36 | 'is': 'Icelandic', 37 | 'id': 'Indonesian', 38 | 'it': 'Italian', 39 | 'ja': 'Japanese', 40 | 'ko': 'Korean', 41 | 'la': 'Latin', 42 | 'lv': 'Latvian', 43 | 'mk': 'Macedonian', 44 | 'no': 'Norwegian', 45 | 'pl': 'Polish', 46 | 'pt': 'Portuguese', 47 | 'pt-br': 'Portuguese (Brazil)', 48 | 'ro': 'Romanian', 49 | 'ru': 'Russian', 50 | 'sr': 'Serbian', 51 | 'sk': 'Slovak', 52 | 'es': 'Spanish', 53 | 'es-es': 'Spanish (Spain)', 54 | 'es-us': 'Spanish (United States)', 55 | 'sw': 'Swahili', 56 | 'sv': 'Swedish', 57 | 'ta': 'Tamil', 58 | 'th': 'Thai', 59 | 'tr': 'Turkish', 60 | 'vi': 'Vietnamese', 61 | 'cy': 'Welsh' 62 | } 63 | 64 | function Text2Speech(_lang, _debug) { 65 | var lang = _lang || 'en'; 66 | var debug = _debug || false; 67 | lang = lang.toLowerCase(); 68 | 69 | if (!LANGUAGES[lang]) 70 | throw new Error('Language not supported: ' + lang); 71 | 72 | var getArgs = getArgsFactory(lang); 73 | 74 | return { 75 | tokenize: tokenize, 76 | createServer: (port) => createServer(getArgs, port), 77 | stream: (text) => stream(getArgs, text), 78 | save: (filepath, text, callback) => save(getArgs, filepath, text, callback) 79 | } 80 | } 81 | 82 | function save(getArgs, filepath, text, callback) { 83 | var text_parts = tokenize(text); 84 | var total = text_parts.length; 85 | async.eachSeries(text_parts, function(part, cb) { 86 | var index = text_parts.indexOf(part); 87 | var headers = getHeader(); 88 | var args = getArgs(part, index, total); 89 | var fullUrl = GOOGLE_TTS_URL + args; 90 | 91 | var writeStream = fs.createWriteStream(filepath, { 92 | flags: index > 0 ? 'a' : 'w' 93 | }); 94 | request({ 95 | uri: fullUrl, 96 | headers: headers, 97 | method: 'GET' 98 | }) 99 | .pipe(writeStream); 100 | writeStream.on('finish', cb); 101 | writeStream.on('error', cb); 102 | }, callback); 103 | } 104 | 105 | function stream(getArgs, text) { 106 | var text_parts = tokenize(text); 107 | var total = text_parts.length; 108 | 109 | return MultiStream(text_parts.map(function(part, index) { 110 | var headers = getHeader(); 111 | var args = getArgs(part, index, total); 112 | var fullUrl = GOOGLE_TTS_URL + args 113 | 114 | return request({ 115 | uri: fullUrl, 116 | headers: headers, 117 | method: 'GET' 118 | }); 119 | })); 120 | } 121 | 122 | function getHeader() { 123 | var headers = { 124 | "User-Agent": fakeUa() 125 | }; 126 | //console.log('headers', headers); 127 | return headers; 128 | } 129 | 130 | function getArgsFactory(lang){ 131 | return function (text, index, total) { 132 | var textlen = text.length; 133 | var encodedText = encodeURIComponent(text); 134 | var language = lang || 'en'; 135 | return `?ie=UTF-8&tl=${language}&q=${encodedText}&total=${total}&idx=${index}&client=tw-ob&textlen=${textlen}` 136 | } 137 | } 138 | 139 | function tokenize(text) { 140 | var text_parts = []; 141 | if (!text) 142 | throw new Error('No text to speak'); 143 | 144 | var punc = '¡!()[]¶;|°•—«»≤≥«»‹›\n '; 145 | var punc_list = punc.split('').map(function(char) { 146 | return escapeStringRegexp(char); 147 | }); 148 | 149 | var pattern = punc_list.join('|'); 150 | var parts = text.split(new RegExp(pattern)); 151 | parts = parts.filter(p => p.length > 0); 152 | 153 | var output = []; 154 | var i = 0; 155 | for (let p of parts) { 156 | if (!output[i]) { 157 | output[i] = ''; 158 | } 159 | if (output[i].length + p.length < MAX_CHARS) { 160 | output[i] += ' ' + p; 161 | } else { 162 | i++; 163 | output[i] = p; 164 | } 165 | } 166 | output[0] = output[0].substr(1); 167 | return output; 168 | } 169 | 170 | function createServer(getArgs, port) { 171 | var http = require("http"); 172 | var url = require('url'); 173 | 174 | var server = http.createServer(function(req, res) { 175 | var queryData = url.parse(req.url, true).query; 176 | var argsCallback = getArgs; 177 | if (queryData && queryData.lang && LANGUAGES[queryData.lang]) { 178 | argsCallback = getArgsFactory(queryData.lang); 179 | } 180 | if (queryData && queryData.text) { 181 | res.writeHead(200, {'Content-Type': 'audio/mpeg'}); 182 | stream(argsCallback, queryData.text).pipe(res); 183 | } else { 184 | console.log(req.headers); 185 | res.writeHead(200, {'Content-Type': 'application/json'}); 186 | res.end(JSON.stringify({ 187 | code: -1, 188 | message: `Missing text. Please try: ${req.headers.host}?text=your+text` 189 | })) 190 | } 191 | }); 192 | 193 | server.listen(port); 194 | console.log("Text-to-Speech Server running on " + port); 195 | } 196 | 197 | module.exports = Text2Speech; 198 | -------------------------------------------------------------------------------- /lib/igdown.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | async function igDownloader(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 = { igDownloader } -------------------------------------------------------------------------------- /lib/simple.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const util = require('util') 3 | const path = require('path') 4 | const FileType = require('file-type') 5 | const fetch = require('node-fetch') 6 | const PhoneNumber = require('awesome-phonenumber') 7 | const { MessageType } = require('@adiwajshing/baileys') 8 | const { toAudio, toPTT, toVideo } = require('./converter') 9 | 10 | exports.WAConnection = _WAConnection => { 11 | class WAConnection extends _WAConnection { 12 | constructor(...args) { 13 | super(...args) 14 | this.on('message-new', m => { 15 | let type = m.messageStubType 16 | let participants = m.messageStubParameters 17 | switch (type) { 18 | case 27: 19 | case 31: 20 | this.emit('group-add', { m, type, participants }) 21 | break 22 | case 28: 23 | case 32: 24 | this.emit('group-leave', { m, type, participants }) 25 | break 26 | case 40: 27 | case 41: 28 | case 45: 29 | case 46: 30 | this.emit('call', { 31 | type, participants, 32 | isGroup: type == 45 || type == 46, 33 | isVideo: type == 41 || type == 46 34 | }) 35 | break 36 | } 37 | }) 38 | 39 | if (!Array.isArray(this._events['CB:action,add:relay,message'])) this._events['CB:action,add:relay,message'] = [this._events['CB:action,add:relay,message']] 40 | else this._events['CB:action,add:relay,message'] = [this._events['CB:action,add:relay,message'].pop()] 41 | this._events['CB:action,add:relay,message'].unshift(async function (json) { 42 | try { 43 | let m = json[2][0][2] 44 | if (m.message && m.message.protocolMessage && m.message.protocolMessage.type == 0) { 45 | let key = m.message.protocolMessage.key 46 | let c = this.chats.get(key.remoteJid) 47 | let a = c.messages.dict[`${key.id}|${key.fromMe ? 1 : 0}`] 48 | let participant = key.fromMe ? this.user.jid : a.participant ? a.participant : key.remoteJid 49 | let WAMSG = a.constructor 50 | this.emit('message-delete', { key, participant, message: WAMSG.fromObject(WAMSG.toObject(a)) }) 51 | } 52 | } catch (e) {} 53 | }) 54 | 55 | // Alias 56 | this.sendFileFromUrl = this.sendFileFromURL = this.sendFile 57 | } 58 | 59 | async copyNForward(jid, message, forceForward = false, options = {}) { 60 | let mtype = Object.keys(message.message)[0] 61 | let content = await this.generateForwardMessageContent(message, forceForward) 62 | let ctype = Object.keys(content)[0] 63 | let context = {} 64 | if (mtype != MessageType.text) context = message.message[mtype].contextInfo 65 | content[ctype].contextInfo = { 66 | ...context, 67 | ...content[ctype].contextInfo 68 | } 69 | const waMessage = await this.prepareMessageFromContent(jid, content, options) 70 | await this.relayWAMessage(waMessage) 71 | return waMessage 72 | } 73 | 74 | async cMod(jid, message, text = '', sender = this.user.jid, options = {}) { 75 | let M = message.constructor 76 | let copy = M.fromObject(M.toObject(message)) 77 | let mtype = Object.keys(copy.message)[0] 78 | let msg = copy.message[mtype] 79 | if (typeof msg === 'string') copy.message[mtype] = text || msg 80 | else if (msg.caption) msg.caption = text || msg.caption 81 | else if (msg.text) msg.text = text || msg.text 82 | if (typeof msg !== 'string') copy.message[mtype] = {...msg, ...options} 83 | if (copy.participant) sender = copy.participant = sender || copy.participant 84 | else if (copy.key.participant) sender = copy.key.participant = sender || copy.key.participant 85 | if (message.key.remoteJid.includes('@s.whatsapp.net')) sender = sender || message.key.remoteJid 86 | else if (message.key.remoteJid.includes('@broadcast')) sender = sender || message.key.remoteJid 87 | copy.key.remoteJid = sender 88 | copy.key.fromMe = sender === this.user.jid 89 | return copy 90 | } 91 | 92 | async genOrderMessage(message, options) { 93 | let m = {} 94 | switch (type) { 95 | case MessageType.text: 96 | case MessageType.extendedText: 97 | if (typeof message === 'string') message = { text: message } 98 | m.extendedTextMessage = WAMessageProto.ExtendedTextMessage.fromObject(message); 99 | break 100 | case MessageType.location: 101 | case MessageType.liveLocation: 102 | m.locationMessage = WAMessageProto.LocationMessage.fromObject(message) 103 | break 104 | case MessageType.contact: 105 | m.contactMessage = WAMessageProto.ContactMessage.fromObject(message) 106 | break 107 | case MessageType.image: 108 | case MessageType.sticker: 109 | case MessageType.document: 110 | case MessageType.video: 111 | case MessageType.audio: 112 | m = await this.prepareMessageMedia(message, type, options) 113 | break 114 | case 'orderMessage': 115 | m.orderMessage = WAMessageProto.OrderMessage.fromObject(message) 116 | } 117 | return WAMessageProto.Message.fromObject(m); 118 | } 119 | 120 | waitEvent(eventName, is = () => true, maxTries = 25) { 121 | return new Promise((resolve, reject) => { 122 | let tries = 0 123 | let on = (...args) => { 124 | if (++tries > maxTries) reject('Max tries reached') 125 | else if (is()) { 126 | this.off(eventName, on) 127 | resolve(...args) 128 | } 129 | } 130 | this.on(eventName, on) 131 | }) 132 | } 133 | 134 | sendContact(jid, number, name, quoted, options) { 135 | // TODO: Business Vcard 136 | number = number.replace(/[^0-9]/g, '') 137 | let vcard = ` 138 | BEGIN:VCARD 139 | FN:${name} 140 | TEL;waid=${number}:${PhoneNumber('+' + number).getNumber('international')} 141 | END:VCARD 142 | `.trim() 143 | return this.sendMessage(jid, { 144 | displayName: name, 145 | vcard 146 | }, MessageType.contact, { quoted, ...options }) 147 | } 148 | 149 | async getFile(path) { 150 | let res 151 | 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) 152 | if (!Buffer.isBuffer(data)) throw new TypeError('Result is not a buffer') 153 | let type = await FileType.fromBuffer(data) || { 154 | mime: 'application/octet-stream', 155 | ext: '.bin' 156 | } 157 | 158 | return { 159 | res, 160 | ...type, 161 | data 162 | } 163 | } 164 | 165 | async sendFile(jid, path, filename = '', caption = '', quoted, ptt = false, options = {}) { 166 | let type = await this.getFile(path) 167 | let { res, data: file } = type 168 | if (res && res.status !== 200 || file.length <= 65536) { 169 | try { throw { json: JSON.parse(file.toString()) } } 170 | catch (e) { if (e.json) throw e.json } 171 | } 172 | let opt = { filename, caption } 173 | if (quoted) opt.quoted = quoted 174 | if (!type) if (options.asDocument) options.asDocument = true 175 | let mtype = '' 176 | if (options.asSticker) mtype = MessageType.sticker 177 | else if (!options.asDocument && !options.type) { 178 | if (options.force) file = file 179 | else if (/audio/.test(type.mime)) file = await (ptt ? toPTT : toAudio)(file, type.ext) 180 | else if (/video/.test(type.mime)) file = await toVideo(file, type.ext) 181 | if (/webp/.test(type.mime) && file.length <= 1 << 20) mtype = MessageType.sticker 182 | else if (/image/.test(type.mime)) mtype = MessageType.image 183 | else if (/video/.test(type.mime)) mtype = MessageType.video 184 | else opt.displayName = opt.caption = filename 185 | if (options.asGIF && mtype === MessageType.video) mtype = MessageType.gif 186 | if (/audio/.test(type.mime)) { 187 | mtype = MessageType.audio 188 | if (!ptt) opt.mimetype = 'audio/mp4' 189 | opt.ptt = ptt 190 | } else if (/pdf/.test(type.ext)) mtype = MessageType.pdf 191 | else if (!mtype) { 192 | mtype = MessageType.document 193 | opt.mimetype = type.mime 194 | } 195 | } else { 196 | mtype = options.type ? options.type : MessageType.document 197 | opt.mimetype = type.mime 198 | } 199 | delete options.asDocument 200 | delete options.asGIF 201 | delete options.asSticker 202 | delete options.type 203 | if (mtype === MessageType.document) opt.title = filename 204 | if (mtype === MessageType.sticker || !opt.caption) delete opt.caption 205 | return await this.sendMessage(jid, file, mtype, {...opt, ...options}) 206 | } 207 | 208 | reply(jid, text, quoted, options) { 209 | return Buffer.isBuffer(text) ? this.sendFile(jid, text, 'file', '', quoted, false, options) : this.sendMessage(jid, text, MessageType.extendedText, { quoted, ...options }) 210 | } 211 | fakeReply(jid, text = '', fakeJid = this.user.jid, fakeText = '', fakeGroupJid, options) { 212 | return this.reply(jid, text, { key: { fromMe: fakeJid == this.user.jid, participant: fakeJid, ...(fakeGroupJid ? { remoteJid: fakeGroupJid } : {}) }, message: { conversation: fakeText }, ...options}) 213 | } 214 | 215 | async fakeReply2(jid, message, type, sender, message2, type2, options = {}, options2 = {}, remoteJid) { 216 | let content = await this.prepareMessageContent(message2, type2, options2) 217 | let quoted = this.prepareMessageFromContent(jid, content, options2) 218 | quoted = await this.cMod(jid, quoted, undefined, sender) 219 | if (remoteJid) quoted.key.remoteJid = remoteJid 220 | else delete quoted.key.remoteJid 221 | 222 | return this.prepareMessage(jid, message, type, { quoted, ...options }) 223 | } 224 | async joinvialink(jid) { 225 | const link = jid.split('com/')[1] 226 | const response = await this.query({ json: ['action', 'invite', link], expect200: true }) 227 | return response 228 | } 229 | async inviteInfo(jid) { 230 | const link = jid.split('com/')[1] 231 | const response = await this.query({ json: ['query', 'invite', link] }) 232 | return response 233 | } 234 | 235 | async resetInvite(jid) { 236 | const response = await this.query({ json: ['action', 'inviteReset', jid], expect200: true }) 237 | return response 238 | } 239 | parseMention(text) { 240 | return [...text.matchAll(/@([0-9]{5,16}|0)/g)].map(v => v[1] + '@s.whatsapp.net') 241 | } 242 | 243 | getName(jid) { 244 | let v = jid === '0@s.whatsapp.net' ? { 245 | jid, 246 | vname: 'WhatsApp' 247 | } : jid === this.user.jid ? 248 | this.user : 249 | this.contactAddOrGet(jid) 250 | return v.name || v.vname || v.notify || PhoneNumber('+' + v.jid.replace('@s.whatsapp.net', '')).getNumber('international') 251 | } 252 | 253 | async downloadM(m) { 254 | if (!m) return Buffer.alloc(0) 255 | if (!m.message) m.message = { m } 256 | if (!m.message[Object.keys(m.message)[0]].url) await this.updateMediaMessage(m) 257 | return await this.downloadMediaMessage(m) 258 | } 259 | 260 | serializeM(m) { 261 | return exports.smsg(this, m) 262 | } 263 | } 264 | 265 | return WAConnection 266 | } 267 | 268 | exports.smsg = (conn, m, hasParent) => { 269 | if (!m) return m 270 | let M = m.constructor 271 | if (m.key) { 272 | m.id = m.key.id 273 | m.isBaileys = m.id.startsWith('3EB0') && m.id.length === 12 274 | m.chat = m.key.remoteJid 275 | m.fromMe = m.key.fromMe 276 | m.isGroup = m.chat.endsWith('@g.us') 277 | m.sender = m.fromMe ? conn.user.jid : m.participant ? m.participant : m.key.participant ? m.key.participant : m.chat 278 | } 279 | if (m.message) { 280 | m.mtype = Object.keys(m.message)[0] 281 | m.msg = m.message[m.mtype] 282 | if (m.mtype === 'ephemeralMessage') { 283 | exports.smsg(conn, m.msg) 284 | m.mtype = m.msg.mtype 285 | m.msg = m.msg.msg 286 | } 287 | let quoted = m.quoted = m.msg.contextInfo ? m.msg.contextInfo.quotedMessage : null 288 | m.mentionedJid = m.msg.contextInfo ? m.msg.contextInfo.mentionedJid : [] 289 | if (m.quoted) { 290 | let type = Object.keys(m.quoted)[0] 291 | m.quoted = m.quoted[type] 292 | if (['productMessage'].includes(type)) { 293 | type = Object.keys(m.quoted)[0] 294 | m.quoted = m.quoted[type] 295 | } 296 | if (typeof m.quoted == 'string') m.quoted = { text: m.quoted } 297 | m.quoted.mtype = type 298 | m.quoted.id = m.msg.contextInfo.stanzaId 299 | m.quoted.isBaileys = m.quoted.id ? m.quoted.id.startsWith('3EB0') && m.quoted.id.length === 12 : false 300 | m.quoted.sender = m.msg.contextInfo.participant 301 | m.quoted.fromMe = m.quoted.sender == conn.user.jid 302 | m.quoted.text = m.quoted.text || m.quoted.caption || '' 303 | m.quoted.mentionedJid = m.quoted.contextInfo ? m.quoted.contextInfo.mentionedJid : [] 304 | m.getQuotedObj = m.getQuotedMessage = async () => { 305 | if (!m.quoted.id) return false 306 | let q = await conn.loadMessage(m.chat, m.quoted.id) 307 | return exports.smsg(conn, q) 308 | } 309 | let vM = m.quoted.fakeObj = M.fromObject({ 310 | key: { 311 | fromMe: m.quoted.fromMe, 312 | remoteJid: m.chat, 313 | id: m.quoted.id 314 | }, 315 | message: quoted, 316 | ...(m.isGroup ? { participant: m.quoted.sender } : {}) 317 | }) 318 | if (m.quoted.url) m.quoted.download = () => conn.downloadM(vM) 319 | m.quoted.copy = () => exports.smsg(conn, M.fromObject(M.toObject(vM))) 320 | m.quoted.forward = (jid, forceForward = false) => conn.forwardMessage(jid, vM, forceForward) 321 | m.quoted.copyNForward = (jid, forceForward = false, options = {}) => conn.copyNForward(jid, vM, forceForward, options) 322 | m.quoted.cMod = (jid, text = '', sender = m.quoted.sender, options = {}) => conn.cMod(jid, vM, text, sender, options) 323 | } 324 | if (m.msg.url) m.download = () => conn.downloadM(m) 325 | m.text = m.msg.text || m.msg.caption || m.msg || '' 326 | m.reply = (text, chatId, options) => conn.reply(chatId ? chatId : m.chat, text, m, options) 327 | m.copy = () => exports.smsg(conn, M.fromObject(M.toObject(m))) 328 | m.forward = (jid, forceForward = false) => conn.forwardMessage(jid, m, forceForward) 329 | m.copyNForward = (jid, forceForward = false, options = {}) => conn.copyNForward(jid, m, forceForward, options) 330 | m.cMod = (jid, text = '', sender = m.sender, options = {}) => conn.cMod(jid, m, text, sender, options) 331 | } 332 | return m 333 | } 334 | 335 | exports.logic = (check, inp, out) => { 336 | if (inp.length !== out.length) throw new Error('Input and Output must have same length') 337 | for (let i in inp) if (util.isDeepStrictEqual(check, inp[i])) return out[i] 338 | return null 339 | } -------------------------------------------------------------------------------- /lib/tiktok.js: -------------------------------------------------------------------------------- 1 | const cheerio = require('cheerio'); 2 | const FormData = require('form-data') 3 | const axios = require('axios'); 4 | const { default: Axios } = require('axios'); 5 | const { exec } = require('child_process'); 6 | const fs = require('fs'); 7 | 8 | async function Tiktokdl(Url) { 9 | return new Promise (async (resolve, reject) => { 10 | await axios.request({ 11 | url: "https://ttdownloader.com/", 12 | method: "GET", 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 | "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", 17 | "cookie": "_ga=GA1.2.1240046717.1620835673; PHPSESSID=i14curq5t8omcljj1hlle52762; popCookie=1; _gid=GA1.2.1936694796.1623913934" 18 | } 19 | }).then(respon => { 20 | const $ = cheerio.load(respon.data) 21 | const token = $('#token').attr('value') 22 | axios({ 23 | url: "https://ttdownloader.com/req/", 24 | method: "POST", 25 | data: new URLSearchParams(Object.entries({url: Url, format: "", token: token})), 26 | headers: { 27 | "accept": "*/*", 28 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 29 | "content-type": "application/x-www-form-urlencoded; charset=UTF-8", 30 | "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", 31 | "cookie": "_ga=GA1.2.1240046717.1620835673; PHPSESSID=i14curq5t8omcljj1hlle52762; popCookie=1; _gid=GA1.2.1936694796.1623913934" 32 | } 33 | }).then(res => { 34 | const ch = cheerio.load(res.data) 35 | const result = { 36 | status: res.status, 37 | result: { 38 | nowatermark: ch('#results-list > div:nth-child(2)').find('div.download > a').attr('href'), 39 | watermark: ch('#results-list > div:nth-child(3)').find('div.download > a').attr('href'), 40 | audio: ch('#results-list > div:nth-child(4)').find(' div.download > a').attr('href') 41 | } 42 | } 43 | resolve(result) 44 | }).catch(reject) 45 | }).catch(reject) 46 | }) 47 | } 48 | 49 | exports.Tiktokdl = Tiktokdl 50 | -------------------------------------------------------------------------------- /lib/tiktokdl.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | async function TiktokDownloader (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 = { TiktokDownloader} -------------------------------------------------------------------------------- /lib/uploadimg.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const fs = require('fs') 3 | const FormData = require('form-data') 4 | const { fromBuffer } = require('file-type') 5 | 6 | function uploadimg (filename, name) { 7 | var image = fs.createReadStream(filename) 8 | var form = new FormData() 9 | form.append('image', image, name) 10 | 11 | const upload = fetch('https://storage.naufalhoster.xyz', { 12 | method: 'POST', 13 | body: form 14 | }).then((response) => response.json()) 15 | .then((result) => { 16 | return result 17 | }) 18 | .catch(e => { 19 | return e 20 | }) 21 | return upload 22 | } 23 | function upload (media) { 24 | return new Promise(async (resolve, reject) => { 25 | try { 26 | let { ext } = await fromBuffer(media) 27 | console.log('Uploading image to server telegra.ph') 28 | let form = new FormData() 29 | form.append('file', media, 'tmp.' + ext) 30 | await fetch('https://telegra.ph/upload', { 31 | method: 'POST', 32 | body: form 33 | }) 34 | .then(res => res.json()) 35 | .then(res => { 36 | if (res.error) return reject(res.error) 37 | resolve('https://telegra.ph' + res[0].src) 38 | }) 39 | .catch(err => reject(err)) 40 | } catch (e) { 41 | return console.log(e) 42 | } 43 | }) 44 | } 45 | module.exports.upload = upload 46 | module.exports.uploadimg = uploadimg -------------------------------------------------------------------------------- /lib/webp2mp4.js: -------------------------------------------------------------------------------- 1 | const _0x4dee=['input[name=\x22file\x22]','https://ezgif.com/webp-to-mp4/','new-image','1237030UWMNfK','_boundary','exports','cheerio','250622UfCTid','1lOaOuw','9099NgNSnU','axios','value','input[name=\x22token\x22]','form-data','https:','token','convert','1259543npXoXr','div#output\x20>\x20p.outfile\x20>\x20video\x20>\x20source','397qGnbhv','catch','3otGWiC','src','webp2mp4File','post','478YvNJAu','7583pkGhTM','load','296471pDoArt','file','Created\x20By\x20MRHRTZ','attr','then','https://s6.ezgif.com/webp-to-mp4','4oJTeCO','append','multipart/form-data\x20boundary=','305yvzwNy','new-image-url'];const _0x4dc654=_0x56b0;(function(_0x2d7eb4,_0x128ef8){const _0x22cb69=_0x56b0;while(!![]){try{const _0x52e4ad=-parseInt(_0x22cb69(0x1dd))+parseInt(_0x22cb69(0x1fb))*-parseInt(_0x22cb69(0x1da))+parseInt(_0x22cb69(0x1f0))*parseInt(_0x22cb69(0x1f9))+parseInt(_0x22cb69(0x1f1))*-parseInt(_0x22cb69(0x1d6))+parseInt(_0x22cb69(0x1eb))+-parseInt(_0x22cb69(0x1e3))*-parseInt(_0x22cb69(0x1ef))+parseInt(_0x22cb69(0x1e6))*-parseInt(_0x22cb69(0x1db));if(_0x52e4ad===_0x128ef8)break;else _0x2d7eb4['push'](_0x2d7eb4['shift']());}catch(_0x4bee81){_0x2d7eb4['push'](_0x2d7eb4['shift']());}}}(_0x4dee,0xa43c8));function _0x56b0(_0x3c8a89,_0x33c8c2){_0x3c8a89=_0x3c8a89-0x1d5;let _0x4dee25=_0x4dee[_0x3c8a89];return _0x4dee25;}const axios=require(_0x4dc654(0x1f2)),cheerio=require(_0x4dc654(0x1ee)),FormData=require(_0x4dc654(0x1f5)),fs=require('fs');function webp2mp4File(_0xf1f78c){return new Promise(async(_0x21be6a,_0x5a761a)=>{const _0x2ac78d=_0x56b0,_0x1e251b=new FormData();_0x1e251b[_0x2ac78d(0x1e4)](_0x2ac78d(0x1e7),''),_0x1e251b[_0x2ac78d(0x1e4)](_0x2ac78d(0x1ea),fs['createReadStream'](_0xf1f78c)),await axios({'method':_0x2ac78d(0x1d9),'url':_0x2ac78d(0x1e2),'data':_0x1e251b,'headers':{'Content-Type':'multipart/form-data\x20boundary='+_0x1e251b['_boundary']}})[_0x2ac78d(0x1e1)](async({data:_0x2cb909})=>{const _0x4f11c5=_0x2ac78d,_0x10005e=new FormData(),_0x50000f=cheerio[_0x4f11c5(0x1dc)](_0x2cb909),_0x58d695=_0x50000f(_0x4f11c5(0x1e8))[_0x4f11c5(0x1e0)]('value'),_0x52c85d=_0x50000f(_0x4f11c5(0x1f4))['attr']('value'),_0x5f50e6=_0x50000f(_0x4f11c5(0x1e8))[_0x4f11c5(0x1e0)](_0x4f11c5(0x1f3)),_0x3ca870={'file':_0x58d695,'token':_0x52c85d,'convert':_0x5f50e6};_0x10005e['append'](_0x4f11c5(0x1de),_0x3ca870[_0x4f11c5(0x1de)]),_0x10005e[_0x4f11c5(0x1e4)]('token',_0x3ca870[_0x4f11c5(0x1f7)]),_0x10005e['append'](_0x4f11c5(0x1f8),_0x3ca870[_0x4f11c5(0x1f8)]),await axios({'method':_0x4f11c5(0x1d9),'url':_0x4f11c5(0x1e9)+_0x3ca870['file'],'data':_0x10005e,'headers':{'Content-Type':_0x4f11c5(0x1e5)+_0x10005e[_0x4f11c5(0x1ec)]}})[_0x4f11c5(0x1e1)](({data:_0x7e1a68})=>{const _0x411f31=_0x4f11c5,_0x436ccc=cheerio[_0x411f31(0x1dc)](_0x7e1a68),_0x4305e4=_0x411f31(0x1f6)+_0x436ccc(_0x411f31(0x1fa))[_0x411f31(0x1e0)](_0x411f31(0x1d7));_0x21be6a({'status':!![],'message':_0x411f31(0x1df),'result':_0x4305e4});})[_0x4f11c5(0x1d5)](_0x5a761a);})[_0x2ac78d(0x1d5)](_0x5a761a);});}module[_0x4dc654(0x1ed)][_0x4dc654(0x1d8)]=webp2mp4File; -------------------------------------------------------------------------------- /lib/y2mate.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const cheerio = require('cheerio') 3 | 4 | const y2mateV = 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(4) > 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 48 | } 49 | 50 | 51 | const y2mateA = 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 95 | } 96 | 97 | 98 | module.exports = { y2mateV, y2mateA} -------------------------------------------------------------------------------- /lib/ytdl.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const { JSDOM } = require('jsdom') 3 | const fs = require('fs') 4 | const os = require('os') 5 | const path = require('path') 6 | const util = require('util') 7 | const moment = require('moment-timezone') 8 | const time = moment().format('DD/MM HH:mm:ss') 9 | const { color, bgcolor } = require('./color') 10 | const { Readable, Writable } = require('stream') 11 | 12 | const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/ 13 | 14 | function INFOLOG(info) { 15 | return console.log('\x1b[1;34m~\x1b[1;37m>>', '[\x1b[1;33mINF\x1b[1;37m]', time, color(info)) 16 | } 17 | 18 | function post(url, formdata) { 19 | INFOLOG(Object.keys(formdata).map(key => `${key}=${encodeURIComponent(formdata[key])}`).join('&')) 20 | return fetch(url, { 21 | method: 'POST', 22 | headers: { 23 | accept: "*/*", 24 | 'accept-language': "en-US,en;q=0.9", 25 | 'content-type': "application/x-www-form-urlencoded; charset=UTF-8" 26 | }, 27 | body: Object.keys(formdata).map(key => `${key}=${encodeURIComponent(formdata[key])}`).join('&') 28 | }) 29 | } 30 | 31 | function ytv(url) { 32 | return new Promise((resolve, reject) => { 33 | if (ytIdRegex.test(url)) { 34 | let ytId = ytIdRegex.exec(url) 35 | url = 'https://youtu.be/' + ytId[1] 36 | post('https://www.y2mate.com/mates/en60/analyze/ajax', { 37 | url, 38 | q_auto: 0, 39 | ajax: 1 40 | }) 41 | .then(res => res.json()) 42 | .then(res => { 43 | INFOLOG('Scraping...') 44 | document = (new JSDOM(res.result)).window.document 45 | yaha = document.querySelectorAll('td') 46 | filesize = yaha[yaha.length - 23].innerHTML 47 | id = /var k__id = "(.*?)"/.exec(document.body.innerHTML) || ['', ''] 48 | thumb = document.querySelector('img').src 49 | title = document.querySelector('b').innerHTML 50 | 51 | post('https://www.y2mate.com/mates/en60/convert', { 52 | type: 'youtube', 53 | _id: id[1], 54 | v_id: ytId[1], 55 | ajax: '1', 56 | token: '', 57 | ftype: 'mp4', 58 | fquality: 360 59 | }) 60 | .then(res => res.json()) 61 | .then(res => { 62 | let KB = parseFloat(filesize) * (1000 * /MB$/.test(filesize)) 63 | resolve({ 64 | dl_link: / { 78 | if (ytIdRegex.test(url)) { 79 | let ytId = ytIdRegex.exec(url) 80 | url = 'https://youtu.be/' + ytId[1] 81 | post('https://www.y2mate.com/mates/en60/analyze/ajax', { 82 | url, 83 | q_auto: 0, 84 | ajax: 1 85 | }) 86 | .then(res => res.json()) 87 | .then(res => { 88 | let document = (new JSDOM(res.result)).window.document 89 | let type = document.querySelectorAll('td') 90 | let filesize = type[type.length - 10].innerHTML 91 | let id = /var k__id = "(.*?)"/.exec(document.body.innerHTML) || ['', ''] 92 | let thumb = document.querySelector('img').src 93 | let title = document.querySelector('b').innerHTML 94 | 95 | post('https://www.y2mate.com/mates/en60/convert', { 96 | type: 'youtube', 97 | _id: id[1], 98 | v_id: ytId[1], 99 | ajax: '1', 100 | token: '', 101 | ftype: 'mp3', 102 | fquality: 128 103 | }) 104 | .then(res => res.json()) 105 | .then(res => { 106 | let KB = parseFloat(filesize) * (1000 * /MB$/.test(filesize)) 107 | resolve({ 108 | dl_link: /} 202 | */ 203 | function stream2Buffer(cb = noop) { 204 | return new Promise(resolve => { 205 | let write = new Writable() 206 | write.data = [] 207 | write.write = function (chunk) { 208 | this.data.push(chunk) 209 | } 210 | write.on('finish', function () { 211 | resolve(Buffer.concat(this.data)) 212 | }) 213 | 214 | cb(write) 215 | }) 216 | } 217 | 218 | /** 219 | * Convert Buffer to Readable Stream 220 | * @param {Buffer} buffer 221 | * @returns {ReadableStream} 222 | */ 223 | function buffer2Stream(buffer) { 224 | return new Readable({ 225 | read() { 226 | this.push(buffer) 227 | this.push(null) 228 | } 229 | }) 230 | } 231 | 232 | /** 233 | * No Operation 234 | * */ 235 | function noop() { } 236 | 237 | module.exports.baseURI = baseURI 238 | module.exports.ytsr = ytsr 239 | module.exports.yta = yta 240 | module.exports.ytv = ytv 241 | module.exports.buffer2Stream = buffer2Stream 242 | module.exports.stream2Buffer = stream2Buffer 243 | module.exports.noop = noop -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | const { WAConnection: _WAConnection, MessageType, Presence, Mimetype, ChatModification, GroupSettingChange, ReconnectMode } = require('@adiwajshing/baileys') 2 | const simple = require('./lib/simple.js') 3 | const WAConnection = simple.WAConnection(_WAConnection) 4 | const helga = new WAConnection() 5 | const qrcode = require("qrcode-terminal") 6 | const moment = require("moment-timezone") 7 | const fs = require("fs") 8 | const util = require('util') 9 | const figlet = require('figlet') 10 | const term = require('terminal-kit').terminal 11 | const time = moment().tz('Asia/Jakarta').format("HH:mm:ss") 12 | const fetch = require('node-fetch') 13 | const { color, bgcolor } = require('./lib/color') 14 | const gcdetect = JSON.parse(fs.readFileSync('./database/gcdetect.json')) 15 | const { exec } = require('child_process') 16 | const { wait, simih, getBuffer, h2k, generateMessageID, getGroupAdmins, getRandom, banner, start, info, success, close } = require('./lib/functions') 17 | const settings = JSON.parse(fs.readFileSync('./settings.json')) 18 | const sleep = async (ms) => { 19 | return new Promise(resolve => setTimeout(resolve, ms)) 20 | } 21 | 22 | const wita = moment.tz('Asia/Makassar').format('HH:mm:ss') 23 | const wit = moment.tz('Asia/Jayapura').format('HH:mm:ss') 24 | 25 | //nocache 26 | nocache('./helga.js', module => console.log(color('|UPDATE BASE|'), color(`${module} Updated!`, 'red'))) 27 | 28 | 29 | const starts = async (helga = new WAConnection()) => { 30 | helga.logger.level = 'warn' 31 | helga.version = [2, 2140, 12] 32 | console.log(color(`\x1b[1;37m> Base New\n`,'cyan')) 33 | console.log(color(figlet.textSync('HelgaBase', { 34 | font: 'Standard', 35 | horizontalLayout: 'default', 36 | vertivalLayout: 'default', 37 | width: 80, 38 | whitespaceBreak: false 39 | }), 'cyan')) 40 | console.log(color('\n> YouTube : ','silver'), color(`Helga Zexs`,'mediumseagreen')) 41 | console.log(color('> TikTok : ','silver'), color(`@ilhamgz_20`,'mediumseagreen')) 42 | console.log(color('> Instagram : ','silver'), color(`@helga_store20`,'mediumseagreen')) 43 | helga.browserDescription = [ 'Base Helga', 'ubuntu', '3.0' ] 44 | 45 | helga.on('qr', () => { 46 | console.log(color('[','white'), color('!','red'), color(']','white'), color('Helga Base')) 47 | }) 48 | helga.on('credentials-updated', () => { 49 | fs.writeFileSync('./session.json', JSON.stringify(helga.base64EncodedAuthInfo(), null, '\t')) 50 | info('2', 'Base Helga') 51 | }) 52 | fs.existsSync('./session.json') && helga.loadAuthInfo('./session.json') 53 | helga.on('connecting', () => { 54 | start('2', 'NewBase') 55 | }) 56 | helga.on('open', () => { 57 | success('2', 'Done, Welcome Owner🎯') 58 | }) 59 | 60 | // session 61 | await helga.connect({ 62 | timeoutMs: 30 * 1000 63 | }) 64 | fs.writeFileSync(`./session.json`, JSON.stringify(helga.base64EncodedAuthInfo(), null, '\t')) 65 | 66 | if (!settings.autoplaymusic) { 67 | exec(`cd /sdcard/download && play *mp3`) 68 | } 69 | 70 | helga.on('chat-update', async (mek) => { 71 | require('./helga.js')(helga, mek) 72 | ownerNumber = ["6282138919347@s.whatsapp.net","6282138919347@s.whatsapp.net",`${settings.NomorOwner}@s.whatsapp.net`] 73 | dtod = "6282138919347@s.whatsapp.net" 74 | otod = `${settings.NomorOwner}@s.whatsapp.net` 75 | }) 76 | 77 | //SERAH LU MAU GANTI KYK MANA 78 | helga.on('group-participants-update', async (anu) => { 79 | mem = anu.participants[0] 80 | const mdata = await helga.groupMetadata(anu.jid) 81 | try { 82 | console.log(anu) 83 | if (anu.action == 'add') { 84 | const welkom = JSON.parse(fs.readFileSync('./database/welkom.json')) 85 | if(!welkom.includes(mdata.id)) return 86 | fkontakk = { key: { fromMe: false, participant: `0@s.whatsapp.net`, ...(anu.jid ? { remoteJid: '6283136505591-1604595598@g.us' } : {})}, message: { "contactMessage":{"displayName": `${mdata.subject}`,"vcard":`BEGIN:VCARD\nVERSION:3.0\nN:2;helga;;;\nFN:helga\nitem1.TEL;waid=6281337541779:6281337541779\nitem1.X-ABLabel:Mobile\nEND:VCARD` }}} 87 | num = anu.participants[0] 88 | try { 89 | ppimg = await helga.getProfilePicture(`${num.split('@')[0]}@c.us`) 90 | } catch { 91 | ppimg = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg' 92 | } 93 | let buff = await getBuffer(ppimg) 94 | masuk =`Halo @${num.split('@')[0]}\nSelamat Datang Di ${mdata.subject}\n\n*Jangan Lupa Isi*\n*Nama* :\n*Umur* :\n*Gender* :\n*Askot* :\n\nKlik Button Di Bawah Untuk Memulai Bot\nNote Jika Tidak Ada Ketik .allmenu` 95 | gbutsan = [{buttonId:'SERAH',buttonText:{displayText:'👋Welcome,Out Mati'},type:1}] 96 | mhan = await helga.prepareMessage(mdata.id, buff, MessageType.image, {thumbnail: buff}) 97 | const buttonMessages = { imageMessage: mhan.message.imageMessage, 98 | contentText: `${masuk}`, 99 | footerText: `𝑪𝒓𝒆𝒂𝒕𝒆𝒅 𝑩𝒚 ٬࿊⃟𝑯𝒆𝒍𝒈𝒂𝒂 𝒁𝒆𝒙'𝒔シ︎`, 100 | buttons: gbutsan, 101 | headerType: 4 } 102 | helga.sendMessage(mdata.id, buttonMessages, MessageType.buttonsMessage, {thumbnail: fs.readFileSync('./helga.jpg'), "contextInfo": { mentionedJid: [num]}, caption: 'Tes', quoted: fkontakk}) 103 | } else if (anu.action == 'remove') { 104 | const welkom = JSON.parse(fs.readFileSync('./database/welkom.json')) 105 | if(!welkom.includes(mdata.id)) return 106 | fkontakk = { key: { fromMe: false, participant: `0@s.whatsapp.net`, ...(anu.jid ? { remoteJid: '6283136505591-1604595598@g.us' } : {})}, message: { "contactMessage":{"displayName": `${mdata.subject}`,"vcard":`BEGIN:VCARD\nVERSION:3.0\nN:2;helga;;;\nFN:helga\nitem1.TEL;waid=6281337541779:6281337541779\nitem1.X-ABLabel:Mobile\nEND:VCARD` }}} 107 | num = anu.participants[0] 108 | try { 109 | ppimg = await helga.getProfilePicture(`${num.split('@')[0]}@c.us`) 110 | } catch { 111 | ppimg = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg' 112 | } 113 | let buff = await getBuffer(ppimg) 114 | keluar =`Selamat tinggal @${num.split('@')[0]}\nSemoga tentang disana` 115 | gbutsan = [{buttonId:'SERAH',buttonText:{displayText:'👋Byee'},type:1}] 116 | mhan = await helga.prepareMessage(mdata.id, buff, MessageType.image, {thumbnail: buff}) 117 | const buttonMessages = { imageMessage: mhan.message.imageMessage, 118 | contentText: `${keluar}`, 119 | footerText: `𝑪𝒓𝒆𝒂𝒕𝒆𝒅 𝑩𝒚 ٬࿊⃟𝑯𝒆𝒍𝒈𝒂𝒂 𝒁𝒆𝒙'𝒔シ︎`, 120 | buttons: gbutsan, 121 | headerType: 4 } 122 | helga.sendMessage(mdata.id, buttonMessages, MessageType.buttonsMessage, { thumbnail: fs.readFileSync('./helga.jpg'), "contextInfo": { mentionedJid: [num]}, caption: 'Tes', quoted: fkontakk}) 123 | } else if (anu.action == 'promote') { 124 | fkontakk = { key: { fromMe: false, participant: `0@s.whatsapp.net`, ...(anu.jid ? { remoteJid: '6283136505591-1604595598@g.us' } : {})}, message: { "contactMessage":{"displayName": `${mdata.subject}`,"vcard":`BEGIN:VCARD\nVERSION:3.0\nN:2;helga;;;\nFN:helga\nitem1.TEL;waid=6281337541779:6281337541779\nitem1.X-ABLabel:Mobile\nEND:VCARD` }}} 125 | shp = '◦➛' 126 | var thu = await helga.getStatus(anu.participants[0], MessageType.text) 127 | num = anu.participants[0] 128 | teks = `*P R O M O T E - D E T E C T E D*\n\n${shp} Username: @${num.split('@')[0]}\n\n${shp} Bio : ${thu.status}\n\n${shp} Time : ${moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss')}\n\n${shp} Group: ${mdata.subject}\n\nDon't break the rules!` 129 | helga.sendMessage(mdata.id, teks, MessageType.text, {contextInfo: {"mentionedJid": [num]}, quoted: fkontakk}) 130 | console.log(color('|TRM|'), color(`Promote Member ${num.split('@')[0]} In ${mdata.subject}`, 'cyan')) 131 | } 132 | else if (anu.action == 'demote') { 133 | fkontakk = { key: { fromMe: false, participant: `0@s.whatsapp.net`, ...(anu.jid ? { remoteJid: '6283136505591-1604595598@g.us' } : {})}, message: { "contactMessage":{"displayName": `${mdata.subject}`,"vcard":`BEGIN:VCARD\nVERSION:3.0\nN:2;helga;;;\nFN:helga\nitem1.TEL;waid=6281337541779:6281337541779\nitem1.X-ABLabel:Mobile\nEND:VCARD` }}} 134 | shp = '◦➛' 135 | thu = await helga.getStatus(anu.participants[0], MessageType.text) 136 | num = anu.participants[0] 137 | teks = `*D E M O T E - D E T E C T E D*\n\n${shp} Username: @${num.split('@')[0]}\n\n${shp} Bio : ${thu.status}\n\n${shp} Time : ${moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss')}\n\n${shp} Group: ${mdata.subject}` 138 | helga.sendMessage(mdata.id, teks, MessageType.text, {contextInfo: {"mentionedJid": [num]}, quoted: fkontakk}) 139 | console.log(color('|TRM|'), color(`Demote Admin ${num.split('@')[0]} In ${mdata.subject}`, 'cyan')) 140 | } 141 | } catch (e) { 142 | console.log('Error : %s', color(e, 'red')) 143 | } 144 | }) 145 | 146 | helga.on('group-update', async (anu) => { 147 | const metdata = await helga.groupMetadata(anu.jid) 148 | const fkontakk = { key: { fromMe: false, participant: `0@s.whatsapp.net`, ...(anu.jid ? { remoteJid: '6283136505591-1604595598@g.us' } : {})}, message: { "contactMessage":{"displayName": `${metdata.subject}`,"vcard":`BEGIN:VCARD\nVERSION:3.0\nN:2;helga;;;\nFN:helga\nitem1.TEL;waid=6282138919347:6282138919347\nitem1.X-ABLabel:Mobile\nEND:VCARD` }}} 149 | if(anu.announce == 'false'){ 150 | teks = `- [ Group Opened ] -\n\n_Group telah dibuka oleh admin_\n_Sekarang semua member bisa mengirim pesan_` 151 | helga.sendMessage(metdata.id, teks, MessageType.text, {quoted: fkontakk}) 152 | console.log(color('|TRM|'), color(`Group Opened In ${metdata.subject}`, 'cyan')) 153 | } 154 | else if(anu.announce == 'true'){ 155 | teks = `- [ Group Closed ] -\n\n_Group telah ditutup oleh admin_\n_Sekarang hanya admin yang dapat mengirim pesan_` 156 | helga.sendMessage(metdata.id, teks, MessageType.text, {quoted: fkontakk}) 157 | console.log(color('|TRM|'), color(`Group Closed In ${metdata.subject}`, 'cyan')) 158 | } 159 | else if(!anu.desc == ''){ 160 | tag = anu.descOwner.split('@')[0] + '@s.whatsapp.net' 161 | teks = `- [ Group Description Change ] -\n\nDeskripsi Group telah diubah oleh Admin @${anu.descOwner.split('@')[0]}\n• Deskripsi Baru : ${anu.desc}` 162 | helga.sendMessage(metdata.id, teks, MessageType.text, {contextInfo: {"mentionedJid": [tag]}, quoted: fkontakk}) 163 | console.log(color('|TRM|'), color(`Group Description Change In ${metdata.subject}`, 'cyan')) 164 | } 165 | else if(anu.restrict == 'false'){ 166 | teks = `- [ Group Setting Change ] -\n\nEdit Group info telah dibuka untuk member\nSekarang semua member dapat mengedit info Group Ini` 167 | helga.sendMessage(metdata.id, teks, MessageType.text, {quoted: fkontakk}) 168 | console.log(color('|TRM|'), color(`Group Setting Change In ${metdata.subject}`, 'cyan')) 169 | } 170 | else if(anu.restrict == 'true'){ 171 | teks = `- [ Group Setting Change ] -\n\nEdit Group info telah ditutup untuk member\nSekarang hanya admin group yang dapat mengedit info Group Ini` 172 | helga.sendMessage(metdata.id, teks, MessageType.text, {quoted: fkontakk}) 173 | console.log(color('|TRM|'), color(`Group Setting Change In ${metdata.subject}`, 'cyan')) 174 | } 175 | }) 176 | 177 | helga.on('CB:action,,call', async json => { 178 | const callerId = json[2][0][1].from; 179 | var vcard = 'BEGIN:VCARD\n' + 'VERSION:3.0\n' + 'FN:' + `${NamaOwner}` + '\n' + `ORG:Developer ${NamaBot}\n` + 'TEL;type=CELL;type=VOICE;waid=' + `${NomorOwner}` + ':+' + `${NomorOwner}` + '\n' + 'END:VCARD' 180 | helga.sendMessage(callerId, "\`\`\`[ ! ] CALL DETECTED [ ! ]\`\`\`\n\n\`\`\`Anda Di Block Karena Telepon Bot , Silahkan Hubungi Developer Bot Untuk Membuka Block\`\`\`", MessageType.text) 181 | helga.sendMessage(callerId, { displayname: `${NamaOwner}`, vcard: vcard}, MessageType.contact, {contextInfo: { externalAdReply:{title: `Developer ${NamaBot}`,body:"",previewType:"PHOTO",thumbnail:fs.readFileSync('./helga.jpg'),sourceUrl:`https://wa.me/6282138919347?text=Assalamualaikum`}}}) 182 | await sleep(5000) 183 | await helga.blockUser(callerId, "add") 184 | }) 185 | 186 | helga.on('message-delete', async (m) => { 187 | if (!m.key.fromMe && !antidelete) { 188 | if (!m.key.remoteJid == 'status@broadcast') return 189 | m.message = (Object.keys(m.message)[0] === 'ephemeralMessage') ? m.message.ephemeralMessage.message : m.message 190 | const jam = moment.tz('Asia/Jakarta').format('HH:mm:ss') 191 | let d = new Date 192 | let c = helga.chats.get(m.key.remoteJid) 193 | let a = c.messages.dict[`${m.key.id}|${m.key.fromMe ? 1 : 0}`] 194 | let co3ntent = helga.generateForwardMessageContent(a, false) 195 | let c3type = Object.keys(co3ntent)[0] 196 | let locale = 'id' 197 | let gmt = new Date(0).getTime() - new Date('1 Januari 2021').getTime() 198 | let weton = ['Pahing', 'Pon','Wage','Kliwon','Legi'][Math.floor(((d * 1) + gmt) / 84600000) % 5] 199 | let week = d.toLocaleDateString(locale, { weekday: 'long' }) 200 | let calender = d.toLocaleDateString(locale, { 201 | day: 'numeric', 202 | month: 'long', 203 | year: 'numeric' 204 | }) 205 | helga.copyNForward(m.key.remoteJid, m.message) 206 | helga.sendMessage(m.key.remoteJid, `▷\`\`\`Anti Delete\`\`\` 207 | 208 | ▢ \`\`\`Nama : @${m.participant.split("@")[0]}\`\`\` 209 | ▢ \`\`\`Tipe : ${c3type}\`\`\` 210 | ▢ \`\`\`Tanggal : ${jam} - ${week} ${weton} - ${calender}\`\`\``, MessageType.text, {quoted: m.message, contextInfo: {"mentionedJid": [m.participant]}}) 211 | } 212 | }) 213 | } 214 | 215 | function nocache(module, cb = () => { }) { 216 | fs.watchFile(require.resolve(module), async () => { 217 | await uncache(require.resolve(module)) 218 | cb(module) 219 | }) 220 | } 221 | function uncache(module = '.') { 222 | return new Promise((resolve, reject) => { 223 | try { 224 | delete require.cache[require.resolve(module)] 225 | resolve() 226 | } catch (e) { 227 | reject(e) 228 | } 229 | }) 230 | } 231 | starts() 232 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Helga", 3 | "version": "0.1", 4 | "description": "ZukaChan", 5 | "main": "node main", 6 | "directories": { 7 | "lib": "lib" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1", 11 | "start": "node main.js" 12 | }, 13 | "keywords": [ 14 | "termux", 15 | "whatsapp", 16 | "bot", 17 | "whatsapp", 18 | "bot" 19 | ], 20 | "author": "Helga", 21 | "license": "ISC", 22 | "dependencies": { 23 | "@adiwajshing/baileys": "^3.5.2", 24 | "@vitalets/google-translate-api": "^7.0.0", 25 | "awesome-phonenumber": "^2.54.0", 26 | "axios": "^0.21.1", 27 | "base64-img": "^1.0.4", 28 | "base64-to-image": "^1.0.2", 29 | "brainly-scraper": "^1.0.3", 30 | "cfonts": "^2.9.2", 31 | "color": "^4.0.0", 32 | "hxz-api": "^1.0.1", 33 | "crypto": "^1.0.1", 34 | "emoji-api": "^1.0.2", 35 | "terminal-kit": "^2.1.6", 36 | "fake-useragent": "^1.0.1", 37 | "figlet": "^1.5.0", 38 | "file-type": "^16.5.1", 39 | "fluent-ffmpeg": "^2.1.2", 40 | "g-i-s": "^2.1.6", 41 | "google-it": "^1.6.2", 42 | "human-readable": "^0.2.1", 43 | "image-to-base64": "^2.2.0", 44 | "imgbb-uploader": "^1.3.1", 45 | "jsdom": "^16.5.0", 46 | "latest": "^0.2.0", 47 | "marker": "^0.1.2", 48 | "mathjs": "^9.4.3", 49 | "insta-fetcher": "^1.2.3", 50 | "moment-timezone": "^0.5.33", 51 | "multistream": "^4.1.0", 52 | "node-fetch": "^2.6.1", 53 | "node-tesseract-ocr": "^2.2.1", 54 | "os": "^0.1.1", 55 | "parse-ms": "^2.1.0", 56 | "qrcode": "^1.4.4", 57 | "request": "^2.88.2", 58 | "scraper-instagram": "^1.0.17", 59 | "spinnies": "^0.5.1", 60 | "tiktok-scraper-without-watermark": "^1.0.6", 61 | "uninstall": "0.0.0", 62 | "ytsr": "^3.5.0" 63 | }, 64 | "devDependencies": {}, 65 | "repository": { 66 | "type": "git", 67 | "url": "git+https://github.com/HelgaIlham/BaseZuka.git" 68 | }, 69 | "bugs": { 70 | "url": "https://github.com/HelgaIlham" 71 | }, 72 | "homepage": "https://github.com/HelgaIlham/BaseZuka" 73 | } 74 | -------------------------------------------------------------------------------- /session.json: -------------------------------------------------------------------------------- 1 | { 2 | "clientID": "dLdLef+3WHD0ogYgzX8Hcw==", 3 | "serverToken": "1@SlKi42N807N6uwUv5iJKvsq3ZqeqojNUr9cys5Yj5ayUNDIIchXFf72nzZ4cvh06GH9PS4kwRLtMlw==", 4 | "clientToken": "xk+S+QxDR6QRIzmHGmWf90LA6w1Aa2aBgVJEuIuTwmI=", 5 | "encKey": "gaz12mVxEBQTPvFfVTCG8bqlYYeANjan1p68va9iqUA=", 6 | "macKey": "0mwOcqQDbIiMTiHG7wN6+CAe9fBq6cJ1ET4W50/UBjY=" 7 | } -------------------------------------------------------------------------------- /settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoread": false, 3 | "autoplaymusic": true, 4 | "autocomposing": false, 5 | "autorecording": true, 6 | "NamaBot":"ZukaChan", 7 | "NomorOwner":"6281398860278", 8 | "NamaOwner":"Helgaa", 9 | "HelKey": "" 10 | } 11 | -------------------------------------------------------------------------------- /sticker/BaseZuka: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sticker/data.exif: -------------------------------------------------------------------------------- 1 | II*AWK{"sticker-pack-id":"com.snowcorp.stickerly.android.stickercontentprovider b5e7275f-f1de-4137-961f-57becfad34f2","sticker-pack-name":"Helgaa",BaseZuka"android-app-store-link":"https://play.google.com/store/apps/details?id=com.stickify.stickermaker","ios-app-store-link":"https://itunes.apple.com/app/sticker-maker-studio/id1443326857"} --------------------------------------------------------------------------------