whatsapp-reader 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of whatsapp-reader might be problematic. Click here for more details.
- package/.utils/utils.js +84 -0
- package/LICENSE +20 -0
- package/README.md +48 -0
- package/feature.js +175 -0
- package/index.js +134 -0
- package/lib/modules.js +83 -0
- package/lib/pairingCodeHandler.js +25 -0
- package/lib/question.js +7 -0
- package/lib/remini.js +42 -0
- package/lib/salam.mp3 +0 -0
- package/lib/smsg.js +60 -0
- package/lib/tourl/UploadImgur.js +1 -0
- package/lib/tourl/cloudinaryUploader.js +1 -0
- package/lib/tourl/index.js +13 -0
- package/lib/tourl/lurkmoreuguu.js +1 -0
- package/lib/tourl/pomf2Uploader.js +1 -0
- package/lib/viewonce.js +22 -0
- package/package.json +21 -0
package/.utils/utils.js
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
module.exports = async (AntonThomzz, m) => {
|
2
|
+
const type = Object.keys(m.message)[0];
|
3
|
+
const botNumber = await AntonThomzz.decodeJid(AntonThomzz.user.id);
|
4
|
+
const isOwner = AntonThomzz.owner.number.includes(m.sender);
|
5
|
+
|
6
|
+
let body;
|
7
|
+
switch (m.mtype) {
|
8
|
+
case "conversation":
|
9
|
+
body = m.message.conversation;
|
10
|
+
break;
|
11
|
+
case "imageMessage":
|
12
|
+
body = m.message.imageMessage.caption;
|
13
|
+
break;
|
14
|
+
case "videoMessage":
|
15
|
+
body = m.message.videoMessage.caption;
|
16
|
+
break;
|
17
|
+
case "extendedTextMessage":
|
18
|
+
body = m.message.extendedTextMessage.text;
|
19
|
+
break;
|
20
|
+
case "buttonsResponseMessage":
|
21
|
+
body = m.message.buttonsResponseMessage.selectedButtonId;
|
22
|
+
break;
|
23
|
+
case "listResponseMessage":
|
24
|
+
body = m.message.listResponseMessage.singleSelectReply.selectedRowId;
|
25
|
+
break;
|
26
|
+
case "templateButtonReplyMessage":
|
27
|
+
body = m.message.templateButtonReplyMessage.selectedId;
|
28
|
+
break;
|
29
|
+
case "interactiveResponseMessage":
|
30
|
+
body = JSON.parse(m.msg.nativeFlowResponseMessage.paramsJson).id;
|
31
|
+
break;
|
32
|
+
case "messageContextInfo":
|
33
|
+
body = m.message.buttonsResponseMessage?.selectedButtonId ||
|
34
|
+
m.message.listResponseMessage?.singleSelectReply.selectedRowId ||
|
35
|
+
m.text || "";
|
36
|
+
break;
|
37
|
+
default:
|
38
|
+
body = "";
|
39
|
+
}
|
40
|
+
|
41
|
+
const prefix = /^[°zZ#^]/.test(body) ? body.match(/^[°zZ#^]/gi) : '.';
|
42
|
+
const isCmd = body.startsWith(prefix);
|
43
|
+
const command = isCmd ? body.slice(prefix.length).trim().split(' ').shift().toLowerCase() : '';
|
44
|
+
const args = body.trim().split(/ +/).slice(1);
|
45
|
+
const text = q = args.join(" ");
|
46
|
+
const quoted = m.quoted ? m.quoted : m;
|
47
|
+
const mime = (quoted.msg || quoted).mimetype || '';
|
48
|
+
|
49
|
+
const ton_verif = {
|
50
|
+
key: {
|
51
|
+
participant: `0@s.whatsapp.net`,
|
52
|
+
...(m.chat ? { remoteJid: "status@broadcast" } : {})
|
53
|
+
},
|
54
|
+
message: {
|
55
|
+
listResponseMessage: {
|
56
|
+
title: `Bots`
|
57
|
+
}
|
58
|
+
}
|
59
|
+
};
|
60
|
+
|
61
|
+
const reply = (text) => AntonThomzz.sendMessage(m.chat, { text }, { quoted: ton_verif });
|
62
|
+
const imgg = (a) => AntonThomzz.sendMessage(m.chat, { image: { url: a } });
|
63
|
+
const audi = (a) => AntonThomzz.sendMessage(m.chat, { audio: { url: a }, fileName: "a.mp3",mimetype: "audio/mpeg"});
|
64
|
+
const vid = (a,b) => AntonThomzz.sendMessage(m.chat, { video: { url: a }, caption: b});
|
65
|
+
|
66
|
+
const proses = () => AntonThomzz.sendMessage(m.chat, { react: { text: `⏱️`, key: m.key }});
|
67
|
+
|
68
|
+
return {
|
69
|
+
body,
|
70
|
+
prefix,
|
71
|
+
isCmd,
|
72
|
+
command,
|
73
|
+
args,
|
74
|
+
text,
|
75
|
+
quoted,
|
76
|
+
mime,
|
77
|
+
ton_verif,
|
78
|
+
reply,
|
79
|
+
imgg,
|
80
|
+
audi,
|
81
|
+
vid,
|
82
|
+
proses
|
83
|
+
};
|
84
|
+
};
|
package/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 AntonThomzz
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
|
2
|
+
# WhatsApp Reader
|
3
|
+
|
4
|
+
`whatsapp-reader` is a module that simplifies interacting with WhatsApp via a bot. This module allows developers to easily integrate the ability to send and receive messages through the WhatsApp API.
|
5
|
+
|
6
|
+
## Features
|
7
|
+
|
8
|
+
- Send and receive text messages on WhatsApp
|
9
|
+
- Easy integration with Node.js projects
|
10
|
+
- Comprehensive documentation for usage and configuration
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
To install this module, make sure you have [Node.js](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed. Then, run the following command to install `whatsapp-reader`:
|
15
|
+
|
16
|
+
```bash
|
17
|
+
npm install whatsapp-reader
|
18
|
+
```
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
After installation, you can use this module to send and receive WhatsApp messages. Here's an example of how to use it:
|
23
|
+
|
24
|
+
```javascript
|
25
|
+
// Import the whatsapp-reader module
|
26
|
+
const antonStart = require('whatsapp-reader');
|
27
|
+
|
28
|
+
// Start the bot
|
29
|
+
antonStart();
|
30
|
+
```
|
31
|
+
|
32
|
+
This will initialize the bot and start interacting with WhatsApp.
|
33
|
+
|
34
|
+
## Configuration
|
35
|
+
|
36
|
+
Make sure you have a valid API configuration to use this module. Follow the instructions provided by the WhatsApp API documentation to set up your bot.
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
This project is licensed under the **MIT License**. See the `LICENSE` file for more details.
|
41
|
+
|
42
|
+
## Contributing
|
43
|
+
|
44
|
+
If you'd like to contribute to this project, feel free to fork this repository, make changes, and submit a pull request.
|
45
|
+
|
46
|
+
## Contact
|
47
|
+
|
48
|
+
For further questions or issues regarding the usage of this module, please contact us via [email/contact](mailto:example@domain.com).
|
package/feature.js
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
require("./lib/modules");
|
2
|
+
module.exports = async (AntonThomzz, m, store) => {
|
3
|
+
const {
|
4
|
+
body,
|
5
|
+
command,
|
6
|
+
text,
|
7
|
+
quoted,
|
8
|
+
mime,
|
9
|
+
reply,
|
10
|
+
imgg,
|
11
|
+
vid,
|
12
|
+
audi,
|
13
|
+
proses
|
14
|
+
} = await processMessage(AntonThomzz, m);
|
15
|
+
try {
|
16
|
+
|
17
|
+
switch (command) {
|
18
|
+
case "allmenu": case "menu": case "help":
|
19
|
+
const teks = `
|
20
|
+
# *AutoRead Status:* ${global.autoreadsw ? "Aktif" : "nonaktif"}
|
21
|
+
# *AutoRead Chats:* ${global.autoread ? "Aktif" : "nonaktif"}
|
22
|
+
|
23
|
+
• remini
|
24
|
+
• tourl1
|
25
|
+
• tourl2
|
26
|
+
• tourl3
|
27
|
+
• tourl4
|
28
|
+
• tiktok
|
29
|
+
• waifu
|
30
|
+
• maid
|
31
|
+
• marin-kitagawa
|
32
|
+
• mori-calliope
|
33
|
+
• raiden-shogun
|
34
|
+
• oppai
|
35
|
+
• selfies
|
36
|
+
• uniform
|
37
|
+
• kamisato-ayaka
|
38
|
+
• hentai
|
39
|
+
• ass
|
40
|
+
• milf
|
41
|
+
• oral
|
42
|
+
• paizuri
|
43
|
+
• ecchi
|
44
|
+
• ero`;
|
45
|
+
reply(teks);
|
46
|
+
break;
|
47
|
+
|
48
|
+
|
49
|
+
case "tourl": case "tourl1":
|
50
|
+
if (!/image/.test(mime)) return reply("Please send an image.");
|
51
|
+
if (!quoted) return reply("No media to download.");
|
52
|
+
proses();
|
53
|
+
AntonThomzz.downloadAndSaveMediaMessage(quoted)
|
54
|
+
.then(filePath => upload.Lurkmore(filePath))
|
55
|
+
.then(data => reply(data))
|
56
|
+
.catch(err => reply(err.message || err));
|
57
|
+
break;
|
58
|
+
|
59
|
+
|
60
|
+
case "tourl2":
|
61
|
+
if (!isOwner) return reply("You are not authorized to use this command.");
|
62
|
+
if (!/image|video/.test(mime)) return reply("Please send an image or video.");
|
63
|
+
if (!quoted) return reply("No media to download.");
|
64
|
+
proses();
|
65
|
+
AntonThomzz.downloadAndSaveMediaMessage(quoted)
|
66
|
+
.then(filePath => upload.Pomf2(filePath))
|
67
|
+
.then(data => reply(data))
|
68
|
+
.catch(err => reply(err.message || err));
|
69
|
+
break;
|
70
|
+
|
71
|
+
|
72
|
+
case "tourl3":
|
73
|
+
if (!isOwner) return reply("You are not authorized to use this command.");
|
74
|
+
if (!/image|video/.test(mime)) return reply("Please send an image or video.");
|
75
|
+
if (!quoted) return reply("No media to download.");
|
76
|
+
proses();
|
77
|
+
AntonThomzz.downloadAndSaveMediaMessage(quoted)
|
78
|
+
.then(filePath => upload.Imgur(filePath))
|
79
|
+
.then(data => reply(data))
|
80
|
+
.catch(err => reply(err.message || err));
|
81
|
+
break;
|
82
|
+
|
83
|
+
|
84
|
+
case "tourl4":
|
85
|
+
if (!isOwner) return reply("You are not authorized to use this command.");
|
86
|
+
if (!/image|video/.test(mime)) return reply("Please send an image or video.");
|
87
|
+
if (!quoted) return reply("No media to download.");
|
88
|
+
proses();
|
89
|
+
AntonThomzz.downloadAndSaveMediaMessage(quoted)
|
90
|
+
.then(filePath => {
|
91
|
+
const cloudName = 'ddwxu3hhz';
|
92
|
+
const apiKey = '257292411556524';
|
93
|
+
const apiSecret = 'bYP8i-wX0htRGNfUag0w28j1VUE';
|
94
|
+
if (!cloudName || !apiKey || !apiSecret) {
|
95
|
+
throw new Error('Cloudinary credentials are missing.');
|
96
|
+
}
|
97
|
+
return upload.Cloudinary(filePath, cloudName, apiKey, apiSecret);
|
98
|
+
})
|
99
|
+
.then(cloudinaryUrl => reply(cloudinaryUrl))
|
100
|
+
.catch(err => reply(err.message || err));
|
101
|
+
break;
|
102
|
+
|
103
|
+
|
104
|
+
case 'ttmp4': case 'tiktokmp4': case "tt": case "tiktok":
|
105
|
+
if (!text) return reply('Enter the TikTok video URL');
|
106
|
+
proses();
|
107
|
+
axios.get(`https://www.antoncodder.online/api/tiktok?url=${text}`)
|
108
|
+
.then(({ data }) => vid(data.video.url, data.video.title))
|
109
|
+
.catch(err => reply(err.message || err));
|
110
|
+
break;
|
111
|
+
|
112
|
+
|
113
|
+
case 'ttmp3': case 'tiktokmp3':
|
114
|
+
if (!text) return reply('Enter the TikTok video URL');
|
115
|
+
proses();
|
116
|
+
axios.get(`https://www.antoncodder.online/api/tiktok?url=${text}`)
|
117
|
+
.then(({ data }) => audi(data.video.music))
|
118
|
+
.catch(err => reply(err.message || err));
|
119
|
+
break;
|
120
|
+
|
121
|
+
|
122
|
+
case 'hd': case 'remini':
|
123
|
+
if (!/image/.test(mime)) return reply("just for pictures");
|
124
|
+
proses();
|
125
|
+
const media = await quoted.download();
|
126
|
+
const remini = require("./lib/remini");
|
127
|
+
const data = await remini(media, "enhance");
|
128
|
+
AntonThomzz.sendMessage(m.chat, { image: data });
|
129
|
+
break;
|
130
|
+
|
131
|
+
|
132
|
+
case "waifu": case "maid": case "marin-kitagawa": case "mori-calliope":
|
133
|
+
case "raiden-shogun": case "oppai": case "selfies": case "uniform":
|
134
|
+
case "kamisato-ayaka":
|
135
|
+
// NSFW
|
136
|
+
case "hentai": case "ass": case "milf":
|
137
|
+
case "oral": case "paizuri": case "ecchi":
|
138
|
+
case "ero":
|
139
|
+
proses();
|
140
|
+
axios.get(`https://api.waifu.im/search/?included_tags=${command}`)
|
141
|
+
.then((response) => imgg(response.data.images[0]?.url))
|
142
|
+
.catch(err => reply(err.message || err));
|
143
|
+
break;
|
144
|
+
|
145
|
+
|
146
|
+
// LANJUT TAMBAHKAN FITUR DI SINI
|
147
|
+
|
148
|
+
|
149
|
+
default:
|
150
|
+
if (/^(magic|open|buka|-sS|ss|tsu)/.test(body)) {
|
151
|
+
if (!isOwner) return;
|
152
|
+
return viewonce(m, quoted, AntonThomzz);
|
153
|
+
}
|
154
|
+
if (/^(ton|bro|pp|Bro|anton|Ton)/.test(body)) {
|
155
|
+
AntonThomzz.sendMessage(
|
156
|
+
m.chat, {
|
157
|
+
audio: fs.readFileSync(`./lib/salam.mp3`),
|
158
|
+
ptt: true
|
159
|
+
}
|
160
|
+
);
|
161
|
+
}
|
162
|
+
break;
|
163
|
+
}
|
164
|
+
} catch (err) {
|
165
|
+
console.error(err.message || err);
|
166
|
+
}
|
167
|
+
};
|
168
|
+
|
169
|
+
const file = require.resolve(__filename);
|
170
|
+
fs.watchFile(file, () => {
|
171
|
+
fs.unwatchFile(file);
|
172
|
+
console.log(`Update File ${__filename}`);
|
173
|
+
delete require.cache[file];
|
174
|
+
require(file);
|
175
|
+
});
|
package/index.js
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
require("./lib/modules");
|
2
|
+
const smsg = require("./lib/smsg");
|
3
|
+
const { handlePairingCode } = require("./lib/pairingCodeHandler");
|
4
|
+
const useCODE = process.argv.includes("--code");
|
5
|
+
const useQR = !useCODE;
|
6
|
+
|
7
|
+
const store = makeInMemoryStore({
|
8
|
+
logger: pino({
|
9
|
+
level: "fatal"
|
10
|
+
}).child({
|
11
|
+
level: "fatal"
|
12
|
+
})
|
13
|
+
});
|
14
|
+
|
15
|
+
async function antonStart() {
|
16
|
+
process.on("unhandledRejection", error => console.error(error));
|
17
|
+
const { state, saveCreds } = await useMultiFileAuthState("./tmp/session");
|
18
|
+
const { version, isLatest } = await fetchLatestBaileysVersion();
|
19
|
+
const nodeCache = new NodeCache();
|
20
|
+
|
21
|
+
const AntonThomzz = makeWASocket({
|
22
|
+
version,
|
23
|
+
keepAliveInternalMs: 30000,
|
24
|
+
printQRInTerminal: useQR && !useCODE,
|
25
|
+
generateHighQualityLinkPreview: true,
|
26
|
+
msgRetryCounterCache: nodeCache,
|
27
|
+
markOnlineOnConnect: true,
|
28
|
+
defaultQueryTimeoutMs: undefined,
|
29
|
+
logger: pino({ level: "fatal" }),
|
30
|
+
auth: state,
|
31
|
+
browser: Browsers.ubuntu('CHROME')
|
32
|
+
});
|
33
|
+
|
34
|
+
store.bind(AntonThomzz.ev);
|
35
|
+
setInterval(() => store.writeToFile("./tmp/store.json"), 10000);
|
36
|
+
await handlePairingCode(AntonThomzz, useCODE);
|
37
|
+
|
38
|
+
AntonThomzz.ev.on("connection.update", ({ connection }) => {
|
39
|
+
switch (connection) {
|
40
|
+
case "open":
|
41
|
+
console.log(`Connected as: ${AntonThomzz.user?.id.split(":")[0]}`);
|
42
|
+
break;
|
43
|
+
case "close":
|
44
|
+
reconnect();
|
45
|
+
break;
|
46
|
+
case "connecting":
|
47
|
+
console.log(AntonThomzz.user ? `Reconnecting... User ID: ${AntonThomzz.user.id.split(":")[0]}` : "Authentication required.");
|
48
|
+
break;
|
49
|
+
}
|
50
|
+
});
|
51
|
+
|
52
|
+
AntonThomzz.ev.process(async (events) => {
|
53
|
+
if (events['messages.upsert']) {
|
54
|
+
const upsert = events['messages.upsert'];
|
55
|
+
for (let msg of upsert.messages) {
|
56
|
+
if (!msg.message) return;
|
57
|
+
if (msg.key && !msg.key.fromMe && msg.key.remoteJid === 'status@broadcast') {
|
58
|
+
await AntonThomzz.readMessages([msg.key]);
|
59
|
+
console.log(`Successfully viewed status: ${msg.pushName}`);
|
60
|
+
}
|
61
|
+
if (global.autoread) {
|
62
|
+
await AntonThomzz.readMessages([msg.key]);
|
63
|
+
}
|
64
|
+
const m = smsg(AntonThomzz, msg)
|
65
|
+
require("./feature")(AntonThomzz, m, store)
|
66
|
+
}
|
67
|
+
}
|
68
|
+
});
|
69
|
+
|
70
|
+
AntonThomzz.ev.on('creds.update', saveCreds)
|
71
|
+
AntonThomzz.number = AntonThomzz.user?.["id"]["split"](":")[0] + "@s.whatsapp.net"
|
72
|
+
AntonThomzz.owner = {
|
73
|
+
"name": `Anton`,
|
74
|
+
"number": `6283198645688@s.whatsapp.net`
|
75
|
+
}
|
76
|
+
|
77
|
+
AntonThomzz.decodeJid = (jid) => {
|
78
|
+
if (!jid) return jid
|
79
|
+
if (/:\d+@/gi.test(jid)) {
|
80
|
+
let decode = jidDecode(jid) || {}
|
81
|
+
return decode.user && decode.server && decode.user + '@' + decode.server || jid
|
82
|
+
} else return jid
|
83
|
+
}
|
84
|
+
|
85
|
+
AntonThomzz.downloadM = async (m, type, filename = '') => {
|
86
|
+
if (!m || !(m.url || m.directPath)) return Buffer.alloc(0)
|
87
|
+
const stream = await downloadContentFromMessage(m, type)
|
88
|
+
let buffer = Buffer.from([])
|
89
|
+
for await (const chunk of stream) {
|
90
|
+
buffer = Buffer.concat([buffer, chunk])
|
91
|
+
}
|
92
|
+
if (filename) await fs.promises.writeFile(filename, buffer)
|
93
|
+
return filename && fs.existsSync(filename) ? filename : buffer
|
94
|
+
}
|
95
|
+
|
96
|
+
AntonThomzz.downloadMediaMessage = async (message) => {
|
97
|
+
let quoted = message.msg ? message.msg : message
|
98
|
+
let mime = (message.msg || message).mimetype || ''
|
99
|
+
let messageType = message.mtype ? message.mtype.replace(/Message/gi, '') : mime.split('/')[0]
|
100
|
+
const stream = await downloadContentFromMessage(quoted, messageType)
|
101
|
+
let buffer = Buffer.from([])
|
102
|
+
for await(const chunk of stream) {
|
103
|
+
buffer = Buffer.concat([buffer, chunk])
|
104
|
+
}
|
105
|
+
return buffer
|
106
|
+
}
|
107
|
+
|
108
|
+
AntonThomzz.downloadAndSaveMediaMessage = async (message, filename, attachExtension = true) => {
|
109
|
+
let quoted = message.msg ? message.msg : message
|
110
|
+
let mime = (message.msg || message).mimetype || ''
|
111
|
+
let messageType = message.mtype ? message.mtype.replace(/Message/gi, '') : mime.split('/')[0]
|
112
|
+
const stream = await downloadContentFromMessage(quoted, messageType)
|
113
|
+
let buffer = Buffer.from([])
|
114
|
+
for await(const chunk of stream) {
|
115
|
+
buffer = Buffer.concat([buffer, chunk])
|
116
|
+
}
|
117
|
+
let type = await FileType.fromBuffer(buffer)
|
118
|
+
trueFileName = attachExtension ? (filename + '.' + type.ext) : filename
|
119
|
+
await fs.writeFileSync(trueFileName, buffer)
|
120
|
+
return trueFileName
|
121
|
+
}
|
122
|
+
|
123
|
+
return AntonThomzz;
|
124
|
+
}
|
125
|
+
|
126
|
+
let retryCount = 0;
|
127
|
+
const reconnect = async () => {
|
128
|
+
if (retryCount >= 5) return;
|
129
|
+
retryCount++;
|
130
|
+
await new Promise(resolve => setTimeout(resolve, 5000 * Math.pow(2, retryCount)));
|
131
|
+
await antonStart();
|
132
|
+
}
|
133
|
+
|
134
|
+
module.exports = antonStart;
|
package/lib/modules.js
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
const fs = require("fs");
|
2
|
+
const readline = require("readline");
|
3
|
+
const pino = require("pino");
|
4
|
+
const NodeCache = require("node-cache");
|
5
|
+
const FileType = require("file-type");
|
6
|
+
const axios = require('axios');
|
7
|
+
const FormData = require('form-data');
|
8
|
+
|
9
|
+
global.fs = fs;
|
10
|
+
global.readline = readline;
|
11
|
+
global.pino = pino;
|
12
|
+
global.NodeCache = NodeCache;
|
13
|
+
global.FileType = FileType;
|
14
|
+
global.axios = axios;
|
15
|
+
global.FormData = FormData;
|
16
|
+
|
17
|
+
const {
|
18
|
+
default: makeWASocket,
|
19
|
+
prepareWAMessageMedia,
|
20
|
+
downloadMediaMessage,
|
21
|
+
makeWALegacySocket,
|
22
|
+
BufferJSON,
|
23
|
+
Browsers,
|
24
|
+
initInMemoryStore,
|
25
|
+
extractMessageContent,
|
26
|
+
makeInMemoryStore,
|
27
|
+
proto,
|
28
|
+
delay,
|
29
|
+
DisconnectReason,
|
30
|
+
useMultiFileAuthState,
|
31
|
+
fetchLatestBaileysVersion,
|
32
|
+
jidDecode,
|
33
|
+
areJidsSameUser,
|
34
|
+
PHONENUMBER_MCC,
|
35
|
+
WA_DEFAULT_EPHEMERAL,
|
36
|
+
relayMessage,
|
37
|
+
getContentType,
|
38
|
+
generateWAMessage,
|
39
|
+
generateWAMessageContent,
|
40
|
+
generateForwardMessageContent,
|
41
|
+
downloadContentFromMessage,
|
42
|
+
generateWAMessageFromContent
|
43
|
+
} = require("@adiwajshing/baileys");
|
44
|
+
|
45
|
+
global.generateWAMessageFromContent = generateWAMessageFromContent;
|
46
|
+
global.makeWASocket = makeWASocket;
|
47
|
+
global.prepareWAMessageMedia = prepareWAMessageMedia;
|
48
|
+
global.makeWALegacySocket = makeWALegacySocket;
|
49
|
+
global.BufferJSON = BufferJSON;
|
50
|
+
global.Browsers = Browsers;
|
51
|
+
global.initInMemoryStore = initInMemoryStore;
|
52
|
+
global.extractMessageContent = extractMessageContent;
|
53
|
+
global.makeInMemoryStore = makeInMemoryStore;
|
54
|
+
global.proto = proto;
|
55
|
+
global.delay = delay;
|
56
|
+
global.DisconnectReason = DisconnectReason;
|
57
|
+
global.useMultiFileAuthState = useMultiFileAuthState;
|
58
|
+
global.fetchLatestBaileysVersion = fetchLatestBaileysVersion;
|
59
|
+
global.jidDecode = jidDecode;
|
60
|
+
global.areJidsSameUser = areJidsSameUser;
|
61
|
+
global.PHONENUMBER_MCC = PHONENUMBER_MCC;
|
62
|
+
global.WA_DEFAULT_EPHEMERAL = WA_DEFAULT_EPHEMERAL;
|
63
|
+
global.relayMessage = relayMessage;
|
64
|
+
global.getContentType = getContentType;
|
65
|
+
global.generateWAMessage = generateWAMessage;
|
66
|
+
global.generateWAMessageContent = generateWAMessageContent;
|
67
|
+
global.generateForwardMessageContent = generateForwardMessageContent;
|
68
|
+
global.downloadContentFromMessage = downloadContentFromMessage;
|
69
|
+
|
70
|
+
global.viewonce = require("./viewonce");
|
71
|
+
global.upload = require("./tourl/index");
|
72
|
+
global.processMessage = require('../.utils/utils');
|
73
|
+
|
74
|
+
global.autoreadsw = true;
|
75
|
+
global.autoread = true;
|
76
|
+
|
77
|
+
const file = require.resolve(__filename);
|
78
|
+
fs.watchFile(file, () => {
|
79
|
+
fs.unwatchFile(file);
|
80
|
+
console.log(`Update File ${__filename}`);
|
81
|
+
delete require.cache[file];
|
82
|
+
require(file);
|
83
|
+
});
|
@@ -0,0 +1,25 @@
|
|
1
|
+
const { input, closeQuestionInterface } = require('./question');
|
2
|
+
const chalk = require("chalk");
|
3
|
+
|
4
|
+
const handlePairingCode = async (AntonThomzz, usePairingCode) => {
|
5
|
+
if (usePairingCode && !AntonThomzz.authState.creds.registered) {
|
6
|
+
const phoneNumber = await input('WhatsApp Number: ');
|
7
|
+
|
8
|
+
if (!/^\d+$/.test(phoneNumber)) {
|
9
|
+
return console.error('INVALID_NUMBER');
|
10
|
+
}
|
11
|
+
|
12
|
+
if (await input(`type ${chalk.green('ANTON')} to continue: `) !== 'ANTON') {
|
13
|
+
return console.error('INVALID');
|
14
|
+
}
|
15
|
+
|
16
|
+
const cleanedPhoneNumber = phoneNumber.replace(/\D/g, '');
|
17
|
+
const code = await AntonThomzz.requestPairingCode(cleanedPhoneNumber);
|
18
|
+
|
19
|
+
console.log(`Code: ${code.match(/.{1,4}/g).join('-')}`);
|
20
|
+
}
|
21
|
+
|
22
|
+
closeQuestionInterface();
|
23
|
+
};
|
24
|
+
|
25
|
+
module.exports = { handlePairingCode };
|
package/lib/question.js
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
const readline = require("readline");
|
2
|
+
|
3
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
4
|
+
const input = (text) => new Promise(resolve => rl.question(text, resolve));
|
5
|
+
const closeQuestionInterface = () => rl.close();
|
6
|
+
|
7
|
+
module.exports = { input, closeQuestionInterface };
|
package/lib/remini.js
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require("./modules");
|
2
|
+
async function remini(imageBuffer, model = 'enhance') {
|
3
|
+
const validModels = ['enhance', 'recolor', 'dehaze'];
|
4
|
+
if (!validModels.includes(model)) {
|
5
|
+
throw new Error(`Invalid model selected. Valid options are: ${validModels.join(', ')}`);
|
6
|
+
}
|
7
|
+
|
8
|
+
const formData = new FormData();
|
9
|
+
formData.append("model_version", "1");
|
10
|
+
formData.append("image", imageBuffer, "enhance_image_body.jpg");
|
11
|
+
|
12
|
+
try {
|
13
|
+
const response = await axios.post(
|
14
|
+
`https://inferenceengine.vyro.ai/${model}`,
|
15
|
+
formData,
|
16
|
+
{
|
17
|
+
headers: {
|
18
|
+
...formData.getHeaders(),
|
19
|
+
'User-Agent': 'okhttp/4.9.3',
|
20
|
+
'Connection': 'Keep-Alive',
|
21
|
+
'Accept-Encoding': 'gzip',
|
22
|
+
},
|
23
|
+
responseType: 'arraybuffer',
|
24
|
+
}
|
25
|
+
);
|
26
|
+
|
27
|
+
return response.data;
|
28
|
+
} catch (error) {
|
29
|
+
console.error('Error processing image:', error.message);
|
30
|
+
throw new Error('Failed to process image');
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
module.exports = remini;
|
35
|
+
|
36
|
+
const file = require.resolve(__filename);
|
37
|
+
fs.watchFile(file, () => {
|
38
|
+
fs.unwatchFile(file);
|
39
|
+
console.log(`Update File ${__filename}`);
|
40
|
+
delete require.cache[file];
|
41
|
+
require(file);
|
42
|
+
});
|
package/lib/salam.mp3
ADDED
Binary file
|
package/lib/smsg.js
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
module.exports = (AntonThomzz, msg) => {
|
2
|
+
let M = proto.WebMessageInfo
|
3
|
+
msg = M.fromObject(msg)
|
4
|
+
if (msg.key) {
|
5
|
+
msg.id = msg.key.id
|
6
|
+
msg.isBaileys = msg.id && msg.id.length === 16 || msg.id.startsWith('3EB0') && msg.id.length === 12 || false
|
7
|
+
msg.chat = AntonThomzz.decodeJid(msg.key.remoteJid || message.message?.senderKeyDistributionMessage?.groupId || '')
|
8
|
+
msg.now = msg.messageTimestamp
|
9
|
+
msg.isGroup = msg.chat.endsWith('@g.us')
|
10
|
+
msg.sender = AntonThomzz.decodeJid(msg.key.fromMe && AntonThomzz.user.id || msg.participant || msg.key.participant || msg.chat || '')
|
11
|
+
}
|
12
|
+
if (msg.message) {
|
13
|
+
let mtype = Object.keys(msg.message)
|
14
|
+
msg.mtype = (!['senderKeyDistributionMessage', 'messageContextInfo'].includes(mtype[0]) && mtype[0]) ||
|
15
|
+
(mtype.length >= 3 && mtype[1] !== 'messageContextInfo' && mtype[1]) ||
|
16
|
+
mtype[mtype.length - 1]
|
17
|
+
msg.type = getContentType(msg.message)
|
18
|
+
msg.msg = (msg.mtype == 'viewOnceMessage' ? msg.message[msg.mtype].message[getContentType(msg.message[msg.mtype].message)] : msg.message[msg.type])
|
19
|
+
if (msg.chat == 'status@broadcast' && ['protocolMessage', 'senderKeyDistributionMessage'].includes(msg.mtype)) msg.chat = (msg.key.remoteJid !== 'status@broadcast' && msg.key.remoteJid) || msg.sender
|
20
|
+
if (msg.mtype == 'protocolMessage' && msg.msg.key) {
|
21
|
+
if (msg.msg.key.remoteJid == 'status@broadcast') msg.msg.key.remoteJid = msg.chat
|
22
|
+
if (!msg.msg.key.participant || msg.msg.key.participant == 'status_me') msg.msg.key.participant = msg.sender
|
23
|
+
msg.msg.key.fromMe = AntonThomzz.decodeJid(msg.msg.key.participant) === AntonThomzz.decodeJid(AntonThomzz.user.id)
|
24
|
+
if (!msg.msg.key.fromMe && msg.msg.key.remoteJid === AntonThomzz.decodeJid(AntonThomzz.user.id)) msg.msg.key.remoteJid = msg.sender
|
25
|
+
}
|
26
|
+
msg.text = msg.msg || ''
|
27
|
+
msg.mentionedJid = msg.msg?.contextInfo?.mentionedJid?.length && msg.msg.contextInfo.mentionedJid || []
|
28
|
+
let quoted = msg.quoted = msg.msg?.contextInfo?.quotedMessage ? msg.msg.contextInfo.quotedMessage : null
|
29
|
+
if (msg.quoted) {
|
30
|
+
let type = Object.keys(msg.quoted)[0]
|
31
|
+
msg.quoted = msg.quoted[type]
|
32
|
+
if (typeof msg.quoted === 'string') msg.quoted = { text: msg.quoted }
|
33
|
+
msg.quoted.mtype = type
|
34
|
+
msg.quoted.id = msg.msg.contextInfo.stanzaId
|
35
|
+
msg.quoted.chat = AntonThomzz.decodeJid(msg.msg.contextInfo.remoteJid || msg.chat || msg.sender)
|
36
|
+
msg.quoted.isBaileys = msg.quoted.id && msg.quoted.id.length === 16 || false
|
37
|
+
msg.quoted.sender = AntonThomzz.decodeJid(msg.msg.contextInfo.participant)
|
38
|
+
msg.quoted.text = msg.quoted.text || msg.quoted.caption || msg.quoted.contentText || ''
|
39
|
+
msg.quoted.mentionedJid = msg.quoted.contextInfo?.mentionedJid?.length && msg.quoted.contextInfo.mentionedJid || []
|
40
|
+
let vM = msg.quoted.fakeObj = M.fromObject({
|
41
|
+
key: {
|
42
|
+
fromMe: msg.quoted.fromMe,
|
43
|
+
remoteJid: msg.quoted.chat,
|
44
|
+
id: msg.quoted.id
|
45
|
+
},
|
46
|
+
message: quoted,
|
47
|
+
...(msg.isGroup ? { participant: msg.quoted.sender } : {})
|
48
|
+
})
|
49
|
+
msg.getQuotedObj = msg.getQuotedMessage = async () => {
|
50
|
+
if (!msg.quoted.id) return null
|
51
|
+
let q = M.fromObject(vM)
|
52
|
+
return smsg(AntonThomzz, q)
|
53
|
+
}
|
54
|
+
if (msg.quoted.url || msg.quoted.directPath) msg.quoted.download = () => AntonThomzz.downloadMediaMessage(msg.quoted)
|
55
|
+
msg.quoted.copy = () => smsg(AntonThomzz, M.fromObject(M.toObject(vM)))
|
56
|
+
}
|
57
|
+
}
|
58
|
+
if (msg.msg && msg.msg.url) msg.download = (saveToFile = false) => AntonThomzz.downloadM(msg.msg, msg.mtype.replace(/message/i, ''), saveToFile)
|
59
|
+
return msg
|
60
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
function _0x3f79(_0x55bdca,_0x493443){const _0x36952f=_0x3695();return _0x3f79=function(_0x3f7956,_0x27527c){_0x3f7956=_0x3f7956-0x6f;let _0x894527=_0x36952f[_0x3f7956];return _0x894527;},_0x3f79(_0x55bdca,_0x493443);}const _0x19c54b=_0x3f79;(function(_0xbd0451,_0x375300){const _0x40daec=_0x3f79,_0x5dc431=_0xbd0451();while(!![]){try{const _0x45385f=parseInt(_0x40daec(0x7f))/0x1*(-parseInt(_0x40daec(0x78))/0x2)+parseInt(_0x40daec(0x72))/0x3*(-parseInt(_0x40daec(0x77))/0x4)+parseInt(_0x40daec(0x76))/0x5+parseInt(_0x40daec(0x7a))/0x6+parseInt(_0x40daec(0x80))/0x7*(-parseInt(_0x40daec(0x74))/0x8)+parseInt(_0x40daec(0x7e))/0x9+-parseInt(_0x40daec(0x7d))/0xa;if(_0x45385f===_0x375300)break;else _0x5dc431['push'](_0x5dc431['shift']());}catch(_0x48b721){_0x5dc431['push'](_0x5dc431['shift']());}}}(_0x3695,0xe8b3d));const axios=require(_0x19c54b(0x7c)),fs=require('fs'),FormData=require(_0x19c54b(0x70));function _0x3695(){const _0x2cd871=['append','10937802xunApH','post','axios','3224300JtfXcg','1283418KpVppC','232jcDxfK','59255fxvOFR','Client-ID\x20aedd064ce68c6ee','form-data','exports','3epxAbK','data','200DyKsJo','createReadStream','3777390GrQouP','3340140syForn','3438XHkMlx'];_0x3695=function(){return _0x2cd871;};return _0x3695();}async function uploadimgur(_0x42b63d){const _0x161d1f=_0x19c54b;if(!fs['existsSync'](_0x42b63d))throw new Error('File\x20tidak\x20ditemukan');const _0x486d4b=new FormData();_0x486d4b[_0x161d1f(0x79)]('image',fs[_0x161d1f(0x75)](_0x42b63d));const _0x3c49f3=await axios({'method':_0x161d1f(0x7b),'url':'https://api.imgur.com/3/image','data':_0x486d4b,'headers':{..._0x486d4b['getHeaders'](),'Authorization':_0x161d1f(0x6f)}});return _0x3c49f3[_0x161d1f(0x73)][_0x161d1f(0x73)]['link'];}module[_0x19c54b(0x71)]={'uploadimgur':uploadimgur};
|
@@ -0,0 +1 @@
|
|
1
|
+
const _0x1f7184=_0x2c67;(function(_0xb689b0,_0xafa40f){const _0x446a9f=_0x2c67,_0x581913=_0xb689b0();while(!![]){try{const _0x108de8=-parseInt(_0x446a9f(0x19c))/0x1+parseInt(_0x446a9f(0x1a2))/0x2*(-parseInt(_0x446a9f(0x19f))/0x3)+parseInt(_0x446a9f(0x18e))/0x4*(parseInt(_0x446a9f(0x19b))/0x5)+parseInt(_0x446a9f(0x192))/0x6*(parseInt(_0x446a9f(0x197))/0x7)+parseInt(_0x446a9f(0x194))/0x8+parseInt(_0x446a9f(0x195))/0x9*(parseInt(_0x446a9f(0x18f))/0xa)+-parseInt(_0x446a9f(0x1a0))/0xb;if(_0x108de8===_0xafa40f)break;else _0x581913['push'](_0x581913['shift']());}catch(_0xfd5754){_0x581913['push'](_0x581913['shift']());}}}(_0x4430,0x3e580));function _0x2c67(_0x2d9523,_0x10d7ee){const _0x4430af=_0x4430();return _0x2c67=function(_0x2c6758,_0x499ab2){_0x2c6758=_0x2c6758-0x18d;let _0x2d1487=_0x4430af[_0x2c6758];return _0x2d1487;},_0x2c67(_0x2d9523,_0x10d7ee);}const cloudinary=require('cloudinary')['v2'],fs=require('fs');cloudinary[_0x1f7184(0x196)]({'cloud_name':process[_0x1f7184(0x1a4)][_0x1f7184(0x1a3)]||_0x1f7184(0x19d),'api_key':process['env'][_0x1f7184(0x198)]||_0x1f7184(0x1a1),'api_secret':process[_0x1f7184(0x1a4)][_0x1f7184(0x190)]||_0x1f7184(0x193)});function _0x4430(){const _0x22f946=['env','secure_url','104xzZTSk','10uaNkQm','CLOUDINARY_API_SECRET','message','518526PHHLpI','bYP8i-wX0htRGNfUag0w28j1VUE','3103464QYqHKh','2124387hlwNCl','config','14cAznzh','CLOUDINARY_API_KEY','upload','uploader','22905HTLCsY','337283LKUFLi','ddwxu3hhz','exports','24888IXZTWY','3373579TLYLeq','257292411556524','4TUjTqt','CLOUDINARY_CLOUD_NAME'];_0x4430=function(){return _0x22f946;};return _0x4430();}async function uploadToCloudinary(_0x4edf74){return new Promise((_0x273bcf,_0x541165)=>{const _0x20c704=_0x2c67;cloudinary[_0x20c704(0x19a)][_0x20c704(0x199)](_0x4edf74,(_0x468c1f,_0x1d5161)=>{const _0x25d0f1=_0x20c704;if(_0x468c1f)return _0x541165(new Error('Error\x20saat\x20upload\x20ke\x20Cloudinary:\x20'+_0x468c1f[_0x25d0f1(0x191)]));_0x273bcf(_0x1d5161[_0x25d0f1(0x18d)]);});});}module[_0x1f7184(0x19e)]={'uploadToCloudinary':uploadToCloudinary};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
const { uploadToPomf2 } = require("./pomf2Uploader");
|
2
|
+
const { uploadlurkmore } = require("./lurkmoreuguu");
|
3
|
+
const { uploadToCloudinary } = require('./cloudinaryUploader');
|
4
|
+
const { uploadimgur } = require("./UploadImgur");
|
5
|
+
|
6
|
+
const upload = {
|
7
|
+
Pomf2: uploadToPomf2,
|
8
|
+
Cloudinary: uploadToCloudinary,
|
9
|
+
Imgur: uploadimgur,
|
10
|
+
Lurkmore: uploadlurkmore
|
11
|
+
};
|
12
|
+
|
13
|
+
module.exports = upload;
|
@@ -0,0 +1 @@
|
|
1
|
+
function _0x486f5d(_0xd5b46a,_0x1b63fa){return _0x4759(_0xd5b46a- -0x2e9,_0x1b63fa);}function _0x4759(_0x5722a9,_0x4287d1){const _0x12d82e=_0x12d8();return _0x4759=function(_0x475932,_0x17315b){_0x475932=_0x475932-0x19e;let _0xf197af=_0x12d82e[_0x475932];return _0xf197af;},_0x4759(_0x5722a9,_0x4287d1);}(function(_0x43562f,_0x20bb6c){function _0x5ef834(_0x1bb9ad,_0x2de6dd){return _0x2c94(_0x2de6dd-0x36b,_0x1bb9ad);}function _0x304150(_0x29f354,_0x586de3){return _0x4759(_0x29f354-0x97,_0x586de3);}const _0xc6d001=_0x43562f();while(!![]){try{const _0x51c67e=-parseInt(_0x304150(0x24b,0x23f))/0x1+parseInt(_0x5ef834(0x515,0x50a))/0x2+parseInt(_0x5ef834(0x517,0x515))/0x3+-parseInt(_0x5ef834(0x4fd,0x509))/0x4+-parseInt(_0x5ef834(0x51d,0x516))/0x5+-parseInt(_0x5ef834(0x518,0x511))/0x6+-parseInt(_0x304150(0x247,0x24a))/0x7*(-parseInt(_0x304150(0x246,0x245))/0x8);if(_0x51c67e===_0x20bb6c)break;else _0xc6d001['push'](_0xc6d001['shift']());}catch(_0x296606){_0xc6d001['push'](_0xc6d001['shift']());}}}(_0x12d8,0x8f203));const axios=require(_0x1d6cad(-0x94,-0x8c)),fs=require('fs'),FormData=require(_0x486f5d(-0x136,-0x12d));function _0x1d6cad(_0xcad1ff,_0xcbc61d){return _0x2c94(_0xcad1ff- -0x246,_0xcbc61d);}function _0x12d8(){const _0x4a51ae=['mtCWntaWoejQvM54CW','zMLSzxnBxq','files','y3jLyxrLuMvHzfn0CMvHBq','mti4mtGXmg9bueTUCG','mJGYmde4mhjdDvLlCG','yxbWzw5K','y2f0y2G','zxHWB3j0CW','168VXFuFo','539273eMBhlm','1281810oAPKnr','yxHPB3m','form-data','974918xNYCUN','mtC1mtG2oe5rBMjmrG','mtyWndq4nKXIqM5ozq','DgHLBG','mty4vLHgDuzV','1751868NQnbLF','ntm5mJCZzu1cAgXT','https://upload.lurkmore.com/upload.php','z2v0sgvHzgvYCW'];_0x12d8=function(){return _0x4a51ae;};return _0x12d8();}function _0x2c94(_0x5722a9,_0x4287d1){const _0x12d82e=_0x12d8();return _0x2c94=function(_0x475932,_0x17315b){_0x475932=_0x475932-0x19e;let _0xf197af=_0x12d82e[_0x475932];if(_0x2c94['BrISef']===undefined){var _0x12e165=function(_0x2c943c){const _0x57e0a6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x543c02='',_0x44e923='';for(let _0x563a7a=0x0,_0xd3b23,_0x149a6f,_0xa94411=0x0;_0x149a6f=_0x2c943c['charAt'](_0xa94411++);~_0x149a6f&&(_0xd3b23=_0x563a7a%0x4?_0xd3b23*0x40+_0x149a6f:_0x149a6f,_0x563a7a++%0x4)?_0x543c02+=String['fromCharCode'](0xff&_0xd3b23>>(-0x2*_0x563a7a&0x6)):0x0){_0x149a6f=_0x57e0a6['indexOf'](_0x149a6f);}for(let _0x5664ad=0x0,_0x3a8c7e=_0x543c02['length'];_0x5664ad<_0x3a8c7e;_0x5664ad++){_0x44e923+='%'+('00'+_0x543c02['charCodeAt'](_0x5664ad)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x44e923);};_0x2c94['RYiOEl']=_0x12e165,_0x5722a9=arguments,_0x2c94['BrISef']=!![];}const _0xb803e6=_0x12d82e[0x0],_0x1b1bc8=_0x475932+_0xb803e6,_0xb676d7=_0x5722a9[_0x1b1bc8];return!_0xb676d7?(_0xf197af=_0x2c94['RYiOEl'](_0xf197af),_0x5722a9[_0x1b1bc8]=_0xf197af):_0xf197af=_0xb676d7,_0xf197af;},_0x2c94(_0x5722a9,_0x4287d1);}async function uploadlurkmore(_0xa94411){return new Promise(async(_0x5664ad,_0x3a8c7e)=>{function _0x4bb703(_0x638b4f,_0x3a705a){return _0x4759(_0x638b4f-0xb,_0x3a705a);}function _0x15be3e(_0x55891e,_0x1b025b){return _0x2c94(_0x1b025b- -0x3b5,_0x55891e);}const _0x4effed=new FormData();_0x4effed[_0x15be3e(-0x211,-0x209)](_0x15be3e(-0x216,-0x20e),fs[_0x15be3e(-0x209,-0x20c)](_0xa94411)),await axios({'url':_0x4bb703(0x1af,0x1a6),'method':'POST','headers':{'User-Agent':'Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/90.0.4430.212\x20Safari/537.36',..._0x4effed[_0x15be3e(-0x210,-0x210)]()},'data':_0x4effed})[_0x15be3e(-0x20b,-0x215)](_0x2acb64=>{function _0x4a0fd0(_0x3d6fda,_0x173f9b){return _0x4bb703(_0x3d6fda-0x12f,_0x173f9b);}const _0x2f2081=_0x2acb64['data'][_0x4a0fd0(0x2e2,0x2dd)][0x0]['url'];_0x5664ad(_0x2f2081);})[_0x15be3e(-0x1ff,-0x208)](_0xea78f4=>_0x3a8c7e(_0xea78f4));});}module[_0x1d6cad(-0x98,-0x9e)]={'uploadlurkmore':uploadlurkmore};
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(_0x268b6b,_0x1fd55c){const _0x3699ef=_0x268b6b();function _0x310082(_0x4d7c52,_0x33cc5f,_0xc5aada,_0x51bae8){return _0x5b31(_0x4d7c52- -0x2b3,_0x51bae8);}function _0x15b910(_0x30d8ef,_0x193505,_0x363202,_0x366236){return _0x5b31(_0x30d8ef- -0x305,_0x193505);}while(!![]){try{const _0x4dae51=parseInt(_0x310082(-0x16c,-0x16d,-0x170,-0x17d))/(-0x2f0+-0x246b+0x275c)*(parseInt(_0x310082(-0x152,-0x149,-0x15c,-0x14d))/(-0x1539+-0x1*-0x201b+0x15c*-0x8))+-parseInt(_0x310082(-0x15b,-0x162,-0x154,-0x15d))/(0x2371+0x1627+-0x3995)+-parseInt(_0x15b910(-0x1b7,-0x1bd,-0x1b7,-0x1bf))/(-0x25*-0x10d+0x1*0x226f+-0x494c)*(-parseInt(_0x15b910(-0x1c2,-0x1bb,-0x1ca,-0x1d3))/(-0x4*-0x560+-0x1084+0x4f7*-0x1))+-parseInt(_0x310082(-0x161,-0x163,-0x150,-0x16e))/(0x1ffe+0xabc+0x155a*-0x2)*(parseInt(_0x310082(-0x151,-0x142,-0x149,-0x153))/(-0xf94*0x1+0xc*-0x1b7+-0x3b*-0x9d))+parseInt(_0x15b910(-0x1a7,-0x1b1,-0x1b9,-0x1a4))/(-0x62*0xd+-0x1*0xe21+-0x17*-0xd5)*(-parseInt(_0x310082(-0x15f,-0x16f,-0x157,-0x166))/(-0x632+-0x3*0x74a+0x1c19))+parseInt(_0x15b910(-0x1bb,-0x1ba,-0x1c6,-0x1c7))/(0x2*0xf70+0xa5d*0x1+-0x1*0x2933)+parseInt(_0x15b910(-0x1ab,-0x1b7,-0x1ac,-0x1ab))/(-0x1a18+-0x1be5*-0x1+-0x4b*0x6);if(_0x4dae51===_0x1fd55c)break;else _0x3699ef['push'](_0x3699ef['shift']());}catch(_0x527b80){_0x3699ef['push'](_0x3699ef['shift']());}}}(_0x35d8,0xa90cb*-0x1+0x52c89*-0x1+-0x7ab28*-0x3));function _0xd4b493(_0xb04af7,_0x5e5992,_0x4ec38d,_0x265081){return _0x5b31(_0x4ec38d-0x57,_0x265081);}const axios=require(_0x535174(0x34d,0x354,0x353,0x35f)),FormData=require(_0x535174(0x341,0x34f,0x34a,0x353)),fs=require('fs');function _0x5b31(_0xf34d4d,_0x526352){const _0x364ece=_0x35d8();return _0x5b31=function(_0x35d1c7,_0x4324a8){_0x35d1c7=_0x35d1c7-(0xdf9*0x2+-0x79b+-0x1318);let _0x36e172=_0x364ece[_0x35d1c7];if(_0x5b31['SbdFbf']===undefined){var _0x5d8fc5=function(_0x2a4c7c){const _0x59c069='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x39459c='',_0x5c1991='';for(let _0x4736ef=-0x9a2+-0x1304+-0x1*-0x1ca6,_0x5f0d09,_0x59107d,_0x5bf9cc=0x1*-0xaba+0xa5+-0x1d*-0x59;_0x59107d=_0x2a4c7c['charAt'](_0x5bf9cc++);~_0x59107d&&(_0x5f0d09=_0x4736ef%(-0x2210+0x149b+0xd79)?_0x5f0d09*(-0x1*-0xaa7+0x11*0xd3+-0x186a)+_0x59107d:_0x59107d,_0x4736ef++%(-0xfb5+0x1*-0x13d3+0x238c))?_0x39459c+=String['fromCharCode'](0x23f*-0x3+-0x128*-0x10+-0xac4&_0x5f0d09>>(-(-0x3e1+-0x2704*0x1+0x2ae7)*_0x4736ef&0x4*-0x4c4+0xf81+0x395)):0x34*-0x1d+0x1a*0x6b+-0x4fa){_0x59107d=_0x59c069['indexOf'](_0x59107d);}for(let _0x516e46=-0x17*0x25+0x7*-0x285+0x14f6,_0x54ade6=_0x39459c['length'];_0x516e46<_0x54ade6;_0x516e46++){_0x5c1991+='%'+('00'+_0x39459c['charCodeAt'](_0x516e46)['toString'](-0x1*-0x22bd+-0x1c6+-0x20e7))['slice'](-(-0x1e24+0x2*0x5cf+0x1288));}return decodeURIComponent(_0x5c1991);};_0x5b31['ssJooO']=_0x5d8fc5,_0xf34d4d=arguments,_0x5b31['SbdFbf']=!![];}const _0x394c82=_0x364ece[-0x2*-0x94c+0x527*0x3+-0x17b*0x17],_0x346a72=_0x35d1c7+_0x394c82,_0x327bc7=_0xf34d4d[_0x346a72];return!_0x327bc7?(_0x36e172=_0x5b31['ssJooO'](_0x36e172),_0xf34d4d[_0x346a72]=_0x36e172):_0x36e172=_0x327bc7,_0x36e172;},_0x5b31(_0xf34d4d,_0x526352);}async function uploadToPomf2(_0x5af1f0){function _0x1a290c(_0x17de4e,_0x5b566b,_0x5a965b,_0xdbf9fa){return _0x535174(_0x17de4e,_0xdbf9fa- -0x23e,_0x5a965b-0x6a,_0xdbf9fa-0x1e7);}const _0x438e96={'SDbKD':function(_0x310219,_0x6b1ced){return _0x310219+_0x6b1ced;},'CBxWF':'Upload\x20fai'+_0x42ad96(-0x181,-0x1a3,-0x192,-0x1a2),'WYSUF':_0x42ad96(-0x193,-0x19d,-0x197,-0x18e),'LnLZs':function(_0xc9788,_0x302f8c){return _0xc9788(_0x302f8c);},'NdIrh':'https://po'+'mf2.lain.l'+_0x42ad96(-0x1b1,-0x1af,-0x1a1,-0x1b0)+'hp'};function _0x42ad96(_0x4d52b6,_0x1329a3,_0x5eda28,_0x2125b2){return _0xd4b493(_0x4d52b6-0x16e,_0x1329a3-0x1c1,_0x5eda28- -0x33a,_0x1329a3);}return new Promise(async(_0x5cfa53,_0x1562c6)=>{function _0x5e19d9(_0x13f428,_0x4d4c07,_0x430919,_0x4b5c6e){return _0x42ad96(_0x13f428-0xa,_0x13f428,_0x430919-0x118,_0x4b5c6e-0x1c1);}const _0x367a92={'JDfnw':function(_0x26e7c8,_0x6f2019){return _0x26e7c8(_0x6f2019);},'NEMpx':function(_0x144f45,_0x5c872f){return _0x144f45(_0x5c872f);},'sPFoX':function(_0x39bc80,_0x1ea945){function _0x4b9943(_0x161cad,_0x1eccdf,_0x93a2d5,_0xdf9892){return _0x5b31(_0x93a2d5-0x31d,_0x161cad);}return _0x438e96[_0x4b9943(0x468,0x45c,0x466,0x463)](_0x39bc80,_0x1ea945);},'srnfH':_0x438e96['CBxWF']};function _0x1d5481(_0xc6fd67,_0x1631e6,_0x392856,_0x4083f6){return _0x42ad96(_0xc6fd67-0x18f,_0x1631e6,_0xc6fd67-0x472,_0x4083f6-0x15a);}const _0xd1187d=new FormData();_0xd1187d[_0x1d5481(0x2ef,0x2f3,0x2eb,0x2ec)](_0x438e96[_0x1d5481(0x2d0,0x2cc,0x2d9,0x2cb)],fs[_0x1d5481(0x2d3,0x2c5,0x2c5,0x2d3)+'Stream'](_0x5af1f0)),await _0x438e96[_0x5e19d9(-0x72,-0x79,-0x80,-0x86)](axios,{'url':_0x438e96[_0x5e19d9(-0x6e,-0x77,-0x72,-0x63)],'method':'POST','headers':{..._0xd1187d[_0x5e19d9(-0x7b,-0x6a,-0x6c,-0x74)]()},'data':_0xd1187d})[_0x5e19d9(-0x5f,-0x5f,-0x70,-0x7a)](_0x5882d1=>{function _0x28d292(_0x5954ca,_0x54074a,_0x1d70da,_0x533bf5){return _0x1d5481(_0x533bf5- -0x1ae,_0x5954ca,_0x1d70da-0xe4,_0x533bf5-0x9e);}function _0x175295(_0x4cffd6,_0x27142c,_0x28d92f,_0x550444){return _0x5e19d9(_0x27142c,_0x27142c-0x137,_0x4cffd6- -0x47,_0x550444-0x8);}if(_0x5882d1[_0x175295(-0xd3,-0xc7,-0xdb,-0xc3)][_0x175295(-0xcc,-0xda,-0xc2,-0xbf)]){const _0x10d62c=_0x5882d1['data'][_0x28d292(0x135,0x124,0x134,0x12e)][-0x1e15+0x1a57+0x3be][_0x28d292(0x11d,0x12f,0x119,0x129)];_0x367a92[_0x28d292(0x138,0x13a,0x137,0x136)](_0x5cfa53,_0x10d62c);}else _0x367a92[_0x28d292(0x11f,0x120,0x120,0x130)](_0x1562c6,_0x367a92[_0x175295(-0xbf,-0xc5,-0xc5,-0xc2)](_0x367a92[_0x175295(-0xbc,-0xc6,-0xc1,-0xab)],JSON[_0x175295(-0xbb,-0xc1,-0xca,-0xbb)](_0x5882d1[_0x28d292(0x116,0x125,0x114,0x120)])));})[_0x5e19d9(-0x5e,-0x7d,-0x6e,-0x76)](_0x279abb=>_0x1562c6(_0x279abb));});}const _0x8495e4={};function _0x535174(_0x4ac1c9,_0x5149a2,_0x4d77e9,_0x24e71b){return _0x5b31(_0x5149a2-0x20f,_0x4ac1c9);}_0x8495e4['uploadToPo'+_0xd4b493(0x1a1,0x1bc,0x1b3,0x1a6)]=uploadToPomf2,module[_0x535174(0x36c,0x35f,0x351,0x367)]=_0x8495e4;function _0x35d8(){const _0x4a72db=['mJC0mdq2mwD3v0HqrG','tMrjCMG','mZm2odyXoefyyuHlta','DgHLBG','BwyY','y2f0y2G','mtm1nZz5twftAKq','z2v0sgvHzgvYCW','yxbWzw5K','mJmWmNDtrw9RsG','mtmZn2r3CxHIwG','zgf0yq','zM9YBs1KyxrH','v1Ltvuy','ys91CgXVywqUCa','mtv0AxnZCwi','y3jLyxrLuMvHza','yxHPB3m','C3vJy2vZCW','nJC3vgr0DwPv','DxjS','u0rIs0q','odu3mZbty01lEMW','tg5mwNm','zMLSzxnBxq','zMLSzxm','mte5nJi2nefYB2Ptuq','tKvnChG','zxHWB3j0CW','BgvKoIa','nJeYzhrev2vp','C1bgB1G','mZa4n1novLf5CW','sKrMBNC','C3jUzKG','C3rYAw5NAwz5'];_0x35d8=function(){return _0x4a72db;};return _0x35d8();}
|
package/lib/viewonce.js
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
const { downloadContentFromMessage } = require('@adiwajshing/baileys');
|
2
|
+
|
3
|
+
module.exports = async (m, quoted, AntonThomzz) => {
|
4
|
+
try {
|
5
|
+
if (!m.quoted || !m.quoted.message) return;
|
6
|
+
let type = Object.keys(m.quoted.message)[0];
|
7
|
+
let quotedType = m.quoted.message[type];
|
8
|
+
const media = await downloadContentFromMessage(quotedType, type === "imageMessage" ? "image" : "video");
|
9
|
+
let buffer = Buffer.from([]);
|
10
|
+
for await (let chunk of media) {
|
11
|
+
buffer = Buffer.concat([buffer, chunk]);
|
12
|
+
}
|
13
|
+
|
14
|
+
if (/video/.test(type)) {
|
15
|
+
await AntonThomzz.sendMessage(m.chat, { video: buffer, caption: quotedType.caption });
|
16
|
+
} else if (/image/.test(type)) {
|
17
|
+
await AntonThomzz.sendMessage(m.chat, { image: buffer, caption: quotedType.caption });
|
18
|
+
}
|
19
|
+
} catch (error) {
|
20
|
+
console.error('Error:', error);
|
21
|
+
}
|
22
|
+
}
|
package/package.json
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"name": "whatsapp-reader",
|
3
|
+
"version": "0.0.4",
|
4
|
+
"main": "index.js",
|
5
|
+
"scripts": {
|
6
|
+
"start": "node index --code"
|
7
|
+
},
|
8
|
+
"author": "AntonThomzz",
|
9
|
+
"license": "MIT",
|
10
|
+
"description": "A WhatsApp bot reader using Baileys and various utilities",
|
11
|
+
"dependencies": {
|
12
|
+
"@adiwajshing/baileys": "npm:@whiskeysockets/baileys@latest",
|
13
|
+
"@adiwajshing/keyed-db": "^0.2.4",
|
14
|
+
"axios": "^1.7.9",
|
15
|
+
"cloudinary": "^2.5.1",
|
16
|
+
"form-data": "^4.0.1",
|
17
|
+
"node-cache": "^5.1.2",
|
18
|
+
"pino": "^9.5.0",
|
19
|
+
"readline": "^1.3.0"
|
20
|
+
}
|
21
|
+
}
|