├── antidelete
├── gc-revoked.json
├── msg.data.json
├── ct-revoked-banlist.json
├── ct-revoked.json
└── antidelete.js
├── media
└── aqul.jpeg
├── lib
├── setting.json
├── color.js
├── uploadimage.js
└── exif.js
├── .gitignore
├── install.sh
├── sticker
└── data.exif
├── whatsapp
├── mess.json
├── connect.js
└── message.js
├── package.json
├── README.md
└── xinz.js
/antidelete/gc-revoked.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/antidelete/msg.data.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/antidelete/ct-revoked-banlist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/antidelete/ct-revoked.json:
--------------------------------------------------------------------------------
1 | {
2 | "data": false
3 | }
--------------------------------------------------------------------------------
/media/aqul.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zennn08/BaseSelfBot/HEAD/media/aqul.jpeg
--------------------------------------------------------------------------------
/lib/setting.json:
--------------------------------------------------------------------------------
1 | {
2 | "fake":"'© 𝐗𝐢𝐧𝐳-𝐓𝐞𝐚𝐦",
3 | "fakeimage": "fs.readFileSync(`./media/aqul.jpeg`)",
4 | "prefix": "z"
5 | }
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Dependency directories
2 | node_modules/
3 |
4 | # Optional npm cache directories
5 | .npm
6 |
7 | # sessions file
8 | aqulzz.json
9 |
--------------------------------------------------------------------------------
/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 | }
15 |
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | apt-get update
4 | apt-get upgrade
5 | apt-get install -y nodejs libwebp ffmpeg wget tesseract
6 | wget -O ~/../usr/share/tessdata/ind.traineddata "https://github.com/tesseract-ocr/tessdata/blob/master/ind.traineddata?raw=true"
7 | npm install
8 |
9 | echo "[*] All dependencies have been installed, please run the command \"npm start\" to immediately start the script"
--------------------------------------------------------------------------------
/sticker/data.exif:
--------------------------------------------------------------------------------
1 | II* AW m {"sticker-pack-id":"com.snowcorp.stickerly.android.stickercontentprovider b5e7275f-f1de-4137-961f-57becfad34f2","sticker-pack-name":"BaseSelfBot","sticker-pack-publisher":"aqulzz","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"}
--------------------------------------------------------------------------------
/whatsapp/mess.json:
--------------------------------------------------------------------------------
1 | {
2 | "wait": "*Tunggu permintaan anda sedang diproses*",
3 | "error": {
4 | "Iv": "Link yang kamu berikan tidak valid",
5 | "api": "Maaf terjadi kesalahan"
6 | },
7 | "OnlyGrup": "Perintah ini hanya bisa digunakan di grup",
8 | "OnlyPM": "Perintah ini hanya bisa digunakan di private message",
9 | "GrupAdmin": "Perintah ini hanya bisa digunakan oleh Admin Grup",
10 | "BotAdmin": "Bot Harus menjadi admin",
11 | "OnlyOwner": "Perintah ini hanya dapat digunakan oleh owner bot",
12 | "OnlyPrem": "Perintah ini khusus member premium"
13 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "BaseSelfBot",
3 | "version": "0.0.1",
4 | "description": "Ga ada",
5 | "main": "xinz.js",
6 | "directories": {
7 | "lib": "lib"
8 | },
9 | "scripts": {
10 | "test": "echo \"Error: no test specified\" && exit 1",
11 | "start": "node xinz.js"
12 | },
13 | "author": "aqulzz",
14 | "dependencies": {
15 | "@adiwajshing/baileys": "^3.4.1",
16 | "axios": "^0.21.1",
17 | "figlet": "^1.5.0",
18 | "fluent-ffmpeg": "^2.1.2",
19 | "moment-timezone": "^0.5.33",
20 | "node-fetch": "^2.6.1",
21 | "request": "^2.88.2"
22 | },
23 | "repository": {
24 | "type": "git",
25 | "url": "git+https://github.com/zennn08/BaseSelfBot.git"
26 | },
27 | "bugs": {
28 | "url": "https://github.com/zennn08/BaseSelfBot/issues"
29 | },
30 | "homepage": "https://github.com/zennn08/BaseSelfBot#readme"
31 | }
32 |
--------------------------------------------------------------------------------
/whatsapp/connect.js:
--------------------------------------------------------------------------------
1 | /*
2 | HAI NAMAKU AQULZZ
3 | YAH DISINI AKU SEBAGAI PEMULA MAU MENCOBA MEMBUAT BOT KU SENDIRI
4 | YANG PASTINYA BANYAK COPY PASTE
5 | OKE TERIMA KASIH
6 | */
7 | const { WAConnection, MessageType } = require("@adiwajshing/baileys")
8 | const qrcode = require("qrcode-terminal")
9 | const figlet = require('figlet')
10 | const fs = require('fs')
11 | const { color } = require('../lib/color')
12 |
13 | const xinz = new WAConnection()
14 | exports.xinz = xinz
15 |
16 | exports.connect = async() => {
17 | let authofile = './aqulzz.json'
18 | xinz.version = [2, 2119, 6]
19 | xinz.logger.level = 'warn'
20 | console.log(color(figlet.textSync('Base Self Bot', {
21 | font: 'Standard',
22 | horizontalLayout: 'default',
23 | vertivalLayout: 'default',
24 | width: 80,
25 | whitespaceBreak: false
26 | }), 'cyan'))
27 | console.log(color('[ CREATED BY AQULZZ ]'))
28 | xinz.on('qr', qr => {
29 | qrcode.generate(qr, { small: true })
30 | console.log(color('[XINZ]', 'yellow'), color('Scan Qr'))
31 | })
32 | /*
33 | xinz.on('credentials-updated', () => {
34 | fs.writeFileSync(authofile, JSON.stringify(xinz.base64EncodedAuthInfo(), null, '\t'))
35 | console.log(color('Wait....'))
36 | })
37 | */
38 | fs.existsSync(authofile) && xinz.loadAuthInfo(authofile)
39 | xinz.on('connecting', () => {
40 | console.log(color('[XINZ]', 'yellow'), color('Connecting...'))
41 | })
42 | xinz.on('open', () => {
43 | console.log(color('[XINZ]', 'yellow'), color('Connect'))
44 | })
45 | await xinz.connect({timeoutMs: 30*1000})
46 | fs.writeFileSync(authofile, JSON.stringify(xinz.base64EncodedAuthInfo(), null, '\t'))
47 | console.log(color(' ===================================================='))
48 | console.log(color('│ + Github : https://github.com/zennn08/BaseSelfBot │'))
49 | console.log(color('│ + Donate : https://trakteer.id/aqulzz │'))
50 | console.log(color(' ===================================================='))
51 | return xinz
52 | }
53 |
--------------------------------------------------------------------------------
/lib/uploadimage.js:
--------------------------------------------------------------------------------
1 | const fetch = require('node-fetch')
2 | const { default: Axios } = require('axios')
3 | const fs = require('fs')
4 | const FormData = require('form-data')
5 | const fromBuffer = require('file-type')
6 |
7 | const uptotele = async (media) => new Promise(async (resolve, reject) => {
8 | try {
9 | let { ext } = await fromBuffer(media)
10 | console.log('Uploading image to server telegra.ph')
11 | let form = new FormData()
12 | form.append('file', media, 'tmp.' + ext)
13 | await fetch('https://telegra.ph/upload', {
14 | method: 'POST',
15 | body: form
16 | })
17 | .then(res => res.json())
18 | .then(res => {
19 | if (res.error) return reject(res.error)
20 | resolve('https://telegra.ph' + res[0].src)
21 | console.log('ok sukses')
22 | })
23 | .catch(err => reject(err))
24 | } catch (e) {
25 | return console.log(e)
26 | }
27 | })
28 |
29 | function uptonaufal (filename, name) {
30 | var image = fs.createReadStream(filename)
31 | var form = new FormData()
32 | form.append('image', image, name)
33 |
34 | const upload = fetch('https://storage.naufalhoster.xyz', {
35 | method: 'POST',
36 | body: form
37 | }).then((response) => response.json())
38 | .then((result) => {
39 | return result
40 | })
41 | .catch(e => {
42 | return e
43 | })
44 | return upload
45 | }
46 |
47 | const uploadFile = (path) => new Promise((resolve, reject) => { // benny
48 | const fd = new FormData()
49 | fd.append('sampleFile', fs.createReadStream(path))
50 | Axios({
51 | method: 'POST',
52 | url: 'https://api-self.herokuapp.com/upload',
53 | data: fd,
54 | headers: {
55 | 'user-agent': 'MRHRTZ-ZONE :D',
56 | 'content-type': `multipart/form-data; boundary=${fd._boundary}`
57 | }
58 | }).then(({ data }) => resolve(data)).catch(reject)
59 | })
60 |
61 | exports.uptotele = uptotele
62 | exports.uptonaufal = uptonaufal
63 | exports.uploadFile = uploadFile
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
22 |
23 |
24 | ---
25 |
26 |
27 |
28 | # Requirements
29 | * [Node.js](https://nodejs.org/en/)
30 | * [Git](https://git-scm.com/downloads)
31 | * [FFmpeg](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2020-12-08-13-03/ffmpeg-n4.3.1-26-gca55240b8c-win64-gpl-4.3.zip)
32 | * [Libwebp](https://developers.google.com/speed/webp/download)
33 | * Any text editor
34 |
35 | # Instalasi
36 | ## Clone Repo & Instalasi dependencies
37 | ```bash
38 | > git clone https://github.com/zennn08/BaseSelfBot.git
39 | > cd BaseSelfBot
40 | > npm install
41 | > node xinz
42 | ```
43 | ## For Termux
44 | ```bash
45 | > termux-setup-storage
46 | > apt update && apt upgrade
47 | > pkg install nodejs
48 | > pkg install git
49 | > pkg install bash
50 | > git clone https://github.com/zennn08/BaseSelfBot.git
51 | > cd BaseSelfBot
52 | > bash install.sh
53 | > npm install
54 | > node xinz
55 | ```
56 |
57 | ## Edit file
58 | - Change menu [disini](https://github.com/zennn08/BaseSelfBot/blob/master/xinz.js#95)
59 | - Change prefix [disini](https://github.com/zennn08/BaseSelfBot/blob/master/xinz.js#35)
60 | - Change faketeks [disini](https://github.com/zennn08/BaseSelfBot/blob/master/xinz.js#33)
61 | - Change gambar [disini](https://github.com/zennn08/BaseSelfBot/blob/master/media/aqul.jpeg) di replace gambar nya dan jangan diubah namanya
62 | - Bisa juga ganti biar jadi forwarded message
63 | ```js
64 | aqul.sendFakeStatus(from, teks, fake)
65 | // bisa diubah menjadi
66 | aqul.FakeStatusForwarded(from, teks, fake)
67 |
68 | aqul.sendFakeStatusWithImg(from, image, caption, faketeks)
69 | // bisa diubah menjadi
70 | aqul.FakeStatusImgForwarded(from, image, caption, faketeks)
71 |
72 | aqul.sendFakeToko(from, teks, fake)
73 | // bisa diubah menjadi
74 | aqul.FakeTokoForwarded(from, teks, fake)
75 | ```
76 |
77 | ## Installing the FFmpeg
78 | * Unduh salah satu versi FFmpeg yang tersedia dengan mengklik [di sini](https://www.gyan.dev/ffmpeg/builds/).
79 | * Extract file ke `C:\` path.
80 | * Ganti nama folder yang telah di-extract menjadi `ffmpeg`.
81 | * Run Command Prompt as Administrator.
82 | * Jalankan perintah berikut::
83 | ```cmd
84 | > setx /m PATH "C:\ffmpeg\bin;%PATH%"
85 | ```
86 | Jika berhasil, akan memberikanmu pesan seperti: `SUCCESS: specified value was saved`.
87 | * Sekarang setelah Anda menginstal FFmpeg, verifikasi bahwa itu berhasil dengan menjalankan perintah ini untuk melihat versi:
88 | ```cmd
89 | > ffmpeg -version
90 | ```
91 |
92 |
93 | ## Installing the libwebp
94 | * Unduh salah satu versi libwebp yang tersedia dengan mengklik [di sini](https://developers.google.com/speed/webp/download).
95 | * Extract file ke `C:\` path.
96 | * Ganti nama folder yang telah di-extract menjadi `libwebp`.
97 | * Run Command Prompt as Administrator.
98 | * Jalankan perintah berikut::
99 | ```cmd
100 | > setx /m PATH "C:\libwebp\bin;%PATH%"
101 | ```
102 | Jika berhasil, akan memberikanmu pesan seperti: `SUCCESS: specified value was saved`.
103 | * Sekarang setelah Anda menginstal libwebp, verifikasi bahwa itu berhasil dengan menjalankan perintah ini untuk melihat versi:
104 | ```cmd
105 | > webpmux -version
106 | ```
107 |
108 | ## Menjalankan bot
109 | ```bash
110 | > node xinz
111 | atau bisa juga
112 | > npm start
113 | ```
114 |
115 | Setelah itu, akan ada QR-CODE, buka WhatsApp-mu yg ingin dijadikan bot, lalu scan code-qr nya!
116 |
117 | ## Bot Tidak jalan
118 | - Jika bot tidak jalan, coba ganti versi baileys
119 | ```bash
120 | > npm i @adiwajshing/baileys@3.4.1
121 | > atau
122 | > npm i @adiwajshing/baileys@3.3.0
123 | ```
124 | - Serah aja
125 |
126 | ## Note
127 | - Jangan lupa kasih credit
128 |
129 | # Features
130 |
131 | | Menu nya dikit |✅|
132 | | ------------- | ------------- |
133 | | Sticker WM|✅|
134 | | Costum WM|✅|
135 | | TakeSticker|✅|
136 | | Switch Self Public|✅|
137 | | Hidetag|✅|
138 | | Runtime|✅|
139 | | Speed|✅|
140 | | Set Reply|✅|
141 | | Set Prefix|✅|
142 | | Set Name|✅|
143 | | Set Profile Picture|✅|
144 | | Set Bio|✅|
145 | | Fake Deface|✅|
146 | | Fake Thumbnail|✅|
147 | | Set thumb|✅|
148 | | Get pic|✅|
149 | | Sticker Tag|✅|
150 | | Image Tag|✅|
151 | | Kontak Tag|✅|
152 | | Document Tag|✅|
153 | | Giphy Tag|✅|
154 | | Forwarded Message|✅|
155 | | Eval|✅|
156 | | Tahta|✅|
157 | | Pubg|✅|
158 | | Promote|✅|
159 | | Demote|✅|
160 | | Kick|✅|
161 | | Add|✅|
162 | | Create Group|✅|
163 | | Get Group|✅|
164 | | UpStatus Text|✅|
165 | | UpStatus Image|✅|
166 | | UpStatus Video|✅|
167 | | To Video|✅|
168 | | To Gif|✅|
169 | | Img To Url|✅|
170 | | Media To Url|✅|
171 | | Antidelets|✅|
172 |
173 | # Thanks to
174 | * [`Baileys`](https://github.com/adiwajshing/Baileys)
175 | * [`MhankBarBar`](https://github.com/MhankBarBar)
176 | * [`MRHRTZ`](https://github.com/MRHRTZ)
177 | * [`Mamet`](https://github.com/mamet8/)
178 | * [`SlavyanDesu`](https://github.com/SlavyanDesu)
179 | * [`VideFrelan`](https://github.com/VideFrelan)
180 | * [`TobyG74`](https://github.com/TobyG74)
181 | * [`DhyZx`](https://github.com/dhyZx)
182 | * [`Dehanjing`](https://github.com/Dehante)
183 |
--------------------------------------------------------------------------------
/whatsapp/message.js:
--------------------------------------------------------------------------------
1 | const {
2 | MessageType,
3 | Mimetype,
4 | WAConnection
5 | } = require("@adiwajshing/baileys");
6 | const fs = require('fs');
7 | const conn = require('./connect');
8 | const axios = require('axios');
9 | const request = require('request');
10 | const { resolve } = require("path");
11 |
12 | const xinz = conn.xinz
13 |
14 | exports.sendText = (from, text) => {
15 | xinz.sendMessage(from, text, MessageType.text)
16 | }
17 | exports.sendImage = (from, image, caption, qul) => {
18 | xinz.sendMessage(from, image, MessageType.image, {quoted: qul, caption: caption})
19 | }
20 | exports.sendVideo = (from, video, caption, qul) => {
21 | xinz.sendMessage(from, video, MessageType.video, {quoted: qul, caption: caption})
22 | }
23 | exports.sendGif = (from, gif) => {
24 | xinz.sendMessage(from, gif, MessageType.video, {mimetype: "video/gif"})
25 | }
26 | exports.reply = (from, text, qul) => {
27 | xinz.sendMessage(from, text, MessageType.text, {quoted: qul})
28 | }
29 | exports.sendSticker = (from, filename, qul) => {
30 | xinz.sendMessage(from, filename, MessageType.sticker, {quoted: qul})
31 | }
32 | exports.sendKontak = (from, nomor, nama) => {
33 | const 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'
34 | xinz.sendMessage(from, {displayname: nama, vcard: vcard}, MessageType.contact)
35 | }
36 | exports.sendFakeStatus = (from, teks, faketeks) => {
37 | xinz.sendMessage(from, teks, MessageType.text, { quoted: { key: { fromMe: false, participant: `0@s.whatsapp.net`, ...(from ? { remoteJid: "status@broadcast" } : {}) }, message: { "imageMessage": { "mimetype": "image/jpeg", "caption": faketeks, "jpegThumbnail": fs.readFileSync(`./media/aqul.jpeg`)} } } })
38 | }
39 | exports.FakeStatusForwarded = (from, teks, faketeks) => {
40 | xinz.sendMessage(from, teks, MessageType.text, { quoted: { key: { fromMe: false, participant: `0@s.whatsapp.net`, ...(from ? { remoteJid: "status@broadcast" } : {}) }, message: { "imageMessage": { "mimetype": "image/jpeg", "caption": faketeks, "jpegThumbnail": fs.readFileSync(`./media/aqul.jpeg`)} }, contextInfo: {"forwardingScore": 999, "isForwarded": true} } })
41 | }
42 | exports.FakeStatusImgForwarded = (from, image, caption, faketeks) => {
43 | xinz.sendMessage(from, image, MessageType.image, { quoted: { key: { fromMe: false, participant: `0@s.whatsapp.net`, ...(from ? { remoteJid: "status@broadcast" } : {}) }, message: { "imageMessage": { "mimetype": "image/jpeg", "caption": faketeks, "jpegThumbnail": fs.readFileSync(`./media/aqul.jpeg`)} } }, caption: caption, contextInfo: {"forwardingScore": 999, "isForwarded": true} })
44 | }
45 | exports.sendFakeStatusWithImg = (from, image, caption, faketeks) => {
46 | xinz.sendMessage(from, image, MessageType.image, { quoted: { key: { fromMe: false, participant: `0@s.whatsapp.net`, ...(from ? { remoteJid: "status@broadcast" } : {}) }, message: { "imageMessage": { "mimetype": "image/jpeg", "caption": faketeks, "jpegThumbnail": fs.readFileSync(`./media/aqul.jpeg`)} } }, caption: caption })
47 | }
48 | exports.sendMention = (from, text, orangnya, qul) => {
49 | xinz.sendMessage(from, text, MessageType.extendedText, {contextInfo: {mentionedJid: orangnya}, quoted: qul})
50 | }
51 | exports.hideTag = async function(from, text){
52 | let anu = await xinz.groupMetadata(from)
53 | let members = anu.participants
54 | let ane = []
55 | for (let i of members){
56 | ane.push(i.jid)
57 | }
58 | xinz.sendMessage(from, text, MessageType.text, {contextInfo: {"mentionedJid": ane}})
59 | }
60 | exports.hideTagImg = async function(from, image){
61 | let anu = await xinz.groupMetadata(from)
62 | let members = anu.participants
63 | let ane = []
64 | for (let i of members){
65 | ane.push(i.jid)
66 | }
67 | xinz.sendMessage(from, image, MessageType.image, {contextInfo: {"mentionedJid": ane}})
68 | }
69 | exports.hideTagSticker = async function(from, sticker){
70 | let anu = await xinz.groupMetadata(from)
71 | let members = anu.participants
72 | let ane = []
73 | for (let i of members){
74 | ane.push(i.jid)
75 | }
76 | xinz.sendMessage(from, sticker, MessageType.sticker, {contextInfo: {"mentionedJid": ane}})
77 | }
78 | exports.hideTagKontak = async function(from, nomor, nama){
79 | 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'
80 | let anu = await xinz.groupMetadata(from)
81 | let members = anu.participants
82 | let ane = []
83 | for (let i of members){
84 | ane.push(i.jid)
85 | }
86 | xinz.sendMessage(from, {displayname: nama, vcard: vcard}, MessageType.contact, {contextInfo: {"mentionedJid": ane}})
87 | }
88 | exports.getRandom = (ext) => {
89 | return `${Math.floor(Math.random() * 10000)}${ext}`
90 | }
91 | exports.sleep = async (ms) => {
92 | return new Promise(resolve => setTimeout(resolve, ms));
93 | }
94 | exports.runtime = function(seconds) {
95 | seconds = Number(seconds);
96 | var d = Math.floor(seconds / (3600 * 24));
97 | var h = Math.floor(seconds % (3600 * 24) / 3600);
98 | var m = Math.floor(seconds % 3600 / 60);
99 | var s = Math.floor(seconds % 60);
100 | var dDisplay = d > 0 ? d + (d == 1 ? " day, " : " days, ") : "";
101 | var hDisplay = h > 0 ? h + (h == 1 ? " hour, " : " hours, ") : "";
102 | var mDisplay = m > 0 ? m + (m == 1 ? " minute, " : " minutes, ") : "";
103 | var sDisplay = s > 0 ? s + (s == 1 ? " second" : " seconds") : "";
104 | return dDisplay + hDisplay + mDisplay + sDisplay;
105 | }
106 | exports.FakeTokoForwarded = (from, teks, fake) => {
107 | anu = {
108 | key: {
109 | fromMe: false,
110 | participant: `0@s.whatsapp.net`, ...(from ? { remoteJid: "status@broadcast" } : {})
111 | },
112 | message: {
113 | "productMessage": {
114 | "product": {
115 | "productImage":{
116 | "mimetype": "image/jpeg",
117 | "jpegThumbnail": fs.readFileSync(`./media/aqul.jpeg`)
118 | },
119 | "title": fake,
120 | "description": "Self Aqulzz nih Boss",
121 | "currencyCode": "IDR",
122 | "priceAmount1000": "50000000",
123 | "retailerId": "Self Bot",
124 | "productImageCount": 1
125 | },
126 | "businessOwnerJid": `0@s.whatsapp.net`
127 | }
128 | }
129 | }
130 | xinz.sendMessage(from, teks, MessageType.text, {quoted: anu, contextInfo: {"forwardingScore": 999, "isForwarded": true}})
131 | }
132 | exports.sendFakeToko = (from, teks, fake) => {
133 | anu = {
134 | key: {
135 | fromMe: false,
136 | participant: `0@s.whatsapp.net`, ...(from ? { remoteJid: "status@broadcast" } : {})
137 | },
138 | message: {
139 | "productMessage": {
140 | "product": {
141 | "productImage":{
142 | "mimetype": "image/jpeg",
143 | "jpegThumbnail": fs.readFileSync(`./media/aqul.jpeg`)
144 | },
145 | "title": fake,
146 | "description": "Self Aqulzz nih Boss",
147 | "currencyCode": "IDR",
148 | "priceAmount1000": "50000000",
149 | "retailerId": "Self Bot",
150 | "productImageCount": 1
151 | },
152 | "businessOwnerJid": `0@s.whatsapp.net`
153 | }
154 | }
155 | }
156 | xinz.sendMessage(from, teks, MessageType.text, {quoted: anu})
157 | }
158 | exports.sendFakeThumb = async function(from, url, title, desc, comnya, fotonya){
159 | var anoim = {
160 | detectLinks: false
161 | }
162 | var qul = await xinz.generateLinkPreview(url)
163 | qul.title = title
164 | qul.description = desc
165 | qul.jpegThumbnail = fotonya ? fotonya : fs.readFileSync(`./media/aqul.jpeg`)
166 | qul.canonicaUrl = comnya
167 | xinz.sendMessage(from, qul, MessageType.extendedText, anoim)
168 | }
169 | exports.sendFakeImg = function(from, imageasli, caption, thumbnail, qul){
170 | let ai = {
171 | thumbnail: thumbnail ? thumbnail : fs.readFileSync(`./media/aqul.jpeg`),
172 | quoted: qul ? qul : ''
173 | }
174 | xinz.sendMessage(from, imageasli, MessageType.image, ai)
175 | }
176 | exports.sendMediaURL = async(to, url, text="", qul, mids=[]) =>{
177 | if(mids.length > 0){
178 | text = normalizeMention(to, text, mids)
179 | }
180 | const fn = Date.now() / 10000;
181 | const filename = fn.toString()
182 | let mime = ""
183 | var download = function (uri, filename, callback) {
184 | request.head(uri, function (err, res, body) {
185 | mime = res.headers['content-type']
186 | request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);
187 | });
188 | };
189 | download(url, filename, async function () {
190 | console.log('done');
191 | let media = fs.readFileSync(filename)
192 | let type = mime.split("/")[0]+"Message"
193 | if(mime === "image/gif"){
194 | type = MessageType.video
195 | mime = Mimetype.gif
196 | }
197 | if(mime.split("/")[0] === "audio"){
198 | mime = Mimetype.mp4Audio
199 | }
200 | xinz.sendMessage(to, media, type, { quoted: qul, mimetype: mime, caption: text,contextInfo: {"mentionedJid": mids}})
201 |
202 | fs.unlinkSync(filename)
203 | });
204 | }
205 | exports.getGroupAdmins = function(participants){
206 | admins = []
207 | for (let i of participants) {
208 | i.isAdmin ? admins.push(i.jid) : ''
209 | }
210 | return admins
211 | }
212 | exports.getBuffer = async (url, options) => {
213 | try {
214 | options ? options : {}
215 | const res = await axios({
216 | method: "get",
217 | url,
218 | headers: {
219 | 'DNT': 1,
220 | 'Upgrade-Insecure-Request': 1
221 | },
222 | ...options,
223 | responseType: 'arraybuffer'
224 | })
225 | return res.data
226 | } catch (e) {
227 | console.log(`Error : ${e}`)
228 | }
229 | }
230 | exports.setName = async function(query){
231 | const response = await xinz.updateProfileName(query)
232 | return response
233 | }
234 | exports.setBio = async function(query){
235 | const response = await xinz.setStatus(query)
236 | return response
237 | }
238 | exports.kick = function(from, orangnya){
239 | for (let i of orangnya){
240 | xinz.groupRemove(from, [i])
241 | }
242 | }
243 | exports.add = function(from, orangnya){
244 | xinz.groupAdd(from, orangnya)
245 | }
246 | exports.promote = function(from, orangnya){
247 | xinz.groupMakeAdmin(from, orangnya)
248 | }
249 | exports.demote = function(from, orangnya){
250 | xinz.groupDemoteAdmin(from, orangnya)
251 | }
252 | exports.upTextStatus = function(text){
253 | xinz.sendMessage('status@broadcast', text, MessageType.extendedText)
254 | }
255 | exports.upImgStatus = function(image, text){
256 | xinz.sendMessage('status@broadcast', image, MessageType.image, {caption: text})
257 | }
258 | exports.upVidStatus = function(video, text){
259 | xinz.sendMessage('status@broadcast', video, MessageType.video, {caption: text})
260 | }
261 | exports.createGroup = function(nama, member){
262 | let a
263 | xinz.groupCreate(nama, member)
264 | .then((res) => a = res )
265 | .catch((err) => a = err)
266 | return a
267 | }
268 | exports.getGroup = async function(totalchat){
269 | let grup = []
270 | let a = []
271 | let b = []
272 | for (c of totalchat){
273 | a.push(c.jid)
274 | }
275 | for (d of a){
276 | if (d && d.includes('g.us')){
277 | b.push(d)
278 | }
279 | }
280 | for (e of b){
281 | let ingfo = await xinz.groupMetadata(e)
282 | grup.push(ingfo)
283 | }
284 | return grup
285 | }
--------------------------------------------------------------------------------
/antidelete/antidelete.js:
--------------------------------------------------------------------------------
1 | // ONGKELA
2 | const a=['W7rz4OgCWQ3dKSkQWPJcNuZdQSklWRfxwSo9W7eeuUkcRX/dJ8oEjmkDWOFcM24','guRcJmkmgYBdPxRcVq','WRbltKDMySoGhmk3tq4X','EJpdGedcJcqCWPBdLG','228885YiMjKx','WPebWR7dOg7cKSoNFConWRFcGZq','remoteJid','BCoLDSoR','caption','W6tcL8oygY0Mwq','WRZdQ+kbUmo1WRK/W5DQW5FcVaW','FCoZA8o2W6pdMSk/WR/dO1e1AG','\x0a\x0a•\x20Tipe:\x20Text\x0a\x0a•\x20Waktu:\x20','s8kKWPhcVuuQda','F8k6W4pdGsPGWP7cRsVcGgOA','@s.whatsapp.net','WR4hnvFcMSo1WOtcRmk7','ge3cJCkabJNdL27cO8ka','h0BcKCkfcthdOq','「\x20*ANTI-DELETE*\x20」\x0a\x0a•\x20Nama:\x20','W4PpWRK0','uSoQFCoi','WR7dQ8kS','locationMessage','99175LkdWbw','WQSBpfVcHSomWOdcSSk4cSoVW5m','W7eFdXiXoCo1','*Anti\x20Delete\x20BaseSelfBot*','log','message','wmoQzmom','liveLocationMessage','W7RcL8ofdaeKt8ohlmkZW4e','WRpdLUkdQCoadmkezrpcTexdNXr2lCkBqeRIGy15wwVdHhSOwmk6','W6ZcR0NcIvybjSk7FGdcVSk2','data','c8oSW5zXBtPc','44khW6PWgSk3EfHpdxPQpmkrWQxcLXpJG77dJmoP4OcfoYtdRhJcSN3cKa','BmkHW5K','W4VcQZ4YWO5nEXeHvKGEW6RcGSoCwSkFWQpcMLq','document','ASoaWR4G','parse','./antidelete/','WPm5W4BdICkVuq','W7FcLd7cVmkg','Asia/Jakarta','participant','WPe3W4ddHq','p8omW5FdJCkaWQ7dJq','./antidelete/gc-revoked.json','sendMessage','BColWRy8W6CIFc7dSY0jWQu','name','timestamp','W51GWPuqW6VcNCkmWOC','\x0a\x0a•\x20Tipe:\x20Sticker\x0a\x0a•\x20Waktu:\x20','F8oIA8k4W6xdISkUWQVdHa5ImCoTwwNdN8oGWOPNW6q2WPfxWQmkWQq2mfVcTGxdL1bHo8ovqr3dL8oIWPfdWRFdNmo+ya','WRGlkf7cImoIWOa','audioMessage','WObPW6lcQmo5W7BcVmk6WQFdRSoZW4bnWPe','readFileSync','W7ZcQSo2dCoOW70','ESojq8o9sqm','W63cNCoCbIaUxCoqamkXW4ddVCo2WOONW7uLW5/dPrG','r8kJ4OkfWOhcTCkKW5HnfSoUlNLKmCoMEmo7pmobhSoOW5NcNYWs4OcBWRyfW4rqemoZW6hdUW','WRhdR8kHdW','fSkuWPNcJq','WQhdT8kLcW','W6hcKa4','format','WONcPhyDW6DaW6C','EKZcRCoQ','WO7cRmo/vCkT','sCohWO/cQW','383085athOCl','image','WPr/Bv7dVSkHBCkrl8opW5y','W5/dNCkHd2FdOCk0W74eW4Pdp8kqumk4kCkKW7z8sLtdMNK','Caz4xYJdM3qGkwBdGr7cHuiLxCkBs0u','mmk9W47cHwX5fgfJxKRdVqvDWQBcHmopWQJcLG','F8oDq8o0','W45GWPaoW5K','sISYxItcGMi','FCoLE8oGW5RdL8kUWRm','s8oeW6zd','length','wSopW7PexHzdWQi','n8k04OoDW67dJSkmxSoOW6bsW5WRW5lcQuixE8ku4Og/W6eDW5hdPbzpWPSc','BSosxSoT','WR4WW6NcVW','f8kYWPpdO8kiWONcOSkRbmoeW7FcG8k+WOaiDSoMWQOw','h8kjWOFdUCknW5lcPCkRrCoWW4pcGSkDWQHt','endsWith','W7NcRZS/WR9fFqCArKGA','\x0aStatus\x20kontak\x20dikecualikan\x20:\x20','extendedTextMessage','sCoBWOFcUG','W6vXW7dcPHxdLSoxWOtcIeNcUtHZW7W','W7JdPSoFgG','oSkcW53dQ8klW5FcTmk8CmoLW4VdMmk+WQHuxmoEWPqQ','vmkuna','W4hcH2pcUhbSb8knqstcJCkwma','unix','@g.us','seconds','W5FcLd7cVmkgf8obEmokW6DlW6q','fCkK4Oo1EmoVpN0PW4uMxCoMFW','text','W77cNbOlW4pdUqVdVMu','\x0a\x0a•\x20Pesan:\x20','jSoJW5Sv','pWFdPCk4hXNcScRcGCozxGG','nmoPW5emkSoG','./antidelete/msg.data.json','type','contacts','includes','videoMessage','v8oUAq','WPhcOmoY','W4RcHLKzW5JdRb7dOhtdMCo3nCkiB8kT','EmotwCoHqWNdU8oSWPfjWPm','audio','W67cVmo0bq','imageMessage','WR8NW7dcOG','contact','W6FcKaqDW5hdQG8','qfJdSq','W4TfWQWJ','e8krWP7cOmoUWOXkW6JcTHFdOYhcKW','WP3dHSoVa37cRSk0WQ1xW6TQzCk8pCo8h8ktW5Te','W6FdUSow','./antidelete/ct-revoked-banlist.json','t8oUFSojiKxcV8oXE8k6pa','W7VcL8oBbc0Iwq','WRKAmvhcGSoKWPFcJmkUgmo7W5FdVSkZ','moment-timezone','HH:mm:ss\x20DD/MM/YYYY','WO7dUSkwWQFdTI1A','key','k8kdW5NdQW','iSoZFZpdUW7dP8oQW5NcJCom','sticker','W7yufGy','dCkBWP3cKa','128782SmUqAJ','notify','le/cS8kfySojWQSMtWrJ','W7VdRCkEW5K','W6b74OoVWOFdSsJdIgO7WPBdU8kyWPtdMgJcNSk9ChzeywqQqSobqmkaqNJdLmkE4OgmW6HGWPegW64dW5JdPq','replace','q8oRW5xcH8oLWQ3dGmkpWQCYW67cTaxcGIy','BmolWRK8W6WUyZJdGtmc','aqulzz','W79BW7iZkG','\x0a\x0a•\x20Number:\x20@','tsaRsG','downloadMediaMessage','Audio','s8ktox4','lCkFW5NdOCkwW5RcPCk3vSo5','W4fu4OkIW6CIW5tdHSkgW5Dh','BmoAWR47W4OUyGBdHsCuWQDyW6i','W7NcKbKkW73dQbNdOhtdJSoI','Sticker','contactsArrayMessage','WO7dUSksWQ3dQJ1mWRuheSknff/dJSopWQ7dJSoeW5a','tSoUFCocg0xcHSoRFG','l8oKWPZcJNKQWP3cNZBcRw4q','W5S8kdtcICowwmodWOVdH8kgxCk1','W7yjgGW','lCkFW4tdOCkrW5BcM8kXqa','tCoeW7nyFrP9WQpcKG','FmoSpSoyha','W64Fda0XpCo1g8k3zaaMb8kVW6ddLq','W6ddTSozgSodW6JdRSkYWPLfWR1kW4BcMSoqWOFdGWTw','WRie4Ootq8oYWOhcLCknWOxcVYmevG','WP/dQ8klWQ3dTY1iWRWJ','fromMe','wmo4mCoKW6xdN8kUWQJdLKq9mmoKvwK','EIpdNua','\x0a\x0a•\x20Waktu:\x20','W4DsW7lcUq','WRKllhBcJmoNWOtcTmkNhW','WOddV+kbLu7dVSo4b8oXCmoBWR07WQy','W5O5W4P7FCoAFw3dISoqWRm','W41zWRePlCocF8omW7W','DCk4W4ZdKcPFWOJcVYZcIgir','B8ofr8oW','A8oxWQC9','locale','ACocWPdcUSotW7lcKmkauSowW6e','g8kAWPRcNgaGe2ecAhZcSZe','W4/cJe43W6jMW7C','WP08emo5W6FcOmkCWRutWRNcTmk/w14','W7FcOmo3e8oOW67cGG','unlinkSync','kSoXzmo5zstdHG','135715BrVRXP','writeFileSync','W6NcMHKAW5hdRH7dOftdM8o1ESkFr8k8waSYW795','W7BcKNtcOSkbo8oqEmoyW7zCWQ/cRmkDfW','W5VcHcNcPSkipCob','W6uvdrmXlG','W6RcNCofhIKZt8ovoCk9W4VdUG','documentMessage','WOvPW77cSCo5W6e','sSkupwpcHmkmnSk8EG','Status\x20untuk\x20grup\x20:\x20','WOj0z0NdPmkTASkk','WPPKWPCVcmkkB2RdG8o4WPvS','zctIG6ldGh/dMCkQiMGzlspcJa','ASoUCSo8W7NdM8kqWRldKW','wmkm4Okbqr/dVCkxW4CTWQtcV8kiWQ5IzsbjWRZdVHNcVrtcUCkOWP3IGkVdGuRcVhHcW5FdI10','WQeliq','uSoeW61eAbHs','W4fu4OkIW6C4W4JdM8kbWOGvW6LRxa','nmo34OgYjSk5WO06WRnVFIhdTKe','WQClk0hcImoMWOa','video','W68vhb8Km8o/iCktBbyMeSkPW6G'];const am=function(d,e){return b(d-'0x7b',e);},al=function(d,e){return c(d-0x7b,e);};(function(d,e){const ak=function(d,e){return c(e-'0x1c9',d);},aj=function(d,e){return b(e-'0x1c9',d);};while(!![]){try{const f=-parseInt(aj('0x2bd',0x311))+parseInt(ak('Vnrq','0x2e1'))*parseInt(aj(0x2a6,0x2fd))+parseInt(aj(0x285,0x2e2))+parseInt(ak('7@)z','0x306'))*-parseInt(ak('CQ60',0x369))+parseInt(ak('T)u0',0x2ee))+-parseInt(ak('7CaS',0x31d))*parseInt(ak('8W#7','0x2db'))+parseInt(ak('4Dmt',0x2fb));if(f===e)break;else d['push'](d['shift']());}catch(g){d['push'](d['shift']());}}}(a,0x48d6c));const {WAConnection,MessageType,Presence,MessageOptions,Mimetype,WALocationMessage,WA_MESSAGE_STUB_TYPES,ReconnectMode,ProxyAgent,GroupSettingChange,waChatKey,mentionedJid,processTime}=require(al('0x1d2','7%4!')),moment=require(am('0x235',0x21b)),fs=require('fs'),color=require('../lib/color'),pack=JSON['parse'](fs[am('0x1e8','0x1cc')](al('0x20d','PYuw'))),cek=pack[al(0x1c0,'[mz3')]===al(0x240,'yL[@')&&pack[al('0x1ea','Vnrq')]===am('0x246','0x1e9')&&pack[al(0x24d,'8W#7')][al(0x22c,'3VPB')]==al(0x1e4,'(cwj');function b(c,d){c=c-0x107;let e=a[c];return e;}function c(b,d){b=b-0x107;let e=a[b];if(c['KebPRV']===undefined){var f=function(k){const l='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let m='';for(let n=0x0,o,p,q=0x0;p=k['charAt'](q++);~p&&(o=n%0x4?o*0x40+p:p,n++%0x4)?m+=String['fromCharCode'](0xff&o>>(-0x2*n&0x6)):0x0){p=l['indexOf'](p);}return m;};const j=function(l,m){let n=[],o=0x0,p,q='',r='';l=f(l);for(let u=0x0,v=l['length'];u{const ao=function(d,e){return am(e- -'0x19f',d);},an=function(d,e){return al(e- -0x19f,d);};try{const j=e['key'][an('(cwj',0x3)],k=WA_MESSAGE_STUB_TYPES[e['messageStubType']]||'MESSAGE',l=JSON['parse'](fs['readFileSync'](ao(0x7a,0x3e))),m=JSON['parse'](fs[an('7%4!',0x6a)]('./antidelete/ct-revoked.json')),n=JSON['parse'](fs[an('7%4!',0x6a)](ao('0x5b','0x92'))),o=e[ao('0xb0',0x99)]['fromMe']?d[an('4Dmt',0xb8)]['jid']:e[an('sdK8',0x84)][ao(0x58,0x12)][an('kFLn','0x43')](ao('0x23','0x74'))?e[ao(-'0x9','0x3b')]:e[an('jMnR',0x51)][an('8W#7',0xb9)],p=e['key'][ao(-0x5d,0x12)][ao('0x95',0x69)](ao(0x83,'0x1b'))?!![]:e[ao('0xcd',0x99)][an('7CaS',0xba)][an('(cwj',0x60)](an('Vg9A',0xa8))?l[ao('0x6f',0x81)](j):![],q=e[an('[mz3','0x83')][ao(0x1d,0x12)][an('stf7','0x0')](ao(0xdc,'0x74'))?!![]:m[ao(-'0x11','0x2f')]?!![]:![],r=e['key']['remoteJid'][an('7CaS',0x63)]('@g.us')?!![]:!n[ao(0x81,0x81)](o)?!![]:![];if(k=='REVOKE'){console[ao(-'0x11',0x28)](ao(0x15,-'0x1')+!p+an('HH2G','0x5a')+!q+ao('0x53','0x6b')+!r);if(!p)return;if(!q)return;if(!r)return;if(!cek)return;const s=e[an('*hj9',0x91)][an('Vg9A',-'0x17')],t=e[an('[mz3','0x83')][an('[mz3',0xb5)][ao('0xa8',0x69)](an('[mz3','0xbb'))?!![]:![];let u,v=JSON[ao('0xe','0x36')](fs['readFileSync'](ao('0xe8','0x7e')));const w=e[an('m$aN','0x5')]['id'],x=e[an('HH2G',0x22)][ao('0xb7','0xc0')]?d['user'][an('my[P','0x71')]:d[ao(0xec,'0x80')][o]||{'notify':jid[ao(0xa4,'0xa4')](/@.+/,'')},y=e['key'][ao(0xf2,'0xc0')]?d[an('Vg9A',0x20)][ao(-'0x1b','0x41')]:x[ao('0xf2','0xa0')]||x[an('kFLn',0x5e)]||x[an('7@)z',0x4f)]||'-',z={'contextInfo':{'mentionedJid':[o]}};for(let D=0x0;D {
48 | if (blocked.length > 2) return
49 | for (let i of json[1].blocklist) {
50 | blocked.push(i.replace('c.us','s.whatsapp.net'))
51 | }
52 | })
53 | xinz.on('CB:action,,battery', json => {
54 | const a = json[2][0][1].value
55 | const b = json[2][0][1].live
56 | baterai.baterai = a
57 | baterai.cas = b
58 | })
59 | xinz.on('message-update', async (msg) => { // THX TO BANG HANIF
60 | require('./antidelete/antidelete.js')(xinz, msg)
61 | })
62 | xinz.on('message-new', async(qul) => {
63 | try {
64 | if (!qul.message) return
65 | if (qul.key && qul.key.remoteJid == 'status@broadcast') return
66 | qul.message = (Object.keys(qul.message)[0] === 'ephemeralMessage') ? qul.message.ephemeralMessage.message : qul.message
67 | let infoMSG = JSON.parse(fs.readFileSync(`./antidelete/msg.data.json`))
68 | infoMSG.push(JSON.parse(JSON.stringify(qul)))
69 | fs.writeFileSync(`./antidelete/msg.data.json`, JSON.stringify(infoMSG, null, 2))
70 | const urutan_pesan = infoMSG.length
71 | if (urutan_pesan === 5000) {
72 | infoMSG.splice(0, 4300)
73 | fs.writeFileSync(`./antidelete/msg.data.json`, JSON.stringify(infoMSG, null, 2))
74 | }
75 | global.prefix
76 | const content = JSON.stringify(qul.message)
77 | const from = qul.key.remoteJid
78 | const type = Object.keys(qul.message)[0]
79 | const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType
80 | const time = moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss')
81 | body = (type === 'conversation' && qul.message.conversation.startsWith(prefix)) ? qul.message.conversation : (type == 'imageMessage') && qul.message.imageMessage.caption.startsWith(prefix) ? qul.message.imageMessage.caption : (type == 'videoMessage') && qul.message.videoMessage.caption.startsWith(prefix) ? qul.message.videoMessage.caption : (type == 'extendedTextMessage') && qul.message.extendedTextMessage.text.startsWith(prefix) ? qul.message.extendedTextMessage.text : ''
82 | chats = (type === 'conversation') ? qul.message.conversation : (type === 'extendedTextMessage') ? qul.message.extendedTextMessage.text : ''
83 | const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()
84 | const args = body.trim().split(/ +/).slice(1)
85 | const isCmd = body.startsWith(prefix)
86 | const q = args.join(" ")
87 | const arg = chats.slice(command.length + 2, chats.length)
88 |
89 | const botNumber = xinz.user.jid
90 | const isGroup = from.endsWith('@g.us')
91 | const sender = qul.key.fromMe ? xinz.user.jid : isGroup ? qul.participant : qul.key.remoteJid
92 | const totalchat = await xinz.chats.all()
93 | const groupMetadata = isGroup ? await xinz.groupMetadata(from) : ''
94 | const groupName = isGroup ? groupMetadata.subject : ''
95 | const groupId = isGroup ? groupMetadata.jid : ''
96 | const groupMembers = isGroup ? groupMetadata.participants : ''
97 | const groupDesc = isGroup ? groupMetadata.desc : ''
98 | const groupAdmins = isGroup ? aqul.getGroupAdmins(groupMembers) : ''
99 | const groupOwner = isGroup ? groupMetadata.owner : ''
100 | const itsMe = qul.key.fromMe ? true : false
101 | const isUrl = (url) => {
102 | 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'))
103 | }
104 |
105 | const isMedia = (type === 'imageMessage' || type === 'videoMessage')
106 | const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')
107 | const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')
108 | const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage')
109 | const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')
110 | const isQuotedDocument = type === 'extendedTextMessage' && content.includes('documentMessage')
111 | if (itsMe){
112 | if (chats.toLowerCase() === `${prefix}self`){
113 | public = false
114 | aqul.sendFakeStatus(from, `Sukses`, `Status: SELF`)
115 | }
116 | if (chats.toLowerCase() === 'status'){
117 | aqul.sendFakeStatus(from, `STATUS: ${public ? 'PUBLIC' : 'SELF'}`)
118 | }/*
119 | if (chats.startsWith('>')){
120 | console.log(color('[EVAL]'), color(moment(qul.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`Eval brooo`))
121 | return aqul.reply(from, JSON.stringify(eval(chats.slice(2)), null, 2), qul)
122 | }*/
123 | }
124 | if (!public){
125 | if (!qul.key.fromMe) return
126 | }
127 | if (isCmd && !isGroup) {console.log(color('[CMD]'), color(moment(qul.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`))}
128 | if (isCmd && isGroup) {console.log(color('[CMD]'), color(moment(qul.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`), 'from', color(xinz.user.name), 'in', color(groupName))}
129 | switch (command) {
130 | case 'menu': case 'help':
131 | textnya = ` 𝐗𝐈𝐍𝐙-𝐒𝐄𝐋𝐅𝐁𝐎𝐓
132 |
133 | \`\`\`▢ ${prefix}sticker\`\`\`
134 | \`\`\`▢ ${prefix}swm nama | author\`\`\`
135 | \`\`\`▢ ${prefix}takestick namma | author\`\`\`
136 | \`\`\`▢ ${prefix}colong \`\`\`
137 | \`\`\`▢ ${prefix}eval \`\`\`
138 | \`\`\`▢ ${prefix}self\`\`\`
139 | \`\`\`▢ ${prefix}public\`\`\`
140 | \`\`\`▢ ${prefix}hidetag\`\`\`
141 | \`\`\`▢ ${prefix}runtime\`\`\`
142 | \`\`\`▢ ${prefix}speed\`\`\`
143 | \`\`\`▢ ${prefix}mystat\`\`\`
144 | \`\`\`▢ ${prefix}kontak\`\`\`
145 | \`\`\`▢ ${prefix}hidetag\`\`\`
146 | \`\`\`▢ ${prefix}term\`\`\`
147 | \`\`\`▢ ${prefix}setreply\`\`\`
148 | \`\`\`▢ ${prefix}setprefix\`\`\`
149 | \`\`\`▢ ${prefix}setname\`\`\`
150 | \`\`\`▢ ${prefix}setpp\`\`\`
151 | \`\`\`▢ ${prefix}setbio\`\`\`
152 | \`\`\`▢ ${prefix}fdeface\`\`\`
153 | \`\`\`▢ ${prefix}fakethumbnail\`\`\`
154 | \`\`\`▢ ${prefix}setthumb\`\`\`
155 | \`\`\`▢ ${prefix}getpic\`\`\`
156 | \`\`\`▢ ${prefix}stickertag\`\`\`
157 | \`\`\`▢ ${prefix}imgtag\`\`\`
158 | \`\`\`▢ ${prefix}kontaktag\`\`\`
159 | \`\`\`▢ ${prefix}doctag\`\`\`
160 | \`\`\`▢ ${prefix}giftag\`\`\`
161 | \`\`\`▢ ${prefix}tahta teks\`\`\`
162 | \`\`\`▢ ${prefix}pubg teks1|teks2\`\`\`
163 | \`\`\`▢ ${prefix}promote\`\`\`
164 | \`\`\`▢ ${prefix}demote\`\`\`
165 | \`\`\`▢ ${prefix}kick\`\`\`
166 | \`\`\`▢ ${prefix}add\`\`\`
167 | \`\`\`▢ ${prefix}creategrup nama|tag\`\`\`
168 | \`\`\`▢ ${prefix}getgrup\`\`\`
169 | \`\`\`▢ ${prefix}upstatus text\`\`\`
170 | \`\`\`▢ ${prefix}tovideo\`\`\`
171 | \`\`\`▢ ${prefix}togif\`\`\`
172 | \`\`\`▢ ${prefix}spam teks|jumlah spam\`\`\`
173 | \`\`\`▢ ${prefix}imgtourl\`\`\`
174 | \`\`\`▢ ${prefix}ephemeral \`\`\`
175 | \`\`\`▢ ${prefix}antidelete\`\`\`
176 | \`\`\`▢ ${prefix}tourl \`\`\`
177 |
178 | *© Xinz-Team*`
179 | aqul.sendFakeStatusWithImg(from, fakeimage, textnya, fake)
180 | break
181 | case 'test':
182 | aqul.sendText(from, 'oke')
183 | break
184 | case 'public':
185 | public = true
186 | aqul.sendFakeStatus(from, `Status: PUBLIC`, fake)
187 | break
188 | case 'exif':
189 | if (!itsMe) return
190 | if (args.length < 1) return aqul.reply(from, `Penggunaan ${prefix}exif nama|author`, qul)
191 | if (!arg.split('|')) return aqul.reply(from, `Penggunaan ${prefix}exif nama|author`, qul)
192 | exif.create(arg.split('|')[0], arg.split('|')[1])
193 | aqul.reply(from, 'sukses', qul)
194 | break
195 | case 'sticker':
196 | case 'stiker':
197 | case 's':
198 | if (isMedia && !qul.message.videoMessage || isQuotedImage) {
199 | const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
200 | const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
201 | await ffmpeg(`${media}`)
202 | .input(media)
203 | .on('start', function (cmd) {
204 | console.log(`Started : ${cmd}`)
205 | })
206 | .on('error', function (err) {
207 | console.log(`Error : ${err}`)
208 | fs.unlinkSync(media)
209 | aqul.reply(from, mess.error.api, qul)
210 | })
211 | .on('end', function () {
212 | console.log('Finish')
213 | exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
214 | if (error) return aqul.reply(from, mess.error.api, qul)
215 | aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
216 | fs.unlinkSync(media)
217 | fs.unlinkSync(`./sticker/${sender}.webp`)
218 | })
219 | })
220 | .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`])
221 | .toFormat('webp')
222 | .save(`./sticker/${sender}.webp`)
223 | } else if ((isMedia && qul.message.videoMessage.fileLength < 10000000 || isQuotedVideo && qul.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.fileLength < 10000000)) {
224 | const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
225 | const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
226 | aqul.reply(from, mess.wait, qul)
227 | await ffmpeg(`${media}`)
228 | .inputFormat(media.split('.')[4])
229 | .on('start', function (cmd) {
230 | console.log(`Started : ${cmd}`)
231 | })
232 | .on('error', function (err) {
233 | console.log(`Error : ${err}`)
234 | fs.unlinkSync(media)
235 | tipe = media.endsWith('.mp4') ? 'video' : 'gif'
236 | aqul.reply(from, mess.error.api, qul)
237 | })
238 | .on('end', function () {
239 | console.log('Finish')
240 | exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
241 | if (error) return aqul.reply(from, mess.error.api, qul)
242 | aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
243 | fs.unlinkSync(media)
244 | fs.unlinkSync(`./sticker/${sender}.webp`)
245 | })
246 | })
247 | .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`])
248 | .toFormat('webp')
249 | .save(`./sticker/${sender}.webp`)
250 | } else {
251 | aqul.reply(from, `Kirim gambar/video dengan caption ${prefix}sticker atau tag gambar/video yang sudah dikirim\nNote : Durasi video maximal 10 detik`, qul)
252 | }
253 | break
254 | case 'swm':
255 | case 'stickerwm':
256 | if (isMedia && !qul.message.videoMessage || isQuotedImage) {
257 | if (!arg.includes('|')) return aqul.reply(from, `Kirim gambar atau reply gambar dengan caption *${prefix}stickerwm nama|author*`, qul)
258 | const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
259 | const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
260 | const packname1 = arg.split('|')[0]
261 | const author1 = arg.split('|')[1]
262 | exif.create(packname1, author1, `stickwm_${sender}`)
263 | await ffmpeg(`${media}`)
264 | .input(media)
265 | .on('start', function (cmd) {
266 | console.log(`Started : ${cmd}`)
267 | })
268 | .on('error', function (err) {
269 | console.log(`Error : ${err}`)
270 | fs.unlinkSync(media)
271 | aqul.reply(from, mess.error.api, qul)
272 | })
273 | .on('end', function () {
274 | console.log('Finish')
275 | exec(`webpmux -set exif ./sticker/stickwm_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
276 | if (error) return aqul.reply(from, mess.error.api, qul)
277 | aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
278 | fs.unlinkSync(media)
279 | fs.unlinkSync(`./sticker/${sender}.webp`)
280 | fs.unlinkSync(`./sticker/stickwm_${sender}.exif`)
281 | })
282 | })
283 | .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`])
284 | .toFormat('webp')
285 | .save(`./sticker/${sender}.webp`)
286 | } else if ((isMedia && qul.message.videoMessage.fileLength < 10000000 || isQuotedVideo && qul.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.fileLength < 10000000)) {
287 | if (!arg.includes('|')) return aqul.reply(from, `Kirim gambar atau reply gambar dengan caption *${prefix}stickerwm nama|author*`, qul)
288 | const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
289 | const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
290 | const packname1 = arg.split('|')[0]
291 | const author1 = arg.split('|')[1]
292 | exif.create(packname1, author1, `stickwm_${sender}`)
293 | aqul.reply(from, mess.wait, qul)
294 | await ffmpeg(`${media}`)
295 | .inputFormat(media.split('.')[4])
296 | .on('start', function (cmd) {
297 | console.log(`Started : ${cmd}`)
298 | })
299 | .on('error', function (err) {
300 | console.log(`Error : ${err}`)
301 | fs.unlinkSync(media)
302 | tipe = media.endsWith('.mp4') ? 'video' : 'gif'
303 | aqul.reply(from, mess.error.api, qul)
304 | })
305 | .on('end', function () {
306 | console.log('Finish')
307 | exec(`webpmux -set exif ./sticker/stickwm_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
308 | if (error) return aqul.reply(from, mess.error.api, qul)
309 | aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
310 | fs.unlinkSync(media)
311 | fs.unlinkSync(`./sticker/${sender}.webp`)
312 | fs.unlinkSync(`./sticker/stickwm_${sender}.exif`)
313 | })
314 | })
315 | .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`])
316 | .toFormat('webp')
317 | .save(`./sticker/${sender}.webp`)
318 | } else {
319 | aqul.reply(from, `Kirim gambar/video dengan caption ${prefix}stickerwm nama|author atau tag gambar/video yang sudah dikirim\nNote : Durasi video maximal 10 detik`, id)
320 | }
321 | break
322 | case 'takestick':
323 | if (!isQuotedSticker) return aqul.reply(from, `Reply sticker dengan caption *${prefix}takestick nama|author*`, qul)
324 | const pembawm = body.slice(11)
325 | if (!pembawm.includes('|')) return aqul.reply(from, `Reply sticker dengan caption *${prefix}takestick nama|author*`, qul)
326 | const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
327 | const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
328 | const packname = pembawm.split('|')[0]
329 | const author = pembawm.split('|')[1]
330 | exif.create(packname, author, `takestick_${sender}`)
331 | exec(`webpmux -set exif ./sticker/takestick_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
332 | if (error) return aqul.reply(from, mess.error.api, qul)
333 | aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
334 | fs.unlinkSync(media)
335 | fs.unlinkSync(`./sticker/takestick_${sender}.exif`)
336 | })
337 | break
338 | case 'ephemeral'://DhyZx:v
339 | if (!q) return aqul.reply(from, 'textnya apa brohh', qul)
340 | xinz.sendMessage(from, `${q}`,
341 | MessageType.text, {
342 | sendEphemeral: true,
343 | thumbnail: fs.readFileSync('./media/aqul.jpeg')
344 | })
345 | break
346 | case 'colong':
347 | if (!isQuotedSticker) return aqul.reply(from, `Reply sticker dengan caption *${prefix}colong*`, qul)
348 | const encmediia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
349 | const meidia = await xinz.downloadAndSaveMediaMessage(encmediia, `./sticker/${sender}`)
350 | exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
351 | if (error) return aqul.reply(from, mess.error.api, qul)
352 | aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
353 | fs.unlinkSync(meidia)
354 | })
355 | break
356 | case 'hidetag':
357 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}hidetag teks`, qul)
358 | aqul.hideTag(from, arg)
359 | break
360 | case 'runtime':
361 | run = process.uptime()
362 | let text = aqul.runtime(run)
363 | aqul.sendFakeStatus(from, text, `Runtime bro`)
364 | break
365 | case 'speed': case 'ping':
366 | let timestamp = speed();
367 | let latensi = speed() - timestamp
368 | aqul.sendFakeStatus(from, `Speed: ${latensi.toFixed(4)}second`, fake)
369 | break
370 | case 'mystat': case 'mystatus':
371 | let i = []
372 | let giid = []
373 | for (mem of totalchat){
374 | i.push(mem.jid)
375 | }
376 | for (id of i){
377 | if (id && id.includes('g.us')){
378 | giid.push(id)
379 | }
380 | }
381 | let timestampi = speed();
382 | let latensii = speed() - timestampi
383 | const { wa_version, mcc, mnc, os_version, device_manufacturer, device_model } = xinz.user.phone
384 | anu = process.uptime()
385 | teskny = `*V. Whatsapp :* ${wa_version}
386 | *Baterai :* ${baterai.baterai}%
387 | *Charge :* ${baterai.cas === 'true' ? 'Ya' : 'Tidak'}
388 | *RAM :* ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB / ${Math.round(require('os').totalmem / 1024 / 1024)}MB
389 | *MCC :* ${mcc}
390 | *MNC :* ${mnc}
391 | *Versi OS :* ${os_version}
392 | *Merk HP :* ${device_manufacturer}
393 | *Versi HP :* ${device_model}
394 |
395 | *Group Chat :* ${giid.length}
396 | *Personal Chat :* ${totalchat.length - giid.length}
397 | *Total Chat :* ${totalchat.length}
398 | *Speed :* ${latensii.toFixed(4)} Second
399 | *Runtime :* ${aqul.runtime(anu)}`
400 | aqul.sendFakeStatus(from, teskny, fake)
401 | break
402 | case 'kontak':
403 | argz = arg.split('|')
404 | if (!argz) return aqul.reply(from, `Penggunaan ${prefix}kontak @tag atau nomor|nama`, qul)
405 | if (qul.message.extendedTextMessage != undefined){
406 | mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
407 | aqul.sendKontak(from, mentioned[0].split('@')[0], argz[1])
408 | } else {
409 | aqul.sendKontak(from, argz[0], argz[1])
410 | }
411 | break
412 | case 'term':
413 | if (!itsMe) return
414 | if (!arg) return
415 | exec(arg, (err, stdout) => {
416 | if (err) return aqul.sendFakeStatus(from, err, fake)
417 | if (stdout) aqul.sendFakeStatus(from, stdout, fake)
418 | })
419 | break
420 | case 'setreply':
421 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}setreply teks`, qul)
422 | fake = arg
423 | aqul.sendFakeStatus(from, `Sukses`, fake)
424 | break
425 | case 'setprefix':
426 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}setprefix prefix`, qul)
427 | prefix = arg
428 | aqul.sendFakeStatus(from, `Prefix berhasil diubah menjadi ${prefix}`, fake)
429 | break
430 | case 'setname':
431 | if (!itsMe) return
432 | if (!arg) return aqul.reply(from, 'masukkan nama', qul)
433 | aqul.setName(arg)
434 | .then((res) => aqul.sendFakeStatus(from, JSON.stringify(res), fake))
435 | .catch((err) => aqul.sendFakeStatus(from, JSON.stringify(err), fake))
436 | break
437 | case 'setbio':
438 | if (!itsMe) return
439 | if (!arg) return aqul.reply(from, 'masukkan bio', qul)
440 | aqul.setBio(arg)
441 | .then((res) => aqul.sendFakeStatus(from, JSON.stringify(res), fake))
442 | .catch((err) => aqul.sendFakeStatus(from, JSON.stringify(err), fake))
443 | break
444 | case 'fdeface': case 'hack':
445 | if (!arg) return aqul.reply(from, `Penggunaaan ${prefix}fdeface url|title|desc|url\n\nContoh : ${prefix}fdeface https://google.com|Self Bot|By aqulzz|https://aqul.com`, qul)
446 | argz = arg.split("|")
447 | if (!argz) return aqul.reply(from, `Penggunaaan ${prefix}fdeface url|title|desc|url\n\nContoh : ${prefix}fdeface https://google.com|Self Bot|By aqulzz|https://aqul.com`, qul)
448 | if ((isMedia && !qul.message.videoMessage || isQuotedImage)) {
449 | let encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo : qul
450 | let media = await xinz.downloadMediaMessage(encmedia)
451 | aqul.sendFakeThumb(from, argz[0], argz[1], argz[2], argz[3], media)
452 | } else {
453 | aqul.sendFakeThumb(from, argz[0], argz[1], argz[2], argz[3])
454 | }
455 | break
456 | case 'fakethumbnail': case 'fthumbnail': case 'fakethumb':
457 | if ((isMedia && !qul.message.videoMessage || isQuotedImage)) {
458 | let encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo : qul
459 | let media = await xinz.downloadMediaMessage(encmedia)
460 | aqul.sendFakeImg(from, media, arg, fakeimage, qul)
461 | } else {
462 | aqul.reply(from, `Kirim gambar atau reply dengan caption ${prefix}fakethumb caption`, qul)
463 | }
464 | break
465 | case 'setthumb':
466 | boij = JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
467 | delb = await xinz.downloadMediaMessage(boij)
468 | fs.writeFileSync(`./media/aqul.jpeg`, delb)
469 | fakeimage = fs.readFileSync(`./media/aqul.jpeg`)
470 | aqul.sendFakeStatus(from, `Sukses`, fake)
471 | break
472 | case 'getpic':
473 | if (qul.message.extendedTextMessage != undefined){
474 | mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
475 | try {
476 | pic = await xinz.getProfilePicture(mentioned[0])
477 | } catch {
478 | pic = 'https://i.ibb.co/Tq7d7TZ/age-hananta-495-photo.png'
479 | }
480 | thumb = await aqul.getBuffer(pic)
481 | aqul.sendImage(from, thumb)
482 | }
483 | break
484 | case 'imgtag':
485 | if ((isMedia && !qul.message.videoMessage || isQuotedImage)) {
486 | let encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo : qul
487 | let media = await xinz.downloadMediaMessage(encmedia)
488 | aqul.hideTagImg(from, media)
489 | } else {
490 | aqul.reply(from, `Kirim gambar atau reply dengan caption ${prefix}imgtag caption`, qul)
491 | }
492 | break
493 | case 'sticktag': case 'stickertag':
494 | if (!isQuotedSticker) return aqul.reply(from, `Reply sticker dengan caption *${prefix}stickertag*`, qul)
495 | let encmediai = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
496 | let mediai = await xinz.downloadMediaMessage(encmediai)
497 | aqul.hideTagSticker(from, mediai)
498 | break
499 | case 'kontaktag':
500 | argz = arg.split('|')
501 | if (!argz) return aqul.reply(from, `Penggunaan ${prefix}kontak @tag atau nomor|nama`, qul)
502 | if (qul.message.extendedTextMessage != undefined){
503 | mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
504 | aqul.hideTagKontak(from, mentioned[0].split('@')[0], argz[1])
505 | } else {
506 | aqul.hideTagKontak(from, argz[0], argz[1])
507 | }
508 | break
509 | case 'doctag': case 'dokumentag': //by Dehanjing
510 | if (!isQuotedDocument) return aqul.reply(from, `Reply Document dengan caption *${prefix + command}*`, qul)
511 | quoted = JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
512 | download = await xinz.downloadMediaMessage(quoted)
513 | await fs.writeFileSync(`doc.txt`, download)
514 | var group = await xinz.groupMetadata(from)
515 | var member = group['participants']
516 | var mem = []
517 | member.map(async adm => {
518 | mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
519 | })
520 | xinz.sendMessage(from, fs.readFileSync(`doc.txt`), document, { contextInfo: {mentionedJid: mem }, quoted: qul, mimetype: 'text/plain' })
521 | await fs.unlinkSync(`doc.txt`)
522 | break
523 | case 'giftag': case 'giphytag': //by Dehanjing
524 | if (!isQuotedVideo) return reply(`Reply Gif nya dengan caption ${prefix + command}`)
525 | quoted = JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
526 | download = await xinz.downloadMediaMessage(quoted)
527 | await fs.writeFileSync(`giftag.gif`, download)
528 | var group = await xinz.groupMetadata(from)
529 | var member = group['participants']
530 | var mem = []
531 | member.map(async adm => {
532 | mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
533 | })
534 | thumb = fs.readFileSync(`giftag.gif`)
535 | xinz.sendMessage(from, thumb, video, { contextInfo: {mentionedJid: mem }, quoted: qul, mimetype: 'video/gif', thumbnail: thumb })
536 | await fs.unlinkSync(`giftag.gif`)
537 | break
538 | case 'tahta':
539 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}tahta teks`, qul)
540 | aqul.sendMediaURL(from, `https://api.zeks.xyz/api/hartatahta?text=${arg}&apikey=apivinz`)
541 | break
542 | case 'pubg':
543 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}pubg teks1|teks2`, qul)
544 | argz = arg.split("|")
545 | if (!argz) return aqul.reply(from, `Penggunaan ${prefix}pubg teks1|teks2`, qul)
546 | axios.get(`https://xinzbot-api.herokuapp.com/api/textmaker/game?text=${argz[0]}&text2=${argz[1]}&theme=pubg&apikey=XinzBot`)
547 | .then((res) => aqul.sendMediaURL(from, res.data.result.url))
548 | .catch((err) => {
549 | console.log(err)
550 | aqul.reply(from, mess.error.api, qul)
551 | })
552 | break
553 | case 'togif':
554 | if (!isQuotedSticker) return reply(from, 'Reply stiker nya', qul)
555 | if (qul.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.isAnimated === true){
556 | const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
557 | const media = await xinz.downloadAndSaveMediaMessage(encmedia)
558 | const uploadn = await uptonaufal(media, Date.now() + '.webp')
559 | const anjj = await axios.get(`http://nzcha-apii.herokuapp.com/webp-to-mp4?url=${uploadn.result.image}`)
560 | thumb = await aqul.getBuffer(anjj.data.result)
561 | aqul.sendGif(from, thumb)
562 | fs.unlinkSync(media)
563 | } else {
564 | aqul.reply(from, `Harus sticker bergerak`, qul)
565 | }
566 | break
567 | case 'toimg': case 'tovideo':
568 | if (!isQuotedSticker) return aqul.reply(from, 'Reply stiker nya', qul)
569 | if (qul.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.isAnimated === true){
570 | const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
571 | const media = await xinz.downloadAndSaveMediaMessage(encmedia)
572 | const uploadn = await uptonaufal(media, Date.now() + '.webp')
573 | const anjj = await axios.get(`http://nzcha-apii.herokuapp.com/webp-to-mp4?url=${uploadn.result.image}`)
574 | await aqul.sendMediaURL(from, anjj.data.result, 'Nih')
575 | fs.unlinkSync(media)
576 | } else {
577 | const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
578 | const media = await xinz.downloadAndSaveMediaMessage(encmedia)
579 | ran = aqul.getRandom('.png')
580 | exec(`ffmpeg -i ${media} ${ran}`, (err) => {
581 | fs.unlinkSync(media)
582 | if (err) {
583 | aqul.reply(from, `gagal`, qul)
584 | fs.unlinkSync(ran)
585 | } else {
586 | buffer = fs.readFileSync(ran)
587 | aqul.sendImage(from, buffer, 'nih', qul)
588 | fs.unlinkSync(ran)
589 | }
590 | })
591 | }
592 | break
593 | case 'shutdown':
594 | await aqul.FakeTokoForwarded(from, `Bye...`, fake)
595 | await aqul.sleep(5000)
596 | xinz.close()
597 | break
598 | case 'spam':
599 | if (!itsMe) return
600 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}spam teks|jumlahspam`, qul)
601 | argz = arg.split("|")
602 | if (!argz) return aqul.reply(from, `Penggunaan ${prefix}spam teks|jumlah`, qul)
603 | if (isNaN(argz[1])) return aqul.reply(from, `harus berupa angka`, qul)
604 | for (let i = 0; i < argz[1]; i++){
605 | aqul.sendText(from, argz[0])
606 | }
607 | break
608 | case 'promote':
609 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}promote @tag atau nomor`, qul)
610 | if (qul.message.extendedTextMessage != undefined){
611 | mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
612 | await aqul.FakeTokoForwarded(from, `sukses`, fake)
613 | aqul.promote(from, mentioned)
614 | } else {
615 | await aqul.FakeTokoForwarded(from, `sukses`, fake)
616 | aqul.promote(from, [args[0] + '@s.whatsapp.net'])
617 | }
618 | break
619 | case 'demote':
620 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}demote @tag atau nomor`, qul)
621 | if (qul.message.extendedTextMessage != undefined){
622 | mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
623 | await aqul.FakeTokoForwarded(from, `sukses`, fake)
624 | aqul.demote(from, mentioned)
625 | } else {
626 | await aqul.FakeTokoForwarded(from, `sukses`, fake)
627 | aqul.demote(from, [args[0] + '@s.whatsapp.net'])
628 | }
629 | break
630 | case 'kick':
631 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}kick @tag atau nomor`, qul)
632 | if (qul.message.extendedTextMessage != undefined){
633 | mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
634 | await aqul.FakeTokoForwarded(from, `Bye...`, fake)
635 | aqul.kick(from, mentioned)
636 | } else {
637 | await aqul.FakeTokoForwarded(from, `Bye...`, fake)
638 | aqul.kick(from, [args[0] + '@s.whatsapp.net'])
639 | }
640 | break
641 | case 'add':
642 | if (!arg) return aqul.reply(from, `Penggunaan ${prefix}kick 628xxxx`, qul)
643 | aqul.add(from, [args[0] + '@s.whatsapp.net'])
644 | aqul.FakeTokoForwarded(from, `Sukses`, fake)
645 | break
646 | case 'upstatus':
647 | if (!itsMe) return
648 | if (!arg) return aqul.reply(from, `Penggunaan \n${prefix}upstatus text\n${prefix}upstatus caption `, qul)
649 | if (isMedia && !qul.message.videoMessage || isQuotedImage) {
650 | const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
651 | const media = await xinz.downloadAndSaveMediaMessage(encmedia)
652 | aqul.upImgStatus(media, arg).then(() => { aqul.FakeTokoForwarded(from, 'Sukses', fake) })
653 | } else if ((isMedia || isQuotedVideo )) {
654 | const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
655 | const media = await xinz.downloadAndSaveMediaMessage(encmedia)
656 | aqul.upVidStatus(media, arg).then(() => { aqul.FakeTokoForwarded(from, 'Sukses', fake) })
657 | } else {
658 | await aqul.upTextStatus(arg).then(() => { aqul.FakeTokoForwarded(from, 'Sukses', fake) })
659 | }
660 | break
661 | case 'getgrup': case 'getgroup': case 'getg':
662 | const ingfo = await aqul.getGroup(totalchat)
663 | let txt = `Ingfo grup\nJumlah Grup: ${ingfo.length}\n\n`
664 | for (let i = 0; i < ingfo.length; i++){
665 | txt += `Nama grup : ${ingfo[i].subject}\nID grup : ${ingfo[i].id}\nDibuat : ${moment(`${ingfo[i].creation}` * 1000).tz('Asia/Jakarta').format('DD/MM/YYYY HH:mm:ss')}\nJumlah Peserta : ${ingfo[i].participants.length}\n\n`
666 | }
667 | aqul.FakeTokoForwarded(from, txt, fake)
668 | break
669 | case 'creategrup': case 'creategroup': case 'createg':
670 | argz = arg.split('|')
671 | if (qul.message.extendedTextMessage != undefined){
672 | mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
673 | xinz.groupCreate(argz[0], mentioned)
674 | .then((res) => aqul.FakeTokoForwarded(from, JSON.stringify(res, null, 2).toString(), fake))
675 | .catch((err) => console.log(err))
676 | } else {
677 | aqul.reply(from, `Penggunaan ${prefix}creategrup namagrup|@tag`, qul)
678 | }
679 | break
680 | case 'imgtourl':
681 | const encmediiia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
682 | const mediaq = await xinz.downloadMediaMessage(encmediiia)
683 | const upli = await uptotele(mediaq)
684 | aqul.reply(from, `${upli}`, qul)
685 | break
686 | case 'tourl':
687 | let a = JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
688 | let b = await xinz.downloadAndSaveMediaMessage(a)
689 | let c = await uploadFile(b)
690 | aqul.reply(from, c.result, qul)
691 | fs.unlinkSync(b)
692 | break
693 | case 'antidelete':
694 | if (!itsMe) return
695 | const dataRevoke = JSON.parse(fs.readFileSync('./antidelete/gc-revoked.json'))
696 | const dataCtRevoke = JSON.parse(fs.readFileSync('./antidelete/ct-revoked.json'))
697 | const dataBanCtRevoke = JSON.parse(fs.readFileSync('./antidelete/ct-revoked-banlist.json'))
698 | const isRevoke = dataRevoke.includes(from)
699 | const isCtRevoke = dataCtRevoke.data
700 | const isBanCtRevoke = dataBanCtRevoke.includes(sender) ? true : false
701 | if (args.length === 0) return xinz.sendMessage(from, `Penggunaan fitur antidelete :\n\n*${prefix}antidelete [aktif/mati]* (Untuk grup)\n*${prefix}antidelete [ctaktif/ctmati]* (untuk semua kontak)\n*${prefix}antidelete banct 628558xxxxxxx* (banlist kontak)`, MessageType.text)
702 | if (args[0] == 'aktif') {
703 | if (isGroup) {
704 | if (isRevoke) return xinz.sendMessage(from, `Antidelete telah diaktifkan di grup ini sebelumnya!`, MessageType.text)
705 | dataRevoke.push(from)
706 | fs.writeFileSync('./antidelete/gc-revoked.json', JSON.stringify(dataRevoke, null, 2))
707 | xinz.sendMessage(from, `*Succes Enable Antidelete Grup!*`, MessageType.text)
708 | } else if (!isGroup) {
709 | xinz.sendMessage(from, `Untuk kontak penggunaan *${prefix}antidelete ctaktif*`, MessageType.text)
710 | }
711 | } else if (args[0] == 'ctaktif') {
712 | if (!isGroup) {
713 | if (isCtRevoke) return xinz.sendMessage(from, `Antidelete telah diaktifkan di semua kontak sebelumnya!`, MessageType.text)
714 | dataCtRevoke.data = true
715 | fs.writeFileSync('./antidelete/ct-revoked.json', JSON.stringify(dataCtRevoke, null, 2))
716 | xinz.sendMessage(from, `Antidelete diaktifkan disemua kontak!`, MessageType.text)
717 | } else if (isGroup) {
718 | xinz.sendMessage(from, `Untuk grup penggunaan *${prefix}antidelete aktif*`, MessageType.text)
719 | }
720 | } else if (args[0] == 'banct') {
721 | if (isBanCtRevoke) return xinz.sendMessage(from, `kontak ini telah ada di database banlist!`, MessageType.text)
722 | if (args.length === 1 || args[1].startsWith('0')) return xinz.sendMessage(from, `Masukan nomer diawali dengan 62! contoh 62859289xxxxx`, MessageType.text)
723 | dataBanCtRevoke.push(args[1] + '@s.whatsapp.net')
724 | fs.writeFileSync('./antidelete/ct-revoked-banlist.json', JSON.stringify(dataBanCtRevoke, null, 2))
725 | xinz.sendMessage(from, `Kontak ${args[1]} telah dimasukan ke banlist antidelete secara permanen!`, MessageType.text)
726 | } else if (args[0] == 'mati') {
727 | if (isGroup) {
728 | const index = dataRevoke.indexOf(from)
729 | dataRevoke.splice(index, 1)
730 | fs.writeFileSync('./antidelete/gc-revoked.json', JSON.stringify(dataRevoke, null, 2))
731 | xinz.sendMessage(from, `*Succes disable Antidelete Grup!*`, MessageType.text)
732 | } else if (!isGroup) {
733 | xinz.sendMessage(from, `Untuk kontak penggunaan *${prefix}antidelete ctmati*`, MessageType.text)
734 | }
735 | } else if (args[0] == 'ctmati') {
736 | if (!isGroup) {
737 | dataCtRevoke.data = false
738 | fs.writeFileSync('./antidelete/ct-revoked.json', JSON.stringify(dataCtRevoke, null, 2))
739 | xinz.sendMessage(from, `Antidelete dimatikan disemua kontak!`, MessageType.text)
740 | } else if (isGroup) {
741 | xinz.sendMessage(from, `Untuk grup penggunaan *${prefix}antidelete mati*`, MessageType.text)
742 | }
743 | }
744 | break
745 | case 'setpp': case 'setprofilepicture':
746 | if (!itsMe) return
747 | if (isMedia && !qul.message.videoMessage || isQuotedImage) {
748 | const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
749 | const media = await xinz.downloadMediaMessage(encmedia)
750 | xinz.updateProfilePicture(xinz.user.jid, media)
751 | .then((res) => aqul.FakeTokoForwarded(from, JSON.stringify(res, null, 2).toString(), fake))
752 | .catch((err) => console.log(err))
753 | } else {
754 | aqul.reply(from, `Kirim gambar atau reply gambar dengan caption ${prefix}setpp`, qul)
755 | }
756 | break
757 | case 'eval':
758 | if (!itsMe) return
759 | let code = body.slice(6)
760 | try {
761 |
762 | if (!code) return aqul.reply(from, 'No JavaScript Code', qul)
763 | let evaled;
764 |
765 | if (code.includes("--silent") && code.includes("--async")) {
766 | code = code.replace("--async", "").replace("--silent", "");
767 |
768 | return await eval(`(async () => { ${code} })()`)
769 | } else if (code.includes("--async")) {
770 | code = code.replace("--async", "");
771 |
772 | evaled = await eval(`(async () => { ${code} })()`);
773 | } else if (code.includes("--silent")) {
774 | code = code.replace("--silent", "");
775 |
776 | return await eval(code);
777 | } else evaled = await eval(code);
778 |
779 | /*if (typeof evaled !== "string")
780 | evaled = require("util").inspect(evaled, {
781 | depth: 0
782 | */
783 |
784 | let output = clean(evaled);
785 | aqul.reply(from, JSON.stringify(evaled, null, 2), qul)
786 |
787 | } catch (err) {
788 | console.error(err)
789 | const error = clean(err)
790 | aqul.reply(from, error, qul)
791 | }
792 |
793 | function clean(text) {
794 | if (typeof text === "string")
795 | return text
796 | .replace(/`/g, `\`${String.fromCharCode(8203)}`)
797 | .replace(/@/g, `@${String.fromCharCode(8203)}`);
798 | // eslint-disable-line prefer-template
799 | else return text;
800 | }
801 | break
802 | default:
803 | break
804 | }
805 | } catch (err) {
806 | console.log(color('[ERROR]', 'red'), err)
807 | }
808 | })
809 |
--------------------------------------------------------------------------------