├── media ├── black.jpg ├── banFolder │ └── banbye.mp4 ├── goodFolder │ └── goodbye.mp4 └── welFolder │ └── welcome.mp4 ├── heroku.yml ├── Dockerfile ├── replit.nix ├── plugins ├── clear.js ├── pm2.js ├── alive.js ├── ping.js ├── react.js ├── upload.js ├── pp.js ├── url.js ├── reddit.js ├── tog.js ├── tiktok.js ├── mediafire.js ├── pinterest.js ├── insta.js ├── trt.js ├── lydia.js ├── poll.js ├── dlt.js ├── tts.js ├── vote.js ├── fancy.js ├── forward.js ├── img.js ├── movie.js ├── pdm.js ├── afk.js ├── qr.js ├── gpp.js ├── news.js ├── chatgpt.js ├── ss.js ├── spam.js ├── gemini.js ├── wcg.js ├── greet.js ├── facebook.js ├── delete.js ├── cmd.js ├── twitter.js ├── removebg.js ├── story.js ├── nr.js ├── weather.js ├── truecaller.js ├── tictactoe.js ├── ison.js ├── antiwords.js ├── tag.js ├── vars.js ├── apk.js ├── mention.js ├── bing.js ├── antifake.js ├── scheduleMessage.js ├── filters.js ├── budget.js ├── antiLink.js ├── warn.js ├── y2mate.js ├── sticker.js ├── plugins.js ├── profile.js ├── _menu.js ├── heroku.js ├── gfilters.js ├── yts.js ├── msgs.js ├── greetings.js ├── misc.js ├── mute.js ├── editor.js ├── group.js └── media.js ├── index.js ├── package.json ├── config.js ├── README.md ├── app.json └── lib ├── class └── index.js └── db └── warn.js /media/black.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Passkey-md/Levanter-update/HEAD/media/black.jpg -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | worker: Dockerfile 4 | run: 5 | worker: npm start 6 | -------------------------------------------------------------------------------- /media/banFolder/banbye.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Passkey-md/Levanter-update/HEAD/media/banFolder/banbye.mp4 -------------------------------------------------------------------------------- /media/goodFolder/goodbye.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Passkey-md/Levanter-update/HEAD/media/goodFolder/goodbye.mp4 -------------------------------------------------------------------------------- /media/welFolder/welcome.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Passkey-md/Levanter-update/HEAD/media/welFolder/welcome.mp4 -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/lyfe00011/md:beta 2 | RUN git clone https://github.com/lyfe00011/whatsapp-bot-md.git /root/LyFE/ 3 | WORKDIR /root/LyFE/ 4 | RUN yarn install 5 | CMD ["npm", "start"] -------------------------------------------------------------------------------- /replit.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: { 2 | deps = [ 3 | pkgs.nodePackages.typescript-language-server 4 | pkgs.yarn 5 | pkgs.arcanPackages.ffmpeg 6 | pkgs.libwebp 7 | pkgs.imagemagick 8 | pkgs.git 9 | ]; 10 | } -------------------------------------------------------------------------------- /plugins/clear.js: -------------------------------------------------------------------------------- 1 | const { bot } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'clear ?(.*)', 6 | fromMe: true, 7 | desc: 'delete whatsapp chat', 8 | type: 'whatsapp', 9 | }, 10 | async (message, match) => { 11 | await message.clearChat(message.jid) 12 | await message.send('_Cleared_') 13 | } 14 | ) 15 | -------------------------------------------------------------------------------- /plugins/pm2.js: -------------------------------------------------------------------------------- 1 | const { bot } = require('../lib/') 2 | const { restartInstance } = require('../lib/pm2') 3 | bot( 4 | { 5 | pattern: 'reboot ?(.*)', 6 | fromMe: true, 7 | desc: 'restart with pm2', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | await message.send(`_Restarting_`) 12 | restartInstance() 13 | } 14 | ) 15 | -------------------------------------------------------------------------------- /plugins/alive.js: -------------------------------------------------------------------------------- 1 | const { bot, aliveMessage } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'alive ?(.*)', 6 | fromMe: true, 7 | desc: 'bot alive message', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | const { msg, options, type } = await aliveMessage(match, message) 12 | return await message.send(msg, options, type) 13 | } 14 | ) 15 | -------------------------------------------------------------------------------- /plugins/ping.js: -------------------------------------------------------------------------------- 1 | const { bot } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'ping ?(.*)', 6 | fromMe: true, 7 | desc: 'To check ping', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | const start = new Date().getTime() 12 | await message.send('```Ping!```') 13 | const end = new Date().getTime() 14 | return await message.send('*Pong!*\n ```' + (end - start) + '``` *ms*') 15 | } 16 | ) 17 | -------------------------------------------------------------------------------- /plugins/react.js: -------------------------------------------------------------------------------- 1 | const { bot } = require('../lib/') 2 | bot( 3 | { 4 | pattern: 'react ?(.*)', 5 | fromMe: true, 6 | desc: 'React to msg', 7 | type: 'misc', 8 | }, 9 | async (message, match) => { 10 | if (!match || !message.reply_message) 11 | return await message.send('_Example : react ❣_') 12 | return await message.send( 13 | { 14 | text: match, 15 | key: message.reply_message.key, 16 | }, 17 | {}, 18 | 'react' 19 | ) 20 | } 21 | ) 22 | -------------------------------------------------------------------------------- /plugins/upload.js: -------------------------------------------------------------------------------- 1 | const { bot, isUrl, getImgUrl } = require('../lib/') 2 | bot( 3 | { 4 | pattern: 'upload ?(.*)', 5 | fromMe: true, 6 | desc: 'Download from url', 7 | type: 'download', 8 | }, 9 | async (message, match) => { 10 | match = isUrl(match || message.reply_message.text) 11 | if (!match) return await message.send('_Example : upload url_') 12 | if (match.startsWith('https://images.app.goo.gl')) 13 | match = await getImgUrl(match) 14 | await message.sendFromUrl(match, { buffer: false }) 15 | } 16 | ) 17 | -------------------------------------------------------------------------------- /plugins/pp.js: -------------------------------------------------------------------------------- 1 | const { bot } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'fullpp ?(.*)', 6 | fromMe: true, 7 | desc: 'set full size profile picture', 8 | type: 'user', 9 | }, 10 | async (message, match) => { 11 | if (!message.reply_message || !message.reply_message.image) 12 | return await message.send('*Reply to a image.*') 13 | await message.updateProfilePicture( 14 | await message.reply_message.downloadMediaMessage(), 15 | message.client.user.jid 16 | ) 17 | return await message.send('_Profile Picture Updated_') 18 | } 19 | ) 20 | -------------------------------------------------------------------------------- /plugins/url.js: -------------------------------------------------------------------------------- 1 | const { bot, getUrl } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'url ?(.*)', 6 | fromMe: true, 7 | desc: 'Image/Video to url', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | if (!message.reply_message || (!message.reply_message.image && !message.reply_message.video)) 12 | return await message.send('*Reply to a image | video*\nurl imgur - for imgur url') 13 | await message.send( 14 | await getUrl(await message.reply_message.downloadAndSaveMediaMessage('url'), match) 15 | ) 16 | } 17 | ) 18 | -------------------------------------------------------------------------------- /plugins/reddit.js: -------------------------------------------------------------------------------- 1 | const { reddit, bot, isUrl } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'reddit ?(.*)', 6 | fromMe: true, 7 | desc: 'Download reddit video', 8 | type: 'download', 9 | }, 10 | async (message, match) => { 11 | match = isUrl(match || message.reply_message.text) 12 | if (!match) return await message.send('_Example : reddit url_') 13 | const result = await reddit(match) 14 | if (!result) 15 | return await message.send('*Not found*', { 16 | quoted: message.quoted, 17 | }) 18 | return await message.sendFromUrl(result) 19 | } 20 | ) 21 | -------------------------------------------------------------------------------- /plugins/tog.js: -------------------------------------------------------------------------------- 1 | const { TogCmd, bot } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'tog ?(.*)', 6 | fromMe: true, 7 | desc: 'Enable or Disable Cmd', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | const [cmd, tog] = match.split(' ') 12 | if (!cmd || (tog != 'off' && tog != 'on')) 13 | return await message.send('*Example :* tog ping off') 14 | if (cmd == 'tog') 15 | return await message.send(`Did you really want to kill me?`) 16 | await TogCmd(cmd, tog) 17 | await message.send(`_${cmd} ${tog == 'on' ? 'Enabled' : 'Disabled'}._`) 18 | } 19 | ) 20 | -------------------------------------------------------------------------------- /plugins/tiktok.js: -------------------------------------------------------------------------------- 1 | const { tiktok, bot, isUrl } = require('../lib/index') 2 | 3 | bot( 4 | { 5 | pattern: 'tiktok ?(.*)', 6 | fromMe: true, 7 | desc: 'Download tiktok video', 8 | type: 'download', 9 | }, 10 | async (message, match) => { 11 | match = isUrl(match || message.reply_message.text) 12 | if (!match) return await message.send('_Example : tiktok url_') 13 | const result = await tiktok(match) 14 | if (!result) 15 | return await message.send('*Not found*', { 16 | quoted: message.quoted, 17 | }) 18 | return await message.sendFromUrl(result.url2) 19 | } 20 | ) 21 | -------------------------------------------------------------------------------- /plugins/mediafire.js: -------------------------------------------------------------------------------- 1 | const { mediafire, bot, isUrl } = require('../lib/index') 2 | 3 | bot( 4 | { 5 | pattern: 'mediafire ?(.*)', 6 | fromMe: true, 7 | desc: 'Download mediafire file', 8 | type: 'download', 9 | }, 10 | async (message, match) => { 11 | match = isUrl(match || message.reply_message.text) 12 | if (!match) return await message.send('_Example : mediafire url_') 13 | const result = await mediafire(match) 14 | if (!result) 15 | return await message.send('*Not found*', { 16 | quoted: message.quoted, 17 | }) 18 | return await message.sendFromUrl(result) 19 | } 20 | ) 21 | -------------------------------------------------------------------------------- /plugins/pinterest.js: -------------------------------------------------------------------------------- 1 | const { pinterest, bot, isUrl } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'pinterest ?(.*)', 6 | fromMe: true, 7 | desc: 'Download pinterest video/image', 8 | type: 'download', 9 | }, 10 | async (message, match) => { 11 | match = isUrl(match || message.reply_message.text) 12 | if (!match) return await message.send('_Example : pinterest url_') 13 | const result = await pinterest(match) 14 | if (!result.length) 15 | return await message.send('*Not found*', { 16 | quoted: message.quoted, 17 | }) 18 | return await message.sendFromUrl(result) 19 | } 20 | ) 21 | -------------------------------------------------------------------------------- /plugins/insta.js: -------------------------------------------------------------------------------- 1 | const { instagram, bot } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'insta ?(.*)', 6 | fromMe: true, 7 | desc: 'Download Instagram Posts', 8 | type: 'download', 9 | }, 10 | async (message, match) => { 11 | match = match || message.reply_message.text 12 | if (!match) return await message.send('_Example : insta url_') 13 | const result = await instagram(match) 14 | if (!result.length) 15 | return await message.send('*Not found*', { 16 | quoted: message.quoted, 17 | }) 18 | for (const url of result) { 19 | await message.sendFromUrl(url) 20 | } 21 | } 22 | ) 23 | -------------------------------------------------------------------------------- /plugins/trt.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { trt, bot } = require('../lib/index') 3 | 4 | bot( 5 | { 6 | pattern: 'trt ?(.*)', 7 | fromMe: true, 8 | desc: 'Google transalte', 9 | type: 'search', 10 | }, 11 | async (message, match) => { 12 | if (!message.reply_message.text) 13 | return await message.send( 14 | '*Reply to a text msg\n*_Example : trt ml_\ntrt ml hi' 15 | ) 16 | const [to, from] = match.split(' ') 17 | const msg = await trt(message.reply_message.text, to || config.LANG, from) 18 | if (msg) return await message.send(msg, { quoted: message.quoted }) 19 | } 20 | ) 21 | -------------------------------------------------------------------------------- /plugins/lydia.js: -------------------------------------------------------------------------------- 1 | const { setLydia, bot } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'lydia ?(.*)', 6 | fromMe: true, 7 | desc: 'to on off chat bot', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | if (!match) 12 | return await message.send( 13 | '*Example : lydia on/off*\n_Reply or mention to activate for a person only._' 14 | ) 15 | const user = message.mention[0] || message.reply_message.jid 16 | await setLydia(message.jid, match == 'on', user) 17 | await message.send( 18 | `_Lydia ${ 19 | match == 'on' ? 'Activated' : 'Deactivated' 20 | }_\n*Only works from reply msg.` 21 | ) 22 | } 23 | ) 24 | -------------------------------------------------------------------------------- /plugins/poll.js: -------------------------------------------------------------------------------- 1 | const { bot } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'poll ?(.*)', 6 | fromMe: true, 7 | desc: 'poll', 8 | type: 'whatsapp', 9 | }, 10 | async (message, match) => { 11 | const poll = match.split(',') 12 | if (poll.length < 3) 13 | return await message.send('*Example : question,option1,option2,...*') 14 | const name = poll[0] 15 | const options = [] 16 | for (let i = 1; i < poll.length; i++) options.push({ optionName: poll[i] }) 17 | await message.send( 18 | { 19 | name, 20 | options, 21 | selectableOptionsCount: options.length, 22 | }, 23 | {}, 24 | 'poll' 25 | ) 26 | } 27 | ) 28 | -------------------------------------------------------------------------------- /plugins/dlt.js: -------------------------------------------------------------------------------- 1 | const { bot, isAdmin } = require('../lib') 2 | 3 | bot( 4 | { 5 | pattern: 'dlt ?(.*)', 6 | fromMe: true, 7 | desc: 'delete replied msg', 8 | type: 'whatsapp', 9 | }, 10 | async (message, match) => { 11 | if (!message.reply_message) 12 | return await message.send('*Reply to a message*') 13 | const key = message.reply_message.key 14 | if (!key.fromMe && message.isGroup) { 15 | const participants = await message.groupMetadata(message.jid) 16 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 17 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 18 | } 19 | return await message.send(key, {}, 'delete') 20 | } 21 | ) 22 | -------------------------------------------------------------------------------- /plugins/tts.js: -------------------------------------------------------------------------------- 1 | const { bot, tts } = require('../lib/') 2 | const config = require('../config') 3 | bot( 4 | { 5 | pattern: 'tts ?(.*)', 6 | fromMe: true, 7 | desc: 'text to speach', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | match = match || message.reply_message.text 12 | if (!match) 13 | return await message.send('*Example : tts Hi*\n*tts Hi {ml}*') 14 | let LANG = config.LANG 15 | const lang = match.match('\\{([a-z]+)\\}') 16 | if (lang) { 17 | match = match.replace(lang[0], '') 18 | LANG = lang[1] 19 | } 20 | await message.send( 21 | await tts(LANG, match), 22 | { ptt: true, mimetype: 'audio/ogg; codecs=opus' }, 23 | 'audio' 24 | ) 25 | } 26 | ) 27 | -------------------------------------------------------------------------------- /plugins/vote.js: -------------------------------------------------------------------------------- 1 | const { bot, newVote, participateInVote, sleep } = require('../lib/') 2 | 3 | bot({ on: 'text', fromMe: false, type: 'vote' }, async (message, match) => { 4 | const msg = await participateInVote(message) 5 | if (msg) return await message.send(msg.text, msg.option) 6 | }) 7 | 8 | bot( 9 | { 10 | pattern: 'vote ?(.*)', 11 | fromMe: true, 12 | desc: 'vote in whatsapp', 13 | type: 'group', 14 | }, 15 | async (message, match) => { 16 | const [msg, jids] = await newVote(message, match) 17 | if (!jids) return await message.send(msg) 18 | for (const jid of jids) { 19 | await message.send(msg, {}, 'text', jid) 20 | await sleep(5 * 1000) 21 | } 22 | } 23 | ) 24 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const { Client, logger } = require('./lib/client') 2 | const { DATABASE, VERSION } = require('./config') 3 | const { stopInstance } = require('./lib/pm2') 4 | 5 | const start = async () => { 6 | logger.info(`levanter ${VERSION}`) 7 | try { 8 | await DATABASE.authenticate({ retry: { max: 3 } }) 9 | } catch (error) { 10 | console.error('Unable to connect to the database:', error.message, process.env.DATABASE_URL) 11 | return stopInstance() 12 | } 13 | try { 14 | logger.info('Database syncing...') 15 | await DATABASE.sync() 16 | const bot = new Client() 17 | await bot.init() 18 | await bot.connect() 19 | } catch (error) { 20 | logger.error(error) 21 | } 22 | } 23 | start() 24 | -------------------------------------------------------------------------------- /plugins/fancy.js: -------------------------------------------------------------------------------- 1 | const { bot, textToStylist, fontType, stylishTextGen } = require('../lib') 2 | bot( 3 | { 4 | pattern: 'fancy ?(.*)', 5 | fromMe: true, 6 | desc: 'Creates fancy text from given text', 7 | type: 'misc', 8 | }, 9 | async (message, match) => { 10 | if ( 11 | !match || 12 | (message.reply_message.text && 13 | (!match || isNaN(match) || match < 1 || match > 47)) 14 | ) 15 | return await message.send( 16 | '*Example :*\nfancy Hi\nfancy 7 replying text msg' 17 | ) 18 | if (message.reply_message.text) { 19 | return await message.send( 20 | textToStylist(message.reply_message.text, fontType(match)) 21 | ) 22 | } 23 | return await message.send(stylishTextGen(match)) 24 | } 25 | ) 26 | -------------------------------------------------------------------------------- /plugins/forward.js: -------------------------------------------------------------------------------- 1 | const { forwardOrBroadCast, bot, parsedJid } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'forward ?(.*)', 6 | fromMe: true, 7 | desc: 'forward replied msg', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | if (!message.reply_message) 12 | return await message.send('*Reply to a message*') 13 | for (const jid of parsedJid(match)) await forwardOrBroadCast(jid, message) 14 | } 15 | ) 16 | 17 | bot( 18 | { 19 | pattern: 'save ?(.*)', 20 | fromMe: true, 21 | desc: 'forward replied msg to u', 22 | type: 'misc', 23 | }, 24 | async (message, match) => { 25 | if (!message.reply_message) 26 | return await message.send('*Reply to a message*') 27 | await forwardOrBroadCast(message.participant, message) 28 | } 29 | ) 30 | -------------------------------------------------------------------------------- /plugins/img.js: -------------------------------------------------------------------------------- 1 | const { bot, googleImageSearch } = require('../lib') 2 | 3 | bot( 4 | { 5 | pattern: 'img ?(.*)', 6 | fromMe: true, 7 | desc: 'Download img from google', 8 | type: 'search', 9 | }, 10 | async (message, match) => { 11 | if (!match) return await message.send('*Example : img bot*\n*img 10 bot*') 12 | let lim = 3 13 | const count = /\d+/.exec(match) 14 | if (count) { 15 | match = match.replace(count[0], '') 16 | lim = count[0] 17 | } 18 | const result = await googleImageSearch(match) 19 | lim = 20 | (result.length && (result.length > lim ? lim : result.length)) || 21 | result.length 22 | await message.send(`_Downloading ${lim} images of ${match.trim()}_`) 23 | for (let i = 0; i < lim; i++) { 24 | await message.sendFromUrl(result[i], { buffer: false }) 25 | } 26 | } 27 | ) 28 | -------------------------------------------------------------------------------- /plugins/movie.js: -------------------------------------------------------------------------------- 1 | const { getJson, bot } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'movie ?(.*)', 6 | fromMe: true, 7 | desc: 'Movie info', 8 | type: 'search', 9 | }, 10 | async (message, match) => { 11 | const movie = await getJson( 12 | `http://www.omdbapi.com/?apikey=742b2d09&t=${match}&plot=full` 13 | ) 14 | if (movie.Response != 'True') 15 | return await message.send('*Not found*', { 16 | quoted: message.data, 17 | }) 18 | let msg = '' 19 | const url = movie.Poster 20 | delete movie.Poster 21 | delete movie.Response 22 | delete movie.Ratings 23 | for (const data in movie) 24 | if (movie[data] != 'N/A') msg += `*${data} :* ${movie[data]}\n` 25 | if (url == 'N/A') return await message.send(msg.trim()) 26 | return await message.sendFromUrl(url, { caption: msg.trim() }) 27 | } 28 | ) 29 | -------------------------------------------------------------------------------- /plugins/pdm.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | setPdm, 4 | // genButtonMessage 5 | } = require('../lib/') 6 | 7 | bot( 8 | { 9 | pattern: 'pdm ?(.*)', 10 | fromMe: true, 11 | desc: 'To manage promote demote alert', 12 | type: 'group', 13 | onlyGroup: true, 14 | }, 15 | async (message, match) => { 16 | if (!match) return await message.send('*Promote demote message*\npdm on | off') 17 | // await message.send( 18 | // await genButtonMessage( 19 | // [ 20 | // { id: 'pdm on', text: 'ON' }, 21 | // { id: 'pdm off', text: 'OFF' }, 22 | // ], 23 | // 'Promote Demote Message' 24 | // ), 25 | // {}, 26 | // 'button' 27 | // ) 28 | if (match == 'on' || match == 'off') { 29 | await setPdm(message.jid, match) 30 | await message.send(`_pdm ${match == 'on' ? 'Activated' : 'Deactivated'}_`) 31 | } 32 | } 33 | ) 34 | -------------------------------------------------------------------------------- /plugins/afk.js: -------------------------------------------------------------------------------- 1 | const { bot } = require('../lib/') 2 | 3 | global.AFK = { 4 | isAfk: false, 5 | reason: false, 6 | lastseen: 0, 7 | } 8 | 9 | bot( 10 | { 11 | pattern: 'afk ?(.*)', 12 | fromMe: true, 13 | desc: 'away from keyboard', 14 | type: 'misc', 15 | }, 16 | async (message, match) => { 17 | if (!global.AFK.isAfk && !match) 18 | return await message.send( 19 | 'Example : My owner is AFK\n last seen before #lastseen\nTo off afk send a msg again.' 20 | ) 21 | if (!global.AFK.isAfk) { 22 | if (match) global.AFK.reason = match 23 | global.AFK.isAfk = true 24 | global.AFK.lastseen = Math.round(new Date().getTime() / 1000) 25 | return await message.send( 26 | match.replace( 27 | '#lastseen', 28 | Math.round(new Date().getTime() / 1000) - global.AFK.lastseen 29 | ) 30 | ) 31 | } 32 | } 33 | ) 34 | -------------------------------------------------------------------------------- /plugins/qr.js: -------------------------------------------------------------------------------- 1 | const { bot } = require('../lib/') 2 | const jimp = require('jimp') 3 | const QRReader = require('qrcode-reader') 4 | 5 | bot( 6 | { pattern: 'qr ?(.*)', fromMe: true, desc: 'Read/Write Qr.', type: 'misc' }, 7 | async (message, match) => { 8 | if (match) 9 | return await message.sendFromUrl( 10 | `https://levanter.onrender.com/gqr?text=${encodeURIComponent(match)}` 11 | ) 12 | if (!message.reply_message || !message.reply_message.image) 13 | return await message.send( 14 | '*Example : qr test*\n*Reply to a qr image.*' 15 | ) 16 | 17 | const { bitmap } = await jimp.read( 18 | await message.reply_message.downloadMediaMessage() 19 | ) 20 | const qr = new QRReader() 21 | qr.callback = (err, value) => 22 | message.send(err ?? value.result, { quoted: message.data }) 23 | qr.decode(bitmap) 24 | } 25 | ) 26 | -------------------------------------------------------------------------------- /plugins/gpp.js: -------------------------------------------------------------------------------- 1 | const { bot, isAdmin } = require('../lib/') 2 | const fm = true 3 | 4 | bot( 5 | { 6 | pattern: 'gpp ?(.*)', 7 | fromMe: fm, 8 | desc: 'change group icon', 9 | type: 'group', 10 | onlyGroup: true, 11 | }, 12 | async (message, match) => { 13 | const isRestrict = await message.groupMetadata(message.jid, 'restrict') 14 | if (isRestrict) { 15 | const participants = await message.groupMetadata(message.jid) 16 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 17 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 18 | } 19 | if (!message.reply_message || !message.reply_message.image) 20 | return await message.send('*Reply to a image.*') 21 | await message.updateProfilePicture( 22 | await message.reply_message.downloadMediaMessage(), 23 | message.jid 24 | ) 25 | return await message.send('_Group icon Updated_') 26 | } 27 | ) 28 | -------------------------------------------------------------------------------- /plugins/news.js: -------------------------------------------------------------------------------- 1 | const { bot, generateList, getJson } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'news ?(.*)', 6 | fromMe: true, 7 | desc: 'malayalam news', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | if (!match) { 12 | const { result } = await getJson('https://levanter.onrender.com/news') 13 | const list = generateList( 14 | result.map(({ title, url, time }) => ({ 15 | _id: `🆔 &id\n`, 16 | text: `🗞${title}${time ? `\n🕒${time}` : ''}\n`, 17 | id: `news ${url}`, 18 | })), 19 | 'Malayalam News', 20 | message.jid, 21 | message.participant 22 | ) 23 | 24 | return await message.send(list.message, {}, list.type) 25 | } 26 | if (match.startsWith('http')) { 27 | const { result } = await getJson(`https://levanter.onrender.com/news?url=${match}`) 28 | return await message.send(result, { quoted: message.data }) 29 | } 30 | } 31 | ) 32 | -------------------------------------------------------------------------------- /plugins/chatgpt.js: -------------------------------------------------------------------------------- 1 | const { bot, getGPTResponse, getDallEResponse } = require('../lib') 2 | 3 | bot( 4 | { 5 | pattern: 'gpt ?(.*)', 6 | fromMe: true, 7 | desc: 'ChatGPT fun', 8 | type: 'AI', 9 | }, 10 | async (message, match) => { 11 | match = match || message.reply_message.text 12 | if (!match) return await message.send('*Example : gpt What is the capital of France?*') 13 | const res = await getGPTResponse(match) 14 | await message.send(res, { quoted: message.data }) 15 | } 16 | ) 17 | 18 | bot( 19 | { 20 | pattern: 'dall ?(.*)', 21 | fromMe: true, 22 | desc: 'dall image generator', 23 | type: 'AI', 24 | }, 25 | async (message, match) => { 26 | if (!match) 27 | return await message.send( 28 | '*Example : dall a close up, studio photographic portrait of a white siamese cat that looks curious, backlit ears*' 29 | ) 30 | const res = await getDallEResponse(match) 31 | await message.sendFromUrl(res) 32 | } 33 | ) 34 | -------------------------------------------------------------------------------- /plugins/ss.js: -------------------------------------------------------------------------------- 1 | const { bot, isUrl, takeScreenshot } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'ss ?(.*)', 6 | fromMe: true, 7 | desc: 'Take web page screenshot', 8 | type: 'download', 9 | }, 10 | async (message, match) => { 11 | match = isUrl(match || message.reply_message.text) 12 | if (!match) return await message.send('*Example :* ss url') 13 | const image = await takeScreenshot(match) 14 | 15 | await message.send(image, { quoted: message.data, mimetype: 'image/png' }, 'image') 16 | } 17 | ) 18 | 19 | bot( 20 | { 21 | pattern: 'fullss ?(.*)', 22 | fromMe: true, 23 | desc: 'Take web page screenshot', 24 | type: 'download', 25 | }, 26 | async (message, match) => { 27 | match = isUrl(match || message.reply_message.text) 28 | if (!match) return await message.send('*Example :* fullss url') 29 | const image = await takeScreenshot(match, 'full') 30 | await message.send(image, { quoted: message.data, mimetype: 'image/png' }, 'image') 31 | } 32 | ) 33 | -------------------------------------------------------------------------------- /plugins/spam.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | setSpam, 4 | getSpam, 5 | // genButtonMessage 6 | } = require('../lib') 7 | 8 | bot( 9 | { 10 | pattern: 'antispam ?(.*)', 11 | fromMe: true, 12 | desc: 'TO remove backgroud of image', 13 | onlyGroup: true, 14 | type: 'group', 15 | }, 16 | async (message, match) => { 17 | if (!match || (match != 'on' && match != 'off')) { 18 | const { enabled } = await getSpam(message.jid) 19 | return await message.send(`Example : antispam ${enabled ? 'off' : 'on'}`) 20 | // return await message.send( 21 | // await genButtonMessage( 22 | // [ 23 | // { 24 | // text: enabled ? 'OFF' : 'ON', 25 | // id: `antispam ${enabled ? 'off' : 'on'}`, 26 | // }, 27 | // ], 28 | // 'AntiSpam\nExample : antispam on/off' 29 | // ), 30 | // {}, 31 | // 'button' 32 | // ) 33 | } 34 | await setSpam(message.jid, match == 'on') 35 | await message.send( 36 | `_AntiSpam ${match == 'on' ? 'activated' : 'deactivated.'}_` 37 | ) 38 | } 39 | ) 40 | -------------------------------------------------------------------------------- /plugins/gemini.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { bot, gemini } = require('../lib') 3 | 4 | bot( 5 | { 6 | pattern: 'gemini ?(.*)', 7 | fromMe: true, 8 | desc: 'google gemini', 9 | type: 'ai', 10 | }, 11 | async (message, match) => { 12 | if (!config.GEMINI_API_KEY) { 13 | return await message.send( 14 | 'Missing Gemini API key? Get one at https://aistudio.google.com/app/apikey.\nsetvar GEMINI_API_KEY = api_key' 15 | ) 16 | } 17 | 18 | if (!match) { 19 | return await message.send( 20 | '*Example :*\ngemini hi\ngemini what is in the picture(reply to a image)' 21 | ) 22 | } 23 | 24 | let image 25 | if (message.reply_message && message.reply_message.image) { 26 | image = { 27 | image: await message.reply_message.downloadMediaMessage(), 28 | mimetype: message.reply_message.mimetype, 29 | } 30 | } 31 | 32 | const res = await gemini(match, image) 33 | await message.send(res.data, { quoted: message.data }) 34 | } 35 | ) 36 | -------------------------------------------------------------------------------- /plugins/wcg.js: -------------------------------------------------------------------------------- 1 | const { bot, wcg } = require('../lib/') 2 | bot( 3 | { 4 | pattern: 'wcg ?(.*)', 5 | fromMe: true, 6 | desc: 'word chain game\nwcg start to force start game', 7 | type: 'game', 8 | }, 9 | async (message, match) => { 10 | if (match == 'start') { 11 | return await wcg.start(message.jid, message.participant) 12 | } 13 | if (match == 'end') { 14 | return await wcg.end(message.jid, message.participant) 15 | } 16 | wcg.start_game(message.jid, message.participant, 'chain', match) 17 | } 18 | ) 19 | 20 | bot( 21 | { 22 | pattern: 'wrg ?(.*)', 23 | fromMe: true, 24 | desc: 'random word game\nwrg start to force start game', 25 | type: 'game', 26 | }, 27 | async (message, match) => { 28 | if (match == 'start') { 29 | return await wcg.start(message.jid, message.participant) 30 | } 31 | if (match == 'end') { 32 | return await wcg.end(message.jid, message.participant) 33 | } 34 | wcg.start_game(message.jid, message.participant, 'random', match) 35 | } 36 | ) 37 | -------------------------------------------------------------------------------- /plugins/greet.js: -------------------------------------------------------------------------------- 1 | const { bot, setVar, getVars } = require('../lib/index') 2 | 3 | bot( 4 | { 5 | pattern: 'setgreet ?(.*)', 6 | fromMe: true, 7 | desc: 'Set personal message var', 8 | type: 'personal', 9 | }, 10 | async (message, match) => { 11 | if (!match) 12 | return await message.send( 13 | `*Example : setgreet Hi this is a bot, My boss will reply soon*` 14 | ) 15 | const vars = await setVar({ 16 | PERSONAL_MESSAGE: match, 17 | }) 18 | return await message.send(`_Greet Message Updated_`) 19 | } 20 | ) 21 | 22 | bot( 23 | { 24 | pattern: 'getgreet ?(.*)', 25 | fromMe: true, 26 | desc: 'Get personal message var', 27 | type: 'personal', 28 | }, 29 | async (message, match) => { 30 | const vars = await getVars() 31 | const msg = vars['PERSONAL_MESSAGE'] 32 | if (!msg || msg == 'null') 33 | return await message.send(`*Greet Message not Set*`) 34 | return await message.send(msg) 35 | } 36 | ) 37 | 38 | bot( 39 | { 40 | pattern: 'delgreet ?(.*)', 41 | fromMe: true, 42 | desc: 'Delete personal message var', 43 | type: 'personal', 44 | }, 45 | async (message, match) => { 46 | await setVar({ PERSONAL_MESSAGE: 'null' }) 47 | return await message.send(`_Greet Message Deleted_`) 48 | } 49 | ) 50 | -------------------------------------------------------------------------------- /plugins/facebook.js: -------------------------------------------------------------------------------- 1 | const { facebook, bot, generateList, isUrl } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'fb ?(.*)', 6 | fromMe: true, 7 | desc: 'Download facebook video', 8 | type: 'download', 9 | }, 10 | async (message, match) => { 11 | match = isUrl(match || message.reply_message.text) 12 | if (!match) return await message.send('_Example : fb url_') 13 | const result = await facebook(match) 14 | if (!result.length) 15 | return await message.send('*Not found*', { 16 | quoted: message.quoted, 17 | }) 18 | if (result.length == 1) 19 | return await message.sendFromUrl(result[0].url, { quoted: message.data }) 20 | const list = generateList( 21 | result.map((e) => ({ 22 | id: `upload ${e.url}`, 23 | text: e.quality, 24 | })), 25 | `*Choose Video Quality*`, 26 | message.jid, 27 | message.participant 28 | ) 29 | return await message.send(list.message, {}, list.type) 30 | // return await message.send( 31 | // await genButtonMessage( 32 | // result.map((e) => ({ 33 | // id: `upload ${e.url}`, 34 | // text: e.quality, 35 | // })), 36 | // 'Choose Video Quality' 37 | // ), 38 | // {}, 39 | // 'button' 40 | // ) 41 | } 42 | ) 43 | -------------------------------------------------------------------------------- /plugins/delete.js: -------------------------------------------------------------------------------- 1 | const { bot, setVar, parsedJid, isGroup } = require('../lib/index') 2 | 3 | bot( 4 | { 5 | pattern: 'delete ?(.*)', 6 | fromMe: true, 7 | desc: 'anti delete', 8 | type: 'whatsapp', 9 | }, 10 | async (message, match) => { 11 | const jid = parsedJid(match)[0] 12 | if (!match || (match != 'p' && match != 'g' && match != 'off' && !jid)) 13 | return await message.send( 14 | "*Anti delete Message*\n*Example :* delete p | g | off\n p - Send deleted messages to your chat or sudo\n g - Send deleted Message on chat where it delete\njid - Send deleted Message to jid\n off - Don't do anything with delete (off)" 15 | ) 16 | if (isGroup(jid)) { 17 | try { 18 | await message.groupMetadata(jid) 19 | } catch (error) { 20 | return await message.send(`_${jid} is invalid_`) 21 | } 22 | } else if (jid) { 23 | const exist = await message.onWhatsapp(jid) 24 | if (!exist) return await message.send(`_${jid} is invalid_`) 25 | } 26 | await setVar({ ANTI_DELETE: match }) 27 | const msg = jid 28 | ? `_Deleted Messages send to ${jid}_` 29 | : match == 'off' 30 | ? '_Anti delete Disabled_' 31 | : match == 'p' 32 | ? '_Deleted Messages send to your chat or sudo_' 33 | : '_Deleted Messages send to the chat itself_' 34 | await message.send(msg) 35 | } 36 | ) 37 | -------------------------------------------------------------------------------- /plugins/cmd.js: -------------------------------------------------------------------------------- 1 | const { setCmd, bot, getCmd, delCmd } = require('../lib/index') 2 | 3 | bot( 4 | { 5 | pattern: 'setcmd ?(.*)', 6 | fromMe: true, 7 | desc: 'to set cmd', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | if (!message.reply_message || !message.reply_message.sticker) 12 | return await message.send('*Reply to a sticker*') 13 | if (!match) return await message.send('*Example : setcmd ping*') 14 | const res = await setCmd(match, message.reply_message) 15 | return await message.send(res < 1 ? '_Failed_' : '_Success_') 16 | } 17 | ) 18 | 19 | bot( 20 | { 21 | pattern: 'getcmd ?(.*)', 22 | fromMe: true, 23 | desc: 'to get cmd', 24 | type: 'misc', 25 | }, 26 | async (message, match) => { 27 | const res = await getCmd() 28 | if (!res.length) return await message.send('*Not set any cmds*') 29 | return await message.send('```' + res.join('\n') + '```') 30 | } 31 | ) 32 | 33 | bot( 34 | { 35 | pattern: 'delcmd ?(.*)', 36 | fromMe: true, 37 | desc: 'to del cmd', 38 | type: 'misc', 39 | }, 40 | async (message, match) => { 41 | if (!match && (!message.reply_message || !message.reply_message.sticker)) 42 | return await message.send('*Example :*\ndelcmd cmdName\nReply to a sticker') 43 | const res = await delCmd(match || message.reply_message) 44 | return await message.send(res < 1 ? '_Failed_' : '_Success_') 45 | } 46 | ) 47 | -------------------------------------------------------------------------------- /plugins/twitter.js: -------------------------------------------------------------------------------- 1 | const { twitter, bot, generateList, isUrl } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'twitter ?(.*)', 6 | fromMe: true, 7 | desc: 'Download twitter video', 8 | type: 'download', 9 | }, 10 | async (message, match) => { 11 | match = isUrl(match || message.reply_message.text) 12 | if (!match) return await message.send('_Example : twitter url_') 13 | const result = await twitter(match) 14 | if (!result.length) 15 | return await message.send('*Not found*', { 16 | quoted: message.quoted, 17 | }) 18 | if (result.length > 1) { 19 | const list = generateList( 20 | result.map((e) => ({ 21 | id: `upload ${e.url}`, 22 | text: e.quality.split('x')[0], 23 | })), 24 | '*Choose Video Quality*\n', 25 | message.jid, 26 | message.participant 27 | ) 28 | return await message.send(list.message, {}, list.type) 29 | // return await message.send( 30 | // await genButtonMessage( 31 | // result.map((e) => ({ 32 | // id: `upload ${e.url}`, 33 | // text: e.quality.split('x')[0], 34 | // })), 35 | // 'Choose Video Quality' 36 | // ), 37 | // {}, 38 | // 'button' 39 | // ) 40 | } 41 | await message.sendFromUrl(result[0].url, { quoted: message.quoted }) 42 | } 43 | ) 44 | -------------------------------------------------------------------------------- /plugins/removebg.js: -------------------------------------------------------------------------------- 1 | const { bot, removeBg } = require('../lib') 2 | const config = require('../config') 3 | bot( 4 | { 5 | pattern: 'rmbg', 6 | fromMe: true, 7 | desc: 'TO remove backgroud of image', 8 | type: 'misc', 9 | }, 10 | async (message, match) => { 11 | if (config.RMBG_KEY == 'null') 12 | return await message.send(`1. Create a account in remove.bg 13 | 2. Verify your account. 14 | 3. Copy your Key. 15 | 4. .setvar RMBG_KEY:copied_key 16 | ....................... 17 | 18 | Example => .setvar RMBG_KEY:GWQ6jVy9MBpfYF9SnyG8jz8P 19 | 20 | For making this steps easy 21 | Click SIGNUP LINK and Choose Google a/c 22 | after completing signup 23 | Click KEY LINK and copy your KEY.(Press show BUTTON) 24 | 25 | SIGNUP LINK : https://accounts.kaleido.ai/users/sign_up 26 | 27 | KEY LINK : https://www.remove.bg/dashboard#api-key`) 28 | if (!message.reply_message || !message.reply_message.image) 29 | return await message.send('*Reply to a image*') 30 | const buffer = await removeBg( 31 | await message.reply_message.downloadAndSaveMediaMessage('rmbg'), 32 | config.RMBG_KEY 33 | ) 34 | if (typeof buffer == 'string') 35 | return await message.send(buffer, { quoted: message.data }) 36 | return await message.send( 37 | buffer, 38 | { quoted: message.quoted, mimetype: 'image/png' }, 39 | 'image' 40 | ) 41 | } 42 | ) 43 | -------------------------------------------------------------------------------- /plugins/story.js: -------------------------------------------------------------------------------- 1 | const { story, bot, generateList } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'story ?(.*)', 6 | fromMe: true, 7 | desc: 'Download Instagram stories', 8 | type: 'download', 9 | }, 10 | async (message, match) => { 11 | match = match || message.reply_message.text 12 | if (!match) return await message.send('_Example : story username_') 13 | const result = await story(match) 14 | if (!result.length) 15 | return await message.send('*Not found*', { 16 | quoted: message.quoted, 17 | }) 18 | if (result.length > 1) { 19 | const list = generateList( 20 | result.map((url, index) => ({ 21 | id: `upload ${url}`, 22 | text: `${index + 1}/${result.length}`, 23 | })), 24 | `*Total ${result.length} stories*\n`, 25 | message.jid, 26 | message.participant 27 | ) 28 | return await message.send(list.message, {}, list.type) 29 | // const msg = genListMessage( 30 | // result.map((url, index) => ({ 31 | // id: `upload ${url}`, 32 | // text: `${index + 1}/${result.length}`, 33 | // })), 34 | // `Total ${result.length} stories`, 35 | // 'Download' 36 | // ) 37 | // return await message.send(msg, { quoted: message.data }, 'list') 38 | } 39 | for (const url of result) { 40 | await message.sendFromUrl(url) 41 | } 42 | } 43 | ) 44 | -------------------------------------------------------------------------------- /plugins/nr.js: -------------------------------------------------------------------------------- 1 | const { bot, zushi, yami, ope } = require('../lib/') 2 | 3 | bot( 4 | { 5 | pattern: 'zushi ?(.*)', 6 | fromMe: true, 7 | desc: 'allow set commands to be used by others in chat', 8 | type: 'logia', 9 | }, 10 | async (message, match) => { 11 | if (!match) return await message.send(`Example : zushi ping, sticker`) 12 | const z = await zushi(match, message.jid) 13 | if (!z) return await message.send(`*${match}* already set`) 14 | 15 | await message.send(`*allowed commands*\n${z.join('\n')}`) 16 | } 17 | ) 18 | 19 | bot( 20 | { 21 | pattern: 'yami ?(.*)', 22 | fromMe: true, 23 | desc: 'shows the commands', 24 | type: 'logia', 25 | }, 26 | async (message, match) => { 27 | const z = await yami(message.jid) 28 | if (!z || !z.length) return await message.send(`not set any`) 29 | await message.send(`*allowed commands*\n${z.join('\n')}`) 30 | } 31 | ) 32 | 33 | bot( 34 | { 35 | pattern: 'ope ?(.*)', 36 | fromMe: true, 37 | desc: 'delete or unset the command', 38 | type: 'logia', 39 | }, 40 | async (message, match) => { 41 | if (!match) return await message.send('Example : ope ping, sticker') 42 | const z = await ope(message.jid, match) 43 | if (z === null) return await message.send(`not set *${match}*`) 44 | if (z === false || !z.length) return await message.send(`not set any`) 45 | await message.send(`*allowed commands*\n${z.join('\n')}`) 46 | } 47 | ) 48 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "levanter", 3 | "version": "5.6.2", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "pm2 start . --attach --name levanter", 8 | "stop": "pm2 stop levanter", 9 | "postinstall": "node -e \"try { require('sharp') } catch (e) { process.exit(1); }\" || yarn add --ignore-engines sharp" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "axios": "^1.3.3", 15 | "baileys": "git+https://lyfe00011-admin@bitbucket.org/lyfe00011/baileys.git", 16 | "browser-id3-writer": "^4.4.0", 17 | "cheerio": "^1.0.0-rc.10", 18 | "cookie": "^0.5.0", 19 | "dotenv": "^16.0.0", 20 | "file-type": "^18.2.1", 21 | "fluent-ffmpeg": "^2.1.2", 22 | "form-data": "^4.0.0", 23 | "fs-extra": "^11.1.0", 24 | "google-tts-api": "^2.0.2", 25 | "googleapis": "^126.0.1", 26 | "got": "11.8.3", 27 | "heroku-client": "^3.1.0", 28 | "jimp": "^0.16.1", 29 | "link-preview-js": "^3.0.4", 30 | "moment": "^2.29.4", 31 | "node-cron": "^3.0.2", 32 | "node-fetch": "3.2.2", 33 | "node-webpmux": "^3.1.4", 34 | "pdfkit": "^0.13.0", 35 | "pg": "^8.7.3", 36 | "pino-pretty": "^9.1.1", 37 | "pm2": "^5.4.2", 38 | "qrcode-reader": "^1.0.4", 39 | "qrcode-terminal": "^0.12.0", 40 | "sequelize": "^6.21.4", 41 | "sharp": "^0.33.4", 42 | "simple-git": "^3.16.1", 43 | "sqlite3": "^5.0.11", 44 | "translate-google-api": "^1.0.4", 45 | "youtubei.js": "^10.0.0" 46 | }, 47 | "packageManager": "yarn@1.22.22" 48 | } 49 | -------------------------------------------------------------------------------- /plugins/weather.js: -------------------------------------------------------------------------------- 1 | const { bot, getJson, getFloor } = require('../lib/') 2 | const moment = require('moment') 3 | bot( 4 | { 5 | pattern: 'weather ?(.*)', 6 | fromMe: true, 7 | desc: 'weather info', 8 | type: 'search', 9 | }, 10 | async (message, match) => { 11 | if (!match) return await message.send('*Example : weather delhi*') 12 | const data = await getJson( 13 | `http://api.openweathermap.org/data/2.5/weather?q=${match}&units=metric&appid=060a6bcfa19809c2cd4d97a212b19273&language=en` 14 | ).catch(() => {}) 15 | if (!data) return await message.send(`_${match} not found_`) 16 | const { name, timezone, sys, main, weather, visibility, wind } = data 17 | const degree = [ 18 | 'N', 19 | 'NNE', 20 | 'NE', 21 | 'ENE', 22 | 'E', 23 | 'ESE', 24 | 'SE', 25 | 'SSE', 26 | 'S', 27 | 'SSW', 28 | 'SW', 29 | 'WSW', 30 | 'W', 31 | 'WNW', 32 | 'NW', 33 | 'NNW', 34 | ][getFloor(wind.deg / 22.5 + 0.5) % 16] 35 | return await message.send( 36 | `*Name :* ${name}\n*Country :* ${sys.country}\n*Weather :* ${ 37 | weather[0].description 38 | }\n*Temp :* ${getFloor(main.temp)}°\n*Feels Like :* ${getFloor( 39 | main.feels_like 40 | )}°\n*Humidity :* ${ 41 | main.humidity 42 | }%\n*Visibility :* ${visibility}m\n*Wind* : ${ 43 | wind.speed 44 | }m/s ${degree}\n*Sunrise :* ${moment 45 | .utc(sys.sunrise, 'X') 46 | .add(timezone, 'seconds') 47 | .format('hh:mm a')}\n*Sunset :* ${moment 48 | .utc(sys.sunset, 'X') 49 | .add(timezone, 'seconds') 50 | .format('hh:mm a')}` 51 | ) 52 | } 53 | ) 54 | -------------------------------------------------------------------------------- /plugins/truecaller.js: -------------------------------------------------------------------------------- 1 | const { bot, truecaller, jidToNum, delTruecaller, getTruecaller } = require('../lib/index') 2 | 3 | bot( 4 | { 5 | pattern: 'truecaller ?(.*)', 6 | fromMe: true, 7 | desc: 'search number in truecaller', 8 | type: 'search', 9 | }, 10 | async (message, match) => { 11 | match = 12 | (message.mention[0] && jidToNum(message.mention[0])) || 13 | match || 14 | (message.reply_message && jidToNum(message.reply_message.jid)) 15 | if (!match) return await message.send(`*Example :* truecaller 919876543210`) 16 | if (match === 'token') { 17 | const token = await getTruecaller() 18 | if (!token) return await message.send(`*Your not logined*`) 19 | return await message.send(token, { quoted: message.quoted }) 20 | } 21 | if (match === 'logout') { 22 | await delTruecaller() 23 | return await message.send(`Logged out from Truecaller.`) 24 | } 25 | const res = await truecaller.search(match) 26 | 27 | if (res.message) { 28 | return await message.send(res.message) 29 | } 30 | let msg = '' 31 | if (res.name) msg += `*Name :* ${res.name}\n` 32 | if (res.gender) msg += `*Gender :* ${res.gender}\n` 33 | if (res.email) msg += `*Email :* ${res.email}\n` 34 | msg += `*Type :* ${res.numberType}(${res.type})\n` 35 | msg += `*Carrier :* ${res.carrier}\n` 36 | msg += `*Number :* ${res.number}\n` 37 | if (res.city) msg += `*City :* ${res.city}\n` 38 | msg += `*DailingCode :* ${res.dialingCode}(${res.countryCode})` 39 | await message.send(msg) 40 | } 41 | ) 42 | -------------------------------------------------------------------------------- /plugins/tictactoe.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | isTactacToe, 4 | ticTacToe, 5 | delTicTacToe, 6 | // genButtonMessage, 7 | isUser, 8 | parsedJid, 9 | } = require('../lib/') 10 | 11 | bot( 12 | { 13 | pattern: 'tictactoe ?(.*)', 14 | fromMe: true, 15 | desc: 'TicTacToe Game.', 16 | type: 'game', 17 | }, 18 | async (message, match) => { 19 | if (match == 'end') { 20 | const end = await delTicTacToe() 21 | if (end) return await message.send('*Game ended*') 22 | } 23 | let [restart, id] = match.split(' ') 24 | // const game = isTactacToe() 25 | // if (game.state) 26 | // return await message.send(game.text + '\n\nChoose a number in 1-9') 27 | // return await message.send( 28 | // await genButtonMessage( 29 | // [{ id: 'tictactoe end', text: 'END' }], 30 | // game.text, 31 | // 'Choose Number from 1-9 to Play' 32 | // ), 33 | // { contextInfo: { mentionedJid: game.mentionedJid } }, 34 | // 'button' 35 | // ) 36 | let opponent = message.mention[0] || message.reply_message.jid 37 | let me = message.participant 38 | const [_me, _opponent] = parsedJid(match) 39 | if (isUser(_me) && isUser(_opponent)) { 40 | me = _me 41 | opponent = _opponent 42 | } 43 | if (restart == 'restart' && isUser(id)) { 44 | opponent = id 45 | await delTicTacToe() 46 | } 47 | if (!opponent || opponent == me) 48 | return await message.send( 49 | '*Choose an Opponent*\n*Reply to a message or mention or tictactoe jid1 jid2*' 50 | ) 51 | const { text } = await ticTacToe(message.jid, me, opponent) 52 | return await message.send(text, { 53 | contextInfo: { mentionedJid: [me, opponent] }, 54 | }) 55 | } 56 | ) 57 | -------------------------------------------------------------------------------- /plugins/ison.js: -------------------------------------------------------------------------------- 1 | const { bot, PREFIX, getNumbers, jidToNum } = require('../lib') 2 | 3 | bot( 4 | { 5 | pattern: 'ison ?(.*)', 6 | fromMe: true, 7 | desc: 'List number in whatsapp', 8 | type: 'search', 9 | }, 10 | async (message, match) => { 11 | if (!match) return message.send(`*Example :* ${PREFIX}ison 9198765432x0`) 12 | 13 | const numbers = getNumbers(match.replace('+', '')) 14 | 15 | const ison = await message.onWhatsapp(numbers) 16 | 17 | if (!ison.length) { 18 | let msg = '' 19 | msg += `*Not Exist on Whatsapp* (${numbers.length})\n` 20 | for (const num of numbers) msg += `+${num}\n` 21 | return await message.send(msg.trim()) 22 | } 23 | 24 | const about = await message.fetchStatus(ison.map((e) => e.jid)) 25 | 26 | const exist = [] 27 | const x403 = [] 28 | 29 | about.forEach((item) => (item.status ? exist.push(item) : x403.push(jidToNum(item.id)))) 30 | 31 | const not = ison.filter((item) => !item.exist).map((item) => jidToNum(item.jid)) 32 | 33 | let msg = '' 34 | if (not.length) { 35 | msg += `*Not Exist on Whatsapp* (${not.length})\n` 36 | for (const num of not) msg += `+${num}\n` 37 | } 38 | 39 | if (exist.length) { 40 | msg += `\n*Exist on Whatsapp* (${exist.length})\n` 41 | for (const about of exist) { 42 | const num = jidToNum(about.id) 43 | msg += `@${num}\n*Number :* +${num}\n*About :* ${about.status}\n*Date :* ${about.date}\n\n` 44 | } 45 | } 46 | 47 | if (x403.length) { 48 | msg += `*Privacy Settings on* (${x403.length})\n` 49 | for (const num of x403) msg += `+${num}\n` 50 | } 51 | 52 | const mentionedJid = exist.map((user) => user.id) 53 | return await message.send(msg.trim(), { contextInfo: { mentionedJid } }) 54 | } 55 | ) 56 | -------------------------------------------------------------------------------- /plugins/antiwords.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | setWord, 4 | getWord, 5 | // genButtonMessage 6 | } = require('../lib') 7 | 8 | const actions = ['null', 'warn', 'kick'] 9 | 10 | bot( 11 | { 12 | pattern: 'antiword ?(.*)', 13 | fromMe: true, 14 | desc: 'filter the group chat', 15 | onlyGroup: true, 16 | type: 'group', 17 | }, 18 | async (message, match) => { 19 | if ( 20 | !match || 21 | (match != 'on' && match != 'off' && !match.startsWith('action')) 22 | ) { 23 | const { enabled, action } = await getWord(message.jid) 24 | return await message.send( 25 | `_Antiword is ${ 26 | enabled ? 'on' : 'off' 27 | } (${action})_\n*Example :*\nantiword action/(kick|warn|null)\nantiword on | off\nsetvar ANTIWORDS:word1,word2` 28 | ) 29 | // const buttons = actions 30 | // .filter((e) => e != action) 31 | // .map((button) => ({ 32 | // text: button, 33 | // id: `antiword action/${button}`, 34 | // })) 35 | // buttons.push({ 36 | // text: enabled ? 'OFF' : 'ON', 37 | // id: `antiword ${enabled ? 'off' : 'on'}`, 38 | // }) 39 | // return await message.send( 40 | // await genButtonMessage( 41 | // buttons, 42 | // 'AntiWord\nExample : antiword on/off\nantiword action/null or kick or warn\nsetvar ANTIWORDS:word1,word2,...' 43 | // ), 44 | // {}, 45 | // 'button' 46 | // ) 47 | } 48 | if (match.startsWith('action/')) { 49 | const action = match.replace('action/', '') 50 | if (!actions.includes(action)) 51 | return await message.send(`${action} _is a invalid action_`) 52 | await setWord(message.jid, action) 53 | return await message.send(`_antiword action updated as ${action}_`) 54 | } 55 | await setWord(message.jid, match == 'on') 56 | await message.send( 57 | `_AntiWord ${match == 'on' ? 'activated' : 'deactivated.'}_` 58 | ) 59 | } 60 | ) 61 | -------------------------------------------------------------------------------- /plugins/tag.js: -------------------------------------------------------------------------------- 1 | const { bot, addSpace, forwardOrBroadCast } = require('../lib/') 2 | bot( 3 | { 4 | pattern: 'tag ?(.*)', 5 | fromMe: true, 6 | onlyGroup: true, 7 | desc: 'tag members or msg', 8 | type: 'group', 9 | }, 10 | async (message, match) => { 11 | const participants = await message.groupMetadata(message.jid) 12 | const mentionedJid = participants.map(({ id }) => id) 13 | if (match == 'all') { 14 | let mesaj = '' 15 | mentionedJid.forEach( 16 | (e, i) => 17 | (mesaj += `${i + 1}${addSpace(i + 1, participants.length)} @${ 18 | e.split('@')[0] 19 | }\n`) 20 | ) 21 | return await message.send('```' + mesaj.trim() + '```', { 22 | contextInfo: { mentionedJid }, 23 | }) 24 | } else if (match == 'admin' || match == 'admins') { 25 | let mesaj = '' 26 | let mentionedJid = participants 27 | .filter((user) => !!user.admin == true) 28 | .map(({ id }) => id) 29 | mentionedJid.forEach((e) => (mesaj += `@${e.split('@')[0]}\n`)) 30 | return await message.send(mesaj.trim(), { 31 | contextInfo: { mentionedJid }, 32 | }) 33 | } else if (match == 'notadmin' || match == 'not admins') { 34 | let mesaj = '' 35 | const mentionedJid = participants 36 | .filter((user) => !!user.admin != true) 37 | .map(({ id }) => id) 38 | mentionedJid.forEach((e) => (mesaj += `@${e.split('@')[0]}\n`)) 39 | return await message.send(mesaj.trim(), { 40 | contextInfo: { mentionedJid }, 41 | }) 42 | } 43 | if (match || message.reply_message.txt) 44 | return await message.send(match || message.reply_message.text, { 45 | contextInfo: { mentionedJid }, 46 | }) 47 | if (!message.reply_message) 48 | return await message.send( 49 | '*Example :*\ntag all\ntag admin\ntag notadmin\ntag text\nReply to a message' 50 | ) 51 | forwardOrBroadCast(message.jid, message, { contextInfo: { mentionedJid } }) 52 | } 53 | ) 54 | -------------------------------------------------------------------------------- /plugins/vars.js: -------------------------------------------------------------------------------- 1 | const { bot, setVar, getVars, delVar } = require('../lib/index') 2 | 3 | bot( 4 | { 5 | pattern: 'getvar ?(.*)', 6 | fromMe: true, 7 | desc: 'Show var', 8 | type: 'vars', 9 | }, 10 | async (message, match) => { 11 | if (!match) return await message.send(`*Example : getvar sudo*`) 12 | const vars = await getVars() 13 | match = match.toUpperCase() 14 | if (vars[match]) return await message.send(`${match} = ${vars[match]}`) 15 | return await message.send(`_${match} not found in vars_`) 16 | } 17 | ) 18 | 19 | bot( 20 | { 21 | pattern: 'delvar ?(.*)', 22 | fromMe: true, 23 | desc: 'delete var', 24 | type: 'vars', 25 | }, 26 | async (message, match) => { 27 | if (!match) return await message.send(`*Example : delvar sudo*`) 28 | const vars = await getVars() 29 | match = match.toUpperCase() 30 | if (!vars[match]) return await message.send(`_${match} not found in vars_`) 31 | await delVar(match) 32 | await message.send(`_${match} deleted_`) 33 | } 34 | ) 35 | 36 | bot( 37 | { 38 | pattern: 'setvar ?(.*)', 39 | fromMe: true, 40 | desc: 'set var', 41 | type: 'vars', 42 | }, 43 | async (message, match) => { 44 | const keyValue = match.split('=') 45 | if (!match || keyValue.length < 2) 46 | return await message.send(`*Example : setvar sudo = 91987653210*`) 47 | const key = keyValue[0].trim().toUpperCase() 48 | const value = keyValue[1].trim() 49 | await setVar({ [key]: value }) 50 | await message.send(`_new var ${key} added as ${value}_`) 51 | } 52 | ) 53 | 54 | bot( 55 | { 56 | pattern: 'allvar ?(.*)', 57 | fromMe: true, 58 | desc: 'Show All var', 59 | type: 'vars', 60 | }, 61 | async (message, match) => { 62 | const vars = await getVars() 63 | let allVars = '' 64 | for (const key in vars) { 65 | allVars += `${key} = ${vars[key]}\n\n` 66 | } 67 | return await message.send(allVars.trim()) 68 | } 69 | ) 70 | -------------------------------------------------------------------------------- /plugins/apk.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | apkMirror, 4 | // genListMessage, 5 | // genButtonMessage, 6 | generateList, 7 | } = require('../lib') 8 | bot( 9 | { 10 | pattern: 'apk ?(.*)', 11 | fromMe: true, 12 | desc: 'Download apk from apkmirror', 13 | type: 'download', 14 | }, 15 | async (message, match) => { 16 | if (!match) return await message.send('*Example : apk Mixplorer*') 17 | const { result, status } = await apkMirror(match) 18 | if (status > 400) { 19 | if (!result.length) return await message.send('_No results found matching your query_') 20 | const list = [] 21 | for (const { title, url } of result) list.push({ id: `apk ${status};;${url}`, text: title }) 22 | const lists = generateList( 23 | list, 24 | `Matching Apps(${list.length})\n`, 25 | message.jid, 26 | message.participant 27 | ) 28 | return await message.send(lists.message, {}, lists.type) 29 | 30 | // return await message.send( 31 | // generateList(list, 'Matching apps', 'DOWNLOAD'), 32 | // {}, 33 | // 'list' 34 | // ) 35 | } 36 | if (status > 200) { 37 | const button = [] 38 | for (const apk in result) 39 | button.push({ 40 | id: `apk ${status};;${result[apk].url}`, 41 | text: result[apk].title, 42 | }) 43 | if (button.length == 1) { 44 | const res = await apkMirror(button[0].id.replace('apk ', '')) 45 | return await message.sendFromUrl(res.result) 46 | } 47 | const list = generateList( 48 | button, 49 | `Available architectures\n`, 50 | message.jid, 51 | message.participant 52 | ) 53 | return await message.send(list.message, { quoted: message.data }, list.type) 54 | // return await message.send( 55 | // await genButtonMessage(button, 'Available apks'), 56 | // {}, 57 | // 'button' 58 | // ) 59 | } 60 | return await message.sendFromUrl(result, { quoted: message.data }) 61 | } 62 | ) 63 | -------------------------------------------------------------------------------- /plugins/mention.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | // genButtonMessage, 4 | mentionMessage, 5 | enableMention, 6 | clearFiles, 7 | getMention, 8 | } = require('../lib/') 9 | 10 | bot( 11 | { 12 | pattern: 'mention ?(.*)', 13 | fromMe: true, 14 | desc: 'To set and Manage mention', 15 | type: 'misc', 16 | }, 17 | async (message, match) => { 18 | if (!match) { 19 | const mention = await getMention() 20 | const onOrOff = mention && mention.enabled ? 'on' : 'off' 21 | return await message.send( 22 | `Mention is ${onOrOff}\n\nhttps://github.com/lyfe00011//whatsapp-bot-md/wiki/mention_example` 23 | ) 24 | 25 | // const button = await genButtonMessage( 26 | // [ 27 | // { id: 'mention get', text: 'GET' }, 28 | // { id: `mention ${onOrOff}`, text: onOrOff.toUpperCase() }, 29 | // ], 30 | // 'Example\nhttps://github.com/lyfe00011//whatsapp-bot-md/wiki/mention_example', 31 | // 'Mention' 32 | // ) 33 | // return await message.send(button, {}, 'button') 34 | // return await message.send( 35 | // await genHydratedButtons( 36 | // [ 37 | // { 38 | // urlButton: { 39 | // text: 'example', 40 | // url: 'https://github.com/lyfe00011//whatsapp-bot-md/wiki/mention_example', 41 | // }, 42 | // }, 43 | // { button: { id: 'mention on', text: 'ON' } }, 44 | // { button: { id: 'mention off', text: 'OFF' } }, 45 | // { button: { id: 'mention get', text: 'GET' } }, 46 | // ], 47 | // 'Mention Msg Manager' 48 | // ), 49 | // {}, 50 | // 'template' 51 | // ) 52 | } 53 | if (match == 'get') { 54 | const msg = await mentionMessage() 55 | if (!msg) return await message.send('_Reply to Mention not Activated._') 56 | return await message.send(msg) 57 | } else if (match == 'on' || match == 'off') { 58 | await enableMention(match == 'on') 59 | return await message.send( 60 | `_Reply to mention ${match == 'on' ? 'Activated' : 'Deactivated'}_` 61 | ) 62 | } 63 | await enableMention(match) 64 | clearFiles() 65 | return await message.send('_Mention Updated_') 66 | } 67 | ) 68 | -------------------------------------------------------------------------------- /plugins/bing.js: -------------------------------------------------------------------------------- 1 | const { bot, bing, dall3 } = require('../lib/') 2 | const config = require('../config') 3 | bot( 4 | { 5 | pattern: 'bing ?(.*)', 6 | fromMe: true, 7 | desc: 'bing ai', 8 | type: 'ai', 9 | }, 10 | async (message, match) => { 11 | if (!config.BING_COOKIE) 12 | return await message.send( 13 | `Please set a bing cookie, log in to bing.com/chat, use bing AI chat once, and then copy the cookie.` 14 | ) 15 | match = match || message.reply_message.text 16 | if (!match) return await message.send('*Example :* bing Hi') 17 | await message.send( 18 | { 19 | text: '⏳', 20 | key: message.message.key, 21 | }, 22 | {}, 23 | 'react' 24 | ) 25 | const res = await bing(match) 26 | await message.send( 27 | { 28 | text: '✅', 29 | key: message.message.key, 30 | }, 31 | {}, 32 | 'react' 33 | ) 34 | return await message.send(res, { quoted: message.data }) 35 | } 36 | ) 37 | 38 | bot( 39 | { 40 | pattern: 'dale ?(.*)', 41 | fromMe: true, 42 | desc: 'bing image creator', 43 | type: 'ai', 44 | }, 45 | async (message, match) => { 46 | if (!config.BING_COOKIE) 47 | return await message.send( 48 | `Please set a bing cookie, log in to https://bing.com/images/create, use bing Image Creator once, and then copy the cookie.` 49 | ) 50 | if (!match) 51 | return await message.send( 52 | '*Example :* dale Create a 3D illusion for a WhatsApp profile picture where a boy in a white shirt sits casually on a royal Sofa. Wearing White sneakers,a black T-shirt, and sunglasses, he looks ahead. The background features “Arjun ” in big and capital Yellow fonts on the black wall.' 53 | ) 54 | await message.send( 55 | { 56 | text: '⏳', 57 | key: message.message.key, 58 | }, 59 | {}, 60 | 'react' 61 | ) 62 | const res = await dall3(match) 63 | await message.send( 64 | { 65 | text: '✅', 66 | key: message.message.key, 67 | }, 68 | {}, 69 | 'react' 70 | ) 71 | return await message.sendFromUrl(res.data) 72 | } 73 | ) 74 | -------------------------------------------------------------------------------- /plugins/antifake.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | getFake, 4 | antiList, 5 | enableAntiFake, 6 | // genButtonMessage, 7 | } = require('../lib/') 8 | 9 | bot( 10 | { 11 | pattern: 'antifake ?(.*)', 12 | fromMe: true, 13 | desc: 'set antifake', 14 | type: 'group', 15 | onlyGroup: true, 16 | }, 17 | async (message, match) => { 18 | if (!match) { 19 | const fake = await getFake(message.jid) 20 | const onOrOff = fake && fake.enabled ? 'on' : 'off' 21 | return await message.send( 22 | `_Antifake is ${onOrOff}_\n*Example :*\nantifake list\nantifake !91,1\nantifake on | off` 23 | ) 24 | // const button = await genButtonMessage( 25 | // [ 26 | // { id: 'antifake list', text: 'LIST' }, 27 | // { id: `antifake ${onOrOff}`, text: onOrOff.toUpperCase() }, 28 | // ], 29 | // 'Example\nhttps://github.com/lyfe00011/whatsapp-bot-md/wiki/antifake', 30 | // 'Antifake' 31 | // ) 32 | // return await message.send(button, {}, 'button') 33 | // return await message.send( 34 | // await genHydratedButtons( 35 | // [ 36 | // { 37 | // urlButton: { 38 | // text: 'Example', 39 | // url: 'https://github.com/lyfe00011/whatsapp-bot-md/wiki/antifake', 40 | // }, 41 | // }, 42 | // { button: { id: 'antifake list', text: 'LIST' } }, 43 | // { button: { id: 'antifake on', text: 'ON' } }, 44 | // { button: { id: 'antifake off', text: 'OFF' } }, 45 | // ], 46 | // 'Antifake' 47 | // ), 48 | // {}, 49 | // 'template' 50 | // ) 51 | } 52 | if (match == 'list') { 53 | let list = '' 54 | let codes = await antiList(message.jid, 'fake') 55 | await message.send(codes.join(',')) 56 | codes.forEach((code, i) => { 57 | list += `${i + 1}. ${code}\n` 58 | }) 59 | return await message.send('```' + list + '```') 60 | } 61 | if (match == 'on' || match == 'off') { 62 | await enableAntiFake(message.jid, match) 63 | return await message.send( 64 | `_Antifake ${match == 'on' ? 'Activated' : 'Deactivated'}_` 65 | ) 66 | } 67 | const res = await enableAntiFake(message.jid, match) 68 | return await message.send( 69 | `_Antifake Updated_\nAllow - ${res.allow.join( 70 | ', ' 71 | )}\nNotAllow - ${res.notallow.join(', ')}` 72 | ) 73 | } 74 | ) 75 | -------------------------------------------------------------------------------- /plugins/scheduleMessage.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | parsedJid, 4 | validateTime, 5 | createSchedule, 6 | delScheduleMessage, 7 | deleteScheduleTask, 8 | getScheduleMessage, 9 | } = require('../lib/') 10 | 11 | bot( 12 | { 13 | pattern: 'setschedule ?(.*)', 14 | fromMe: true, 15 | desc: 'To set Schedule Message', 16 | type: 'schedule', 17 | }, 18 | async (message, match) => { 19 | if (!message.reply_message) 20 | return await message.send( 21 | '*Reply to a Message, which is scheduled to send*' 22 | ) 23 | const [jid, time] = match.split(',') 24 | const [isJid] = parsedJid(jid) 25 | const isTimeValid = validateTime(time) 26 | if (!isJid || !isTimeValid) 27 | return await message.send( 28 | '*Example : setschedule 91987654321@s.whatsapp.net, 9-9-13-8 (min-hour-day-month in 24 hour format)*' 29 | ) 30 | await createSchedule(isJid, isTimeValid, message, message.jid) 31 | await message.send('_Successfully Scheduled_') 32 | } 33 | ) 34 | 35 | bot( 36 | { 37 | pattern: 'getschedule ?(.*)', 38 | fromMe: true, 39 | desc: 'To get all Schedule Message', 40 | type: 'schedule', 41 | }, 42 | async (message, match) => { 43 | const schedules = await getScheduleMessage() 44 | if (schedules.length < 1) 45 | return await message.send('_There is no any schedules_') 46 | let msg = '' 47 | for (const schedule of schedules) { 48 | msg += `Jid : *${schedule.jid}*\nTime : ${schedule.time}\n\n` 49 | } 50 | return await message.send(msg.trim()) 51 | } 52 | ) 53 | 54 | bot( 55 | { 56 | pattern: 'delschedule ?(.*)', 57 | fromMe: true, 58 | desc: 'To delete Schedule Message', 59 | type: 'schedule', 60 | }, 61 | async (message, match) => { 62 | if (!match) 63 | return await message.send( 64 | '*Example : delschedule 9198765431@s.whatsapp.net, 8-8-10-10*' 65 | ) 66 | const [jid, time] = match.split(',') 67 | const [isJid] = parsedJid(jid) 68 | const isTimeValid = validateTime(time) 69 | if (!isJid || !isTimeValid) 70 | return await message.send( 71 | '*Example : delschedule 9198765431@s.whatsapp.net, 8-8-10-10*' 72 | ) 73 | const isDeleted = await delScheduleMessage(isJid, isTimeValid) 74 | if (!isDeleted) return await message.send('_Schedule not found!_') 75 | deleteScheduleTask(isJid, isTimeValid) 76 | return await message.send('_Schedule deleted_') 77 | } 78 | ) 79 | -------------------------------------------------------------------------------- /plugins/filters.js: -------------------------------------------------------------------------------- 1 | const { getFilter, bot, setFilter, deleteFilter, lydia } = require('../lib/') 2 | const fm = true 3 | 4 | bot( 5 | { 6 | pattern: 'stop ?(.*)', 7 | fromMe: fm, 8 | desc: 'Delete filters in chat', 9 | type: 'group', 10 | onlyGroup: true, 11 | }, 12 | async (message, match) => { 13 | if (!match) return await message.send(`*Example : .stop hi*`) 14 | const isDel = await deleteFilter(message.jid, match) 15 | if (!isDel) return await message.send(`_${match} not found in filters_`) 16 | return await message.send(`_${match} deleted._`) 17 | } 18 | ) 19 | 20 | bot( 21 | { 22 | pattern: 'filter ?(.*)', 23 | fromMe: fm, 24 | desc: 'filter in groups', 25 | type: 'group', 26 | onlyGroup: true, 27 | }, 28 | async (message, match) => { 29 | match = match.match(/[\'\"](.*?)[\'\"]/gms) 30 | if (!match) { 31 | const filters = await getFilter(message.jid) 32 | if (!filters) return await message.send(`_Not set any filter_\n*Example filter 'hi' 'hello'*`) 33 | let msg = '' 34 | filters.map(({ pattern }) => { 35 | msg += `=> ${pattern} \n` 36 | }) 37 | return await message.send(msg.trim()) 38 | } else { 39 | if (match.length < 2) { 40 | return await message.send(`Example filter 'hi' 'hello'`) 41 | } 42 | const k = match[0].replace(/['"]+/g, '') 43 | const v = match[1].replace(/['"]+/g, '') 44 | if (k && v) await setFilter(message.jid, k, v, match[0][0] === "'" ? true : false) 45 | await message.send(`_${k}_ added to filters.`) 46 | } 47 | } 48 | ) 49 | 50 | bot({ on: 'text', fromMe: false, type: 'filterOrLydia' }, async (message, match) => { 51 | const filters = await getFilter(message.jid) 52 | if (filters) 53 | filters.map(async ({ pattern, regex, text }) => { 54 | pattern = new RegExp(`(?:^|\\W)${pattern}(?:$|\\W)`, 'i') 55 | if (pattern.test(message.text)) { 56 | await message.send(text, { 57 | quoted: message.data, 58 | }) 59 | } 60 | }) 61 | 62 | const isLydia = await lydia(message) 63 | if (isLydia) return await message.send(isLydia, { quoted: message.data }) 64 | }) 65 | 66 | bot({ on: 'text', fromMe: true, type: 'lydia' }, async (message, match) => { 67 | const isLydia = await lydia(message) 68 | if (isLydia) return await message.send(isLydia, { quoted: message.data }) 69 | }) 70 | -------------------------------------------------------------------------------- /plugins/budget.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | summary, 4 | setBudget, 5 | delBudget, 6 | isValidDate, 7 | } = require('../lib/index') 8 | 9 | bot( 10 | { 11 | pattern: 'income ?(.*)', 12 | fromMe: true, 13 | desc: 'to set income', 14 | type: 'budget', 15 | }, 16 | async (message, match) => { 17 | const [type, amount, remark] = match.split(',') 18 | if (!type || !amount || isNaN(amount)) 19 | return await message.send( 20 | '*Missing type*\n*Example : income type,amount,remark*\n*income salary, 500*\n\n*remark is optional*' 21 | ) 22 | const res = await setBudget( 23 | message.participant, 24 | 'income', 25 | type, 26 | amount, 27 | remark 28 | ) 29 | await message.send(`*Income of current month is ${res}*`) 30 | } 31 | ) 32 | 33 | bot( 34 | { 35 | pattern: 'expense ?(.*)', 36 | fromMe: true, 37 | desc: 'to set expense', 38 | type: 'budget', 39 | }, 40 | async (message, match) => { 41 | const [type, amount, remark] = match.split(',') 42 | if (!type || !amount || isNaN(amount)) 43 | return await message.send( 44 | '*Missing type*\n*Example : expense type,amount,remark*\n*expense movie, 200, movie_name*\n\n*remark is optional*' 45 | ) 46 | const res = await setBudget( 47 | message.participant, 48 | 'expense', 49 | type, 50 | amount, 51 | remark 52 | ) 53 | await message.send(`*Expense of current month is ${res}*`) 54 | } 55 | ) 56 | 57 | bot( 58 | { 59 | pattern: 'delBudget ?(.*)', 60 | fromMe: true, 61 | desc: 'to delete income | expense', 62 | type: 'budget', 63 | }, 64 | async (message, match) => { 65 | if (!match) 66 | return await message.send( 67 | '*Example : delbudget id*\n\n*Id from summary*\n*To update amount re-enter again instead of deletion*' 68 | ) 69 | const res = await delBudget(message.participant, match) 70 | if (!res) return await message.send(`_${match} not in list._`) 71 | await message.send(`_${match} removed from the list._`) 72 | } 73 | ) 74 | 75 | bot( 76 | { 77 | pattern: 'summary ?(.*)', 78 | fromMe: true, 79 | desc: 'to get summary of budget', 80 | type: 'budget', 81 | }, 82 | async (message, match) => { 83 | const [from, to] = match.split(',') 84 | if (match && (!isValidDate(from) || !isValidDate(to))) 85 | return await message.send(`*Example : summary 1 May 2023, 3 May 2023*`) 86 | const budget = await summary(message.participant, from, to) 87 | await message.send( 88 | budget, 89 | { 90 | fileName: 'summary.pdf', 91 | mimetype: 'application/pdf', 92 | }, 93 | 'document' 94 | ) 95 | } 96 | ) 97 | -------------------------------------------------------------------------------- /plugins/antiLink.js: -------------------------------------------------------------------------------- 1 | const { 2 | getAntiLink, 3 | bot, 4 | // genButtonMessage, 5 | setAntiLink, 6 | } = require('../lib/') 7 | 8 | bot( 9 | { 10 | pattern: 'antilink ?(.*)', 11 | fromMe: true, 12 | desc: 'to on off antiLink', 13 | type: 'group', 14 | onlyGroup: true, 15 | }, 16 | async (message, match) => { 17 | const antilink = await getAntiLink(message.jid) 18 | if (!match) { 19 | const onOrOff = antilink.enabled ? 'on' : 'off' 20 | return await message.send( 21 | `_Antilink is ${onOrOff}_\n*Example :*\nantilink info\nantilink whatsapp.com\nantlink on | off` 22 | ) 23 | // const button = await genButtonMessage( 24 | // [ 25 | // { id: 'antilink info', text: 'INFO' }, 26 | // { id: `antilink ${onOrOff}`, text: onOrOff.toUpperCase() }, 27 | // ], 28 | // 'Example\nhttps://github.com/lyfe00011/whatsapp-bot-md/wiki/antilink', 29 | // 'Antilink' 30 | // ) 31 | // return await message.send(button, {}, 'button') 32 | // return await message.send( 33 | // await genHydratedButtons( 34 | // [ 35 | // { 36 | // urlButton: { 37 | // text: 'Example', 38 | // url: 'https://github.com/lyfe00011/whatsapp-bot-md/wiki/antilink', 39 | // }, 40 | // }, 41 | // { 42 | // button: { 43 | // id: `antilink ${antilink.enabled ? 'off' : 'on'}`, 44 | // text: antilink.enabled ? 'OFF' : 'ON', 45 | // }, 46 | // }, 47 | // { button: { id: 'antilink info', text: 'INFO' } }, 48 | // ], 49 | // 'AntiLink' 50 | // ), 51 | // {}, 52 | // 'template' 53 | // ) 54 | } 55 | if (match == 'on' || match == 'off') { 56 | if (match == 'off' && !antilink) 57 | return await message.send('_AntiLink is not enabled._') 58 | await setAntiLink(message.jid, match == 'on') 59 | return await message.send( 60 | `_AntiLink ${match == 'on' ? 'Enabled' : 'Disabled.'}_` 61 | ) 62 | } 63 | if (match == 'info') 64 | return await message.send( 65 | `*AntiLink :* ${antilink.enabled ? 'on' : 'off'}\n*AllowedUrl :* ${ 66 | antilink.allowedUrls 67 | }\n*Action :* ${antilink.action}` 68 | ) 69 | if (match.startsWith('action/')) { 70 | await setAntiLink(message.jid, match) 71 | const action = match.replace('action/', '') 72 | if (!['warn', 'kick', 'null'].includes(action)) 73 | return await message.send('*Invalid action*') 74 | return await message.send(`_AntiLink action updated as ${action}_`) 75 | } 76 | const res = await setAntiLink(message.jid, match) 77 | return await message.send( 78 | `_AntiLink allowed urls are_\nAllow - ${res.allow.join( 79 | ', ' 80 | )}\nNotAllow - ${res.notallow.join(', ')}` 81 | ) 82 | } 83 | ) 84 | -------------------------------------------------------------------------------- /plugins/warn.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { 3 | bot, 4 | setWarn, 5 | jidToNum, 6 | // genButtonMessage, 7 | isAdmin, 8 | deleteWarn, 9 | } = require('../lib/') 10 | 11 | bot( 12 | { 13 | pattern: 'warn ?(.*)', 14 | fromMe: true, 15 | desc: 'warn users in chat', 16 | type: 'group', 17 | onlyGroup: true, 18 | }, 19 | async (message, match) => { 20 | if (!match && !message.reply_message) 21 | return await message.send('*Example :*\nwarn mention/reply\nwarn reset mention/reply') 22 | let [m, u] = match.split(' ') 23 | if (m && m.toLowerCase() == 'reset') { 24 | u = u && u.endsWith('@s.whatsapp.net') ? u : message.mention[0] || message.reply_message.jid 25 | if (!u) return await message.send('*Reply or Mention to a user*') 26 | const count = await setWarn(u, message.jid, (!isNaN(u) && u) || -1) 27 | const mention = `@${jidToNum(u)}` 28 | const remaining = config.WARN_LIMIT - count 29 | const resetMessage = config.WARN_RESET_MESSAGE.replace('&mention', mention) 30 | .replace('&remaining', remaining) 31 | .replace('&warn', config.WARN_LIMIT) 32 | return await message.send(resetMessage, { contextInfo: { mentionedJid: [u] } }) 33 | } 34 | const user = message.mention[0] || message.reply_message.jid 35 | if (!user) return await message.send('*Reply or Mention to a user*') 36 | const count = await setWarn(user, message.jid) 37 | if (count > config.WARN_LIMIT) { 38 | const participants = await message.groupMetadata(message.jid) 39 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 40 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 41 | const isUserAdmin = await isAdmin(participants, user) 42 | if (isUserAdmin) return await message.send(`_I can't Remove admin._`) 43 | const mention = `@${jidToNum(user)}` 44 | const kickMessage = config.WARN_KICK_MESSAGE.replace('&mention', mention) 45 | await message.send(kickMessage, { 46 | contextInfo: { mentionedJid: [user] }, 47 | }) 48 | await deleteWarn(user, message.jid) 49 | return await message.Kick(user) 50 | } 51 | const mention = `@${jidToNum(user)}` 52 | const remainWarnCount = config.WARN_LIMIT - count 53 | const warnMessage = config.WARN_MESSAGE.replace('&mention', mention) 54 | .replace('&remaining', remainWarnCount) 55 | .replace('&reason', match) 56 | .replace('&warn', config.WARN_LIMIT) 57 | await message.send(warnMessage, { contextInfo: { mentionedJid: [user] } }) 58 | // return await message.send( 59 | // await genButtonMessage( 60 | // [{ id: `warn reset ${user}`, text: 'RESET' }], 61 | // `⚠️WARNING⚠️\n*User :* @${jidToNum( 62 | // user 63 | // )}\n*Warn :* ${count}\n*Remaining :* ${config.WARN_LIMIT - count}` 64 | // ), 65 | // { contextInfo: { mentionedJid: [user] } }, 66 | // 'button' 67 | // ) 68 | } 69 | ) 70 | -------------------------------------------------------------------------------- /plugins/y2mate.js: -------------------------------------------------------------------------------- 1 | const { 2 | y2mate, 3 | bot, 4 | getBuffer, 5 | // genButtonMessage, 6 | addAudioMetaData, 7 | yts, 8 | generateList, 9 | } = require('../lib/') 10 | const ytIdRegex = 11 | /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed|shorts\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/ 12 | 13 | bot( 14 | { 15 | pattern: 'ytv ?(.*)', 16 | fromMe: true, 17 | desc: 'Download youtube video', 18 | type: 'download', 19 | }, 20 | async (message, match) => { 21 | match = match || message.reply_message.text 22 | if (!match) return await message.send('_Example : ytv url_') 23 | if (match.startsWith('y2mate;')) { 24 | const [_, q, id] = match.split(';') 25 | const result = await y2mate.dl(id, 'video', q) 26 | return await message.sendFromUrl(result, { quoted: message.data }) 27 | } 28 | if (!ytIdRegex.test(match)) 29 | return await message.send('*Give me a yt link!*', { 30 | quoted: message.data, 31 | }) 32 | const vid = ytIdRegex.exec(match) 33 | const { title, video, thumbnail, time } = await y2mate.get(vid[1]) 34 | const buttons = [] 35 | for (const q in video) 36 | buttons.push({ 37 | text: `${q}(${video[q].fileSizeH || video[q].size})`, 38 | id: `ytv y2mate;${q};${vid[1]}`, 39 | }) 40 | if (!buttons.length) 41 | return await message.send('*Not found*', { 42 | quoted: message.quoted, 43 | }) 44 | const list = generateList(buttons, title + `(${time})\n`, message.jid, message.participant) 45 | if (list.type === 'text') 46 | return await message.sendFromUrl(thumbnail, { 47 | caption: '```' + list.message + '```', 48 | buffer: false, 49 | }) 50 | return await message.send(list.message, {}, list.type) 51 | 52 | // return await message.send( 53 | // await genButtonMessage( 54 | // buttons, 55 | // title, 56 | // time, 57 | // { image: thumbnail }, 58 | // message 59 | // ), 60 | // {}, 61 | // 'button' 62 | // ) 63 | } 64 | ) 65 | 66 | bot( 67 | { 68 | pattern: 'yta ?(.*)', 69 | fromMe: true, 70 | desc: 'Download youtube audio', 71 | type: 'download', 72 | }, 73 | async (message, match) => { 74 | match = match || message.reply_message.text 75 | if (!match) return await message.send('_Example : yta darari/yt url_') 76 | const vid = ytIdRegex.exec(match) 77 | if (vid) match = vid[1] 78 | const [video] = await yts(match, !!vid) 79 | const { title, thumbnail, id } = video 80 | const audio = await y2mate.get(id) 81 | const result = await y2mate.dl(id, 'audio') 82 | if (!result) return await message.send(`_not found._`, { quoted: message.data }) 83 | const { buffer } = await getBuffer(result) 84 | if (!buffer) return await message.send(result, { quoted: message.data }) 85 | return await message.send( 86 | await addAudioMetaData(buffer, title, '', '', thumbnail), 87 | { quoted: message.data, mimetype: 'audio/mpeg' }, 88 | 'audio' 89 | ) 90 | } 91 | ) 92 | -------------------------------------------------------------------------------- /plugins/sticker.js: -------------------------------------------------------------------------------- 1 | const { 2 | sticker, 3 | webpToMp4, 4 | addExif, 5 | bot, 6 | addAudioMetaData, 7 | circleSticker, 8 | } = require('../lib/') 9 | const fm = true 10 | 11 | bot( 12 | { 13 | pattern: 'sticker', 14 | fromMe: fm, 15 | desc: 'image/video to sticker', 16 | type: 'sticker', 17 | }, 18 | async (message, match) => { 19 | if ( 20 | !message.reply_message || 21 | (!message.reply_message.video && !message.reply_message.image) 22 | ) 23 | return await message.send('*Reply to image/video*') 24 | return await message.send( 25 | await sticker( 26 | 'str', 27 | await message.reply_message.downloadAndSaveMediaMessage('sticker'), 28 | message.reply_message.image 29 | ? 1 30 | : //: message.reply_message.seconds < 10 ? 31 | 2 32 | //: 3 33 | ), 34 | { isAnimated: !!message.reply_message.video, quoted: message.quoted }, 35 | 'sticker' 36 | ) 37 | } 38 | ) 39 | 40 | bot( 41 | { 42 | pattern: 'circle', 43 | fromMe: fm, 44 | desc: 'image to circle sticker', 45 | type: 'sticker', 46 | }, 47 | async (message, match) => { 48 | if (!message.reply_message || !message.reply_message.image) 49 | return await message.send('*Reply to a image*') 50 | return await message.send( 51 | await circleSticker( 52 | await message.reply_message.downloadAndSaveMediaMessage( 53 | 'circleSticker' 54 | ), 55 | message.reply_message.video 56 | ), 57 | { isAnimated: false, quoted: message.quoted }, 58 | 'sticker' 59 | ) 60 | } 61 | ) 62 | 63 | bot( 64 | { 65 | pattern: 'take ?(.*)', 66 | fromMe: true, 67 | desc: 'change sticker pack', 68 | type: 'sticker', 69 | }, 70 | async (message, match) => { 71 | if ( 72 | !message.reply_message || 73 | (!message.reply_message.sticker && !message.reply_message.audio) 74 | ) 75 | return await message.send('*Reply to sticker/audio*') 76 | if (message.reply_message.sticker) 77 | return await message.send( 78 | await addExif( 79 | await message.reply_message.downloadMediaMessage('mp4'), 80 | match 81 | ), 82 | { quoted: message.quoted }, 83 | 'sticker' 84 | ) 85 | if (!match) 86 | return await message.send( 87 | `*Give me title,artists,url*\n*aritists or url is optional*` 88 | ) 89 | const [title, artists, url] = match.split(',') 90 | return await message.send( 91 | await addAudioMetaData( 92 | await message.reply_message.downloadMediaMessage(), 93 | title, 94 | artists, 95 | '', 96 | url 97 | ), 98 | { quoted: message.quoted, mimetype: 'audio/mpeg' }, 99 | 'audio' 100 | ) 101 | } 102 | ) 103 | 104 | bot( 105 | { 106 | pattern: 'mp4', 107 | fromMe: fm, 108 | desc: 'animated sticker to video', 109 | type: 'sticker', 110 | }, 111 | async (message, match) => { 112 | if ( 113 | !message.reply_message.sticker || 114 | !message.reply_message || 115 | !message.reply_message.animated 116 | ) 117 | return await message.send('*Reply to animated sticker*') 118 | return await message.sendFromUrl( 119 | await webpToMp4( 120 | await message.reply_message.downloadAndSaveMediaMessage('sticker') 121 | ) 122 | ) 123 | } 124 | ) 125 | -------------------------------------------------------------------------------- /plugins/plugins.js: -------------------------------------------------------------------------------- 1 | const got = require('got') 2 | const path = require('path') 3 | const { 4 | bot, 5 | parseGistUrls, 6 | getPlugin, 7 | setPlugin, 8 | pluginsList, 9 | delPlugin, 10 | // genButtonMessage, 11 | // PLATFORM, 12 | } = require('../lib/') 13 | const { writeFileSync, unlinkSync } = require('fs') 14 | 15 | bot( 16 | { 17 | pattern: 'plugin ?(.*)', 18 | fromMe: true, 19 | desc: 'Install External plugins', 20 | type: 'plugin', 21 | }, 22 | async (message, match) => { 23 | match = match || message.reply_message.text 24 | if (!match && match !== 'list') 25 | return await message.send('*Example :*\nplugin url\nplugin list') 26 | if (match == 'list') { 27 | const plugins = await getPlugin() 28 | if (!plugins) return await message.send(`*Plugins not installed*`) 29 | let msg = '' 30 | plugins.map(({ name, url }) => { 31 | msg += `${name} : ${url}\n` 32 | }) 33 | return await message.send('```' + msg + '```') 34 | } 35 | const isValidUrl = parseGistUrls(match) 36 | if (!isValidUrl || isValidUrl.length < 1) { 37 | const { url } = await getPlugin(match) 38 | if (url) return await message.send(url, { quoted: message.data }) 39 | return await message.send('*Give me valid plugin urls/plugin_name*') 40 | } 41 | let msg = '' 42 | for (const url of isValidUrl) { 43 | try { 44 | const res = await got(url) 45 | if (res.statusCode == 200) { 46 | let plugin_name = /pattern: ["'](.*)["'],/g.exec(res.body) 47 | plugin_name = plugin_name[1].split(' ')[0] 48 | writeFileSync('./plugins/' + plugin_name + '.js', res.body) 49 | try { 50 | require('./' + plugin_name) 51 | } catch (e) { 52 | await message.send(e.stack, { quoted: message.quoted }) 53 | return unlinkSync('./plugins/' + plugin_name + '.js') 54 | } 55 | await setPlugin(plugin_name, url) 56 | msg += `${pluginsList(res.body).join(',')}\n` 57 | } 58 | } catch (error) { 59 | await message.send(`${error}\n${url}`) 60 | } 61 | } 62 | await message.send(`_Newly installed plugins are : ${msg.trim()}_`) 63 | } 64 | ) 65 | 66 | bot( 67 | { 68 | pattern: 'remove ?(.*)', 69 | fromMe: true, 70 | desc: 'Delete External Plugins', 71 | type: 'plugin', 72 | }, 73 | async (message, match) => { 74 | if (!match) 75 | return await message.send('*Example :*\nremove mforward\nremove all') 76 | // const buttons = [{ text: 'REBOOT', id: 'reboot' }] 77 | // if (PLATFORM == 'heroku') buttons.push({ text: 'RESTART', id: 'restart' }) 78 | if (match == 'all') { 79 | const plugins = await getPlugin() 80 | for (const plugin of plugins) { 81 | const paths = path.join(__dirname, '../plugins/' + plugin.name + '.js') 82 | try { 83 | await delPlugin(plugin.name) 84 | delete require.cache[require.resolve(paths)] 85 | unlinkSync(paths) 86 | } catch (error) {} 87 | } 88 | } else { 89 | const isDeleted = await delPlugin(match) 90 | if (!isDeleted) return await message.send(`*Plugin ${match} not found*`) 91 | const paths = path.join(__dirname, '../plugins/' + match + '.js') 92 | delete require.cache[require.resolve(paths)] 93 | unlinkSync(paths) 94 | } 95 | return await message.send(`_Plugins deleted, Restart BOT_`) 96 | // return await message.send( 97 | // await genButtonMessage(buttons, '_Plugin Deleted_'), 98 | // {}, 99 | // 'button' 100 | // ) 101 | } 102 | ) 103 | -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | const toBool = (x) => x == 'true' 2 | const { Sequelize } = require('sequelize') 3 | const { existsSync } = require('fs') 4 | const path = require('path') 5 | const configPath = path.join(__dirname, './config.env') 6 | const databasePath = path.join(__dirname, './database.db') 7 | if (existsSync(configPath)) require('dotenv').config({ path: configPath }) 8 | const DATABASE_URL = 9 | process.env.DATABASE_URL === undefined ? databasePath : process.env.DATABASE_URL 10 | module.exports = { 11 | VERSION: require('./package.json').version, 12 | SESSION_ID: (process.env.SESSION_ID || '').trim(), 13 | DATABASE: 14 | DATABASE_URL === databasePath 15 | ? new Sequelize({ 16 | dialect: 'sqlite', 17 | storage: DATABASE_URL, 18 | logging: false, 19 | }) 20 | : new Sequelize(DATABASE_URL, { 21 | dialect: 'postgres', 22 | ssl: true, 23 | protocol: 'postgres', 24 | dialectOptions: { 25 | native: true, 26 | ssl: { require: true, rejectUnauthorized: false }, 27 | }, 28 | logging: false, 29 | }), 30 | HANDLERS: (process.env.PREFIX || '^[.,!]').trim(), 31 | SUDO: process.env.SUDO || '', 32 | HEROKU_APP_NAME: process.env.HEROKU_APP_NAME, 33 | HEROKU_API_KEY: process.env.HEROKU_API_KEY, 34 | BRANCH: 'master', 35 | STICKER_PACKNAME: process.env.STICKER_PACKNAME || '❤️,LyFE', 36 | ALWAYS_ONLINE: toBool(process.env.ALWAYS_ONLINE), 37 | LOG_MSG: toBool(process.env.LOG_MSG) || false, 38 | RMBG_KEY: process.env.RMBG_KEY || 'null', 39 | BAILEYS_LOG_LVL: process.env.BAILEYS_LOG_LVL || 'silent', 40 | LANG: (process.env.LANGUAG || 'en').toLowerCase(), 41 | WARN_LIMIT: process.env.WARN_LIMIT || 3, 42 | FORCE_LOGOUT: toBool(process.env.FORCE_LOGOUT), 43 | BRAINSHOP: process.env.BRAINSHOP || '159501,6pq8dPiYt7PdqHz3', 44 | DIS_BOT: process.env.DISABLE_BOT || 'null', 45 | ANTILINK_MSG: process.env.ANTILINK_MSG || '_Antilink Detected &mention kicked_', 46 | ANTISPAM_MSG: process.env.ANTISPAM_MSG || '_Antispam Detected &mention kicked_', 47 | ANTIWORDS_MSG: process.env.ANTIWORDS_MSG || '_AntiWord Detected &mention kicked_', 48 | ANTIWORDS: process.env.ANTIWORDS || 'word', 49 | MENTION: process.env.MENTION || '', 50 | MAX_UPLOAD: process.env.MAX_UPLOAD || 230, 51 | REJECT_CALL: toBool(process.env.REJECT_CALL), 52 | VPS: toBool(process.env.VPS), 53 | AUTO_STATUS_VIEW: (process.env.AUTO_STATUS_VIEW || 'false').trim(), 54 | SEND_READ: toBool(process.env.SEND_READ), 55 | KOYEB: toBool(process.env.KOYEB), 56 | KOYEB_NAME: (process.env.KOYEB_NAME || '').trim(), 57 | KOYEB_API: (process.env.KOYEB_API || '').trim(), 58 | AJOIN: toBool(process.env.AJOIN), 59 | GPT: (process.env.GPT || 'free').trim(), 60 | MODEL: (process.env.MODEL || 'gpt-3.5-turbo').trim(), 61 | APPROVE: (process.env.APPROVE || '').trim(), 62 | ANTI_DELETE: (process.env.ANTI_DELETE || 'null').trim(), 63 | PERSONAL_MESSAGE: process.env.PERSONAL_MESSAGE || 'null', 64 | DISABLE_START_MESSAGE: process.env.DISABLE_START_MESSAGE 65 | ? toBool(process.env.DISABLE_START_MESSAGE) 66 | : false, 67 | ANTI_BOT: (process.env.ANTI_BOT || 'off').trim(), 68 | ANTI_BOT_MESSAGE: process.env.ANTI_BOT_MESSAGE || '&mention removed', 69 | WARN_MESSAGE: 70 | process.env.WARN_MESSAGE || 71 | '⚠️WARNING⚠️\n*User :* &mention\n*Warn :* &warn\n*Remaining :* &remaining', 72 | WARN_RESET_MESSAGE: 73 | process.env.WARN_RESET_MESSAGE || `WARN RESET\nUser : &mention\nRemaining : &remaining`, 74 | WARN_KICK_MESSAGE: process.env.WARN_KICK_MESSAGE || '&mention kicked', 75 | TRUECALLER: process.env.TRUECALLER, 76 | DELETE_TYPE: (process.env.DELETE_TYPE || '').trim(), 77 | LIST_TYPE: (process.env.LIST_TYPE || 'poll').trim(), 78 | BING_COOKIE: (process.env.BING_COOKIE || '').trim(), 79 | GEMINI_API_KEY: (process.env.GEMINI_API_KEY || '').trim(), 80 | ADMINS: process.env.GROUP_ADMINS || '', 81 | } 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Levanter Md in Termux 2 | 3 | Simple deployment 4 | 5 | ## Setup 6 | 1. First above all, install Termux Apk. Click [Here](https://termux.en.uptodown.com/android/post-download/106885413) to download. 7 | 8 | 2. Open Termux App info and Allow access to Files and Media: 9 | 10 | 3. Make sure you have Ubuntu Installed in your termux 11 | 12 | First step below 👇👇👇 13 | 14 | 1 . Run below cmd / to Open Ubuntu in termux: 15 | 16 | bash start-ubuntu.sh 17 | 18 | 2. after Install git, ffmpeg, and curl: 19 | 20 | apt -y update && apt -y upgrade 21 | apt -y install git ffmpeg curl 22 | 23 | 3. run below 👇 cmd to Install nodejs: 24 | 25 | curl -fsSl https://deb.nodesource.com/setup_lts.x | bash - && apt -y install nodejs 26 | 27 | 4. Update nodejs version in termux: 28 | 29 | npm install -g npm@10.8.0 30 | 31 | 5. run below 👇 cmd to Install yarn: 32 | 33 | npm install -g yarn 34 | 35 | 6. Install pm2 in termux: 36 | 37 | yarn global add pm2 38 | 39 | 7. Clone the repository and install packages: 40 | 41 | git clone https://github.com/lyfe00011/whatsapp-bot-md botName 42 | cd botName 43 | yarn install --network-concurrency 1 44 | 45 | 8. After you clone above repo click the below 👇 Link to get your session id using pairing code 46 | 47 | 48 | [Levanter](https://qr-hazel-alpha.vercel.app/session): 49 | 50 | 9. watch carefully after you get session I'd Edit below script by adding your session I'd and your number and some other necessary things 51 | 52 | echo "SESSION_ID = put session I'd here 53 | PREFIX = . 54 | STICKER_PACKNAME = Phantom 55 | ALWAYS_ONLINE = true 56 | RMBG_KEY = null 57 | LANGUAG = en 58 | WARN_LIMIT = 1 59 | FORCE_LOGOUT = false 60 | BRAINSHOP = 159501,6pq8dPiYt7PdqHz3 61 | MAX_UPLOAD = 200 62 | REJECT_CALL = true 63 | SUDO = 2348108395270 64 | TZ = Africa/Lagos 65 | VPS = true 66 | AUTO_STATUS_VIEW = no-dl 67 | SEND_READ = true 68 | AJOIN = true 69 | DISABLE_START_MESSAGE = false 70 | PERSONAL_MESSAGE = null" > config.env 71 | 72 | 10. after you edit copy all script above after you have add Your session id and the rest 73 | and paste in termux 74 | 75 | 11. To save, press Ctrl O then press Enter, press Ctrl X to exit. 76 | 77 | 12. Start the Bot: {After this, your bot should start running just copy below 👇 text and paste in termux then tap enter} 78 | 79 | pm2 start . --name botName --attach --time 80 | 81 | - You can leave it at this point, but if you want the bot to run even on offline mode: Do as below 82 | 83 | 13. Click acquire Wakelock in the Termux notification to enable it run in background. Exit both the ubuntu & Termux 84 | and that all 85 | 86 | 87 | 88 | 89 | INCASE BOT STOP OR YOU MISTAKELY CLOSE CONNECTION FOLLOW BELOW 👇 STEP 90 | 1. open Termux again and copy and paste all command below 👇 91 | 92 | 1. first command 93 | 94 | bash start-ubuntu.sh 95 | 96 | 3. second command 97 | 98 | cd botName 99 | pm2 start . --name botName --attach --time 100 | 101 | 102 | 103 | 104 | 🛑 Stop bot:(Incase you wanna stop it): 105 | 106 | pm2 stop botName 107 | 108 | 109 | 110 | 111 | ### Thanks To 112 | 113 | - [Ndeleva](https://github.com/Ndelevamutua) for [Backend](https://github.com/Ndelevamutua/whatsapp) 114 | - [Muindi](https://github.com/muindi6602) for [Frontend](https://muindi6602.github.io/) 115 | 116 | ### Get me on: 117 | 118 | - [WhatsApp](https://wa.me/2348108395270) 119 | 120 | -------------------------------------------------------------------------------- /plugins/profile.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | getName, 4 | formatTime, 5 | jidToNum, 6 | getGids, 7 | parsedJid, 8 | isUser, 9 | isGroup, 10 | } = require('../lib/') 11 | const fm = true 12 | 13 | bot( 14 | { 15 | pattern: 'jid', 16 | fromMe: fm, 17 | desc: 'Give jid of chat/user', 18 | type: 'user', 19 | }, 20 | async (message, match) => { 21 | return await message.send(message.mention[0] || message.reply_message.jid || message.jid) 22 | } 23 | ) 24 | 25 | bot( 26 | { 27 | pattern: 'left', 28 | fromMe: fm, 29 | dec: 'To leave from group', 30 | type: 'user', 31 | onlyGroup: true, 32 | }, 33 | async (message, match) => { 34 | if (match) await message.send(match) 35 | return await message.leftFromGroup(message.jid) 36 | } 37 | ) 38 | 39 | bot( 40 | { 41 | pattern: 'block', 42 | fromMe: fm, 43 | desc: 'Block a person', 44 | type: 'user', 45 | }, 46 | async (message, match) => { 47 | const id = message.mention[0] || message.reply_message.jid || (!message.isGroup && message.jid) 48 | if (!id) return await message.send('*Give me a person*') 49 | await message.send('_Blocked_') 50 | await message.Block(id) 51 | } 52 | ) 53 | 54 | bot( 55 | { 56 | pattern: 'unblock', 57 | fromMe: fm, 58 | desc: 'Unblock a person', 59 | type: 'user', 60 | }, 61 | async (message, match) => { 62 | const id = message.mention[0] || message.reply_message.jid || (!message.isGroup && message.jid) 63 | if (!id) return await message.send('*Give me a person*') 64 | await message.send('_Unblocked_') 65 | await message.Unblock(id) 66 | } 67 | ) 68 | 69 | bot( 70 | { 71 | pattern: 'pp', 72 | fromMe: fm, 73 | desc: 'Change Profile Picture', 74 | type: 'user', 75 | }, 76 | async (message, match) => { 77 | if (!message.reply_message || !message.reply_message.image) 78 | return await message.send('*Reply to a image*') 79 | await message.updateProfilePicture(await message.reply_message.downloadMediaMessage()) 80 | return await message.send('_Profile Picture Updated_') 81 | } 82 | ) 83 | 84 | bot( 85 | { 86 | pattern: 'whois ?(.*)', 87 | fromMe: fm, 88 | desc: 'To get PP and about', 89 | type: 'misc', 90 | }, 91 | async (message, match) => { 92 | match = parsedJid(match)[0] 93 | const gid = (isGroup(match) && match) || message.jid 94 | const id = (isUser(match) && match) || message.mention[0] || message.reply_message.jid 95 | let pp = '' 96 | try { 97 | pp = await message.profilePictureUrl(id || gid) 98 | } catch (error) { 99 | pp = 'https://cdn.wallpapersafari.com/0/83/zKyWb6.jpeg' 100 | } 101 | let caption = '' 102 | if (id) { 103 | try { 104 | const [res] = await message.fetchStatus(id) 105 | caption += `*Name :* ${await getName(gid, id)}\n*Num :* +${jidToNum(id)}\n*About :* ${ 106 | res.status 107 | }\n*setAt :* ${res.date}` 108 | } catch (error) {} 109 | } else { 110 | const { subject, size, creation, desc, owner } = await message.groupMetadata(gid, !!gid) 111 | caption += `*Name :* ${subject}\n*Owner :* ${owner ? '+' : ''}${jidToNum( 112 | owner 113 | )}\n*Members :* ${size}\n*Created :* ${formatTime(creation)}\n*Desc :* ${desc}` 114 | } 115 | return await message.sendFromUrl(pp, { caption }) 116 | } 117 | ) 118 | 119 | bot( 120 | { 121 | pattern: 'gjid', 122 | fromMe: fm, 123 | desc: 'List group jids', 124 | type: 'user', 125 | }, 126 | async (message, match) => { 127 | const gids = await message.getGids() 128 | let msg = '' 129 | let i = 1 130 | for (const gid in gids) { 131 | const name = gids[gid].subject 132 | msg += `*${i}.* *${name} :* ${gid}\n\n` 133 | i++ 134 | } 135 | await message.send(msg.trim()) 136 | } 137 | ) 138 | -------------------------------------------------------------------------------- /plugins/_menu.js: -------------------------------------------------------------------------------- 1 | const bot = require('../lib/events') 2 | const { addSpace, textToStylist, PREFIX, getUptime, PLUGINS, getRam } = require('../lib/') 3 | const { VERSION } = require('../config') 4 | bot.addCommand( 5 | { 6 | pattern: 'help ?(.*)', 7 | fromMe: true, 8 | dontAddCommandList: true, 9 | }, 10 | async (message, match) => { 11 | const sorted = bot.commands.sort((a, b) => { 12 | if (a.name && b.name) { 13 | return a.name.localeCompare(b.name) 14 | } 15 | return 0 16 | }) 17 | const date = new Date() 18 | let CMD_HELP = `╭────────────────╮ 19 | ʟᴇᴠᴀɴᴛᴇʀ 20 | ╰────────────────╯ 21 | 22 | ╭──────────────── 23 | │ Prefix : ${PREFIX} 24 | │ User : ${message.pushName} 25 | │ Time : ${date.toLocaleTimeString()} 26 | │ Day : ${date.toLocaleString('en', { weekday: 'long' })} 27 | │ Date : ${date.toLocaleDateString('hi')} 28 | │ Version : ${VERSION} 29 | │ Plugins : ${PLUGINS.count} 30 | │ Ram : ${getRam()} 31 | │ Uptime : ${getUptime('t')} 32 | ╰──────────────── 33 | ╭──────────────── 34 | ` 35 | sorted.map(async (command, i) => { 36 | if (command.dontAddCommandList === false && command.pattern !== undefined) { 37 | CMD_HELP += `│ ${i + 1} ${addSpace(i + 1, sorted.length)}${textToStylist( 38 | command.name.toUpperCase(), 39 | 'mono' 40 | )}\n` 41 | } 42 | }) 43 | 44 | CMD_HELP += `╰────────────────` 45 | return await message.send('```' + CMD_HELP + '```') 46 | } 47 | ) 48 | 49 | bot.addCommand( 50 | { 51 | pattern: 'list ?(.*)', 52 | fromMe: true, 53 | dontAddCommandList: true, 54 | }, 55 | async (message, match) => { 56 | let msg = '' 57 | const sorted = bot.commands.sort((a, b) => { 58 | if (a.name && b.name) { 59 | return a.name.localeCompare(b.name) 60 | } 61 | return 0 62 | }) 63 | sorted.map(async (command, index) => { 64 | if (command.dontAddCommandList === false && command.pattern !== undefined) { 65 | msg += `${index + 1} ${command.name}\n${command.desc}\n\n` 66 | } 67 | }) 68 | await message.send('```' + msg.trim() + '```') 69 | } 70 | ) 71 | bot.addCommand( 72 | { 73 | pattern: 'menu ?(.*)', 74 | fromMe: true, 75 | dontAddCommandList: true, 76 | }, 77 | async (message, match) => { 78 | const commands = {} 79 | bot.commands.map(async (command, index) => { 80 | if (command.dontAddCommandList === false && command.pattern !== undefined) { 81 | let cmdType = command.type.toLowerCase() 82 | if (!commands[cmdType]) commands[cmdType] = [] 83 | let isDiabled = command.active === false 84 | let cmd = command.name.trim() 85 | commands[cmdType].push(isDiabled ? cmd + ' [disabled]' : cmd) 86 | } 87 | }) 88 | const date = new Date() 89 | let msg = `\`\`\`╭═══ LEVANTER ═══⊷ 90 | ┃❃╭────────────── 91 | ┃❃│ Prefix : ${PREFIX} 92 | ┃❃│ User : ${message.pushName} 93 | ┃❃│ Time : ${date.toLocaleTimeString()} 94 | ┃❃│ Day : ${date.toLocaleString('en', { weekday: 'long' })} 95 | ┃❃│ Date : ${date.toLocaleDateString('hi')} 96 | ┃❃│ Version : ${VERSION} 97 | ┃❃│ Plugins : ${PLUGINS.count} 98 | ┃❃│ Ram : ${getRam()} 99 | ┃❃│ Uptime : ${getUptime('t')} 100 | ┃❃╰─────────────── 101 | ╰═════════════════⊷\`\`\`\n` 102 | 103 | if (match && commands[match]) { 104 | msg += ` ╭─❏ ${textToStylist(match.toLowerCase(), 'smallcaps')} ❏\n` 105 | for (const plugin of commands[match]) 106 | msg += ` │ ${textToStylist(plugin.toUpperCase(), 'mono')}\n` 107 | msg += ` ╰─────────────────` 108 | 109 | return await message.send(msg) 110 | } 111 | for (const command in commands) { 112 | msg += ` ╭─❏ ${textToStylist(command.toLowerCase(), 'smallcaps')} ❏\n` 113 | for (const plugin of commands[command]) 114 | msg += ` │ ${textToStylist(plugin.toUpperCase(), 'mono')}\n` 115 | msg += ` ╰─────────────────\n` 116 | } 117 | await message.send(msg.trim()) 118 | } 119 | ) 120 | -------------------------------------------------------------------------------- /plugins/heroku.js: -------------------------------------------------------------------------------- 1 | const got = require('got') 2 | const Heroku = require('heroku-client') 3 | const { 4 | secondsToHms, 5 | isUpdate, 6 | updateNow, 7 | bot, 8 | // genButtonMessage, 9 | } = require('../lib/') 10 | const Config = require('../config') 11 | const heroku = new Heroku({ token: Config.HEROKU_API_KEY }) 12 | const baseURI = '/apps/' + Config.HEROKU_APP_NAME 13 | 14 | if (Config.HEROKU_API_KEY && Config.HEROKU_APP_NAME) { 15 | bot( 16 | { 17 | pattern: 'restart', 18 | fromMe: true, 19 | desc: 'Restart Dyno', 20 | type: 'heroku', 21 | }, 22 | async (message, match) => { 23 | await message.send(`_Restarting_`) 24 | await heroku.delete(baseURI + '/dynos').catch(async (error) => { 25 | await message.send(`HEROKU : ${error.body.message}`) 26 | }) 27 | } 28 | ) 29 | 30 | bot( 31 | { 32 | pattern: 'shutdown', 33 | fromMe: true, 34 | desc: 'Dyno off', 35 | type: 'heroku', 36 | }, 37 | async (message, match) => { 38 | await heroku 39 | .get(baseURI + '/formation') 40 | .then(async (formation) => { 41 | await message.send(`_Shuttind down._`) 42 | await heroku.patch(baseURI + '/formation/' + formation[0].id, { 43 | body: { 44 | quantity: 0, 45 | }, 46 | }) 47 | }) 48 | .catch(async (error) => { 49 | await message.send(`HEROKU : ${error.body.message}`) 50 | }) 51 | } 52 | ) 53 | 54 | bot( 55 | { 56 | pattern: 'dyno', 57 | fromMe: true, 58 | desc: 'Show Quota info', 59 | type: 'heroku', 60 | }, 61 | async (message, match) => { 62 | try { 63 | heroku 64 | .get('/account') 65 | .then(async (account) => { 66 | const url = `https://api.heroku.com/accounts/${account.id}/actions/get-quota` 67 | headers = { 68 | 'User-Agent': 'Chrome/80.0.3987.149 Mobile Safari/537.36', 69 | Authorization: 'Bearer ' + Config.HEROKU_API_KEY, 70 | Accept: 'application/vnd.heroku+json; version=3.account-quotas', 71 | } 72 | const res = await got(url, { headers }) 73 | const resp = JSON.parse(res.body) 74 | const total_quota = Math.floor(resp.account_quota) 75 | const quota_used = Math.floor(resp.quota_used) 76 | const remaining = total_quota - quota_used 77 | const quota = `Total Quota : ${secondsToHms(total_quota)} 78 | Used Quota : ${secondsToHms(quota_used)} 79 | Remaning : ${secondsToHms(remaining)}` 80 | await message.send('```' + quota + '```') 81 | }) 82 | .catch(async (error) => { 83 | return await message.send(`HEROKU : ${error.body.message}`) 84 | }) 85 | } catch (error) { 86 | await message.send(error) 87 | } 88 | } 89 | ) 90 | } 91 | 92 | bot( 93 | { 94 | pattern: 'update$', 95 | fromMe: true, 96 | desc: 'Check new updates.', 97 | type: 'heroku', 98 | }, 99 | async (message, match) => { 100 | const update = await isUpdate() 101 | if (!update.length) return await message.send('*Bot is up-to-date.*') 102 | await message.send( 103 | `${update.length} updates\n\n${update.join('\n').trim()}` 104 | ) 105 | // return await message.send( 106 | // await genButtonMessage( 107 | // [{ id: 'update now', text: 'UPDATE NOW' }], 108 | // `*Updates*\n${update.join('\n').trim()}`, 109 | // `${update.length} updates` 110 | // ), 111 | // {}, 112 | // 'button' 113 | // ) 114 | } 115 | ) 116 | 117 | bot( 118 | { 119 | pattern: 'update now$', 120 | fromMe: true, 121 | desc: 'To-Up-Date bot.', 122 | type: 'heroku', 123 | }, 124 | async (message, match) => { 125 | const isupdate = await isUpdate() 126 | if (!isupdate.length) 127 | return await message.send('*Bot is up-to-date.*\n*Nothing to Update.*') 128 | await message.send('_Updating..._') 129 | const e = await updateNow() 130 | if (e) return await message.send(e) 131 | return await message.send('_Updated_') 132 | } 133 | ) 134 | -------------------------------------------------------------------------------- /plugins/gfilters.js: -------------------------------------------------------------------------------- 1 | const { getFilter, bot, setFilter, deleteFilter } = require('../lib') 2 | const fm = true 3 | 4 | bot( 5 | { 6 | pattern: 'gstop ?(.*)', 7 | fromMe: fm, 8 | desc: 'Delete gfilters in all group', 9 | type: 'autoReply', 10 | }, 11 | async (message, match) => { 12 | if (!match) return await message.send(`*Example : gstop hi*`) 13 | const isDel = await deleteFilter('gfilter', match) 14 | if (!isDel) return await message.send(`_${match} not found in gfilters_`) 15 | return await message.send(`_${match} deleted._`) 16 | } 17 | ) 18 | 19 | bot( 20 | { 21 | pattern: 'pstop ?(.*)', 22 | fromMe: fm, 23 | desc: 'Delete pfilters in all chat', 24 | type: 'autoReply', 25 | }, 26 | async (message, match) => { 27 | if (!match) return await message.send(`*Example : pstop hi*`) 28 | const isDel = await deleteFilter('pfilter', match) 29 | if (!isDel) return await message.send(`_${match} not found in pfilters_`) 30 | return await message.send(`_${match} deleted._`) 31 | } 32 | ) 33 | 34 | bot( 35 | { 36 | pattern: 'gfilter ?(.*)', 37 | fromMe: fm, 38 | desc: 'gfilter in all groups', 39 | type: 'autoReply', 40 | }, 41 | async (message, match) => { 42 | match = match.match(/[\'\"](.*?)[\'\"]/gms) 43 | if (!match) { 44 | const filters = await getFilter('gfilter') 45 | if (!filters) 46 | return await message.send(`_Not set any filter_\n*Example gfilter 'hi' 'hello'*`) 47 | let msg = '' 48 | filters.map(({ pattern }) => { 49 | msg += `=> ${pattern} \n` 50 | }) 51 | return await message.send(msg.trim()) 52 | } else { 53 | if (match.length < 2) { 54 | return await message.send(`Example gfilter 'hi' 'hello'`) 55 | } 56 | const k = match[0].replace(/['"]+/g, '') 57 | const v = match[1].replace(/['"]+/g, '') 58 | await setFilter('gfilter', k, v, match[0][0] === "'" ? true : false) 59 | await message.send(`_${k}_ added to gfilters.`) 60 | } 61 | } 62 | ) 63 | 64 | bot( 65 | { 66 | pattern: 'pfilter ?(.*)', 67 | fromMe: fm, 68 | desc: 'pfilter in all chat', 69 | type: 'autoReply', 70 | }, 71 | async (message, match) => { 72 | match = match.match(/[\'\"](.*?)[\'\"]/gms) 73 | if (!match) { 74 | const filters = await getFilter('pfilter') 75 | if (!filters) 76 | return await message.send(`_Not set any filter_\n*Example pfilter 'hi' 'hello'*`) 77 | let msg = '' 78 | filters.map(({ pattern }) => { 79 | msg += `=> ${pattern} \n` 80 | }) 81 | return await message.send(msg.trim()) 82 | } else { 83 | if (match.length < 2) { 84 | return await message.send(`Example pfilter 'hi' 'hello'`) 85 | } 86 | const k = match[0].replace(/['"]+/g, '') 87 | const v = match[1].replace(/['"]+/g, '') 88 | await setFilter('pfilter', k, v, match[0][0] === "'" ? true : false) 89 | await message.send(`_${k}_ added to pfilters.`) 90 | } 91 | } 92 | ) 93 | 94 | bot( 95 | { 96 | on: 'text', 97 | fromMe: false, 98 | type: 'gfilter', 99 | onlyGroup: true, 100 | }, 101 | async (message, match) => { 102 | const filters = await getFilter('gfilter') 103 | if (filters) 104 | filters.map(async ({ pattern, regex, text }) => { 105 | pattern = new RegExp(`(?:^|\\W)${pattern}(?:$|\\W)`, 'i') 106 | if (pattern.test(message.text)) { 107 | await message.send(text, { 108 | quoted: message.data, 109 | }) 110 | } 111 | }) 112 | } 113 | ) 114 | 115 | bot( 116 | { 117 | on: 'text', 118 | fromMe: false, 119 | type: 'pfilter', 120 | }, 121 | async (message, match) => { 122 | if (!message.isGroup) { 123 | const filters = await getFilter('pfilter') 124 | if (filters) 125 | filters.map(async ({ pattern, regex, text }) => { 126 | pattern = new RegExp(`(?:^|\\W)${pattern}(?:$|\\W)`, 'i') 127 | if (pattern.test(message.text)) { 128 | await message.send(text, { 129 | quoted: message.data, 130 | }) 131 | } 132 | }) 133 | } 134 | } 135 | ) 136 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "levanter@5.2.3", 3 | "description": "", 4 | "keywords": ["noedjs"], 5 | "success_url": "/", 6 | "env": { 7 | "ALWAYS_ONLINE": { 8 | "description": "show bot number last seen as online", 9 | "required": false, 10 | "value": "false" 11 | }, 12 | "LOG_MSG": { 13 | "description": "Show whatsapp msgs in log", 14 | "required": false, 15 | "value": "false" 16 | }, 17 | "SUDO": { 18 | "description": "admin", 19 | "required": false, 20 | "value": "" 21 | }, 22 | "PREFIX": { 23 | "description": "prefix, check for more", 24 | "required": false, 25 | "value": "." 26 | }, 27 | "SESSION_ID": { 28 | "description": "session id", 29 | "required": true, 30 | "value": "" 31 | }, 32 | "STICKER_PACKNAME": { 33 | "description": "sticker pack info", 34 | "required": false, 35 | "value": "❤️,LyFE" 36 | }, 37 | "HEROKU_APP_NAME": { 38 | "description": "Heroku app name, same as above entered.", 39 | "required": true 40 | }, 41 | "HEROKU_API_KEY": { 42 | "description": "Heroku account api key, https://dashboard.heroku.com/account", 43 | "required": true 44 | }, 45 | "RMBG_KEY": { 46 | "description": "API key from remove.bg, required for plugin rmbg", 47 | "required": false, 48 | "value": "null" 49 | }, 50 | "LANGUAG": { 51 | "description": "Default Language for tts or trt", 52 | "required": false, 53 | "value": "en" 54 | }, 55 | "WARN_LIMIT": { 56 | "description": "Maximum number of wanings to a person.", 57 | "required": false, 58 | "value": "3" 59 | }, 60 | "FORCE_LOGOUT": { 61 | "description": "In Some scenario have to logout web, Only such case make this true and back to false after logout.", 62 | "required": false, 63 | "value": "false" 64 | }, 65 | "DISABLE_BOT": { 66 | "description": "Example : jid,jid,... where bot not works in both ways.", 67 | "required": false, 68 | "value": "null" 69 | }, 70 | "ANTILINK_MSG": { 71 | "description": "Message send when antilink and action is kick.", 72 | "required": false, 73 | "value": "_Antilink Detected &mention kicked_" 74 | }, 75 | "ANTISPAM_MSG": { 76 | "description": "Message send when antispam.", 77 | "required": false, 78 | "value": "_Antispam Detected &mention kicked_" 79 | }, 80 | "ANTIWORDS_MSG": { 81 | "description": "Message send when antiword.", 82 | "required": false, 83 | "value": "_Antiword Detected &mention kicked_" 84 | }, 85 | "ANTIWORDS": { 86 | "description": "words that not allowed in chats.", 87 | "required": false, 88 | "value": "word1,word2,word3" 89 | }, 90 | "SS_TOKEN": { 91 | "description": "token from https://app.screenshotapi.net/dashboard", 92 | "required": false, 93 | "value": "" 94 | }, 95 | "REJECT_CALL": { 96 | "description": "auto reject call, if set as true", 97 | "required": false, 98 | "value": "false" 99 | }, 100 | "AUTO_STATUS_VIEW": { 101 | "description": "view others status", 102 | "required": false, 103 | "value": "false" 104 | }, 105 | "SEND_READ": { 106 | "description": "send blue tick", 107 | "required": false, 108 | "value": "false" 109 | }, 110 | "AJOIN": { 111 | "description": "Accept Group join request(Group privacy)", 112 | "required": false, 113 | "value": "true" 114 | }, 115 | "PERSONAL_MESSAGE": { 116 | "description": "Send a Welcome message on personal chat", 117 | "required": false, 118 | "value": "null" 119 | }, 120 | "DISABLE_START_MESSAGE": { 121 | "description": "Disable start Message", 122 | "required": false, 123 | "value": "false" 124 | } 125 | }, 126 | "addons": [ 127 | { 128 | "plan": "heroku-postgresql:basic" 129 | } 130 | ], 131 | 132 | "buildpacks": [{ "url": "https://github.com/heroku/heroku-buildpack-nodejs#latest" }], 133 | "formation": { 134 | "web": { 135 | "quantity": 1, 136 | "size": "basic" 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /plugins/yts.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | yts, 4 | song, 5 | video, 6 | addAudioMetaData, 7 | // genListMessage, 8 | generateList, 9 | } = require('../lib/') 10 | const ytIdRegex = 11 | /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed|shorts\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/ 12 | 13 | bot( 14 | { 15 | pattern: 'yts ?(.*)', 16 | fromMe: true, 17 | desc: 'YT search', 18 | type: 'search', 19 | }, 20 | async (message, match) => { 21 | if (!match) return await message.send('*Example : yts baymax*') 22 | const vid = ytIdRegex.exec(match) 23 | if (vid) { 24 | const result = await yts(vid[1], true) 25 | const { title, description, duration, view, published } = result[0] 26 | return await message.send( 27 | `*Title :* ${title}\n*Time :* ${duration}\n*Views :* ${view}\n*Publish :* ${published}\n*Desc :* ${description}` 28 | ) 29 | } 30 | const result = await yts(match) 31 | const msg = result 32 | .map( 33 | ({ title, id, view, duration, published, author }) => 34 | `• *${title.trim()}*\n*Views :* ${view}\n*Time :* ${duration}\n*Author :* ${author}\n*Published :* ${published}\n*Url :* https://www.youtube.com/watch?v=${id}\n\n` 35 | ) 36 | .join('') 37 | 38 | return await message.send(msg.trim()) 39 | } 40 | ) 41 | 42 | bot( 43 | { 44 | pattern: 'song ?(.*)', 45 | fromMe: true, 46 | desc: 'download yt song', 47 | type: 'download', 48 | }, 49 | async (message, match) => { 50 | match = match || message.reply_message.text 51 | if (!match) return await message.send('*Example : song indila love story/ yt link*') 52 | const vid = ytIdRegex.exec(match) 53 | if (vid) { 54 | const _song = await song(vid[1]) 55 | if (!_song) return await message.send('*not found*') 56 | const [result] = await yts(vid[1], true) 57 | const { author, title, thumbnail } = result 58 | const meta = title ? await addAudioMetaData(_song, title, author, '', thumbnail.url) : _song 59 | return await message.send( 60 | meta, 61 | { quoted: message.data, mimetype: 'audio/mpeg', fileName: `${title}.mp3` }, 62 | 'audio' 63 | ) 64 | } 65 | const result = await yts(match, 0, 1) 66 | if (!result.length) return await message.send(`_Not result for_ *${match}*`) 67 | const msg = generateList( 68 | result.map(({ title, id, duration, author, album }) => ({ 69 | _id: `🆔&id\n`, 70 | text: `🎵${title}\n🕒${duration}\n👤${author}\n📀${album}\n\n`, 71 | id: `song https://www.youtube.com/watch?v=${id}`, 72 | })), 73 | `Searched ${match} and Found ${result.length} results\nsend 🆔 to download song.\n`, 74 | message.jid, 75 | message.participant 76 | ) 77 | return await message.send(msg.message, { quoted: message.data }, msg.type) 78 | // return await message.send( 79 | // genListMessage( 80 | // result.map(({ title, id, duration }) => ({ 81 | // text: title, 82 | // id: `song https://www.youtube.com/watch?v=${id}`, 83 | // desc: duration, 84 | // })), 85 | // `Searched ${match}\nFound ${result.length} results`, 86 | // 'DOWNLOAD' 87 | // ), 88 | // {}, 89 | // 'list' 90 | // ) 91 | } 92 | ) 93 | 94 | bot( 95 | { 96 | pattern: 'video ?(.*)', 97 | fromMe: true, 98 | desc: 'download yt video', 99 | type: 'download', 100 | }, 101 | async (message, match) => { 102 | match = match || message.reply_message.text 103 | if (!match) return await message.send('*Example : video yt_url*') 104 | const vid = ytIdRegex.exec(match) 105 | if (!vid) { 106 | const result = await yts(match) 107 | if (!result.length) return await message.send(`_Not result for_ *${match}*`) 108 | const msg = generateList( 109 | result.map(({ title, id, duration, view }) => ({ 110 | text: `${title}\nduration : ${duration}\nviews : ${view}\n`, 111 | id: `video https://www.youtube.com/watch?v=${id}`, 112 | })), 113 | `Searched ${match}\nFound ${result.length} results`, 114 | message.jid, 115 | message.participant 116 | ) 117 | return await message.send(msg.message, { quoted: message.data }, msg.type) 118 | } 119 | return await message.send( 120 | await video(vid[1]), 121 | { quoted: message.data, fileName: `${vid[1]}.mp4` }, 122 | 'video' 123 | ) 124 | } 125 | ) 126 | -------------------------------------------------------------------------------- /plugins/msgs.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | getMsg, 4 | jidToNum, 5 | resetMsgs, 6 | getFloor, 7 | sleep, 8 | secondsToHms, 9 | isAdmin, 10 | addSpace, 11 | } = require('../lib') 12 | 13 | bot( 14 | { 15 | pattern: 'msgs ?(.*)', 16 | fromMe: true, 17 | desc: 'shows groups message count', 18 | type: 'group', 19 | onlyGroup: true, 20 | }, 21 | async (message, match) => { 22 | const user = message.mention[0] || message.reply_message.jid 23 | const participants = await getMsg(message.jid, user) 24 | let msg = '' 25 | const now = new Date().getTime() 26 | if (user) { 27 | msg += `*Number :* ${jidToNum(user)}\n*Name :* ${ 28 | participants.name || '' 29 | }\n*Total Msgs :* ${participants.total}\n` 30 | const { items } = participants 31 | for (const item in items) msg += `*${item} :* ${items[item]}\n` 32 | msg += `*lastSeen :* ${ 33 | secondsToHms((now - participants.time) / 1000) || 0 34 | } ago\n\n` 35 | } else { 36 | for (const participant in participants) { 37 | msg += `*Number :* ${jidToNum(participant)}\n*Name :* ${ 38 | participants[participant].name || '' 39 | }\n*Total Msgs :* ${participants[participant].total}\n` 40 | const { items } = participants[participant] 41 | for (const item in items) msg += `*${item} :* ${items[item]}\n` 42 | msg += `*lastSeen :* ${ 43 | secondsToHms((now - participants[participant].time) / 1000) || 0 44 | } ago\n\n` 45 | } 46 | } 47 | await message.send(msg.trim()) 48 | } 49 | ) 50 | 51 | bot( 52 | { 53 | pattern: 'reset ?(.*)', 54 | fromMe: true, 55 | desc: 'reset groups message count', 56 | type: 'group', 57 | onlyGroup: true, 58 | }, 59 | async (message, match) => { 60 | const user = message.reply_message.jid || message.mention[0] 61 | if (!user && match != 'all') 62 | return await message.send( 63 | '*Example :*\nreset all\nreset mention/reply a person' 64 | ) 65 | if (match == 'all') { 66 | await resetMsgs(message.jid) 67 | return await message.send('_Everyones message count deleted._') 68 | } 69 | await resetMsgs(message.jid, user) 70 | return await message.send(`_@${jidToNum(user)} message count deleted._`, { 71 | contextInfo: { mentionedJid: [user] }, 72 | }) 73 | } 74 | ) 75 | 76 | bot( 77 | { 78 | pattern: 'inactive ?(.*)', 79 | fromMe: true, 80 | desc: 'show/kick who message count not met', 81 | type: 'group', 82 | onlyGroup: true, 83 | }, 84 | async (message, match) => { 85 | const members = await message.groupMetadata(message.jid) 86 | const membersJids = members.map(({ id }) => id) 87 | const [type, count, kickOrType, COUNT, KICK] = match.split(' ') 88 | if ( 89 | !type || 90 | !count || 91 | (type.toLowerCase() != 'total' && type.toLowerCase() != 'day') || 92 | isNaN(count) || 93 | (kickOrType && kickOrType != 'total' && kickOrType != 'kick') || 94 | (COUNT && isNaN(COUNT)) 95 | ) 96 | return await message.send( 97 | `*Example :*\ninactive day 10\ninactive day 10 kick\ninactive total 100\ninactive total 100 kick\ninactive day 7 total 150\ninactive day 7 total 150 kick\n\nif kick not mentioned, Just list` 98 | ) 99 | const participants = await getMsg(message.jid) 100 | const now = new Date().getTime() 101 | const inactive = [] 102 | for (const participant of membersJids) { 103 | if (!participants[participant]) inactive.push(participant) 104 | else if (kickOrType && kickOrType == 'total') { 105 | if ( 106 | participants[participant].total <= COUNT && 107 | getFloor((now - participants[participant].time) / 1000) / 86400 >= 108 | count 109 | ) 110 | inactive.push(participant) 111 | } else if (type == 'total') { 112 | if (participants[participant].total <= count) inactive.push(participant) 113 | } else { 114 | if ( 115 | getFloor((now - participants[participant].time) / 1000) / 86400 >= 116 | count 117 | ) 118 | inactive.push(participant) 119 | } 120 | } 121 | let msg = `_Total inactives are : ${inactive.length}_` 122 | if (inactive.length < 1) return await message.send(msg) 123 | if (kickOrType == 'kick' || KICK == 'kick') { 124 | const isImAdmin = await isAdmin(members, message.client.user.jid) 125 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 126 | await message.send( 127 | `_Removing ${inactive.length} inactive members in 7 seconds_` 128 | ) 129 | await sleep(7000) 130 | return await message.Kick(inactive) 131 | } 132 | for (let i = 0; i < inactive.length; i++) 133 | msg += `\n*${i + 1}.*${addSpace(i + 1, inactive.length)} @${jidToNum( 134 | inactive[i] 135 | )}` 136 | return await message.send(msg, { 137 | contextInfo: { mentionedJid: inactive }, 138 | }) 139 | } 140 | ) 141 | -------------------------------------------------------------------------------- /plugins/greetings.js: -------------------------------------------------------------------------------- 1 | const { 2 | enableGreetings, 3 | setMessage, 4 | deleteMessage, 5 | bot, 6 | getMessage, 7 | // genButtonMessage, 8 | greetingsPreview, 9 | clearGreetings, 10 | } = require('../lib/') 11 | 12 | bot( 13 | { 14 | pattern: 'welcome ?(.*)', 15 | fromMe: true, 16 | desc: 'Welcome new members', 17 | onlyGroup: true, 18 | type: 'group', 19 | }, 20 | async (message, match) => { 21 | const welcome = await getMessage(message.jid, 'welcome') 22 | if (!match && !welcome) return await message.send('*Example : welcome Hi &mention*') 23 | if (!match) { 24 | await message.send(welcome.message) 25 | const onOrOff = welcome && welcome.enabled ? 'on' : 'off' 26 | return await message.send( 27 | `Welcome is ${onOrOff}\n\nhttps://github.com/lyfe00011//whatsapp-bot-md/wiki/Greetings` 28 | ) 29 | // const button = await genButtonMessage( 30 | // [{ id: `welcome ${onOrOff}`, text: onOrOff.toUpperCase() }], 31 | // 'Example\nhttps://github.com/lyfe00011//whatsapp-bot-md/wiki/Greetings', 32 | // 'Welcome' 33 | // ) 34 | // return await message.send(button, {}, 'button') 35 | // return await message.send( 36 | // await genHydratedButtons( 37 | // [ 38 | // { 39 | // urlButton: { 40 | // text: 'Example', 41 | // url: 'https://github.com/lyfe00011//whatsapp-bot-md/wiki/Greetings', 42 | // }, 43 | // }, 44 | // { button: { id: 'welcome on', text: 'ON' } }, 45 | // { button: { id: 'welcome off', text: 'OFF' } }, 46 | // ], 47 | // 'Welcome' 48 | // ), 49 | // {}, 50 | // 'template' 51 | // ) 52 | } 53 | if (match == 'on' || match == 'off') { 54 | if (!welcome) return await message.send('*Example : welcome Hi #mention*') 55 | await enableGreetings(message.jid, 'welcome', match) 56 | return await message.send(`_Welcome ${match == 'on' ? 'Enabled' : 'Disabled'}_`) 57 | } 58 | if (match === 'delete') { 59 | await deleteMessage(message.jid, 'welcome') 60 | clearGreetings(message.jid, 'welcome') 61 | return await message.send('_Welcome deleted_') 62 | } 63 | await setMessage(message.jid, 'welcome', match) 64 | const { msg, options, type } = await greetingsPreview(message, 'welcome') 65 | await message.send(msg, options, type) 66 | return await message.send('_Welcome set_') 67 | } 68 | ) 69 | 70 | bot( 71 | { 72 | pattern: 'goodbye ?(.*)', 73 | fromMe: true, 74 | desc: 'Goodbye members', 75 | onlyGroup: true, 76 | type: 'group', 77 | }, 78 | async (message, match) => { 79 | const welcome = await getMessage(message.jid, 'goodbye') 80 | if (!match && !welcome) return await message.send('*Example : goodbye Bye &mention*') 81 | if (!match) { 82 | await message.send(welcome.message) 83 | const onOrOff = welcome && welcome.enabled ? 'on' : 'off' 84 | return await message.send( 85 | `Goodbye is ${onOrOff}\n\nhttps://github.com/lyfe00011//whatsapp-bot-md/wiki/Greetings` 86 | ) 87 | 88 | // const button = await genButtonMessage( 89 | // [{ id: `welcome ${onOrOff}`, text: onOrOff.toUpperCase() }], 90 | // 'Example\nhttps://github.com/lyfe00011//whatsapp-bot-md/wiki/Greetings', 91 | // 'Goodbye' 92 | // ) 93 | // return await message.send(button, {}, 'button') 94 | // return await message.send( 95 | // await genHydratedButtons( 96 | // [ 97 | // { 98 | // urlButton: { 99 | // url: 'https://github.com/lyfe00011/whatsapp-bot-md/wiki/Greetings', 100 | // text: 'Example', 101 | // }, 102 | // }, 103 | // { 104 | // button: { id: 'goodbye on', text: 'ON' }, 105 | // }, 106 | // { button: { id: 'goodbye off', text: 'OFF' } }, 107 | // ], 108 | // 'Goodbye' 109 | // ), 110 | // {}, 111 | // 'template' 112 | // ) 113 | } 114 | if (match == 'on' || match == 'off') { 115 | if (!welcome) return await message.send('*Example : goodbye Bye #mention*') 116 | await enableGreetings(message.jid, 'goodbye', match) 117 | return await message.send(`_Goodbye ${match == 'on' ? 'Enabled' : 'Disabled'}_`) 118 | } 119 | if (match === 'delete') { 120 | await deleteMessage(message.jid, 'goodbye') 121 | clearGreetings(message.jid, 'goodbye') 122 | return await message.send('_Goodbye deleted_') 123 | } 124 | await setMessage(message.jid, 'goodbye', match) 125 | const { msg, options, type } = await greetingsPreview(message, 'goodbye') 126 | await message.send(msg, options, type) 127 | return await message.send('_Goodbye set_') 128 | } 129 | ) 130 | -------------------------------------------------------------------------------- /plugins/misc.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | // genButtonMessage, 4 | setVar, 5 | } = require('../lib/') 6 | bot( 7 | { 8 | pattern: 'status ?(.*)', 9 | fromMe: true, 10 | desc: 'Auto Status view', 11 | type: 'whatsapp', 12 | }, 13 | async (message, match) => { 14 | if (!match) { 15 | return await message.send( 16 | '*Auto View WhatsApp Status*\nstatus on\nstatus off\nstatus no-dl\nstatus expect-view jid,jid,...\nstatus only-view jid,jid,...\nstatus hide-view' 17 | ) 18 | // const msg = await genButtonMessage( 19 | // [ 20 | // { 21 | // id: `status ${config.AUTO_STATUS_VIEW ? 'off' : 'on'}`, 22 | // text: config.AUTO_STATUS_VIEW ? 'DISABLE' : 'ENABLE', 23 | // }, 24 | // ], 25 | // `𝗔𝘂𝘁𝗼 𝘀𝘁𝗮𝘁𝘂𝘀 𝘃𝗶𝗲𝘄 𝗺𝗮𝗻𝗮𝗴𝗲𝗿`, 26 | // `Auto Status View ${config.AUTO_STATUS_VIEW ? 'Enabled' : 'Disabled'}` 27 | // ) 28 | // return await message.send(msg, {}, 'button') 29 | } 30 | try { 31 | await setVar({ 32 | AUTO_STATUS_VIEW: match == 'on' ? 'true' : match == 'off' ? 'false' : match, 33 | }) 34 | await message.send(`_Auto Status View ${match == 'off' ? 'Disabled' : 'Enabled'}_`) 35 | } catch (error) { 36 | await message.send(`${error}`, { 37 | quoted: message.data, 38 | }) 39 | } 40 | } 41 | ) 42 | 43 | bot( 44 | { 45 | pattern: 'call ?(.*)', 46 | fromMe: true, 47 | desc: 'Auto reject call Manager', 48 | type: 'whatsapp', 49 | }, 50 | async (message, match) => { 51 | if (!match) { 52 | return await message.send('*Auto Reject Calls*\ncall on | off') 53 | // const msg = await genButtonMessage( 54 | // [ 55 | // { 56 | // id: `call ${config.REJECT_CALL ? 'off' : 'on'}`, 57 | // text: config.REJECT_CALL ? 'DISABLE' : 'ENABLE', 58 | // }, 59 | // ], 60 | // `Auto Reject Call Manager`, 61 | // `Auto Reject ${config.REJECT_CALL ? 'Enabled' : 'Disabled'}` 62 | // ) 63 | // return await message.send(msg, {}, 'button') 64 | } 65 | if (match == 'on' || match == 'off') { 66 | try { 67 | await setVar({ 68 | REJECT_CALL: match == 'on' ? 'true' : 'false', 69 | }) 70 | await message.send(`_Auto Call Reject ${match == 'on' ? 'Enabled' : 'Disabled'}_`) 71 | } catch (error) { 72 | await message.send(`${error}`, { 73 | quoted: message.data, 74 | }) 75 | } 76 | } 77 | } 78 | ) 79 | 80 | bot( 81 | { 82 | pattern: 'read ?(.*)', 83 | fromMe: true, 84 | desc: 'Auto read Message', 85 | type: 'whatsapp', 86 | }, 87 | async (message, match) => { 88 | if (!match) { 89 | return await message.send('*Auto Read Messages*\nread on | off') 90 | // const msg = await genButtonMessage( 91 | // [ 92 | // { 93 | // id: `call ${config.REJECT_CALL ? 'off' : 'on'}`, 94 | // text: config.REJECT_CALL ? 'DISABLE' : 'ENABLE', 95 | // }, 96 | // ], 97 | // `Auto Reject Call Manager`, 98 | // `Auto Reject ${config.REJECT_CALL ? 'Enabled' : 'Disabled'}` 99 | // ) 100 | // return await message.send(msg, {}, 'button') 101 | } 102 | if (match == 'on' || match == 'off') { 103 | try { 104 | await setVar({ 105 | SEND_READ: match == 'on' ? 'true' : 'false', 106 | }) 107 | await message.send(`_Auto Read ${match == 'on' ? 'Enabled' : 'Disabled'}_`) 108 | } catch (error) { 109 | await message.send(`${error}`, { 110 | quoted: message.data, 111 | }) 112 | } 113 | } 114 | } 115 | ) 116 | 117 | bot( 118 | { 119 | pattern: 'online ?(.*)', 120 | fromMe: true, 121 | desc: 'Always Online', 122 | type: 'whatsapp', 123 | }, 124 | async (message, match) => { 125 | if (!match) { 126 | return await message.send('*Show always online*\nonline on | off') 127 | // const msg = await genButtonMessage( 128 | // [ 129 | // { 130 | // id: `call ${config.REJECT_CALL ? 'off' : 'on'}`, 131 | // text: config.REJECT_CALL ? 'DISABLE' : 'ENABLE', 132 | // }, 133 | // ], 134 | // `Auto Reject Call Manager`, 135 | // `Auto Reject ${config.REJECT_CALL ? 'Enabled' : 'Disabled'}` 136 | // ) 137 | // return await message.send(msg, {}, 'button') 138 | } 139 | if (match == 'on' || match == 'off') { 140 | try { 141 | await setVar({ 142 | ALWAYS_ONLINE: match == 'on' ? 'true' : 'false', 143 | }) 144 | await message.send(`_Always Online ${match == 'on' ? 'Enabled' : 'Disabled'}_`) 145 | } catch (error) { 146 | await message.send(`${error}`, { 147 | quoted: message.data, 148 | }) 149 | } 150 | } 151 | } 152 | ) 153 | -------------------------------------------------------------------------------- /plugins/mute.js: -------------------------------------------------------------------------------- 1 | const { 2 | bot, 3 | isAdmin, 4 | setMute, 5 | addTask, 6 | // genButtonMessage, 7 | c24to12, 8 | getMute, 9 | } = require('../lib') 10 | 11 | bot( 12 | { 13 | pattern: 'amute ?(.*)', 14 | fromMe: true, 15 | desc: 'auto group mute scheduler', 16 | type: 'group', 17 | onlyGroup: true, 18 | }, 19 | async (message, match) => { 20 | const participants = await message.groupMetadata(message.jid) 21 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 22 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 23 | let msg = message.reply_message.text || 'null' 24 | const [hour, min] = match.split(' ') 25 | if (hour == 'info') { 26 | const task = await getMute(message.jid, 'mute') 27 | if (!task) return await message.send('_Not Found AutoMute_') 28 | const { hour, minute, msg, enabled } = task 29 | return await message.send( 30 | `*Hour :* ${hour}\n*Minute :* ${minute}\n*Time :* ${c24to12( 31 | `${hour}:${minute}` 32 | )}\n*Mute :* ${enabled ? 'on' : 'off'}\nMessage : ${msg}` 33 | ) 34 | } 35 | if (hour == 'on' || hour == 'off') { 36 | const isMute = await setMute(message.jid, 'mute', hour == 'on') 37 | if (!isMute) return await message.send('_Not Found AutoMute') 38 | const task = await getMute(message.jid, 'mute') 39 | if (!task || !task.hour) return await message.send('_Not Found AutoMute_') 40 | const isTask = addTask( 41 | message.jid, 42 | 'mute', 43 | hour == 'off' ? 'off' : task.hour, 44 | task.minute, 45 | task.msg 46 | ) 47 | if (!isTask) return await message.send('_AutoMute Already Disabled_') 48 | return await message.send( 49 | `_AutoMute ${hour == 'on' ? 'Enabled' : 'Disabled'}._` 50 | ) 51 | } 52 | if (!hour || !min || isNaN(hour) || isNaN(min)) 53 | return await message.send( 54 | '*Example : amute 6 0*\namute on | off\namute list\nReply to a text to send Msg on mute' 55 | ) 56 | // return await message.send( 57 | // await genButtonMessage( 58 | // [ 59 | // { id: 'amute on', text: 'ON' }, 60 | // { id: 'amute off', text: 'OFF' }, 61 | // { id: 'amute info', text: 'INFO' }, 62 | // ], 63 | // '*Example : amute 6 0*\namute info\namute on/off\nReply to a text to set Msg' 64 | // ), 65 | // {}, 66 | // 'button' 67 | // ) 68 | await setMute(message.jid, 'mute', true, hour, min, msg) 69 | addTask(message.jid, 'mute', hour, min, msg) 70 | 71 | return await message.send( 72 | `_Group will Mute at ${c24to12(`${hour}:${min}`)}_${ 73 | msg != 'null' ? `\n_Message: ${msg}_` : '' 74 | }` 75 | ) 76 | } 77 | ) 78 | 79 | bot( 80 | { 81 | pattern: 'aunmute ?(.*)', 82 | fromMe: true, 83 | desc: 'auto group unmute scheduler', 84 | type: 'group', 85 | onlyGroup: true, 86 | }, 87 | async (message, match) => { 88 | const participants = await message.groupMetadata(message.jid) 89 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 90 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 91 | let msg = message.reply_message.text || 'null' 92 | const [hour, min] = match.split(' ') 93 | if (hour == 'info') { 94 | const task = await getMute(message.jid, 'unmute') 95 | if (!task || !task.hour) 96 | return await message.send('_Not Found AutoUnMute_') 97 | const { hour, minute, msg, enabled } = task 98 | return await message.send( 99 | `*Hour :* ${hour}\n*Minute :* ${minute}\n*Time :* ${c24to12( 100 | `${hour}:${minute}` 101 | )}\n*unMute :* ${enabled ? 'on' : 'off'}\nMessage : ${msg}` 102 | ) 103 | } 104 | if (hour == 'on' || hour == 'off') { 105 | const isMute = await setMute(message.jid, 'unmute', hour == 'on') 106 | if (!isMute) return await message.send('_Not Found AutoUnMute_') 107 | const task = await getMute(message.jid, 'unmute') 108 | if (!task) return await message.send('_Not Found AutoUnMute_') 109 | const isTask = addTask( 110 | message.jid, 111 | 'unmute', 112 | hour == 'off' ? 'off' : task.hour, 113 | task.minute, 114 | task.msg 115 | ) 116 | if (!isTask) return await message.send('_AutoUnMute Already Disabled_') 117 | return await message.send( 118 | `_AutoUnMute ${hour == 'on' ? 'Enabled' : 'Disabled'}._` 119 | ) 120 | } 121 | if (!hour || !min || isNaN(hour) || isNaN(min)) 122 | return await message.send( 123 | '*Example : aunmute 16 30*\naunmute on | off\naunmute list\nReply to a text to send Msg on unmute' 124 | ) 125 | // return await message.send( 126 | // await genButtonMessage( 127 | // [ 128 | // { id: 'aunmute on', text: 'ON' }, 129 | // { id: 'aunmute off', text: 'OFF' }, 130 | // { id: 'aunmute info', text: 'INFO' }, 131 | // ], 132 | // '*Example : aunmute 6 0*\naunmute info\naunmute on/off\nReply to a text to set Msg' 133 | // ), 134 | // {}, 135 | // 'button' 136 | // ) 137 | await setMute(message.jid, 'unmute', true, hour, min, msg) 138 | addTask(message.jid, 'unmute', hour, min, msg) 139 | return await message.send( 140 | `_Group will unMute at ${c24to12(`${hour}:${min}`)}_${ 141 | msg != 'null' ? `\n_Message: ${msg}_` : '' 142 | }` 143 | ) 144 | } 145 | ) 146 | -------------------------------------------------------------------------------- /plugins/editor.js: -------------------------------------------------------------------------------- 1 | const { bot, photoEditor } = require('../lib/') 2 | const fm = true 3 | 4 | bot( 5 | { 6 | pattern: 'skull', 7 | fromMe: fm, 8 | type: 'editor', 9 | desc: 'Skull Photo editor.', 10 | }, 11 | async (message, match) => { 12 | if (!message.reply_message || !message.reply_message.image) 13 | return await message.send('*Reply to a image.*') 14 | const { status, result } = await photoEditor( 15 | await message.reply_message.downloadAndSaveMediaMessage(), 16 | 'skull' 17 | ) 18 | if (!status) return await message.send(result) 19 | return await message.sendFromUrl(result) 20 | } 21 | ) 22 | bot( 23 | { 24 | pattern: 'sketch', 25 | fromMe: fm, 26 | type: 'editor', 27 | desc: 'Sketch Photo editor.', 28 | }, 29 | async (message, match) => { 30 | if (!message.reply_message || !message.reply_message.image) 31 | return await message.send('*Reply to a image.*') 32 | const { status, result } = await photoEditor( 33 | await message.reply_message.downloadAndSaveMediaMessage(), 34 | 'sketch' 35 | ) 36 | if (!status) return await message.send(result) 37 | return await message.sendFromUrl(result) 38 | } 39 | ) 40 | 41 | bot( 42 | { 43 | pattern: 'pencil', 44 | fromMe: fm, 45 | type: 'editor', 46 | desc: 'pencil Photo editor.', 47 | }, 48 | async (message, match) => { 49 | if (!message.reply_message || !message.reply_message.image) 50 | return await message.send('*Reply to a image.*') 51 | const { status, result } = await photoEditor( 52 | await message.reply_message.downloadAndSaveMediaMessage(), 53 | 'pencil' 54 | ) 55 | if (!status) return await message.send(result) 56 | return await message.sendFromUrl(result) 57 | } 58 | ) 59 | 60 | bot( 61 | { 62 | pattern: 'color', 63 | fromMe: fm, 64 | type: 'editor', 65 | desc: 'color Photo editor.', 66 | }, 67 | async (message, match) => { 68 | if (!message.reply_message || !message.reply_message.image) 69 | return await message.send('*Reply to a image.*') 70 | const { status, result } = await photoEditor( 71 | await message.reply_message.downloadAndSaveMediaMessage(), 72 | 'color' 73 | ) 74 | if (!status) return await message.send(result) 75 | return await message.sendFromUrl(result) 76 | } 77 | ) 78 | 79 | bot( 80 | { 81 | pattern: 'kiss', 82 | fromMe: fm, 83 | type: 'editor', 84 | desc: 'kiss Photo editor.', 85 | }, 86 | async (message, match) => { 87 | if (!message.reply_message || !message.reply_message.image) 88 | return await message.send('*Reply to a image.*') 89 | const { status, result } = await photoEditor( 90 | await message.reply_message.downloadAndSaveMediaMessage(), 91 | 'kiss' 92 | ) 93 | if (!status) return await message.send(result) 94 | return await message.sendFromUrl(result) 95 | } 96 | ) 97 | 98 | bot( 99 | { 100 | pattern: 'bokeh', 101 | fromMe: fm, 102 | type: 'editor', 103 | desc: 'bokeh Photo editor.', 104 | }, 105 | async (message, match) => { 106 | if (!message.reply_message || !message.reply_message.image) 107 | return await message.send('*Reply to a image.*') 108 | const { status, result } = await photoEditor( 109 | await message.reply_message.downloadAndSaveMediaMessage(), 110 | 'bokeh' 111 | ) 112 | if (!status) return await message.send(result) 113 | return await message.sendFromUrl(result) 114 | } 115 | ) 116 | 117 | bot( 118 | { 119 | pattern: 'wanted', 120 | fromMe: fm, 121 | type: 'editor', 122 | desc: 'Wanted Photo editor.', 123 | }, 124 | async (message, match) => { 125 | if (!message.reply_message || !message.reply_message.image) 126 | return await message.send('*Reply to a image.*') 127 | const { status, result } = await photoEditor( 128 | await message.reply_message.downloadAndSaveMediaMessage(), 129 | 'wanted' 130 | ) 131 | if (!status) return await message.send(result) 132 | return await message.sendFromUrl(result) 133 | } 134 | ) 135 | 136 | bot( 137 | { 138 | pattern: 'look', 139 | fromMe: fm, 140 | type: 'editor', 141 | desc: 'Dramatic Look Photo editor.', 142 | }, 143 | async (message, match) => { 144 | if (!message.reply_message || !message.reply_message.image) 145 | return await message.send('*Reply to a image.*') 146 | const { status, result } = await photoEditor( 147 | await message.reply_message.downloadAndSaveMediaMessage(), 148 | 'look' 149 | ) 150 | if (!status) return await message.send(result) 151 | return await message.sendFromUrl(result) 152 | } 153 | ) 154 | 155 | bot( 156 | { 157 | pattern: 'gandm', 158 | fromMe: fm, 159 | type: 'editor', 160 | desc: 'Dramatic Look Photo editor.', 161 | }, 162 | async (message, match) => { 163 | if (!message.reply_message || !message.reply_message.image) 164 | return await message.send('*Reply to a image.*') 165 | const { status, result } = await photoEditor( 166 | await message.reply_message.downloadAndSaveMediaMessage(), 167 | 'gandm' 168 | ) 169 | if (!status) return await message.send(result) 170 | return await message.sendFromUrl(result) 171 | } 172 | ) 173 | 174 | bot( 175 | { 176 | pattern: 'dark', 177 | fromMe: fm, 178 | type: 'editor', 179 | desc: 'Dramatic Look Photo editor.', 180 | }, 181 | async (message, match) => { 182 | if (!message.reply_message || !message.reply_message.image) 183 | return await message.send('*Reply to a image.*') 184 | const { status, result } = await photoEditor( 185 | await message.reply_message.downloadAndSaveMediaMessage(), 186 | 'dark' 187 | ) 188 | if (!status) return await message.send(result) 189 | return await message.sendFromUrl(result) 190 | } 191 | ) 192 | 193 | bot( 194 | { 195 | pattern: 'makeup', 196 | fromMe: fm, 197 | type: 'editor', 198 | desc: 'Dramatic Look Photo editor.', 199 | }, 200 | async (message, match) => { 201 | if (!message.reply_message || !message.reply_message.image) 202 | return await message.send('*Reply to a image.*') 203 | const { status, result } = await photoEditor( 204 | await message.reply_message.downloadAndSaveMediaMessage(), 205 | 'makeup' 206 | ) 207 | if (!status) return await message.send(result) 208 | return await message.sendFromUrl(result) 209 | } 210 | ) 211 | 212 | bot( 213 | { 214 | pattern: 'cartoon', 215 | fromMe: fm, 216 | type: 'editor', 217 | desc: 'Dramatic Look Photo editor.', 218 | }, 219 | async (message, match) => { 220 | if (!message.reply_message || !message.reply_message.image) 221 | return await message.send('*Reply to a image.*') 222 | const { status, result } = await photoEditor( 223 | await message.reply_message.downloadAndSaveMediaMessage(), 224 | 'cartoon' 225 | ) 226 | if (!status) return await message.send(result) 227 | return await message.sendFromUrl(result) 228 | } 229 | ) 230 | 231 | bot( 232 | { 233 | pattern: 'demon', 234 | fromMe: fm, 235 | type: 'editor', 236 | desc: 'demon Look Photo editor.', 237 | }, 238 | async (message, match) => { 239 | if (!message.reply_message || !message.reply_message.image) 240 | return await message.send('*Reply to a image.*') 241 | const { status, result } = await photoEditor( 242 | await message.reply_message.downloadAndSaveMediaMessage(), 243 | 'demon' 244 | ) 245 | if (!status) return await message.send(result) 246 | return await message.sendFromUrl(result) 247 | } 248 | ) 249 | 250 | bot( 251 | { 252 | pattern: 'bloody', 253 | fromMe: fm, 254 | type: 'editor', 255 | desc: 'bloody Look Photo editor.', 256 | }, 257 | async (message, match) => { 258 | if (!message.reply_message || !message.reply_message.image) 259 | return await message.send('*Reply to a image.*') 260 | const { status, result } = await photoEditor( 261 | await message.reply_message.downloadAndSaveMediaMessage(), 262 | 'bloody' 263 | ) 264 | if (!status) return await message.send(result) 265 | return await message.sendFromUrl(result) 266 | } 267 | ) 268 | 269 | bot( 270 | { 271 | pattern: 'zombie', 272 | fromMe: fm, 273 | type: 'editor', 274 | desc: 'zombie Look Photo editor.', 275 | }, 276 | async (message, match) => { 277 | if (!message.reply_message || !message.reply_message.image) 278 | return await message.send('*Reply to a image.*') 279 | const { status, result } = await photoEditor( 280 | await message.reply_message.downloadAndSaveMediaMessage(), 281 | 'zombie' 282 | ) 283 | if (!status) return await message.send(result) 284 | return await message.sendFromUrl(result) 285 | } 286 | ) 287 | 288 | bot( 289 | { 290 | pattern: 'horned', 291 | fromMe: fm, 292 | type: 'editor', 293 | desc: 'horned Look Photo editor.', 294 | }, 295 | async (message, match) => { 296 | if (!message.reply_message || !message.reply_message.image) 297 | return await message.send('*Reply to a image.*') 298 | const { status, result } = await photoEditor( 299 | await message.reply_message.downloadAndSaveMediaMessage(), 300 | 'horned' 301 | ) 302 | if (!status) return await message.send(result) 303 | return await message.sendFromUrl(result) 304 | } 305 | ) 306 | -------------------------------------------------------------------------------- /plugins/group.js: -------------------------------------------------------------------------------- 1 | const { 2 | isAdmin, 3 | sleep, 4 | bot, 5 | addSpace, 6 | jidToNum, 7 | formatTime, 8 | parsedJid, 9 | getCommon, 10 | numToJid, 11 | // genButtonMessage, 12 | } = require('../lib/') 13 | const fm = true 14 | 15 | bot( 16 | { 17 | pattern: 'kick ?(.*)', 18 | fromMe: fm, 19 | desc: 'Remove members from Group.', 20 | type: 'group', 21 | onlyGroup: true, 22 | }, 23 | async (message, match) => { 24 | const participants = await message.groupMetadata(message.jid) 25 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 26 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 27 | let user = message.mention[0] || message.reply_message.jid 28 | if (!user && match != 'all') return await message.send(`_Give me a user_`) 29 | const isUserAdmin = match != 'all' && (await isAdmin(participants, user)) 30 | if (isUserAdmin) return await message.send(`_User is admin._`) 31 | if (match == 'all') { 32 | user = participants 33 | .filter((member) => !member.admin == true) 34 | .map(({ id }) => id) 35 | await message.send( 36 | `_kicking everyone(${user.length})_\n*Restart bot if u wanna stop.*` 37 | ) 38 | await sleep(10 * 1000) 39 | } 40 | return await message.Kick(user) 41 | } 42 | ) 43 | 44 | bot( 45 | { 46 | pattern: 'add ?(.*)', 47 | fromMe: true, 48 | desc: 'To add members', 49 | type: 'group', 50 | onlyGroup: true, 51 | }, 52 | async (message, match) => { 53 | const participants = await message.groupMetadata(message.jid) 54 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 55 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 56 | match = match || message.reply_message.jid 57 | if (!match) return await message.send('Example : add 91987654321') 58 | // if (!match.startsWith('@@')) { 59 | // match = jidToNum(match) 60 | // const button = await genButtonMessage( 61 | // [ 62 | // { id: `@@`, text: 'NO' }, 63 | // { id: `add @@${match}`, text: 'YES' }, 64 | // ], 65 | // `Your Number maybe banned, Do you want add @${match}`, 66 | // '' 67 | // ) 68 | // return await message.send( 69 | // button, 70 | // { contextInfo: { mentionedJid: [numToJid(match)] } }, 71 | // 'button' 72 | // ) 73 | // } 74 | match = jidToNum(match) 75 | const res = await message.Add(match) 76 | if (res == '403') return await message.send('_Failed, Invite sent_') 77 | else if (res && res != '200') 78 | return await message.send(res, { quoted: message.data }) 79 | } 80 | ) 81 | 82 | bot( 83 | { 84 | pattern: 'promote ?(.*)', 85 | fromMe: fm, 86 | desc: 'Give admin role.', 87 | type: 'group', 88 | onlyGroup: true, 89 | }, 90 | async (message, match) => { 91 | const participants = await message.groupMetadata(message.jid) 92 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 93 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 94 | const user = message.mention[0] || message.reply_message.jid 95 | if (!user) return await message.send(`_Give me a user._`) 96 | const isUserAdmin = await isAdmin(participants, user) 97 | if (isUserAdmin) return await message.send(`_User is already admin._`) 98 | return await message.Promote(user) 99 | } 100 | ) 101 | 102 | bot( 103 | { 104 | pattern: 'demote ?(.*)', 105 | fromMe: fm, 106 | desc: 'Remove admin role.', 107 | type: 'group', 108 | onlyGroup: true, 109 | }, 110 | async (message, match) => { 111 | const participants = await message.groupMetadata(message.jid) 112 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 113 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 114 | const user = message.mention[0] || message.reply_message.jid 115 | if (!user) return await message.send(`_Give me a user._`) 116 | const isUserAdmin = await isAdmin(participants, user) 117 | if (!isUserAdmin) return await message.send(`_User is not an admin._`) 118 | return await message.Demote(user) 119 | } 120 | ) 121 | 122 | bot( 123 | { 124 | pattern: 'invite ?(.*)', 125 | fromMe: fm, 126 | desc: 'Get Group invite', 127 | type: 'group', 128 | onlyGroup: true, 129 | }, 130 | async (message, match) => { 131 | const participants = await message.groupMetadata(message.jid) 132 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 133 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 134 | return await message.send(await message.inviteCode(message.jid)) 135 | } 136 | ) 137 | 138 | bot( 139 | { 140 | pattern: 'mute ?(.*)', 141 | fromMe: fm, 142 | desc: 'Makes Groups Admins Only.', 143 | type: 'group', 144 | onlyGroup: true, 145 | }, 146 | async (message, match) => { 147 | const participants = await message.groupMetadata(message.jid) 148 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 149 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 150 | if (!match || isNaN(match)) 151 | return await message.GroupSettingsChange(message.jid, true) 152 | await message.GroupSettingsChange(message.jid, true) 153 | await message.send(`_Muted for ${match} min._`) 154 | await sleep(1000 * 60 * match) 155 | return await message.GroupSettingsChange(message.jid, false) 156 | } 157 | ) 158 | 159 | bot( 160 | { 161 | pattern: 'unmute ?(.*)', 162 | fromMe: fm, 163 | desc: 'Makes Group All participants can send Message.', 164 | type: 'group', 165 | onlyGroup: true, 166 | }, 167 | async (message, match) => { 168 | const participants = await message.groupMetadata(message.jid) 169 | const isImAdmin = await isAdmin(participants, message.client.user.jid) 170 | if (!isImAdmin) return await message.send(`_I'm not admin._`) 171 | return await message.GroupSettingsChange(message.jid, false) 172 | } 173 | ) 174 | 175 | bot( 176 | { 177 | pattern: 'join ?(.*)', 178 | fromMe: fm, 179 | type: 'group', 180 | desc: 'Join invite link.', 181 | }, 182 | async (message, match) => { 183 | match = match || message.reply_message.text 184 | if (!match) return await message.send(`_Give me a Group invite link._`) 185 | const wa = /chat.whatsapp.com\/([0-9A-Za-z]{20,24})/ 186 | const [_, code] = match.match(wa) || [] 187 | if (!code) return await message.send(`_Give me a Group invite link._`) 188 | const res = await message.infoInvite(code) 189 | if (res.size > 1024) return await message.send('*Group full!*') 190 | const join = await message.acceptInvite(code) 191 | if(!join) return await message.send(`_Join Request Sent_`) 192 | return await message.send(`_Joined_`) 193 | } 194 | ) 195 | 196 | bot( 197 | { 198 | pattern: 'revoke', 199 | fromMe: fm, 200 | onlyGroup: true, 201 | type: 'group', 202 | desc: 'Revoke Group invite link.', 203 | }, 204 | async (message, match) => { 205 | const participants = await message.groupMetadata(message.jid) 206 | const im = await isAdmin(participants, message.client.user.jid) 207 | if (!im) return await message.send(`_I'm not admin._`) 208 | await message.revokeInvite(message.jid) 209 | } 210 | ) 211 | 212 | bot( 213 | { 214 | pattern: 'ginfo ?(.*)', 215 | fromMe: fm, 216 | type: 'group', 217 | desc: 'Shows group invite info', 218 | }, 219 | async (message, match) => { 220 | match = match || message.reply_message.text 221 | if (!match) return await message.send('*Example : info group_invte_link*') 222 | const linkRegex = /chat.whatsapp.com\/([0-9A-Za-z]{20,24})/i 223 | const [_, code] = match.match(linkRegex) || [] 224 | if (!code) return await message.send('_Invalid invite link_') 225 | const res = await message.infoInvite(code) 226 | const caption = `*Name :* ${res.subject} 227 | *Jid :* ${res.id}@g.us 228 | *Owner :* ${jidToNum(res.creator)} 229 | *Members :* ${res.size} 230 | *Created :* ${formatTime(res.creation)} 231 | *Desc :* ${res.desc}` 232 | if (res.url) return await message.sendFromUrl(res.url, { caption }) 233 | return await message.send(caption) 234 | } 235 | ) 236 | 237 | bot( 238 | { 239 | pattern: 'common ?(.*)', 240 | fromMe: fm, 241 | onlyGroup: true, 242 | type: 'group', 243 | desc: 'Show or kick common memebers in two groups.', 244 | }, 245 | async (message, match) => { 246 | const example = `*Example*\ncommon jid\ncommon jid kick\ncommon jid1 jid2\ncommon jid1,jid2 kick\ncommon jid1 jid2 jid3...jid999\n\ncommon jid1 jid2 jid3 any\nkick - to remove only group u command\nkickall - to remove from all jids\nany - to include two or more common group members\nskip - to avoid removing from all, example skip to avoid from one group or skip jid1,jid2,jid3 to skip from.` 247 | const kick = match.includes('kick') 248 | const kickFromAll = match.includes('kickall') 249 | const isAny = match.includes('any') 250 | const jids = parsedJid(match) 251 | const toSkip = parsedJid(match.split('skip')[1] || '') 252 | const anySkip = match.includes('skip') && !toSkip.length 253 | if (!match || (jids.length == 1 && jids.includes(message.jid))) 254 | return await message.send(example) 255 | if (!jids.includes(message.jid) && jids.length < 2) jids.push(message.jid) 256 | const metadata = {} 257 | for (const jid of jids) { 258 | metadata[jid] = (await message.groupMetadata(jid)) 259 | .filter((user) => !user.admin) 260 | .map(({ id }) => id) 261 | } 262 | if (Object.keys(metadata).length < 2) return await message.send(example) 263 | const common = getCommon(Object.values(metadata), isAny) 264 | if (!common.length) return await message.send(`_Zero common members_`) 265 | if (kickFromAll) { 266 | let gids = jids 267 | if (!anySkip) gids = jids.filter((id) => !toSkip.includes(id)) 268 | const skip = {} 269 | for (const jid of gids) { 270 | const participants = await message.groupMetadata(jid) 271 | const kick = participants 272 | .map(({ id }) => id) 273 | .filter((id) => common.includes(id)) 274 | const im = await isAdmin(participants, message.client.user.jid) 275 | if (im) { 276 | if (anySkip) { 277 | for (const id of kick) { 278 | if (skip[id]) await message.Kick(id, jid) 279 | skip[id] = id 280 | } 281 | } else await message.Kick(kick, jid) 282 | } 283 | } 284 | return 285 | } 286 | if (kick) { 287 | const participants = await message.groupMetadata(message.jid) 288 | const im = await isAdmin(participants, message.client.user.jid) 289 | if (!im) return await message.send(`_I'm not admin._`) 290 | return await message.Kick(common) 291 | } 292 | let msg = '' 293 | common.forEach( 294 | (e, i) => 295 | (msg += `${i + 1}${addSpace(i + 1, common.length)} @${jidToNum(e)}\n`) 296 | ) 297 | await message.send(msg.trim(), { contextInfo: { mentionedJid: common } }) 298 | } 299 | ) 300 | -------------------------------------------------------------------------------- /plugins/media.js: -------------------------------------------------------------------------------- 1 | const { 2 | audioCut, 3 | videoTrim, 4 | mergeVideo, 5 | getFfmpegBuffer, 6 | videoHeightWidth, 7 | avm, 8 | blackVideo, 9 | cropVideo, 10 | bot, 11 | PDF, 12 | } = require('../lib/') 13 | const fs = require('fs') 14 | const fm = true 15 | 16 | bot( 17 | { 18 | pattern: 'rotate ?(.*)', 19 | fromMe: true, 20 | desc: 'rotate video', 21 | type: 'video', 22 | }, 23 | async (message, match) => { 24 | if (!message.reply_message || !message.reply_message.video) 25 | return await message.send('*Reply to a video*') 26 | if (match === '') 27 | return await message.send('*Example : rotate right|left|flip*') 28 | const location = await message.reply_message.downloadAndSaveMediaMessage( 29 | 'rotate' 30 | ) 31 | if (/right/.test(match)) { 32 | await message.send('_Converting..._') 33 | return await message.send( 34 | await getFfmpegBuffer(location, 'orotate.mp4', 'right'), 35 | { mimetype: 'video/mp4', quoted: message.data }, 36 | 'video' 37 | ) 38 | } else if (/left/.test(match)) { 39 | await message.send('_Converting..._') 40 | return await message.send( 41 | await getFfmpegBuffer(location, 'orotate.mp4', 'left'), 42 | { mimetype: 'video/mp4', quoted: message.data }, 43 | 'video' 44 | ) 45 | } else if (/flip/.test(match)) { 46 | await message.send('_Converting..._') 47 | return await message.send( 48 | await getFfmpegBuffer(location, 'orotate.mp4', 'flip'), 49 | { mimetype: 'video/mp4', quoted: message.data }, 50 | 'video' 51 | ) 52 | } else await message.send('*Example : rotate right|left|flip*') 53 | } 54 | ) 55 | 56 | bot( 57 | { 58 | pattern: 'mp3', 59 | fromMe: fm, 60 | desc: 'video to audio or audio to voice note', 61 | type: 'video', 62 | }, 63 | async (message, match) => { 64 | if ( 65 | !message.reply_message || 66 | (!message.reply_message.video && !message.reply_message.audio) 67 | ) 68 | return await message.send('*Reply to a video/audio*') 69 | return await message.send( 70 | await getFfmpegBuffer( 71 | await message.reply_message.downloadAndSaveMediaMessage('mp3'), 72 | 'mp3.mp3', 73 | 'mp3' 74 | ), 75 | { 76 | filename: 'mp3.mp3', 77 | mimetype: 'audio/mpeg', 78 | ptt: !message.reply_message.ptt, 79 | quoted: message.data, 80 | }, 81 | 'audio' 82 | ) 83 | } 84 | ) 85 | 86 | bot( 87 | { pattern: 'photo', fromMe: fm, desc: 'sticker to image', type: 'sticker' }, 88 | async (message, match) => { 89 | if ( 90 | !message.reply_message.sticker || 91 | message.reply_message === false || 92 | message.reply_message.animated 93 | ) 94 | return await message.send('*Reply to photo sticker*') 95 | return await message.send( 96 | await getFfmpegBuffer( 97 | await message.reply_message.downloadAndSaveMediaMessage('photo'), 98 | 'photo.png', 99 | 'photo' 100 | ), 101 | { quoted: message.data, mimetype: 'image/png' }, 102 | 'image' 103 | ) 104 | } 105 | ) 106 | 107 | bot( 108 | { 109 | pattern: 'reverse', 110 | fromMe: true, 111 | desc: 'reverse video/audio', 112 | type: 'video', 113 | }, 114 | async (message, match) => { 115 | if ( 116 | !message.reply_message.audio && 117 | !message.reply_message.video && 118 | !message.reply_message 119 | ) 120 | return await message.send('*Reply to video/audio*') 121 | const location = await message.reply_message.downloadAndSaveMediaMessage( 122 | 'reverse' 123 | ) 124 | if (message.reply_message.video == true) { 125 | return await message.send( 126 | await getFfmpegBuffer(location, 'revered.mp4', 'videor'), 127 | { mimetype: 'video/mp4', quoted: message.data }, 128 | 'video' 129 | ) 130 | } else if (message.reply_message.audio == true) { 131 | return await message.send( 132 | await getFfmpegBuffer(location, 'revered.mp3', 'audior'), 133 | { 134 | filename: 'revered.mp3', 135 | mimetype: 'audio/mpeg', 136 | ptt: false, 137 | quoted: message.data, 138 | }, 139 | 'audio' 140 | ) 141 | } 142 | } 143 | ) 144 | 145 | bot( 146 | { 147 | pattern: 'cut ?(.*)', 148 | fromMe: fm, 149 | desc: 'cut audio/video', 150 | type: 'audio', 151 | }, 152 | async (message, match) => { 153 | if ( 154 | !message.reply_message || 155 | (!message.reply_message.audio && !message.reply_message.video) 156 | ) 157 | return await message.send('*Reply to a audio/video.*') 158 | if (!match) return await message.send('*Example : trim 0;30*') 159 | const [start, duration] = match.split(';') 160 | if (!start || !duration || isNaN(start) || isNaN(duration)) 161 | return await message.send('*Example : trim 10;30*') 162 | return await message.send( 163 | await audioCut( 164 | await message.reply_message.downloadAndSaveMediaMessage('cut'), 165 | start.trim(), 166 | duration.trim() 167 | ), 168 | { 169 | filename: 'cut.mp3', 170 | mimetype: 'audio/mpeg', 171 | ptt: false, 172 | quoted: message.data, 173 | }, 174 | 'audio' 175 | ) 176 | } 177 | ) 178 | 179 | bot( 180 | { 181 | pattern: 'trim ?(.*)', 182 | fromMe: fm, 183 | desc: 'trim video', 184 | type: 'video', 185 | }, 186 | async (message, match) => { 187 | if (!message.reply_message || !message.reply_message.video) 188 | return await message.send('*Reply to a video*') 189 | if (!match) return await message.send('*Example : trim 10;30*') 190 | const [start, duration] = match.split(';') 191 | if (!start || !duration || isNaN(start) || isNaN(duration)) 192 | return await message.send('*Example : trim 60;30*') 193 | return await message.send( 194 | await videoTrim( 195 | await message.reply_message.downloadAndSaveMediaMessage('trim'), 196 | start, 197 | duration 198 | ), 199 | { mimetype: 'video/mp4', quoted: message.data }, 200 | 'video' 201 | ) 202 | } 203 | ) 204 | bot( 205 | { 206 | pattern: 'page ?(.*)', 207 | fromMe: fm, 208 | desc: 'To add images.', 209 | type: 'document', 210 | }, 211 | async (message, match) => { 212 | if (!message.reply_message || !message.reply_message.image) 213 | return await message.send( 214 | '*Reply to a image.*\n```Reply images with caption as page number to this message(.page)```' 215 | ) 216 | if (isNaN(match)) 217 | return await message.send('*Reply in order*\n*Ex: .page 1*') 218 | await message.reply_message.downloadAndSaveMediaMessage(`./pdf/${match}`) 219 | return await message.send('_Added page_ ' + match) 220 | } 221 | ) 222 | 223 | bot( 224 | { 225 | pattern: 'pdf ?(.*)', 226 | fromMe: fm, 227 | desc: 'Convert images to pdf.', 228 | type: 'document', 229 | }, 230 | async (message, match) => { 231 | if (!match) return await message.send('*Example : pdf note*') 232 | await message.send('_Uploading pdf..._') 233 | return await message.send( 234 | await PDF(), 235 | { 236 | fileName: `${match}.pdf`, 237 | mimetype: 'application/pdf', 238 | quoted: message.data, 239 | }, 240 | 'document' 241 | ) 242 | } 243 | ) 244 | 245 | bot( 246 | { 247 | pattern: 'merge ?(.*)', 248 | fromMe: true, 249 | desc: 'Merge videos', 250 | type: 'video', 251 | }, 252 | async (message, match) => { 253 | if (!fs.existsSync('./media/merge')) { 254 | fs.mkdirSync('./media/merge') 255 | } 256 | if ( 257 | match == '' && 258 | message.reply_message != false && 259 | !message.reply_message.video 260 | ) 261 | return await message.send('*Reply to a video*') 262 | if (match == '' && isNaN(match)) 263 | return await message.send('*Reply with order number*\n*Ex: .merge 1*') 264 | if (/[0-9]+/.test(match)) { 265 | await message.reply_message.downloadAndSaveMediaMessage( 266 | './media/merge/' + match 267 | ) 268 | return await message.send('```video ' + match + ' added```') 269 | } else { 270 | let length = fs.readdirSync('./media/merge').length 271 | if (!(length > 0)) 272 | return await message.send( 273 | '```Add videos in order.```\n*Example .merge 1*' 274 | ) 275 | await message.send('```Merging ' + length + ' videos...```') 276 | return await message.send( 277 | await mergeVideo(length), 278 | { mimetype: 'video/mp4', quoted: message.data }, 279 | 'video' 280 | ) 281 | } 282 | } 283 | ) 284 | 285 | bot( 286 | { 287 | pattern: 'compress ?(.*)', 288 | fromMe: true, 289 | desc: 'compress video', 290 | type: 'video', 291 | }, 292 | async (message, match) => { 293 | if (!message.reply_message || !message.reply_message.video) 294 | return await message.send('*Reply to a video*') 295 | return await message.send( 296 | await getFfmpegBuffer( 297 | await message.reply_message.downloadAndSaveMediaMessage('compress'), 298 | 'ocompress.mp4', 299 | 'compress' 300 | ), 301 | { quoted: message.data }, 302 | 'video' 303 | ) 304 | } 305 | ) 306 | 307 | bot( 308 | { 309 | pattern: 'bass ?(.*)', 310 | fromMe: true, 311 | desc: 'alter audio bass', 312 | type: 'audio', 313 | }, 314 | async (message, match) => { 315 | if ( 316 | !message.reply_message || 317 | (!message.reply_message.audio && !message.reply_message.video) 318 | ) 319 | return await message.send('*Reply to a audio/video.*') 320 | return await message.send( 321 | await getFfmpegBuffer( 322 | await message.reply_message.downloadAndSaveMediaMessage('basso'), 323 | 'bass.mp3', 324 | `bass,${match == '' ? 10 : match}` 325 | ), 326 | { mimetype: 'audio/mpeg', quoted: message.data }, 327 | 'audio' 328 | ) 329 | } 330 | ) 331 | 332 | bot( 333 | { 334 | pattern: 'treble ?(.*)', 335 | fromMe: true, 336 | desc: 'alter audio treble', 337 | type: 'audio', 338 | }, 339 | async (message, match) => { 340 | if ( 341 | !message.reply_message || 342 | (!message.reply_message.audio && !message.reply_message.video) 343 | ) 344 | return await message.send('*Reply to a audio/video.*') 345 | return await message.send( 346 | await getFfmpegBuffer( 347 | await message.reply_message.downloadAndSaveMediaMessage('trebleo'), 348 | 'treble.mp3', 349 | `treble,${match == '' ? 10 : match}` 350 | ), 351 | { mimetype: 'audio/mpeg', quoted: message.data }, 352 | 'audio' 353 | ) 354 | } 355 | ) 356 | 357 | bot( 358 | { 359 | pattern: 'histo', 360 | fromMe: true, 361 | desc: 'audio to video', 362 | type: 'audio', 363 | }, 364 | async (message, match) => { 365 | if ( 366 | !message.reply_message || 367 | (!message.reply_message.audio && !message.reply_message.video) 368 | ) 369 | return await message.send('*Reply to a audio/video.*') 370 | return await message.send( 371 | await getFfmpegBuffer( 372 | await message.reply_message.downloadAndSaveMediaMessage('histo'), 373 | 'histo.mp4', 374 | 'histo' 375 | ), 376 | { mimetype: 'video/mp4', quoted: message.data }, 377 | 'video' 378 | ) 379 | } 380 | ) 381 | 382 | bot( 383 | { 384 | pattern: 'vector', 385 | fromMe: true, 386 | desc: 'audio to video', 387 | type: 'audio', 388 | }, 389 | async (message, match) => { 390 | if ( 391 | !message.reply_message || 392 | (!message.reply_message.audio && !message.reply_message.video) 393 | ) 394 | return await message.send('*Reply to a audio/video.*') 395 | return await message.send( 396 | await getFfmpegBuffer( 397 | await message.reply_message.downloadAndSaveMediaMessage('vector'), 398 | 'vector.mp4', 399 | 'vector' 400 | ), 401 | { mimetype: 'video/mp4', quoted: message.data }, 402 | 'video' 403 | ) 404 | } 405 | ) 406 | bot( 407 | { 408 | pattern: 'crop ?(.*)', 409 | fromMe: true, 410 | desc: 'To crop video\nExample \n.crop 512,512,0,512\n.crop outW,outH,WtoCrop,HtoCrop', 411 | type: 'video', 412 | }, 413 | async (message, match) => { 414 | if (!message.reply_message || !message.reply_message.video) 415 | return await message.send('*Reply to a video*') 416 | const [vw, vh, w, h] = match.split(',') 417 | if ( 418 | !vh || 419 | !vw || 420 | !w || 421 | !h || 422 | typeof +vh !== 'number' || 423 | typeof +w !== 'number' || 424 | typeof +h !== 'number' || 425 | typeof +vw !== 'number' 426 | ) 427 | return await message.send( 428 | `*Example :*\ncrop out_w,out_h,x,y\nx and y are top left where to start croping` 429 | ) 430 | const location = await message.reply_message.downloadAndSaveMediaMessage( 431 | 'plain' 432 | ) 433 | const { height, width } = await videoHeightWidth(location) 434 | if (vw > width || vh > height) 435 | return await message.send( 436 | `*Video width: ${width}, height: ${height}*\n*Choose output size in between.*` 437 | ) 438 | return await message.send( 439 | await cropVideo(location, vw, vh, w, h), 440 | { mimetype: 'video/mp4', quoted: message.data }, 441 | 'video' 442 | ) 443 | } 444 | ) 445 | 446 | bot( 447 | { 448 | pattern: 'low', 449 | fromMe: true, 450 | desc: 'alter audio', 451 | type: 'audio', 452 | }, 453 | async (message, match) => { 454 | if ( 455 | !message.reply_message || 456 | (!message.reply_message.audio && !message.reply_message.video) 457 | ) 458 | return await message.send('*Reply to a audio/video.*') 459 | return await message.send( 460 | await getFfmpegBuffer( 461 | await message.reply_message.downloadAndSaveMediaMessage('lowmp3'), 462 | 'lowmp3.mp3', 463 | 'pitch' 464 | ), 465 | { filename: 'lowmp3.mp3', mimetype: 'audio/mpeg', quoted: message.data }, 466 | 'audio' 467 | ) 468 | } 469 | ) 470 | bot( 471 | { 472 | pattern: 'pitch', 473 | fromMe: true, 474 | desc: 'alter audio', 475 | type: 'audio', 476 | }, 477 | async (message, match) => { 478 | if ( 479 | !message.reply_message || 480 | (!message.reply_message.audio && !message.reply_message.video) 481 | ) 482 | return await message.send('*Reply to a audio/video.*') 483 | return await message.send( 484 | await getFfmpegBuffer( 485 | await message.reply_message.downloadAndSaveMediaMessage('pitchmp3'), 486 | 'lowmp3.mp3', 487 | 'lowmp3' 488 | ), 489 | { filename: 'lowmp3.mp3', mimetype: 'audio/mpeg', quoted: message.data }, 490 | 'audio' 491 | ) 492 | } 493 | ) 494 | bot( 495 | { 496 | pattern: 'avec', 497 | fromMe: true, 498 | desc: 'audio to video', 499 | type: 'audio', 500 | }, 501 | async (message, match) => { 502 | if ( 503 | !message.reply_message || 504 | (!message.reply_message.audio && !message.reply_message.video) 505 | ) 506 | return await message.send('*Reply to a audio/video.*') 507 | return await message.send( 508 | await getFfmpegBuffer( 509 | await message.reply_message.downloadAndSaveMediaMessage('avec'), 510 | 'avec.mp4', 511 | 'avec' 512 | ), 513 | { mimetype: 'video/mp4', quoted: message.data }, 514 | 'video' 515 | ) 516 | } 517 | ) 518 | 519 | bot( 520 | { 521 | pattern: 'avm', 522 | fromMe: true, 523 | desc: 'Merge audio and video', 524 | type: 'misc', 525 | }, 526 | async (message, match) => { 527 | if (!fs.existsSync('./media/avm')) { 528 | fs.mkdirSync('./media/avm') 529 | } 530 | let files = fs.readdirSync('./media/avm/') 531 | if ( 532 | (!message.reply_message && files.length < 2) || 533 | (message.reply_message && 534 | !message.reply_message.audio && 535 | !message.reply_message.video) 536 | ) 537 | return await message.send( 538 | '*add audio & video to merge*\n*Reply to a message.*' 539 | ) 540 | if (message.reply_message.audio) { 541 | await message.reply_message.downloadAndSaveMediaMessage( 542 | './media/avm/audio' 543 | ) 544 | return await message.send('```Added audio.```') 545 | } 546 | if (message.reply_message.video) { 547 | await message.reply_message.downloadAndSaveMediaMessage( 548 | './media/avm/video' 549 | ) 550 | return await message.send('```Added video.```') 551 | } 552 | return await message.send( 553 | await avm(files), 554 | { quoted: message.data }, 555 | 'video' 556 | ) 557 | } 558 | ) 559 | 560 | bot( 561 | { 562 | pattern: 'black', 563 | fromMe: true, 564 | desc: 'Audio to video.', 565 | type: 'audio', 566 | }, 567 | async (message, match) => { 568 | if ( 569 | !message.reply_message || 570 | (!message.reply_message.audio && !message.reply_message.video) 571 | ) 572 | return await message.send('*Reply to a audio/video.*') 573 | await message.send( 574 | await blackVideo( 575 | await message.reply_message.downloadAndSaveMediaMessage('black') 576 | ), 577 | { quoted: message.data }, 578 | 'video' 579 | ) 580 | } 581 | ) 582 | -------------------------------------------------------------------------------- /lib/class/index.js: -------------------------------------------------------------------------------- 1 | function _0x4ddd(_0xedce8d,_0x276132){var _0x5b92b4=_0x4b53();_0x4ddd=function(_0x327000,_0x19cbdb){_0x327000=_0x327000-(0x1*0x1646+0x23d0+0x6b*-0x89);var _0x3eb2e0=_0x5b92b4[_0x327000];if(_0x4ddd['\x7a\x67\x68\x50\x4f\x53']===undefined){var _0x2c78c6=function(_0x1d9046){var _0x5bc812='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';var _0x366493='';var _0x422107='';var _0x3a3825=_0x366493+_0x2c78c6;for(var _0x1b6a65=-0x9*-0x35e+-0x2337+0x1a3*0x3,_0x1e0fc9,_0x316182,_0x54fd7a=0x64e*-0x5+0xdc0+0x15e*0xd;_0x316182=_0x1d9046['\x63\x68\x61\x72\x41\x74'](_0x54fd7a++);~_0x316182&&(_0x1e0fc9=_0x1b6a65%(0x1dc9+0xd62+-0x2b27)?_0x1e0fc9*(-0x1a44+-0x32c+0x1db0)+_0x316182:_0x316182,_0x1b6a65++%(0xda8+-0x1*-0x1d1b+-0x2abf))?_0x366493+=_0x3a3825['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x54fd7a+(0x13b3+-0x876+-0xb33))-(-0x3*0xb55+-0x1*-0x761+0x1aa8)!==-0x14a8*0x1+0x1*0x2589+-0x10e1?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x20a5+0x1f19+-0x3ebf*0x1&_0x1e0fc9>>(-(0x2*0x925+-0x40a*-0x5+-0x267a)*_0x1b6a65&0x8*0x418+0x30b*0x5+-0x2ff1)):_0x1b6a65:0xeb4+-0xc1f+-0x295*0x1){_0x316182=_0x5bc812['\x69\x6e\x64\x65\x78\x4f\x66'](_0x316182);}for(var _0x1959f3=0x1*0x1197+0x70b*0x5+-0x34ce,_0x11b675=_0x366493['\x6c\x65\x6e\x67\x74\x68'];_0x1959f3<_0x11b675;_0x1959f3++){_0x422107+='\x25'+('\x30\x30'+_0x366493['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x1959f3)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0x1*-0xf69+0x1df*0x9+0x1018*-0x2))['\x73\x6c\x69\x63\x65'](-(0x1afb*0x1+0xfe8+-0x2ae1));}return decodeURIComponent(_0x422107);};var _0xa3e79=function(_0x583819,_0x5c1f7f){var _0x347e9a=[],_0x4ba7f1=0x3f7+0x59f*0x1+0x1*-0x996,_0x1b5f87,_0x14cf5='';_0x583819=_0x2c78c6(_0x583819);var _0xc7cefd;for(_0xc7cefd=-0x22ed+-0x1f88*0x1+0x4275;_0xc7cefd<0x9*0x219+-0xa76*-0x1+-0x1c57;_0xc7cefd++){_0x347e9a[_0xc7cefd]=_0xc7cefd;}for(_0xc7cefd=-0x15*-0x75+0xd*-0x24+-0x33*0x27;_0xc7cefd<0x6a8+0x1ba+-0xe*0x87;_0xc7cefd++){_0x4ba7f1=(_0x4ba7f1+_0x347e9a[_0xc7cefd]+_0x5c1f7f['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0xc7cefd%_0x5c1f7f['\x6c\x65\x6e\x67\x74\x68']))%(-0x67c+0x1994+-0x1218);_0x1b5f87=_0x347e9a[_0xc7cefd];_0x347e9a[_0xc7cefd]=_0x347e9a[_0x4ba7f1];_0x347e9a[_0x4ba7f1]=_0x1b5f87;}_0xc7cefd=-0x265a*0x1+0x62b+0x1*0x202f;_0x4ba7f1=-0x39d*-0x2+-0x240c+-0x1f*-0xee;for(var _0x3d4b1b=0x1b25*-0x1+-0xa21+-0xd*-0x2de;_0x3d4b1b<_0x583819['\x6c\x65\x6e\x67\x74\x68'];_0x3d4b1b++){_0xc7cefd=(_0xc7cefd+(0x182e+-0x1*-0x663+-0x1e90))%(0x1*0x2281+0x19*0xf1+-0x390a);_0x4ba7f1=(_0x4ba7f1+_0x347e9a[_0xc7cefd])%(0x2*-0x299+0x1d*-0xcd+0x1bb*0x11);_0x1b5f87=_0x347e9a[_0xc7cefd];_0x347e9a[_0xc7cefd]=_0x347e9a[_0x4ba7f1];_0x347e9a[_0x4ba7f1]=_0x1b5f87;_0x14cf5+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x583819['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x3d4b1b)^_0x347e9a[(_0x347e9a[_0xc7cefd]+_0x347e9a[_0x4ba7f1])%(-0x251*0x10+0x14*0x14+-0x20*-0x124)]);}return _0x14cf5;};_0x4ddd['\x79\x68\x76\x51\x59\x76']=_0xa3e79;_0xedce8d=arguments;_0x4ddd['\x7a\x67\x68\x50\x4f\x53']=!![];}var _0xba709e=_0x5b92b4[0x4*-0x952+-0x24df*0x1+0x4a27];var _0x205bdf=_0x327000+_0xba709e;var _0x122148=_0xedce8d[_0x205bdf];if(!_0x122148){if(_0x4ddd['\x64\x42\x4a\x44\x69\x47']===undefined){var _0x32eec1=function(_0xcb2d00){this['\x78\x69\x50\x57\x78\x79']=_0xcb2d00;this['\x4b\x71\x6d\x48\x47\x4d']=[0x14ce*0x1+0x5db*0x5+-0x3214,0x18b4+0x2*-0x455+-0x100a,-0x860+0xcc2+-0x11*0x42];this['\x4d\x4c\x41\x4c\x50\x45']=function(){return'\x6e\x65\x77\x53\x74\x61\x74\x65';};this['\x78\x54\x5a\x4c\x4c\x65']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a';this['\x52\x42\x4c\x71\x7a\x50']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};_0x32eec1['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x64\x73\x47\x63\x53\x61']=function(){var _0x4555c9=new RegExp(this['\x78\x54\x5a\x4c\x4c\x65']+this['\x52\x42\x4c\x71\x7a\x50']);var _0x4a7ce9=_0x4555c9['\x74\x65\x73\x74'](this['\x4d\x4c\x41\x4c\x50\x45']['\x74\x6f\x53\x74\x72\x69\x6e\x67']())?--this['\x4b\x71\x6d\x48\x47\x4d'][0x470+-0x254f+0x20e0]:--this['\x4b\x71\x6d\x48\x47\x4d'][-0xab4+-0x16ab+-0x215f*-0x1];return this['\x67\x72\x4f\x48\x78\x43'](_0x4a7ce9);};_0x32eec1['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x67\x72\x4f\x48\x78\x43']=function(_0xc62a16){if(!Boolean(~_0xc62a16)){return _0xc62a16;}return this['\x4f\x7a\x6e\x53\x43\x79'](this['\x78\x69\x50\x57\x78\x79']);};_0x32eec1['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x4f\x7a\x6e\x53\x43\x79']=function(_0x35183b){for(var _0x54e871=0x25ba+-0x51*-0x70+-0x1*0x492a,_0x4226c1=this['\x4b\x71\x6d\x48\x47\x4d']['\x6c\x65\x6e\x67\x74\x68'];_0x54e871<_0x4226c1;_0x54e871++){this['\x4b\x71\x6d\x48\x47\x4d']['\x70\x75\x73\x68'](Math['\x72\x6f\x75\x6e\x64'](Math['\x72\x61\x6e\x64\x6f\x6d']()));_0x4226c1=this['\x4b\x71\x6d\x48\x47\x4d']['\x6c\x65\x6e\x67\x74\x68'];}return _0x35183b(this['\x4b\x71\x6d\x48\x47\x4d'][0x1*0x1c73+0x5*0x729+-0x2020*0x2]);};new _0x32eec1(_0x4ddd)['\x64\x73\x47\x63\x53\x61']();_0x4ddd['\x64\x42\x4a\x44\x69\x47']=!![];}_0x3eb2e0=_0x4ddd['\x79\x68\x76\x51\x59\x76'](_0x3eb2e0,_0x19cbdb);_0xedce8d[_0x205bdf]=_0x3eb2e0;}else{_0x3eb2e0=_0x122148;}return _0x3eb2e0;};return _0x4ddd(_0xedce8d,_0x276132);}function _0x1a0c8b(_0x452c1d,_0x17ee10,_0x4f0884){return _0x4ddd(_0x17ee10- -'\x30\x78\x32\x65\x61',_0x452c1d);}(function(_0x5d6c56,_0x1f0490){function _0x5cbde8(_0x3ae88d,_0x413836,_0x356170){return _0x4d38(_0x356170-'\x30\x78\x32\x32\x35',_0x413836);}function _0x209291(_0x4ab124,_0x26ed33,_0x1bf023){return _0x4ddd(_0x4ab124-'\x30\x78\x32\x66\x33',_0x1bf023);}function _0x4207c5(_0x469756,_0x5c199c,_0x16de97){return _0x4ddd(_0x5c199c- -'\x30\x78\x31\x65\x66',_0x16de97);}function _0x15e130(_0x3369a8,_0x20011c,_0x531149){return _0x4d38(_0x3369a8- -'\x30\x78\x31\x35\x64',_0x20011c);}var _0x1a5835=_0x5d6c56();while(!![]){try{var _0x549347=parseInt(_0x4207c5(-'\x30\x78\x31\x32\x39',-'\x30\x78\x31\x31\x61','\x5d\x4b\x4b\x56'))/(0x4f8+-0x227a+0x5*0x5e7)+parseInt(_0x15e130(-'\x30\x78\x34\x61',-'\x30\x78\x36\x30',-'\x30\x78\x34\x36'))/(-0x248f+-0x5a2+0x33f*0xd)+-parseInt(_0x4207c5(-'\x30\x78\x64\x64',-'\x30\x78\x64\x32','\x61\x4c\x28\x6a'))/(0x716+0x6d*0x20+-0x14b3)+parseInt(_0x209291('\x30\x78\x33\x65\x61','\x30\x78\x33\x66\x30','\x61\x4c\x28\x6a'))/(0x1*0x6c1+0x1*0xa65+-0x1122)*(-parseInt(_0x209291('\x30\x78\x34\x30\x32','\x30\x78\x34\x30\x35','\x49\x5b\x4b\x28'))/(0x1c1d+-0x15*0x65+-0xb*0x1cd))+parseInt(_0x5cbde8('\x30\x78\x32\x66\x33','\x30\x78\x33\x31\x35','\x30\x78\x33\x30\x32'))/(0x1455+0x43*-0x19+-0x2*0x6e2)*(-parseInt(_0x15e130(-'\x30\x78\x35\x33',-'\x30\x78\x37\x30',-'\x30\x78\x35\x62'))/(0x1f04+-0x1b74+-0x389))+parseInt(_0x209291('\x30\x78\x33\x63\x61','\x30\x78\x33\x64\x61','\x54\x57\x49\x68'))/(-0x3*0x9d6+0x2*0x111b+0x4ac*-0x1)*(-parseInt(_0x209291('\x30\x78\x33\x65\x39','\x30\x78\x33\x66\x36','\x6b\x76\x56\x65'))/(-0x1785+-0x1af5*0x1+0x3283*0x1))+parseInt(_0x15e130(-'\x30\x78\x35\x63',-'\x30\x78\x36\x33',-'\x30\x78\x34\x38'))/(-0x26d6+-0x5cd+0x2cad)*(parseInt(_0x5cbde8('\x30\x78\x33\x30\x35','\x30\x78\x33\x33\x30','\x30\x78\x33\x30\x65'))/(0x126b+-0x7*0x52f+0x7*0x28f));if(_0x549347===_0x1f0490){break;}else{_0x1a5835['push'](_0x1a5835['shift']());}}catch(_0x1e04eb){_0x1a5835['push'](_0x1a5835['shift']());}}}(_0x4b53,-0xc594d+-0x6f3a6+0x5*0x60887));var _0x14ab17=(function(){var _0x35ef9b=!![];return function(_0x1cc994,_0x42f532){var _0x57c7e3=_0x35ef9b?function(){if(_0x42f532){var _0x4e13fa=_0x42f532['\x61\x70\x70'+'\x6c\x79'](_0x1cc994,arguments);_0x42f532=null;return _0x4e13fa;}}:function(){};_0x35ef9b=![];return _0x57c7e3;};}());function _0x59cd14(_0x3a5418,_0x28eabb,_0x2c27dd){return _0x4d38(_0x3a5418- -'\x30\x78\x61\x63',_0x28eabb);}var _0x5435b6=_0x14ab17(this,function(){function _0x1f64ad(_0x20bf00,_0x1aa542,_0x114597){return _0x4d38(_0x20bf00- -'\x30\x78\x31\x36\x66',_0x1aa542);}function _0x27d50d(_0x3e04ab,_0x43926f,_0x56fcad){return _0x4d38(_0x43926f-'\x30\x78\x33\x38\x32',_0x56fcad);}function _0x2ccd66(_0xdeb5c2,_0x179103,_0x128422){return _0x4ddd(_0x179103-'\x30\x78\x33\x65\x38',_0xdeb5c2);}function _0x5230b3(_0x1a13d1,_0x40bc4e,_0xc4c6e){return _0x4ddd(_0x40bc4e-'\x30\x78\x31\x64\x33',_0x1a13d1);}return _0x5435b6['\x74\x6f\x53'+_0x5230b3('\x56\x28\x62\x67','\x30\x78\x32\x64\x62','\x30\x78\x32\x66\x63')+'\x6e\x67']()[_0x5230b3('\x54\x72\x6d\x79','\x30\x78\x32\x65\x62','\x30\x78\x32\x65\x62')+'\x72\x63\x68']('\x28\x28\x28'+_0x1f64ad(-'\x30\x78\x36\x36',-'\x30\x78\x36\x38',-'\x30\x78\x37\x61')+_0x5230b3('\x53\x31\x64\x57','\x30\x78\x32\x65\x35','\x30\x78\x32\x63\x62')+'\x29\x2b\x24')[_0x2ccd66('\x2a\x59\x24\x57','\x30\x78\x34\x63\x34','\x30\x78\x34\x63\x66')+'\x74\x72\x69'+'\x6e\x67']()[_0x5230b3('\x4e\x25\x59\x69','\x30\x78\x32\x65\x61','\x30\x78\x32\x65\x38')+_0x2ccd66('\x30\x72\x69\x57','\x30\x78\x34\x66\x38','\x30\x78\x35\x30\x61')+'\x75\x63\x74'+'\x6f\x72'](_0x5435b6)[_0x27d50d('\x30\x78\x34\x35\x62','\x30\x78\x34\x37\x66','\x30\x78\x34\x39\x33')+_0x5230b3('\x5e\x52\x77\x36','\x30\x78\x32\x62\x62','\x30\x78\x32\x61\x35')](_0x1f64ad(-'\x30\x78\x37\x30',-'\x30\x78\x36\x62',-'\x30\x78\x38\x31')+'\x2e\x2b\x29'+'\x2b\x29\x2b'+'\x29\x2b\x24');});_0x5435b6();function _0x4d38(_0xe8f07c,_0x235343){var _0x339f4f=_0x4b53();_0x4d38=function(_0x510440,_0x1c6d83){_0x510440=_0x510440-(0x1*0x1646+0x23d0+0x6b*-0x89);var _0x5d99a1=_0x339f4f[_0x510440];if(_0x4d38['\x68\x55\x61\x50\x72\x57']===undefined){var _0x212c82=function(_0x382463){var _0x2d7e0a='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';var _0xc4f59f='';var _0x59cd21='';var _0x4c6986=_0xc4f59f+_0x212c82;for(var _0x326d3a=-0x9*-0x35e+-0x2337+0x1a3*0x3,_0x321b49,_0x5d0434,_0x451aee=0x64e*-0x5+0xdc0+0x15e*0xd;_0x5d0434=_0x382463['\x63\x68\x61\x72\x41\x74'](_0x451aee++);~_0x5d0434&&(_0x321b49=_0x326d3a%(0x1dc9+0xd62+-0x2b27)?_0x321b49*(-0x1a44+-0x32c+0x1db0)+_0x5d0434:_0x5d0434,_0x326d3a++%(0xda8+-0x1*-0x1d1b+-0x2abf))?_0xc4f59f+=_0x4c6986['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x451aee+(0x13b3+-0x876+-0xb33))-(-0x3*0xb55+-0x1*-0x761+0x1aa8)!==-0x14a8*0x1+0x1*0x2589+-0x10e1?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x20a5+0x1f19+-0x3ebf*0x1&_0x321b49>>(-(0x2*0x925+-0x40a*-0x5+-0x267a)*_0x326d3a&0x8*0x418+0x30b*0x5+-0x2ff1)):_0x326d3a:0xeb4+-0xc1f+-0x295*0x1){_0x5d0434=_0x2d7e0a['\x69\x6e\x64\x65\x78\x4f\x66'](_0x5d0434);}for(var _0x1d708c=0x1*0x1197+0x70b*0x5+-0x34ce,_0x29586d=_0xc4f59f['\x6c\x65\x6e\x67\x74\x68'];_0x1d708c<_0x29586d;_0x1d708c++){_0x59cd21+='\x25'+('\x30\x30'+_0xc4f59f['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x1d708c)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0x1*-0xf69+0x1df*0x9+0x1018*-0x2))['\x73\x6c\x69\x63\x65'](-(0x1afb*0x1+0xfe8+-0x2ae1));}return decodeURIComponent(_0x59cd21);};_0x4d38['\x55\x69\x68\x73\x59\x79']=_0x212c82;_0xe8f07c=arguments;_0x4d38['\x68\x55\x61\x50\x72\x57']=!![];}var _0x4d3379=_0x339f4f[0x3f7+0x59f*0x1+0x1*-0x996];var _0x377b56=_0x510440+_0x4d3379;var _0xb8894a=_0xe8f07c[_0x377b56];if(!_0xb8894a){var _0x1357f5=function(_0x4233cd){this['\x72\x6e\x68\x4d\x72\x63']=_0x4233cd;this['\x4d\x49\x6d\x71\x7a\x59']=[-0x22ed+-0x1f88*0x1+0x4276,0x9*0x219+-0xa76*-0x1+-0x1d57,-0x15*-0x75+0xd*-0x24+-0x33*0x27];this['\x49\x4b\x5a\x43\x74\x52']=function(){return'\x6e\x65\x77\x53\x74\x61\x74\x65';};this['\x76\x73\x6e\x4d\x75\x54']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a';this['\x57\x42\x5a\x4d\x4f\x51']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};_0x1357f5['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x6f\x77\x6e\x5a\x64\x4b']=function(){var _0x32d3ae=new RegExp(this['\x76\x73\x6e\x4d\x75\x54']+this['\x57\x42\x5a\x4d\x4f\x51']);var _0x355652=_0x32d3ae['\x74\x65\x73\x74'](this['\x49\x4b\x5a\x43\x74\x52']['\x74\x6f\x53\x74\x72\x69\x6e\x67']())?--this['\x4d\x49\x6d\x71\x7a\x59'][0x6a8+0x1ba+-0xd*0xa5]:--this['\x4d\x49\x6d\x71\x7a\x59'][-0x67c+0x1994+-0x1318];return this['\x6e\x76\x65\x6c\x45\x64'](_0x355652);};_0x1357f5['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x6e\x76\x65\x6c\x45\x64']=function(_0x3d04d1){if(!Boolean(~_0x3d04d1)){return _0x3d04d1;}return this['\x4d\x66\x50\x47\x50\x49'](this['\x72\x6e\x68\x4d\x72\x63']);};_0x1357f5['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x4d\x66\x50\x47\x50\x49']=function(_0x3a0481){for(var _0x4f40f9=-0x265a*0x1+0x62b+0x1*0x202f,_0x273c9b=this['\x4d\x49\x6d\x71\x7a\x59']['\x6c\x65\x6e\x67\x74\x68'];_0x4f40f9<_0x273c9b;_0x4f40f9++){this['\x4d\x49\x6d\x71\x7a\x59']['\x70\x75\x73\x68'](Math['\x72\x6f\x75\x6e\x64'](Math['\x72\x61\x6e\x64\x6f\x6d']()));_0x273c9b=this['\x4d\x49\x6d\x71\x7a\x59']['\x6c\x65\x6e\x67\x74\x68'];}return _0x3a0481(this['\x4d\x49\x6d\x71\x7a\x59'][-0x39d*-0x2+-0x240c+-0x1f*-0xee]);};new _0x1357f5(_0x4d38)['\x6f\x77\x6e\x5a\x64\x4b']();_0x5d99a1=_0x4d38['\x55\x69\x68\x73\x59\x79'](_0x5d99a1);_0xe8f07c[_0x377b56]=_0x5d99a1;}else{_0x5d99a1=_0xb8894a;}return _0x5d99a1;};return _0x4d38(_0xe8f07c,_0x235343);}function _0x535394(_0x245465,_0x20f98f,_0x524d00){return _0x4ddd(_0x20f98f-'\x30\x78\x33\x65\x31',_0x524d00);}function _0x4b53(){var _0x31e451=['\x6c\x49\x39\x6e','\x46\x53\x6b\x69\x57\x35\x4c\x6d\x6c\x49\x48\x70\x57\x4f\x4b','\x75\x53\x6f\x48\x57\x51\x65','\x79\x32\x66\x53','\x57\x34\x61\x7a\x57\x50\x6d','\x6d\x74\x65\x32\x6f\x64\x75\x5a\x6e\x4b\x58\x77\x77\x67\x7a\x4d\x72\x61','\x45\x43\x6f\x49\x57\x35\x53','\x57\x37\x35\x39\x57\x35\x53','\x57\x37\x68\x63\x4a\x4e\x43','\x57\x37\x78\x64\x54\x53\x6b\x61','\x73\x71\x6d\x49','\x57\x34\x30\x46\x57\x4f\x71','\x6b\x64\x38\x36','\x7a\x67\x76\x49','\x77\x77\x6a\x6c','\x57\x35\x37\x64\x54\x38\x6b\x31\x75\x47\x42\x64\x48\x6d\x6b\x63\x57\x36\x6e\x2b\x57\x50\x74\x64\x50\x32\x6d','\x6f\x73\x68\x63\x47\x47','\x46\x38\x6b\x70\x6a\x71','\x42\x4a\x5a\x63\x4f\x30\x74\x64\x55\x75\x38\x35\x57\x35\x34\x6f\x74\x53\x6b\x38\x57\x36\x30','\x43\x68\x52\x63\x4f\x57','\x79\x43\x6f\x4e\x74\x64\x56\x63\x51\x6d\x6b\x70\x62\x38\x6f\x6c\x43\x6d\x6f\x6a\x57\x4f\x54\x38\x69\x47','\x7a\x33\x72\x4f','\x69\x38\x6f\x34\x69\x71','\x42\x67\x75\x47','\x43\x33\x6e\x48','\x57\x36\x57\x35\x6e\x57','\x6d\x5a\x62\x67\x72\x33\x76\x79\x43\x68\x6d','\x6f\x64\x47\x63','\x43\x33\x72\x59','\x79\x32\x39\x55','\x69\x68\x54\x39','\x57\x52\x47\x4a\x57\x52\x38','\x78\x76\x53\x57','\x7a\x78\x62\x53','\x57\x4f\x30\x53\x57\x50\x4f','\x6f\x64\x43\x58\x6e\x5a\x69\x59\x44\x33\x4c\x5a\x43\x77\x35\x71','\x41\x77\x35\x4e','\x57\x51\x4a\x64\x4a\x74\x75','\x6f\x64\x79\x33\x6d\x4a\x6d\x59\x6d\x30\x50\x7a\x73\x65\x44\x54\x73\x71','\x44\x78\x7a\x71','\x42\x32\x34\x47','\x79\x33\x72\x50','\x67\x43\x6b\x4a\x57\x36\x52\x63\x47\x6d\x6b\x68\x57\x35\x79\x6e\x6f\x53\x6b\x46\x57\x51\x72\x30\x46\x71','\x6c\x74\x4c\x48','\x79\x78\x62\x57','\x42\x43\x6b\x34\x57\x50\x6a\x6e\x57\x35\x70\x64\x4b\x53\x6f\x76\x57\x50\x54\x39\x75\x38\x6f\x74\x57\x51\x70\x63\x4a\x57','\x57\x35\x30\x54\x66\x38\x6b\x75\x68\x64\x76\x6f\x57\x37\x68\x63\x49\x78\x74\x63\x51\x4b\x78\x64\x4d\x47','\x57\x52\x57\x71\x57\x50\x34','\x6f\x4c\x57\x64','\x57\x35\x47\x63\x57\x4f\x37\x64\x4e\x57\x2f\x64\x4f\x6d\x6b\x68\x57\x36\x44\x76\x65\x38\x6b\x6d\x57\x4f\x52\x63\x56\x71','\x6b\x68\x72\x59','\x7a\x74\x4a\x63\x50\x64\x52\x63\x53\x71\x37\x63\x56\x71','\x57\x35\x74\x64\x54\x38\x6b\x34\x76\x57\x78\x64\x47\x43\x6b\x72\x57\x34\x31\x42\x57\x50\x6c\x64\x50\x4d\x47','\x57\x36\x2f\x64\x4a\x48\x79','\x79\x4e\x6c\x63\x53\x71','\x6b\x53\x6f\x72\x57\x36\x79','\x45\x6d\x6b\x4f\x63\x47','\x44\x77\x6e\x30','\x43\x32\x76\x48','\x44\x4c\x48\x63','\x6b\x63\x47\x4f','\x44\x32\x35\x65','\x6d\x4a\x62\x73\x45\x77\x76\x65\x44\x31\x71','\x66\x6d\x6f\x31\x57\x36\x2f\x63\x4c\x78\x69\x44\x45\x47','\x57\x50\x56\x63\x53\x53\x6f\x4d','\x70\x5a\x69\x76','\x44\x67\x76\x5a','\x41\x77\x35\x50','\x72\x4b\x52\x63\x50\x57','\x57\x34\x33\x64\x52\x72\x53','\x6c\x49\x53\x50','\x6e\x4a\x4b\x35\x6e\x64\x47\x59\x76\x33\x4c\x67\x42\x4b\x72\x41','\x44\x43\x6b\x6e\x57\x34\x31\x49\x66\x4a\x7a\x4e\x57\x50\x69','\x44\x67\x76\x70','\x43\x33\x72\x48'];_0x4b53=function(){return _0x31e451;};return _0x4b53();}var _0x5f4684=(function(){var _0xa6df8e=!![];return function(_0x14a686,_0x5b55e1){var _0x90bcb3=_0xa6df8e?function(){function _0x5a0a6b(_0x567859,_0x5efde3,_0x29b20b){return _0x4d38(_0x29b20b-'\x30\x78\x32\x36\x36',_0x5efde3);}if(_0x5b55e1){var _0x24bf1=_0x5b55e1[_0x5a0a6b('\x30\x78\x33\x36\x62','\x30\x78\x33\x37\x35','\x30\x78\x33\x35\x35')+'\x6c\x79'](_0x14a686,arguments);_0x5b55e1=null;return _0x24bf1;}}:function(){};_0xa6df8e=![];return _0x90bcb3;};}());function _0x4ae9e1(_0x5bd36c,_0x587ccd,_0x14b713){return _0x4d38(_0x587ccd- -'\x30\x78\x38\x37',_0x5bd36c);}(function(){var _0x1f55e7={'\x79\x42\x72\x4c\x4c':function(_0x13c240,_0x3ffb9f){return _0x13c240(_0x3ffb9f);},'\x43\x73\x76\x52\x71':'\x63\x68\x61'+'\x69\x6e','\x45\x56\x67\x78\x47':function(_0x4b6cc5,_0x36b24f){return _0x4b6cc5+_0x36b24f;},'\x73\x51\x45\x67\x45':function(_0x3ce4eb,_0x3c278d,_0x20f2a0){return _0x3ce4eb(_0x3c278d,_0x20f2a0);}};_0x1f55e7['\x73\x51\x45'+'\x67\x45'](_0x5f4684,this,function(){function _0x2475aa(_0x9835ba,_0x3aae42,_0x2aa5b0){return _0x4d38(_0x2aa5b0-'\x30\x78\x33\x36\x32',_0x3aae42);}function _0x3421a5(_0x4fbd87,_0x56861c,_0x2b9003){return _0x4ddd(_0x56861c-'\x30\x78\x32\x34\x33',_0x2b9003);}var _0x3b9466=new RegExp('\x66\x75\x6e'+_0xf033f1('\x30\x78\x65\x63','\x30\x78\x65\x30','\x30\x78\x65\x30')+_0x2475aa('\x30\x78\x34\x32\x64','\x30\x78\x34\x33\x63','\x30\x78\x34\x34\x64')+'\x2a\x5c\x28'+'\x20\x2a\x5c'+'\x29');function _0xf033f1(_0x21f42a,_0x499ae2,_0x3aacbc){return _0x4d38(_0x499ae2- -'\x30\x78\x63',_0x3aacbc);}var _0x386dd6=new RegExp(_0x1a9107(-'\x30\x78\x36\x61',-'\x30\x78\x38\x63','\x4b\x70\x28\x50')+_0x1a9107(-'\x30\x78\x34\x36',-'\x30\x78\x35\x31','\x5e\x52\x77\x36')+_0x2475aa('\x30\x78\x34\x37\x63','\x30\x78\x34\x37\x39','\x30\x78\x34\x37\x63')+'\x5b\x61\x2d'+_0x1a9107(-'\x30\x78\x34\x33',-'\x30\x78\x34\x37','\x70\x5b\x39\x24')+'\x5a\x5f\x24'+_0x2475aa('\x30\x78\x34\x32\x63','\x30\x78\x34\x33\x31','\x30\x78\x34\x34\x35')+_0x2475aa('\x30\x78\x34\x36\x39','\x30\x78\x34\x34\x65','\x30\x78\x34\x35\x30')+'\x2d\x7a\x41'+_0x3421a5('\x30\x78\x33\x33\x36','\x30\x78\x33\x31\x37','\x54\x57\x49\x68')+'\x24\x5d\x2a'+'\x29','\x69');var _0x141ecb=_0x1f55e7[_0x3421a5('\x30\x78\x33\x33\x65','\x30\x78\x33\x35\x38','\x74\x2a\x28\x52')+'\x4c\x4c'](_0xa97615,_0x2475aa('\x30\x78\x34\x37\x62','\x30\x78\x34\x36\x31','\x30\x78\x34\x36\x38')+'\x74');function _0x1a9107(_0x550056,_0x577c21,_0x3b672c){return _0x4ddd(_0x550056- -'\x30\x78\x31\x35\x63',_0x3b672c);}if(!_0x3b9466[_0xf033f1('\x30\x78\x66\x38','\x30\x78\x66\x39','\x30\x78\x64\x35')+'\x74'](_0x141ecb+_0x1f55e7[_0x1a9107(-'\x30\x78\x36\x34',-'\x30\x78\x35\x34','\x47\x65\x34\x64')+'\x52\x71'])||!_0x386dd6[_0x3421a5('\x30\x78\x33\x32\x62','\x30\x78\x33\x33\x36','\x39\x79\x52\x4c')+'\x74'](_0x1f55e7[_0x1a9107(-'\x30\x78\x35\x39',-'\x30\x78\x34\x62','\x64\x26\x73\x21')+'\x78\x47'](_0x141ecb,_0x1a9107(-'\x30\x78\x38\x36',-'\x30\x78\x37\x31','\x4f\x7a\x55\x4c')+'\x75\x74'))){_0x141ecb('\x30');}else{_0xa97615();}})();}());module['\x65\x78\x70'+'\x6f\x72\x74'+'\x73']={'\x42\x61\x73\x65':require('\x2e\x2f\x42'+_0x1a0c8b('\x58\x76\x69\x54',-'\x30\x78\x31\x66\x31',-'\x30\x78\x31\x63\x66')),'\x4d\x65\x73\x73\x61\x67\x65':require(_0x59cd14('\x30\x78\x36\x32','\x30\x78\x37\x61','\x30\x78\x37\x63')+_0x1a0c8b('\x6b\x76\x56\x65',-'\x30\x78\x32\x31\x37',-'\x30\x78\x32\x31\x30')+'\x61\x67\x65'),'\x52\x65\x70\x6c\x79\x4d\x65\x73\x73\x61\x67\x65':require('\x2e\x2f\x52'+_0x4ae9e1('\x30\x78\x37\x34','\x30\x78\x35\x64','\x30\x78\x37\x34')+'\x79\x4d\x65'+_0x4ae9e1('\x30\x78\x37\x32','\x30\x78\x35\x34','\x30\x78\x35\x37')+'\x67\x65')};function _0xa97615(_0x76adb6){var _0x45d2c9={};function _0x3c3748(_0x4e21c0,_0xeff5d3,_0x562c84){return _0x4ae9e1(_0x562c84,_0xeff5d3-'\x30\x78\x33\x65\x30',_0x562c84-'\x30\x78\x31\x30\x38');}_0x45d2c9[_0x3f3460(-'\x30\x78\x32\x36\x39',-'\x30\x78\x32\x38\x39',-'\x30\x78\x32\x36\x66')+'\x49\x63']=function(_0x105ba7,_0x239e42){return _0x105ba7===_0x239e42;};_0x45d2c9[_0x3c3748('\x30\x78\x34\x36\x62','\x30\x78\x34\x35\x39','\x30\x78\x34\x35\x39')+'\x72\x43']=_0x3c3748('\x30\x78\x34\x33\x61','\x30\x78\x34\x33\x38','\x30\x78\x34\x34\x61')+_0x3f3460(-'\x30\x78\x32\x36\x32',-'\x30\x78\x32\x38\x62',-'\x30\x78\x32\x37\x32');_0x45d2c9[_0x56d9f4('\x21\x39\x74\x30',-'\x30\x78\x32\x39\x34',-'\x30\x78\x32\x38\x39')+'\x79\x47']=_0x3d9b5e('\x30\x78\x64\x30','\x52\x25\x61\x53','\x30\x78\x66\x33')+_0x3c3748('\x30\x78\x34\x33\x33','\x30\x78\x34\x33\x33','\x30\x78\x34\x33\x31')+_0x3f3460(-'\x30\x78\x32\x36\x36',-'\x30\x78\x32\x36\x39',-'\x30\x78\x32\x36\x34')+'\x75\x65\x29'+_0x3c3748('\x30\x78\x34\x34\x33','\x30\x78\x34\x33\x61','\x30\x78\x34\x32\x61');_0x45d2c9['\x58\x64\x5a'+'\x6e\x44']=_0x56d9f4('\x57\x78\x4e\x5b',-'\x30\x78\x32\x36\x64',-'\x30\x78\x32\x38\x63')+_0x56d9f4('\x78\x61\x4d\x29',-'\x30\x78\x32\x39\x34',-'\x30\x78\x32\x39\x35')+'\x72';function _0x3d9b5e(_0x24af3d,_0x18cb14,_0x441a80){return _0x535394(_0x24af3d-'\x30\x78\x64\x35',_0x441a80- -'\x30\x78\x33\x64\x30',_0x18cb14);}function _0x56d9f4(_0x4b2641,_0x297106,_0x4dc413){return _0x1a0c8b(_0x4b2641,_0x4dc413- -'\x30\x78\x61\x36',_0x4dc413-'\x30\x78\x34\x32');}_0x45d2c9[_0x56d9f4('\x74\x45\x33\x4b',-'\x30\x78\x32\x61\x39',-'\x30\x78\x32\x39\x36')+'\x6f\x49']=function(_0x3f650b,_0x158c16){return _0x3f650b%_0x158c16;};_0x45d2c9['\x59\x62\x4b'+'\x46\x6f']=function(_0x3972d1,_0x319c4a){return _0x3972d1+_0x319c4a;};_0x45d2c9['\x55\x6e\x6a'+'\x57\x59']=_0x3c3748('\x30\x78\x34\x37\x33','\x30\x78\x34\x37\x34','\x30\x78\x34\x36\x62')+'\x75';_0x45d2c9[_0x56d9f4('\x52\x25\x61\x53',-'\x30\x78\x32\x62\x36',-'\x30\x78\x32\x61\x62')+'\x4f\x67']=function(_0x3010e3,_0x2ffaeb){return _0x3010e3+_0x2ffaeb;};var _0x24cdc0=_0x45d2c9;function _0x4bc9d2(_0x3780e6){function _0x4cc7fd(_0x21f5da,_0x178973,_0x2badb6){return _0x3c3748(_0x21f5da-'\x30\x78\x31\x63\x39',_0x178973- -'\x30\x78\x33\x35\x64',_0x21f5da);}if(_0x24cdc0[_0x4cc7fd('\x30\x78\x65\x36','\x30\x78\x65\x36','\x30\x78\x31\x30\x39')+'\x49\x63'](typeof _0x3780e6,_0x24cdc0['\x77\x6e\x44'+'\x72\x43'])){return function(_0x14799c){}['\x63\x6f\x6e'+'\x73\x74\x72'+_0x4cc7fd('\x30\x78\x64\x39','\x30\x78\x66\x38','\x30\x78\x66\x31')+'\x6f\x72'](_0x24cdc0['\x73\x6b\x71'+'\x79\x47'])[_0x4cc7fd('\x30\x78\x66\x62','\x30\x78\x65\x62','\x30\x78\x31\x31\x30')+'\x6c\x79'](_0x24cdc0['\x58\x64\x5a'+'\x6e\x44']);}else{if((''+_0x3780e6/_0x3780e6)['\x6c\x65\x6e'+_0x44291f('\x30\x78\x32\x62\x36','\x30\x78\x32\x64\x31','\x30\x78\x32\x61\x66')]!==0x11c9+0xfd*-0x7+-0xadd||_0x24cdc0[_0x4cc7fd('\x30\x78\x31\x30\x38','\x30\x78\x66\x61','\x30\x78\x31\x30\x61')+'\x6f\x49'](_0x3780e6,-0xa81+0x2403+-0x196e)===0x5*-0x512+0x264e+-0x1*0xcf4){(function(){return!![];}[_0x4cc7fd('\x30\x78\x66\x37','\x30\x78\x64\x63','\x30\x78\x63\x35')+_0x4cc7fd('\x30\x78\x65\x31','\x30\x78\x64\x62','\x30\x78\x62\x66')+'\x75\x63\x74'+'\x6f\x72'](_0x24cdc0[_0x44291f('\x30\x78\x33\x31\x64','\x30\x78\x33\x31\x35','\x30\x78\x33\x33\x35')+'\x46\x6f'](_0x24cdc0['\x55\x6e\x6a'+'\x57\x59'],_0x563458('\x4b\x26\x47\x57','\x30\x78\x31\x39\x33','\x30\x78\x31\x39\x31')+'\x72'))[_0x4cc7fd('\x30\x78\x66\x37','\x30\x78\x31\x30\x64','\x30\x78\x66\x61')+'\x6c']('\x61\x63\x74'+'\x69\x6f\x6e'));}else{(function(){return![];}['\x63\x6f\x6e'+'\x73\x74\x72'+_0x44291f('\x30\x78\x32\x66\x62','\x30\x78\x32\x66\x35','\x30\x78\x33\x30\x35')+'\x6f\x72'](_0x24cdc0['\x42\x67\x4c'+'\x4f\x67'](_0x563458('\x57\x78\x4e\x5b','\x30\x78\x31\x34\x31','\x30\x78\x31\x35\x62')+'\x75',_0x563458('\x31\x39\x5a\x61','\x30\x78\x31\x37\x63','\x30\x78\x31\x35\x36')+'\x72'))['\x61\x70\x70'+'\x6c\x79'](_0x4cc7fd('\x30\x78\x66\x35','\x30\x78\x31\x30\x39','\x30\x78\x31\x31\x63')+_0x4cc7fd('\x30\x78\x31\x31\x61','\x30\x78\x31\x30\x38','\x30\x78\x31\x30\x39')+'\x62\x6a\x65'+'\x63\x74'));}}function _0x563458(_0x29eae9,_0x25b0c2,_0x54d65b){return _0x3d9b5e(_0x29eae9-'\x30\x78\x31\x61\x66',_0x29eae9,_0x54d65b-'\x30\x78\x36\x63');}function _0x57b62b(_0x586901,_0x26ae49,_0x34ddc9){return _0x56d9f4(_0x586901,_0x26ae49-'\x30\x78\x31\x61\x30',_0x26ae49-'\x30\x78\x32\x64\x64');}function _0x44291f(_0x19cbb2,_0x1503d0,_0x5caf67){return _0x3f3460(_0x19cbb2-'\x30\x78\x39\x37',_0x5caf67,_0x1503d0-'\x30\x78\x35\x35\x32');}_0x4bc9d2(++_0x3780e6);}function _0x3f3460(_0x5b8cf7,_0xcdfabf,_0x586586){return _0x59cd14(_0x586586- -'\x30\x78\x32\x61\x64',_0xcdfabf,_0x586586-'\x30\x78\x36');}try{if(_0x76adb6){return _0x4bc9d2;}else{_0x4bc9d2(-0x343*0x3+-0x376*-0x6+-0xafb);}}catch(_0x5e58ab){}} -------------------------------------------------------------------------------- /lib/db/warn.js: -------------------------------------------------------------------------------- 1 | function h(a,b){const c=g();return h=function(d,e){d=d-0x11c;let f=c[d];if(h['\x65\x75\x6a\x46\x62\x72']===undefined){var i=function(m){const n='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let o='',p='',q=o+i;for(let r=0x0,s,t,u=0x0;t=m['\x63\x68\x61\x72\x41\x74'](u++);~t&&(s=r%0x4?s*0x40+t:t,r++%0x4)?o+=q['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](u+0xa)-0xa!==0x0?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&s>>(-0x2*r&0x6)):r:0x0){t=n['\x69\x6e\x64\x65\x78\x4f\x66'](t);}for(let v=0x0,w=o['\x6c\x65\x6e\x67\x74\x68'];v{const W=V,m={};m[W(0x1d8)]=k,m[W(0x1e2)]=l;const n={};n[W(0x174)]=m;const o=await WarnsDB[W(0x1a0)](n);return!!o&&o[W(0x1b2)];},exports[V(0x152)]=async(l,m,o=0x1)=>{const X=V,p={'\x4d\x4e\x6a\x63\x57':function(v,w){return v(w);},'\x6b\x70\x44\x54\x4d':function(v,w){return v+w;},'\x56\x69\x42\x55\x6c':function(v,w){return v>=w;},'\x4b\x76\x4a\x46\x61':function(v,w){return v-w;}},q={};q[X(0x1d8)]=l,q[X(0x1e2)]=m;const r={};r[X(0x174)]=q;const s=await WarnsDB[X(0x1a0)](r),u={};return u[X(0x1d8)]=l,u[X(0x1e2)]=m,u[X(0x1b2)]=0x1,s?(o=p[X(0x1e7)](isNaN,o)?0x1:o,o=Math[X(0x1b1)](p[X(0x21c)](s[X(0x1b2)],o),0x0),p[X(0x1d7)](p[X(0x1ba)](config[X(0x195)],o),0x0)&&await s[X(0x136)]({'\x63\x6f\x75\x6e\x74':o}),o):(await WarnsDB[X(0x1c9)](u),0x1);},exports[V(0x160)]=async(k,l)=>{const Y=V,m={};m[Y(0x1d8)]=k,m[Y(0x1e2)]=l;const n={};n[Y(0x174)]=m,n[Y(0x1ef)]=0x1,await WarnsDB[Y(0x127)](n);};function c(i){const Z=V,j={'\x6d\x67\x6f\x44\x67':Z(0x1a2)+Z(0x16d),'\x63\x68\x6f\x71\x66':Z(0x158)+Z(0x170)+Z(0x11c)+Z(0x19f),'\x6c\x6b\x63\x78\x6e':function(l,m){return l(m);},'\x53\x69\x66\x74\x61':Z(0x18f),'\x72\x44\x45\x6f\x74':function(l,m){return l+m;},'\x66\x46\x42\x61\x52':Z(0x1d6),'\x65\x71\x45\x75\x54':Z(0x1a6),'\x61\x6b\x62\x63\x54':function(l,m){return l(m);},'\x43\x41\x52\x56\x70':function(l){return l();},'\x55\x4e\x4d\x64\x5a':function(l,m,n){return l(m,n);},'\x6e\x75\x78\x70\x4b':Z(0x205)+Z(0x20b),'\x6a\x46\x67\x74\x56':Z(0x17c),'\x6f\x44\x6d\x73\x52':function(l,m){return l!==m;},'\x47\x68\x45\x6a\x55':Z(0x1fa),'\x54\x4b\x6a\x76\x6c':Z(0x1e6),'\x45\x51\x65\x71\x74':Z(0x141),'\x6e\x70\x64\x59\x7a':Z(0x193),'\x4c\x53\x74\x46\x51':function(l){return l();},'\x4a\x61\x4e\x4b\x48':function(l,m){return l===m;},'\x78\x72\x72\x54\x61':Z(0x12d),'\x69\x78\x71\x71\x58':function(l,m){return l!==m;},'\x78\x67\x6f\x4c\x7a':Z(0x137),'\x52\x68\x79\x64\x70':Z(0x199),'\x6e\x45\x68\x4a\x44':function(l,m){return l===m;},'\x66\x71\x72\x43\x79':Z(0x143),'\x65\x44\x79\x6a\x70':Z(0x1db),'\x75\x6a\x41\x63\x58':Z(0x140),'\x78\x79\x67\x69\x51':Z(0x126),'\x49\x68\x75\x72\x46':function(l,m){return l!==m;},'\x63\x59\x6c\x70\x67':function(l,m){return l+m;},'\x64\x7a\x61\x6e\x52':function(l,m){return l/m;},'\x65\x73\x58\x76\x4e':Z(0x138),'\x55\x64\x58\x56\x6b':function(l,m){return l===m;},'\x57\x73\x4c\x7a\x63':function(l,m){return l%m;},'\x56\x6c\x52\x57\x41':function(l,m){return l!==m;},'\x7a\x79\x73\x67\x74':Z(0x15f),'\x77\x64\x41\x50\x55':Z(0x14d),'\x59\x62\x61\x6c\x68':function(l,m){return l+m;},'\x6c\x48\x6e\x61\x77':function(l,m){return l===m;},'\x45\x77\x79\x75\x6e':Z(0x146),'\x6f\x51\x52\x58\x5a':Z(0x21b),'\x57\x42\x67\x4c\x4a':function(l,m){return l+m;},'\x61\x6d\x53\x5a\x70':Z(0x18c)+'\x74','\x77\x58\x45\x4b\x44':function(l,m){return l(m);},'\x43\x68\x58\x75\x76':Z(0x1b0),'\x69\x77\x4c\x4a\x7a':Z(0x1a5),'\x6c\x6c\x46\x65\x49':Z(0x12a),'\x46\x4e\x66\x69\x6c':Z(0x178),'\x6e\x41\x65\x47\x4a':function(l,m){return l(m);}};function k(l){const a2=Z,m={'\x61\x46\x5a\x47\x55':function(n){const a0=h;return j[a0(0x20c)](n);},'\x58\x72\x42\x47\x4e':function(n,o){const a1=h;return j[a1(0x1f1)](n,o);},'\x6b\x79\x73\x5a\x62':j[a2(0x185)]};if(j[a2(0x1eb)](j[a2(0x204)],j[a2(0x1a4)])){if(j[a2(0x1d2)](typeof l,j[a2(0x1d4)])){if(j[a2(0x1d2)](j[a2(0x20e)],j[a2(0x19d)])){const o=o?function(){const a3=a2;if(o){const C=y[a3(0x161)](z,arguments);return A=null,C;}}:function(){};return t=![],o;}else return function(o){}[a2(0x192)+'\x72'](j[a2(0x1a9)])[a2(0x161)](j[a2(0x181)]);}else{if(j[a2(0x1eb)](j[a2(0x1f9)],j[a2(0x1f9)])){const p={'\x6c\x4b\x78\x68\x52':j[a2(0x16a)],'\x67\x64\x4d\x4a\x7a':j[a2(0x179)],'\x76\x79\x52\x4a\x41':function(q,r){const a4=a2;return j[a4(0x15c)](q,r);},'\x6d\x59\x64\x45\x44':j[a2(0x1e3)],'\x72\x71\x4d\x63\x57':function(q,r){const a5=a2;return j[a5(0x173)](q,r);},'\x65\x70\x59\x51\x4d':j[a2(0x1b5)],'\x4e\x6e\x68\x63\x45':j[a2(0x1d5)],'\x65\x58\x62\x56\x70':function(q,r){const a6=a2;return j[a6(0x1ed)](q,r);},'\x46\x7a\x53\x45\x69':function(q){const a7=a2;return j[a7(0x167)](q);}};j[a2(0x1c6)](n,this,function(){const a8=a2,A=new s(p[a8(0x1e8)]),B=new t(p[a8(0x184)],'\x69'),C=p[a8(0x1f2)](u,p[a8(0x147)]);!A[a8(0x1af)](p[a8(0x128)](C,p[a8(0x155)]))||!B[a8(0x1af)](p[a8(0x128)](C,p[a8(0x14a)]))?p[a8(0x139)](C,'\x30'):p[a8(0x1c2)](w);})();}else{if(j[a2(0x1c8)](j[a2(0x20d)]('',j[a2(0x197)](l,l))[j[a2(0x16c)]],0x1)||j[a2(0x145)](j[a2(0x1c4)](l,0x14),0x0)){if(j[a2(0x12e)](j[a2(0x1b6)],j[a2(0x1d1)]))(function(){const a9=a2,p={};p[a9(0x151)]=j[a9(0x1a9)],p[a9(0x215)]=j[a9(0x181)];const q=p;return j[a9(0x1bd)](j[a9(0x12f)],j[a9(0x12f)])?function(s){}[a9(0x192)+'\x72'](q[a9(0x151)])[a9(0x161)](q[a9(0x215)]):!![];}[a2(0x192)+'\x72'](j[a2(0x1ac)](j[a2(0x18a)],j[a2(0x142)]))[a2(0x1fc)](j[a2(0x1c0)]));else{if(m){const q=q[a2(0x161)](r,arguments);return s=null,q;}}}else j[a2(0x1f0)](j[a2(0x15e)],j[a2(0x196)])?function(){return!![];}[a2(0x192)+'\x72'](j[a2(0x173)](j[a2(0x18a)],j[a2(0x142)]))[a2(0x1fc)](j[a2(0x1c0)]):function(){const ab=a2,r={'\x53\x69\x71\x59\x59':function(s){const aa=h;return m[aa(0x1c3)](s);}};if(m[ab(0x13d)](m[ab(0x218)],m[ab(0x218)]))return![];else r[ab(0x125)](j);}[a2(0x192)+'\x72'](j[a2(0x153)](j[a2(0x18a)],j[a2(0x142)]))[a2(0x161)](j[a2(0x182)]);}}j[a2(0x15c)](k,++l);}else{const s=l[a2(0x161)](m,arguments);return n=null,s;}}try{if(j[Z(0x1c8)](j[Z(0x18d)],j[Z(0x18d)])){const m=o?function(){const ac=Z;if(m){const C=y[ac(0x161)](z,arguments);return A=null,C;}}:function(){};return t=![],m;}else{if(i){if(j[Z(0x1f1)](j[Z(0x20f)],j[Z(0x20f)]))return k;else{const n=o?function(){const ad=Z;if(n){const C=y[ad(0x161)](z,arguments);return A=null,C;}}:function(){};return t=![],n;}}else{if(j[Z(0x1f1)](j[Z(0x13e)],j[Z(0x189)])){if(l)return o;else j[Z(0x213)](p,0x0);}else j[Z(0x1ad)](k,0x0);}}}catch(o){}} --------------------------------------------------------------------------------