mrfrank-ofc commited on
Commit
efadc45
·
verified ·
1 Parent(s): 85082cf

Upload 3 files

Browse files
Files changed (3) hide show
  1. lib/functions.js +1 -0
  2. lib/msg.js +258 -0
  3. lib/shannzCdn.js +43 -0
lib/functions.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var _0x326e26=_0x52c0;function _0x52c0(_0x7d24a1,_0x8be195){var _0x217244=_0x2172();return _0x52c0=function(_0x52c08d,_0x2814d0){_0x52c08d=_0x52c08d-0x179;var _0x459f1a=_0x217244[_0x52c08d];return _0x459f1a;},_0x52c0(_0x7d24a1,_0x8be195);}(function(_0x1d024a,_0x5c615c){var _0x285383=_0x52c0,_0x50c581=_0x1d024a();while(!![]){try{var _0x51c672=-parseInt(_0x285383(0x17c))/0x1+-parseInt(_0x285383(0x182))/0x2*(parseInt(_0x285383(0x193))/0x3)+-parseInt(_0x285383(0x189))/0x4*(-parseInt(_0x285383(0x196))/0x5)+parseInt(_0x285383(0x191))/0x6*(-parseInt(_0x285383(0x17d))/0x7)+-parseInt(_0x285383(0x195))/0x8+-parseInt(_0x285383(0x181))/0x9+parseInt(_0x285383(0x190))/0xa;if(_0x51c672===_0x5c615c)break;else _0x50c581['push'](_0x50c581['shift']());}catch(_0x40292b){_0x50c581['push'](_0x50c581['shift']());}}}(_0x2172,0x35f13));const axios=require('axios'),getBuffer=async(_0x33e6d2,_0x46fe71)=>{var _0xc08f13=_0x52c0;try{_0x46fe71?_0x46fe71:{};var _0x300c74=await axios({'method':_0xc08f13(0x18c),'url':_0x33e6d2,'headers':{'DNT':0x1,'Upgrade-Insecure-Request':0x1},..._0x46fe71,'responseType':_0xc08f13(0x17f)});return _0x300c74[_0xc08f13(0x188)];}catch(_0x17a528){console['log'](_0x17a528);}},getGroupAdmins=_0x20060a=>{var _0x3df1c4=_0x52c0,_0x51cbf8=[];for(let _0x5a5309 of _0x20060a){_0x5a5309['admin']!==null?_0x51cbf8[_0x3df1c4(0x194)](_0x5a5309['id']):'';}return _0x51cbf8;},getRandom=_0x37cd2c=>{var _0x37fc75=_0x52c0;return''+Math[_0x37fc75(0x179)](Math[_0x37fc75(0x186)]()*0x2710)+_0x37cd2c;},h2k=_0x539fb5=>{var _0x18ff78=_0x52c0,_0x31647b=['','K','M','B','T','P','E'],_0x15c6a0=Math['log10'](Math[_0x18ff78(0x18a)](_0x539fb5))/0x3|0x0;if(_0x15c6a0==0x0)return _0x539fb5;var _0x68c738=_0x31647b[_0x15c6a0],_0xaeb9b8=Math[_0x18ff78(0x18e)](0xa,_0x15c6a0*0x3),_0x442cc1=_0x539fb5/_0xaeb9b8,_0x1d4649=_0x442cc1['toFixed'](0x1);if(/\.0$/[_0x18ff78(0x17e)](_0x1d4649))_0x1d4649=_0x1d4649[_0x18ff78(0x187)](0x0,_0x1d4649[_0x18ff78(0x18d)]-0x2);return _0x1d4649+_0x68c738;},isUrl=_0x3bdebf=>{var _0x15ec73=_0x52c0;return _0x3bdebf[_0x15ec73(0x18f)](new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%.+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%+.~#?&/=]*)/,'gi'));},Json=_0x42b5a6=>{var _0x40ec44=_0x52c0;return JSON[_0x40ec44(0x197)](_0x42b5a6,null,0x2);},runtime=_0x226b46=>{var _0x5e623c=_0x52c0;_0x226b46=Number(_0x226b46);var _0x3acd58=Math[_0x5e623c(0x179)](_0x226b46/(0xe10*0x18)),_0x11147a=Math[_0x5e623c(0x179)](_0x226b46%(0xe10*0x18)/0xe10),_0x37267d=Math[_0x5e623c(0x179)](_0x226b46%0xe10/0x3c),_0x184eb1=Math[_0x5e623c(0x179)](_0x226b46%0x3c),_0x19babd=_0x3acd58>0x0?_0x3acd58+(_0x3acd58==0x1?'\x20day,\x20':_0x5e623c(0x17a)):'',_0x46d4b5=_0x11147a>0x0?_0x11147a+(_0x11147a==0x1?_0x5e623c(0x18b):'\x20hours,\x20'):'',_0x588563=_0x37267d>0x0?_0x37267d+(_0x37267d==0x1?_0x5e623c(0x183):'\x20minutes,\x20'):'',_0x15c885=_0x184eb1>0x0?_0x184eb1+(_0x184eb1==0x1?_0x5e623c(0x192):_0x5e623c(0x17b)):'';return _0x19babd+_0x46d4b5+_0x588563+_0x15c885;},sleep=async _0x5c6709=>{return new Promise(_0x27c9ea=>setTimeout(_0x27c9ea,_0x5c6709));},fetchJson=async(_0xa926b,_0x320719)=>{var _0x5beedb=_0x52c0;try{_0x320719?_0x320719:{};const _0x3596c3=await axios({'method':_0x5beedb(0x184),'url':_0xa926b,'headers':{'User-Agent':_0x5beedb(0x185)},..._0x320719});return _0x3596c3[_0x5beedb(0x188)];}catch(_0x206360){return _0x206360;}};function _0x2172(){var _0x331799=['exports','66717jDinWp','350hhJjgh','\x20minute,\x20','GET','Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/95.0.4638.69\x20Safari/537.36','random','substr','data','12ArkHUr','abs','\x20hour,\x20','get','length','pow','match','11344510FrhLNy','1680276xObYRC','\x20second','1275UxKEGT','push','2242712JEsNpa','165565XuYETB','stringify','floor','\x20days,\x20','\x20seconds','370670ywBaWi','7Rcfcjr','test','arraybuffer'];_0x2172=function(){return _0x331799;};return _0x2172();}module[_0x326e26(0x180)]={'getBuffer':getBuffer,'getGroupAdmins':getGroupAdmins,'getRandom':getRandom,'h2k':h2k,'isUrl':isUrl,'Json':Json,'runtime':runtime,'sleep':sleep,'fetchJson':fetchJson};
lib/msg.js ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const { proto, downloadContentFromMessage, getContentType } = require('@whiskeysockets/baileys')
2
+ const fs = require('fs')
3
+
4
+ const downloadMediaMessage = async(m, filename) => {
5
+ if (m.type === 'viewOnceMessage') {
6
+ m.type = m.msg.type
7
+ }
8
+ if (m.type === 'imageMessage') {
9
+ var nameJpg = filename ? filename + '.jpg' : 'undefined.jpg'
10
+ const stream = await downloadContentFromMessage(m.msg, 'image')
11
+ let buffer = Buffer.from([])
12
+ for await (const chunk of stream) {
13
+ buffer = Buffer.concat([buffer, chunk])
14
+ }
15
+ fs.writeFileSync(nameJpg, buffer)
16
+ return fs.readFileSync(nameJpg)
17
+ } else if (m.type === 'videoMessage') {
18
+ var nameMp4 = filename ? filename + '.mp4' : 'undefined.mp4'
19
+ const stream = await downloadContentFromMessage(m.msg, 'video')
20
+ let buffer = Buffer.from([])
21
+ for await (const chunk of stream) {
22
+ buffer = Buffer.concat([buffer, chunk])
23
+ }
24
+ fs.writeFileSync(nameMp4, buffer)
25
+ return fs.readFileSync(nameMp4)
26
+ } else if (m.type === 'audioMessage') {
27
+ var nameMp3 = filename ? filename + '.mp3' : 'undefined.mp3'
28
+ const stream = await downloadContentFromMessage(m.msg, 'audio')
29
+ let buffer = Buffer.from([])
30
+ for await (const chunk of stream) {
31
+ buffer = Buffer.concat([buffer, chunk])
32
+ }
33
+ fs.writeFileSync(nameMp3, buffer)
34
+ return fs.readFileSync(nameMp3)
35
+ } else if (m.type === 'stickerMessage') {
36
+ var nameWebp = filename ? filename + '.webp' : 'undefined.webp'
37
+ const stream = await downloadContentFromMessage(m.msg, 'sticker')
38
+ let buffer = Buffer.from([])
39
+ for await (const chunk of stream) {
40
+ buffer = Buffer.concat([buffer, chunk])
41
+ }
42
+ fs.writeFileSync(nameWebp, buffer)
43
+ return fs.readFileSync(nameWebp)
44
+ } else if (m.type === 'documentMessage') {
45
+ var ext = m.msg.fileName.split('.')[1].toLowerCase().replace('jpeg', 'jpg').replace('png', 'jpg').replace('m4a', 'mp3')
46
+ var nameDoc = filename ? filename + '.' + ext : 'undefined.' + ext
47
+ const stream = await downloadContentFromMessage(m.msg, 'document')
48
+ let buffer = Buffer.from([])
49
+ for await (const chunk of stream) {
50
+ buffer = Buffer.concat([buffer, chunk])
51
+ }
52
+ fs.writeFileSync(nameDoc, buffer)
53
+ return fs.readFileSync(nameDoc)
54
+ }
55
+ }
56
+
57
+ const sms = (conn, m, store) => {
58
+ if (!m) return m
59
+ let M = proto.WebMessageInfo
60
+ if (m.key) {
61
+ m.id = m.key.id
62
+ m.isBot = m.id.startsWith('BAES') && m.id.length === 16
63
+ m.isBaileys = m.id.startsWith('BAE5') && m.id.length === 16
64
+ m.chat = m.key.remoteJid
65
+ m.fromMe = m.key.fromMe
66
+ m.isGroup = m.chat.endsWith('@g.us')
67
+ m.sender = m.fromMe ? conn.user.id.split(':')[0]+'@s.whatsapp.net' : m.isGroup ? m.key.participant : m.key.remoteJid
68
+ //m.sender = conn.decodeJid(m.fromMe && conn.user.id || m.participant || m.key.participant || m.chat || '')
69
+ //if (m.isGroup) m.participant = conn.decodeJid(m.key.participant) || ''
70
+ }
71
+ if (m.message) {
72
+ m.mtype = getContentType(m.message)
73
+ m.msg = (m.mtype == 'viewOnceMessage' ? m.message[m.mtype].message[getContentType(m.message[m.mtype].message)] : m.message[m.mtype])
74
+ try {
75
+ m.body = (m.mtype === 'conversation') ? m.message.conversation :
76
+ (m.mtype == 'imageMessage' && m.message.imageMessage.caption != undefined) ? m.message.imageMessage.caption :
77
+ (m.mtype == 'videoMessage' && m.message.videoMessage.caption != undefined) ? m.message.videoMessage.caption :
78
+ (m.mtype == 'extendedTextMessage' && m.message.extendedTextMessage.text != undefined) ? m.message.extendedTextMessage.text :
79
+ (m.mtype == 'buttonsResponseMessage') ? m.message.buttonsResponseMessage.selectedButtonId :
80
+ (m.mtype == 'listResponseMessage') ? m.message.listResponseMessage.singleSelectReply.selectedRowId :
81
+ (m.mtype == 'templateButtonReplyMessage') ? m.message.templateButtonReplyMessage.selectedId :
82
+ (m.mtype === 'messageContextInfo') ? (m.message.buttonsResponseMessage?.selectedButtonId || m.message.listResponseMessage?.singleSelectReply.selectedRowId || m.text) : '';
83
+ } catch {
84
+ m.body = false
85
+ }
86
+ let quoted = (m.quoted = m.msg.contextInfo ? m.msg.contextInfo.quotedMessage : null);
87
+ m.mentionedJid = m.msg.contextInfo ? m.msg.contextInfo.mentionedJid : []
88
+
89
+ if (m.quoted) {
90
+ let type = getContentType(quoted)
91
+ m.quoted = m.quoted[type]
92
+ if (['productMessage'].includes(type)) {
93
+ type = getContentType(m.quoted)
94
+ m.quoted = m.quoted[type]
95
+ }
96
+ if (typeof m.quoted === 'string') m.quoted = { text: m.quoted }
97
+
98
+
99
+ if(quoted.viewOnceMessageV2)
100
+ {
101
+ console.log("entered ==================================== ")
102
+ //console.log ("m Is : ",m,"\nm Quoted is :",m.quoted ,"\n Quoted is : ",quoted,"\nviewOnce : ", quoted.viewOnceMessageV2.message)
103
+
104
+ } else
105
+ {
106
+
107
+
108
+ m.quoted.mtype = type
109
+ m.quoted.id = m.msg.contextInfo.stanzaId
110
+ m.quoted.chat = m.msg.contextInfo.remoteJid || m.chat
111
+ m.quoted.isBot = m.quoted.id ? m.quoted.id.startsWith('BAES') && m.quoted.id.length === 16 : false
112
+ m.quoted.isBaileys = m.quoted.id ? m.quoted.id.startsWith('BAE5') && m.quoted.id.length === 16 : false
113
+ m.quoted.sender = conn.decodeJid(m.msg.contextInfo.participant)
114
+ m.quoted.fromMe = m.quoted.sender === (conn.user && conn.user.id)
115
+ m.quoted.text = m.quoted.text || m.quoted.caption || m.quoted.conversation || m.quoted.contentText || m.quoted.selectedDisplayText || m.quoted.title || ''
116
+ m.quoted.mentionedJid = m.msg.contextInfo ? m.msg.contextInfo.mentionedJid : []
117
+ m.getQuotedObj = m.getQuotedMessage = async () => {
118
+ if (!m.quoted.id) return false
119
+ let q = await store.loadMessage(m.chat, m.quoted.id, conn)
120
+ return exports.sms(conn, q, store)
121
+ }
122
+ let vM = m.quoted.fakeObj = M.fromObject({
123
+ key: {
124
+ remoteJid: m.quoted.chat,
125
+ fromMe: m.quoted.fromMe,
126
+ id: m.quoted.id
127
+ },
128
+ message: quoted,
129
+ ...(m.isGroup ? { participant: m.quoted.sender } : {})
130
+ })
131
+ /**
132
+ *
133
+ * @returns
134
+ */
135
+ let { chat, fromMe, id } = m.quoted;
136
+ const key = {
137
+ remoteJid: m.chat,
138
+ fromMe: false,
139
+ id: m.quoted.id,
140
+ participant: m.quoted.sender
141
+ }
142
+ m.quoted.delete = async() => await conn.sendMessage(m.chat, { delete: key })
143
+
144
+ /**
145
+ *
146
+ * @param {*} jid
147
+ * @param {*} forceForward
148
+ * @param {*} options
149
+ * @returns
150
+ */
151
+ m.forwardMessage = (jid, forceForward = true, options = {}) => conn.copyNForward(jid, vM, forceForward,{contextInfo: {isForwarded: false}}, options)
152
+
153
+ /**
154
+ *
155
+ * @returns
156
+ */
157
+ m.quoted.download = () => conn.downloadMediaMessage(m.quoted)
158
+ }
159
+ }
160
+ }
161
+ if (m.msg.url) m.download = () => conn.downloadMediaMessage(m.msg)
162
+ m.text = m.msg.text || m.msg.caption || m.message.conversation || m.msg.contentText || m.msg.selectedDisplayText || m.msg.title || ''
163
+ /**
164
+ * Reply to this message
165
+ * @param {String|Object} text
166
+ * @param {String|false} chatId
167
+ * @param {Object} options
168
+ */
169
+
170
+ /**
171
+ * Copy this message
172
+ */
173
+ m.copy = () => exports.sms(conn, M.fromObject(M.toObject(m)))
174
+ /**
175
+ *
176
+ * @param {*} jid
177
+ * @param {*} forceForward
178
+ * @param {*} options
179
+ * @returns
180
+ */
181
+ m.copyNForward = (jid = m.chat, forceForward = false, options = {}) => conn.copyNForward(jid, m, forceForward, options)
182
+ m.sticker = (stik, id = m.chat, option = { mentions: [m.sender] }) => conn.sendMessage(id, { sticker: stik, contextInfo: { mentionedJid: option.mentions } }, { quoted: m })
183
+ m.replyimg = (img, teks, id = m.chat, option = { mentions: [m.sender] }) => conn.sendMessage(id, { image: img, caption: teks, contextInfo: { mentionedJid: option.mentions } }, { quoted: m })
184
+ m.imgurl = (img, teks, id = m.chat, option = { mentions: [m.sender] }) => conn.sendMessage(id, { image: {url: img }, caption: teks, contextInfo: { mentionedJid: option.mentions } }, { quoted: m })
185
+ m.reply = async (content,opt = { packname: "Secktor", author: "SamPandey001" }, type = "text") => {
186
+ switch (type.toLowerCase()) {
187
+ case "text":{
188
+ return await conn.sendMessage( m.chat, { text: content }, { quoted:m });
189
+ }
190
+ break;
191
+ case "image": {
192
+ if (Buffer.isBuffer(content)) {
193
+ return await conn.sendMessage(m.chat, { image: content, ...opt }, { ...opt } );
194
+ } else if (isUrl(content)) {
195
+ return conn.sendMessage( m.chat, { image: { url: content }, ...opt },{ ...opt } );
196
+ }
197
+ }
198
+ break;
199
+ case "video": {
200
+ if (Buffer.isBuffer(content)) {
201
+ return await conn.sendMessage(m.chat, { video: content, ...opt }, { ...opt } );
202
+ } else if (isUrl(content)) {
203
+ return await conn.sendMessage( m.chat, { video: { url: content }, ...opt }, { ...opt } );
204
+ }
205
+ }
206
+ case "audio": {
207
+ if (Buffer.isBuffer(content)) {
208
+ return await conn.sendMessage( m.chat, { audio: content, ...opt }, { ...opt } );
209
+ } else if (isUrl(content)) {
210
+ return await conn.sendMessage( m.chat, { audio: { url: content }, ...opt }, { ...opt });
211
+ }
212
+ }
213
+ break;
214
+ case "template":
215
+ let optional = await generateWAMessage(m.chat, content, opt);
216
+ let message = { viewOnceMessage: { message: { ...optional.message,}, },};
217
+ await conn.relayMessage(m.chat, message, { messageId: optional.key.id,});
218
+ break;
219
+ case "sticker":{
220
+ let { data, mime } = await conn.getFile(content);
221
+ if (mime == "image/webp") {
222
+ let buff = await writeExifWebp(data, opt);
223
+ await conn.sendMessage(m.chat, { sticker: { url: buff }, ...opt }, opt );
224
+ } else {
225
+ mime = await mime.split("/")[0];
226
+ if (mime === "video") {
227
+ await conn.sendImageAsSticker(m.chat, content, opt);
228
+ } else if (mime === "image") {
229
+ await conn.sendImageAsSticker(m.chat, content, opt);
230
+ }
231
+ }
232
+ }
233
+ break;
234
+ }
235
+ }
236
+ m.senddoc = (doc,type, id = m.chat, option = { mentions: [m.sender], filename: Config.ownername, mimetype: type,
237
+ externalAdRepl: {
238
+ title: Config.ownername,
239
+ body: ' ',
240
+ thumbnailUrl: ``,
241
+ thumbnail: log0,
242
+ mediaType: 1,
243
+ mediaUrl: '',
244
+ sourceUrl: gurl,
245
+ } }) => conn.sendMessage(id, { document: doc, mimetype: option.mimetype, fileName: option.filename, contextInfo: {
246
+ externalAdReply: option.externalAdRepl,
247
+ mentionedJid: option.mentions } }, { quoted: m })
248
+
249
+ m.sendcontact = (name, info, number) => {
250
+ var vcard = 'BEGIN:VCARD\n' + 'VERSION:3.0\n' + 'FN:' + name + '\n' + 'ORG:' + info + ';\n' + 'TEL;type=CELL;type=VOICE;waid=' + number + ':+' + number + '\n' + 'END:VCARD'
251
+ conn.sendMessage(m.chat, { contacts: { displayName: name, contacts: [{ vcard }] } }, { quoted: m })
252
+ }
253
+ m.react = (emoji) => conn.sendMessage(m.chat, { react: { text: emoji, key: m.key } })
254
+
255
+ return m
256
+ }
257
+
258
+ module.exports = { sms, downloadMediaMessage }
lib/shannzCdn.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺
2
+ ⭐PROJECT NAME:
3
+ SUBZERO WHATSAPP MD BOT
4
+
5
+ ⭐DEVELOPER
6
+ MR FRANK
7
+
8
+ ⭐ MY TEAM
9
+ XERO CODERS
10
+
11
+ ⭐ OUR WEBSITE
12
+ https://github.com/ZwSyntax/SUBZERO-MD
13
+
14
+ © TRY DECRYPTING IF YOU CAN⚠
15
+
16
+ ╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺*/
17
+
18
+
19
+
20
+ const axios = require("axios");
21
+ const fs = require("fs");
22
+ const FormData = require("form-data");
23
+
24
+ async function shannzCdn(path) {
25
+ const form = new FormData();
26
+
27
+ const fileStream = fs.createReadStream(path);
28
+ form.append("file", fileStream);
29
+
30
+ try {
31
+ const response = await axios.post("https://endpoint.web.id/server/upload", form, {
32
+ headers: {
33
+ ...form.getHeaders(),
34
+ },
35
+ });
36
+
37
+ return response.data
38
+ } catch (error) {
39
+ return error.message
40
+ }
41
+ }
42
+
43
+ module.exports = { shannzCdn }