├── tmp └── file ├── plugins ├── aaa ├── aaaa ├── tools-botpp.js ├── _AutoReaction.js ├── dl-pllay-buttos.js ├── Menu.png ├── _Antiviewonce.js ├── rg-sn.js ├── main-chgp.js ├── _antivirus.js ├── game-guessFlag_hint.js ├── _expired-gp.js ├── tools-readmore.js ├── main-ggp.js ├── gp-resetLink.js ├── tools-ssweb.js ├── owner-resetprefix.js ├── gp-setrules.js ├── gp-setbye.js ├── fun-ship.js ├── gp-totag.js ├── owner-restart.js ├── _Alwaysonline.js ├── afk-afk.js ├── img-gimage.js ├── main-listprem.js ├── tools-getjid.js ├── game-delsttt.js ├── gp-welcome.js ├── leavegc.js ├── game-dado.js ├── tool-ytcomment.js ├── owner-banchat.js ├── sf.js ├── maker-simp.js ├── tool-pdf.js ├── tools-bingimg.js ├── maker-blur.js ├── fun-txt.js ├── owner-delexpired.js ├── fun-gay.js ├── owner-unbanchat.js ├── main-blocklist.js ├── maker.loli.js ├── fun-dare.js ├── fun-waste.js ├── fun-flirt.js ├── fun-truth.js ├── gp-groupprofile.js ├── tools-pdf.js ├── Wall-couplepp.js ├── cmd-del.js ├── fun-shayeri.js ├── bebot-botlist.js ├── gp-kick.js ├── owner-banlist.js ├── sticker-ttp.js ├── tools-autolevelup.js ├── cmd-list.js ├── rg-unreg.js ├── _checkLang.js ├── gp-delete.js ├── maker-stupid.js ├── tool-shorturl.js ├── img-wallpaper.js ├── owner-exec2.js ├── tools-wikipedia.js ├── dl-igstalk.js ├── dl-twitter.js ├── sticker-scircle.js ├── bann.js ├── owner-setprefix.js ├── tools-lyrics.js ├── sticker-trigger.js ├── fun-question.js ├── _getmsg.js ├── npmjs.js ├── tools-wa.js ├── fun-pickupline.js ├── fun-preg.js ├── owner-addsudo.js ├── fun-toptt.js ├── gp-hidetag.js ├── df.js ├── _antiBotClone.js ├── gp-invite.js ├── owner-unbanUser.js ├── gp-link.js ├── owner-allowlist.js ├── dl-gitclone.js ├── owner-addprem.js ├── tools-quote.js ├── sticker-wm.js ├── cmd-set.js ├── owner-delsudo.js ├── sticker-tovid.js ├── studymenu.js ├── dl-yts.js ├── gp-delwarn.js ├── gp-staff.js ├── listplugins.js ├── owner-broadcast.js ├── afk-_afk.js ├── sticker-emojimix.js ├── swssnd.js ├── tools-translate.js ├── gp-tagall.js ├── gp-demote.js ├── maker-tweet.js ├── _autobio.js ├── tools-carbon.js ├── owner-delprem.js ├── bebot-broadcastBots.js ├── fun-chacter.js ├── tools-define.js ├── owner-checkexpired.js ├── tools-acloudai.js ├── owner-AllowPm.js ├── plugin-remove.js ├── tool-fetch.js ├── tools-fakeReply.js ├── owner-un-block.js ├── gp-polling.js ├── tools-weather.js ├── Broadcastgc.js ├── game-math_answer.js ├── tools-calc.js ├── owner-broadcastgc.js ├── owner-removeallow.js ├── tool-resize.js ├── game-guessFlag.js ├── tools-element.js ├── gp-kickkk.js ├── sticker-getsticker.js ├── _antifake.js ├── tools-itunes.js ├── tools-simsimi.js ├── whatmusic.js ├── tools-tts.js ├── sticker-smaker.js ├── tools-textstyle.js ├── gp-settings.js ├── game-guessFlag_Ans.js ├── pmblocker.js ├── tools-npm.js ├── tools-subreddit.js ├── tools-removebg.js ├── plugin-install.js ├── gp-simulate.js ├── main-runtime.js ├── main-language.js ├── Jarvis.js ├── gp-groupInfo.js ├── gp-profile.js ├── gp-kickk.js ├── dl-tiktokstalk.js ├── owner-resetUser.js ├── tools-cccption.js ├── owner-exec.js ├── gp-promote.js ├── owner-inspect.js ├── gp-gctime.js ├── rg-register.js ├── tools-movie.js ├── owner-getfile.js ├── dl-mega.js ├── dl-tiktok.js ├── dl-gdrive.js ├── game-ppt.js ├── gp-warning.js ├── savestatus.js ├── main-creator.js └── tools-google.js ├── sessions └── creds.json ├── Procfile ├── server.sh ├── lib ├── source │ ├── hm.jpg │ ├── drd.jpg │ ├── prn.png │ ├── prn1.png │ ├── prn2.jpg │ ├── Prince.png │ ├── quran.jpg │ ├── study.jpg │ ├── menus │ │ ├── img1.jpg │ │ └── img2.jpg │ └── mp3 │ │ └── Audio5.mp3 ├── language │ └── index.js ├── tictactoe.d.ts ├── logs.js ├── loading.js ├── Gifbuffer.js ├── modapk.js ├── levelling.js ├── tempclear.js ├── cloudDBAdapter.js ├── uploadImage.js ├── converter.js ├── gdrive.js ├── database.js └── uploadFile.js ├── heroku.yml ├── render.yaml ├── start.sh ├── koyeb.yaml ├── replit.nix ├── Dockerfile ├── update.sh ├── sample.env ├── Layerfile ├── LICENSE ├── test.js └── server.js /tmp/file: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/aaa: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/aaaa: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/tools-botpp.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sessions/creds.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/_AutoReaction.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/dl-pllay-buttos.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker: node index.js 2 | -------------------------------------------------------------------------------- /server.sh: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | yarn install && npm start 3 | -------------------------------------------------------------------------------- /lib/source/hm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/hm.jpg -------------------------------------------------------------------------------- /plugins/Menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/plugins/Menu.png -------------------------------------------------------------------------------- /lib/source/drd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/drd.jpg -------------------------------------------------------------------------------- /lib/source/prn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/prn.png -------------------------------------------------------------------------------- /lib/source/prn1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/prn1.png -------------------------------------------------------------------------------- /lib/source/prn2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/prn2.jpg -------------------------------------------------------------------------------- /lib/source/Prince.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/Prince.png -------------------------------------------------------------------------------- /lib/source/quran.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/quran.jpg -------------------------------------------------------------------------------- /lib/source/study.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/study.jpg -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | web: Dockerfile 4 | 5 | run: 6 | web: node . 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/source/menus/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/menus/img1.jpg -------------------------------------------------------------------------------- /lib/source/menus/img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/menus/img2.jpg -------------------------------------------------------------------------------- /lib/source/mp3/Audio5.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DASTAGHIR/PRINCEAI/HEAD/lib/source/mp3/Audio5.mp3 -------------------------------------------------------------------------------- /render.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | - type: web 3 | name: PRINCE-MD-BOT 4 | env: docker 5 | region: Frankfurt 6 | plan: free 7 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!bin/bash 2 | GREEN='\033[0;32m' 3 | while : 4 | do 5 | echo "" 6 | npm start 7 | sleep 1 8 | 9 | done 10 | -------------------------------------------------------------------------------- /plugins/_Antiviewonce.js: -------------------------------------------------------------------------------- 1 | // PRINCE PROPERTY DON'T TOUCH IT OTHERWISE YOU WILL BE FAMOUS IN THE DEPLOYERS AS A CODE THEIF AND JUNIOR DEVELOPER 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /lib/language/index.js: -------------------------------------------------------------------------------- 1 | 2 | import en from './en.js' 3 | import es from './es.js' 4 | import pt from './pt.js' 5 | import id from './id.js' 6 | import ar from './ar.js' 7 | import ur from './ur.js' 8 | 9 | export {en, es, pt, id, ar, ur} 10 | -------------------------------------------------------------------------------- /koyeb.yaml: -------------------------------------------------------------------------------- 1 | name: princemd 2 | services: 3 | - name: prince-md-service 4 | type: web 5 | ports: 6 | - 3000 7 | routes: 8 | - path: "/" 9 | build: 10 | type: docker 11 | dockerfile: ./Dockerfile 12 | regions: 13 | - fra 14 | - sin 15 | -------------------------------------------------------------------------------- /plugins/rg-sn.js: -------------------------------------------------------------------------------- 1 | import { createHash } from 'crypto' 2 | 3 | let handler = async function (m, { conn, text, usedPrefix }) { 4 | let sn = createHash('md5').update(m.sender).digest('hex') 5 | m.reply(` 6 | ▢ *Numero de serie* : ${sn} 7 | `.trim()) 8 | } 9 | handler.help = ['mysn'] 10 | handler.tags = ['rg'] 11 | handler.command = ['nserie', 'sn', 'mysn'] 12 | handler.register = true 13 | export default handler 14 | -------------------------------------------------------------------------------- /plugins/main-chgp.js: -------------------------------------------------------------------------------- 1 | let handler = async m => m.reply(`𝙁𝙊𝙇𝙇𝙊𝙒 𝙏𝙃𝙀 𝘾𝙃𝘼𝙉𝙉𝙀𝙇 𝙏𝙊 𝙂𝙀𝙏 𝙇𝘼𝙏𝙀𝙎𝙏 𝙋𝙍𝙄𝙉𝘾𝙀 𝙈𝘿 𝙐𝙋𝘿𝘼𝙏𝙀𝙎 2 | 3 | *${mssg.link}*: https://whatsapp.com/channel/0029VaKNbWkKbYMLb61S1v11 4 | 5 | *𝙊𝙒𝙉𝙀𝙍* 6 | ${developer} 7 | `.trim()) 8 | handler.help = ['channel'] 9 | handler.tags = ['main'] 10 | handler.command = ['channel', 'ch'] 11 | 12 | export default handler 13 | -------------------------------------------------------------------------------- /plugins/_antivirus.js: -------------------------------------------------------------------------------- 1 | let handler = m => m 2 | 3 | handler.all = async function (m, { isBotAdmin }) { 4 | //جب کوئی پیغام ہو جسے ڈیسک ٹاپ پر نہیں دیکھا جا سکتا ہے تو خودکار حذف 5 | if (m.messageStubType === 68) { 6 | let log = { 7 | key: m.key, 8 | content: m.msg, 9 | sender: m.sender 10 | } 11 | await this.modifyChat(m.chat, 'clear', { 12 | includeStarred: false 13 | }).catch(console.log) 14 | }} 15 | export default handler 16 | -------------------------------------------------------------------------------- /plugins/game-guessFlag_hint.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn }) => { 2 | conn.tebakbendera = conn.tebakbendera ? conn.tebakbendera : {} 3 | let id = m.chat 4 | if (!(id in conn.tebakbendera)) throw false 5 | let json = conn.tebakbendera[id][1] 6 | conn.reply(m.chat, '```' + json.name.replace(/[AIUEOaiueo]/ig, '_') + '```', m) 7 | } 8 | handler.command = /^fhint$/i 9 | 10 | 11 | 12 | export default handler 13 | -------------------------------------------------------------------------------- /plugins/_expired-gp.js: -------------------------------------------------------------------------------- 1 | export async function all(m) { 2 | if (!m.isGroup) 3 | return 4 | let chats = global.db.data.chats[m.chat] 5 | if (!chats.expired) 6 | return !0 7 | if (+new Date() > chats.expired) { 8 | await this.reply(m.chat, `🔴 bye bye *${this.user.name}* will leave the group \n\nyour rent ended`) 9 | await this.groupLeave(m.chat) 10 | chats.expired = null 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /plugins/tools-readmore.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text }) => { 2 | let [l, r] = text.split`|` 3 | if (!l) l = '' 4 | if (!r) r = '' 5 | conn.reply(m.chat, l + readMore + r, m) 6 | } 7 | handler.help = ['readmore |'] 8 | handler.tags = ['tools'] 9 | handler.command = ['readmore'] 10 | 11 | export default handler 12 | 13 | const more = String.fromCharCode(8206) 14 | const readMore = more.repeat(4001) 15 | -------------------------------------------------------------------------------- /plugins/main-ggp.js: -------------------------------------------------------------------------------- 1 | let handler = async m => m.reply(`𝚂𝚄𝙿𝙿𝙾®𝚃 𝙶𝚁𝙾𝚄𝙿 𝙻𝙸𝙽𝙺 2 | ★☆⚡𝑷-𝑴𝑫⚡☆★ 3 | 4 | *${mssg.link}*: https://chat.whatsapp.com/Jo5bmHMAlZpEIp75mKbwxP 5 | 6 | *${mssg.link}*: https://whatsapp.com/channel/0029VaKNbWkKbYMLb61S1v11 7 | 8 | *OWNER* 9 | ${developer} 10 | `.trim()) 11 | handler.help = ['support'] 12 | handler.tags = ['main'] 13 | handler.command = ['support', 'sup'] 14 | 15 | export default handler 16 | -------------------------------------------------------------------------------- /plugins/gp-resetLink.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn }) => { 3 | let res = await conn.groupRevokeInvite(m.chat) 4 | m.reply('✅ Group link has been successfully reset\n\n📌 new link:\nhttps://chat.whatsapp.com/' + res) 5 | } 6 | handler.help = ['resetlink'] 7 | handler.tags = ['group'] 8 | handler.command = ['revoke', 'resetlink', 'anularlink'] 9 | handler.group = true 10 | handler.admin = true 11 | handler.botAdmin = true 12 | 13 | export default handler 14 | -------------------------------------------------------------------------------- /plugins/tools-ssweb.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | let handler = async (m, { conn, command, args }) => { 3 | if (!args[0]) return conn.reply(m.chat, '*[🔎] give url*', m) 4 | let ss = await (await fetch(`https://image.thum.io/get/fullpage/${args[0]}`)).buffer() 5 | conn.sendFile(m.chat, ss, 'error.png', args[0], m)} 6 | handler.help = ['ss', 'ssf'].map(v => v + ' ') 7 | handler.tags = ['tools'] 8 | handler.command = /^ss(web)?f?$/i 9 | export default handler 10 | -------------------------------------------------------------------------------- /plugins/owner-resetprefix.js: -------------------------------------------------------------------------------- 1 | let handler = async(m, { conn }) => { 2 | 3 | global.prefix = new RegExp('^[' + (process.env.PREFIX|| '‎xzXZ/i!#$%+£¢€¥^°=¶∆×÷π√✓©®:;?&.\\-').replace(/[|\\{}()[\]^$+*?.\-\^]/g, '\\$&') + ']') 4 | await m.reply(`*_PREFIX SUCCESSFULLY RESET_*✅`) 5 | } 6 | handler.help = ['resetprefix'] 7 | handler.tags = ['owner'] 8 | handler.command = /^(resetprefix)$/i 9 | handler.owner = true 10 | 11 | 12 | export default handler 13 | -------------------------------------------------------------------------------- /lib/tictactoe.d.ts: -------------------------------------------------------------------------------- 1 | export declare class TicTacToe { 2 | /* X PlayerName */ 3 | playerX: string; 4 | /* Y PlayerName */ 5 | playerY: string; 6 | /* X if true, Y if false */ 7 | _currentTurn: boolean; 8 | _x: number; 9 | _y: number; 10 | _turns: number; 11 | constructor(playerX: string, playerY: string); 12 | get board(): number; 13 | turn(player, index: number): boolean; 14 | turn(player, x: number, y: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /plugins/gp-setrules.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async function (m, { conn, text, usedPrefix }) { 3 | 4 | let chat = global.db.data.chats[m.chat] 5 | if (text) { 6 | chat.rules = text 7 | m.reply(`✅ ${mssg.rulesMsgOn}`) 8 | } else throw `✳️ ${mssg.rulesMsg}` 9 | 10 | } 11 | handler.help = ['setrules '] 12 | handler.tags = ['group'] 13 | handler.command = ['setrules', 'addrules', 'addrule'] 14 | handler.group = true 15 | handler.admin = true 16 | 17 | export default handler 18 | -------------------------------------------------------------------------------- /plugins/gp-setbye.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn, text, isROwner, isOwner }) => { 4 | if (text) { 5 | global.db.data.chats[m.chat].sBye = text 6 | m.reply('✅ The farewell message was established') 7 | } else throw `✳️ enter the message\n@user (mención)` 8 | } 9 | handler.help = ['setbye '] 10 | handler.tags = ['group'] 11 | handler.command = ['setbye'] 12 | handler.admin = true 13 | handler.owner = false 14 | 15 | export default handler 16 | -------------------------------------------------------------------------------- /plugins/fun-ship.js: -------------------------------------------------------------------------------- 1 | let toM = a => '@' + a.split('@')[0] 2 | function handler(m, { groupMetadata }) { 3 | let ps = groupMetadata.participants.map(v => v.id) 4 | let a = m.sender 5 | let b 6 | do b = ps.getRandom() 7 | while (b === a) 8 | m.reply(`${toM(a)} ❤️ ${toM(b)}\nCongratulations 💖🍻`, null, { 9 | mentions: [a, b] 10 | }) 11 | } 12 | handler.help = ['ship'] 13 | handler.tags = ['fun'] 14 | handler.command = ['ship'] 15 | 16 | handler.group = true 17 | 18 | export default handler -------------------------------------------------------------------------------- /plugins/gp-totag.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, text, participants}) => { 3 | 4 | let users = participants.map(u => u.id).filter(v => v !== conn.user.jid) 5 | if (!m.quoted) throw `✳️ Reply to message` 6 | conn.sendMessage(m.chat, { forward: m.quoted.fakeObj, mentions: users } ) 7 | } 8 | 9 | handler.help = ['totag'] 10 | handler.tags = ['group'] 11 | handler.command = /^(totag|tag)$/i 12 | 13 | handler.admin = false 14 | handler.group = true 15 | handler.rowner = true 16 | 17 | export default handler 18 | -------------------------------------------------------------------------------- /replit.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: { 2 | deps = [ 3 | pkgs.sudo 4 | pkgs.nodejs 5 | pkgs.nodePackages.typescript 6 | pkgs.ffmpeg 7 | pkgs.imagemagick 8 | pkgs.git 9 | pkgs.neofetch 10 | pkgs.libwebp 11 | pkgs.speedtest-cli 12 | pkgs.wget 13 | pkgs.yarn 14 | pkgs.pm2 15 | pkgs.libuuid 16 | ]; 17 | env = { 18 | LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ 19 | pkgs.libuuid 20 | ]; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /plugins/owner-restart.js: -------------------------------------------------------------------------------- 1 | import { spawn } from 'child_process' 2 | let handler = async (m, { conn, isROwner, text }) => { 3 | if (!process.send) throw 'Dont: node main.js\nDo: node index.js' 4 | if (conn.user.jid == conn.user.jid) { 5 | await m.reply('_*♻️Restarting Bot...*_\n _*Wait a moment*_') 6 | process.send('reset') 7 | } else throw 'eh' 8 | } 9 | 10 | handler.help = ['restart'] 11 | handler.tags = ['owner'] 12 | handler.command = ['restart'] 13 | 14 | handler.rowner = true 15 | 16 | export default handler 17 | -------------------------------------------------------------------------------- /plugins/_Alwaysonline.js: -------------------------------------------------------------------------------- 1 | export async function before(m) { 2 | const chat = global.db.data.chats[m.chat]; 3 | if (!chat.autotype) return; 4 | 5 | const commands = Object.values(global.plugins).flatMap((plugin) => [].concat(plugin.command)); 6 | const presenceStatus = commands.some((cmd) => (cmd instanceof RegExp ? cmd.test(m.text) : m.text.includes(cmd))) ? 'composing' : 'available'; 7 | 8 | if (presenceStatus) await this.sendPresenceUpdate(presenceStatus, m.chat); 9 | } 10 | 11 | export const disabled = false; 12 | -------------------------------------------------------------------------------- /plugins/afk-afk.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { text, conn }) => { 4 | let user = global.db.data.users[m.sender] 5 | user.afk = + new Date 6 | user.afkReason = text 7 | m.reply(` 8 | 😴 *AFK* 9 | You are now afk until u send a message 10 | ▢ *User:* ${conn.getName(m.sender)} 11 | ▢ *Reason:* ${text ? text : ''} 12 | `) 13 | } 14 | handler.help = ['afk '] 15 | handler.tags = ['fun'] 16 | handler.command = ['afk'] 17 | handler.group = true 18 | 19 | export default handler 20 | -------------------------------------------------------------------------------- /plugins/img-gimage.js: -------------------------------------------------------------------------------- 1 | 2 | import fg from 'api-dylux' 3 | let handler = async (m, { conn, args, text, usedPrefix, command }) => { 4 | if (!text) throw `✳️ Enter query for image\n📌 Example: *${usedPrefix + command}* The Sindh Nature` 5 | let res = await fg.googleImage(text) 6 | conn.sendFile(m.chat, res.getRandom(), 'img.png', ` 7 | ✅ Here is your image: *${text}*`.trim(), m) 8 | } 9 | handler.help = ['imagen'] 10 | handler.tags = ['img'] 11 | handler.command = /^(img2|image2)$/i 12 | handler.diamond = false 13 | 14 | export default handler 15 | -------------------------------------------------------------------------------- /plugins/main-listprem.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, args, usedPrefix, command }) => { 3 | let prem = global.prems.map(v => v.replace(/[^0-9]/g, '') + '@s.whatsapp.net').filter(v => v != conn.user.jid) 4 | let teks = `▢ *USUARIOS PREMIUM*\n─────────────\n` + prem.map(v => '- @' + v.replace(/@.+/, '')).join`\n` 5 | m.reply(teks, null, {mentions: conn.parseMention(teks)}) 6 | 7 | } 8 | handler.help = ['listprem'] 9 | handler.tags = ['main'] 10 | handler.command = ['listprem', 'premlist', 'listpremium'] 11 | 12 | export default handler 13 | -------------------------------------------------------------------------------- /plugins/tools-getjid.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, args, usedPrefix, command, isGroup }) => { 2 | let jid; 3 | 4 | if (isGroup) { 5 | if (m.quoted) { 6 | 7 | jid = m.quoted.sender; 8 | } else { 9 | 10 | jid = m.chat; 11 | } 12 | } else { 13 | 14 | jid = m.chat; 15 | } 16 | 17 | m.reply(jid); 18 | } 19 | 20 | handler.help = ['getjid']; 21 | handler.tags = ['tools']; 22 | handler.command = ['getjid', 'jid', 'jd']; 23 | 24 | export default handler; 25 | -------------------------------------------------------------------------------- /plugins/game-delsttt.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, text }) => { 3 | let room = Object.values(conn.game).find(room => room.id.startsWith('tictactoe') && [room.game.playerX, room.game.playerO].includes(m.sender)) 4 | if (room == undefined) return conn.reply(m.chat,`✳️ You are not in game of TicTacToe 🎮 `, m) 5 | delete conn.game[room.id] 6 | await conn.reply(m.chat, `✅ The session of *tictactoe is restarted 🎮*`, m) 7 | } 8 | handler.help = ['delttt'] 9 | handler.tags = ['game'] 10 | handler.command = ['delttc', 'delttt', 'delxo'] 11 | 12 | export default handler 13 | -------------------------------------------------------------------------------- /plugins/gp-welcome.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn, text, isROwner, isOwner }) => { 4 | if (text) { 5 | global.db.data.chats[m.chat].sWelcome = text 6 | m.reply('✅ The welcome message is configured') 7 | } else throw `✳️ Enter the Welcome message\n\n@user (mention)\n@group (Group name)\n@desc (description of group)` 8 | } 9 | handler.help = ['setwelcome '] 10 | handler.tags = ['group'] 11 | handler.command = ['setwelcome'] 12 | handler.admin = false 13 | handler.owner = true 14 | 15 | export default handler 16 | -------------------------------------------------------------------------------- /plugins/leavegc.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text, command }) => { 2 | let id = text ? text : m.chat 3 | let chat = global.db.data.chats[m.chat] 4 | chat.welcome = false 5 | await conn.reply(id, `*${botname} 𝘓𝘌𝘈𝘝𝘌 𝘛𝘏𝘌 𝘎𝘙𝘖𝘜𝘗, 𝘐𝘛 𝘞𝘈𝘚 𝘎𝘙𝘌𝘈𝘛 𝘉𝘌𝘐𝘕𝘎 𝘏𝘌𝘙𝘌 👋🏻*`) 6 | await conn.groupLeave(id) 7 | try { 8 | chat.welcome = true 9 | } catch (e) { 10 | await m.reply(`error`) 11 | return console.log(e) 12 | }} 13 | handler.command = /^(left|leavegc|exit|leave)$/i 14 | handler.group = true 15 | handler.rowner = true 16 | export default handler 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-buster 2 | 3 | 4 | RUN echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list && \ 5 | echo "deb http://archive.debian.org/debian-security buster/updates main" >> /etc/apt/sources.list 6 | 7 | RUN apt-get update && \ 8 | apt-get install -y \ 9 | ffmpeg \ 10 | imagemagick \ 11 | webp && \ 12 | apt-get upgrade -y && \ 13 | rm -rf /var/lib/apt/lists/* 14 | 15 | COPY package.json . 16 | 17 | RUN npm install && npm install qrcode-terminal 18 | 19 | COPY . . 20 | 21 | EXPOSE 5000 22 | 23 | CMD ["npm", "start"] 24 | -------------------------------------------------------------------------------- /plugins/game-dado.js: -------------------------------------------------------------------------------- 1 | const da = [ 2 | 'https://tinyurl.com/gdd01', 3 | 'https://tinyurl.com/gdd02', 4 | 'https://tinyurl.com/gdd003', 5 | 'https://tinyurl.com/gdd004', 6 | 'https://tinyurl.com/gdd05', 7 | 'https://tinyurl.com/gdd006' 8 | ]; 9 | let handler = async (m, { conn }) => { 10 | conn.sendFile(m.chat, pickRandom(da), 'dado.webp', '', m) 11 | } 12 | handler.help = ['dado'] 13 | handler.tags = ['game'] 14 | handler.command = ['dado', 'dados'] 15 | 16 | export default handler 17 | 18 | function pickRandom(list) { 19 | return list[Math.floor(list.length * Math.random())] 20 | } 21 | -------------------------------------------------------------------------------- /plugins/tool-ytcomment.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text }) => { 2 | if (!text) throw 'No Text' 3 | conn.sendFile(m.chat, global.API('https://some-random-api.com', '/canvas/misc/youtube-comment', { 4 | avatar: await conn.profilePictureUrl(m.sender, 'image').catch(_ => 'https://telegra.ph/file/24fa902ead26340f3df2c.png'), 5 | comment: text, 6 | username: conn.getName(m.sender) 7 | }), 'error.png', '*THANKS FOR COMMENT*', m) 8 | } 9 | handler.help = ['ytcomment '] 10 | handler.tags = ['maker'] 11 | handler.command = /^(ytcomment)$/i 12 | export default handler 13 | -------------------------------------------------------------------------------- /plugins/owner-banchat.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn, isOwner, isAdmin, isROwner }) => { 4 | if (!(isAdmin || isOwner)) return dfail('admin', m, conn) 5 | global.db.data.chats[m.chat].isBanned = true 6 | m.reply('⚠️ Bᴏᴛ ᴅᴇᴀᴄᴛɪᴠᴀᴛᴇᴅ 🚫 \n💀 Nᴏ ᴄᴏᴍᴍᴀɴᴅs ᴡɪʟʟ ᴡᴏʀᴋ! 𒆙') 7 | 8 | // Save the updated database 9 | if (global.db && typeof global.db.save === 'function') { 10 | await global.db.save() 11 | } 12 | } 13 | handler.help = ['banchat'] 14 | handler.tags = ['owner'] 15 | handler.command = ['banchat', 'botoff'] 16 | 17 | export default handler 18 | -------------------------------------------------------------------------------- /plugins/sf.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | let handler = async (m, { text, usedPrefix, command }) => { 3 | if (!text) throw `uhm.. where is the text?\n\nusage:\n${usedPrefix + command} \n\nexample:\n${usedPrefix + command} plugins/sweeto.js` 4 | if (!m.quoted.text) throw `reply to the message!` 5 | let path = `${text}` 6 | await fs.writeFileSync(path, m.quoted.text) 7 | m.reply(`stored in ${path}`) 8 | } 9 | handler.help = ['sf'].map(v => v + ' ') 10 | handler.tags = ['owner'] 11 | handler.command = /^(sf|sp)$/i 12 | 13 | handler.rowner = true 14 | export default handler 15 | -------------------------------------------------------------------------------- /plugins/maker-simp.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn }) => { 2 | let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender 3 | conn.sendFile(m.chat, global.API('https://some-random-api.com', '/canvas/misc/simpcard', { 4 | avatar: await conn.profilePictureUrl(who, 'image').catch(_ => 'https://telegra.ph/file/24fa902ead26340f3df2c.png'), 5 | }), 'error.png', '*your religion is simping*', m) 6 | } 7 | handler.help = ['simpcard'] 8 | handler.tags = ['maker'] 9 | handler.command = /^(simpcard)$/i 10 | export default handler 11 | -------------------------------------------------------------------------------- /plugins/tool-pdf.js: -------------------------------------------------------------------------------- 1 | import uploadImage from '../lib/uploadImage.js' 2 | let handler = async (m, { conn, text, usedPrefix, command, isOwner }) => { 3 | let q = m.quoted ? m.quoted : m 4 | let mime = (q.msg || q).mimetype || '' 5 | if (!mime) throw '*Respond / reply to an image*' 6 | let img = await q.download?.() 7 | let url = await uploadImage(img) 8 | let docname = text ? text : m.pushName || 'Gurubot' 9 | conn.sendFile(m.chat, `http://api.lolhuman.xyz/api/convert/imgtopdf?apikey=${lolkeysapi}&img=${url}`, docname + '.pdf', '', m, false, { asDocument: true }) 10 | } 11 | handler.command = /^topdf$/i 12 | export default handler -------------------------------------------------------------------------------- /plugins/tools-bingimg.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | 3 | let handler = async (m, { conn, text }) => { 4 | if (!text) throw '😇What do you want me to create?' 5 | m.react(rwait) 6 | let msg = encodeURIComponent(text) 7 | let res = await fetch(`https://aemt.me/bingimg?text=${msg}`) 8 | let data = await res.json() 9 | console.log(data) 10 | let buffer = data.result 11 | conn.sendFile(m.chat, buffer, 'image.png', `${text}`, m) 12 | m.react(done) 13 | } 14 | 15 | handler.help = ['bingimg '] 16 | handler.tags = ['AI'] 17 | handler.command = /^bingimg$/i 18 | 19 | export default handler 20 | -------------------------------------------------------------------------------- /plugins/maker-blur.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, usedprefix }) => { 2 | let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender 3 | conn.sendFile(m.chat, global.API('https://some-random-api.com', '/canvas/misc/blur', { 4 | avatar: await conn.profilePictureUrl(who, 'image').catch(_ => 'https://telegra.ph/file/24fa902ead26340f3df2c.png'), 5 | }), 'hornycard.png', '*[ ✔ ]*', m) 6 | } 7 | handler.help = ['blur','difuminar2'] 8 | handler.tags = ['maker'] 9 | handler.command = /^(blur|difuminar2)$/i 10 | export default handler 11 | -------------------------------------------------------------------------------- /plugins/fun-txt.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, text, usedPrefix, command }) => { 3 | 4 | let teks = text ? text : m.quoted && m.quoted.text ? m.quoted.text : '' 5 | if (!teks) throw `📝 Que escribo? Ejemplo : *${usedPrefix + command}* Hola puercos` 6 | m.react(rwait) 7 | let img = global.API('fgmods', '/api/maker/txt', { text: teks }, 'apikey') 8 | conn.sendFile(m.chat, img, 'img.png', `✅ Es mejor de lo que escribes tú ✍🏻`, m) 9 | m.react(done) 10 | 11 | } 12 | handler.help = ['txt'] 13 | handler.tags = ['fun'] 14 | handler.command = ['txt'] 15 | 16 | export default handler 17 | 18 | -------------------------------------------------------------------------------- /plugins/owner-delexpired.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, args, usedPrefix, command }) => { 3 | let who 4 | if (m.isGroup) who = args[1] ? args[1] : m.chat 5 | else who = args[1] 6 | 7 | if (new Date() * 1 < global.db.data.chats[who].expired) global.db.data.chats[who].expired = false 8 | else global.db.data.chats[who].expired = false 9 | 10 | m.reply(`✅ Removed expiration days for this group`) 11 | 12 | } 13 | handler.help = ['delexpired'] 14 | handler.tags = ['owner'] 15 | handler.command = /^(delexpired)$/i 16 | handler.rowner = true 17 | handler.group = true 18 | 19 | export default handler 20 | -------------------------------------------------------------------------------- /plugins/fun-gay.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn }) => { 2 | let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender 3 | let name = conn.getName(who) 4 | let pp = await conn.profilePictureUrl(who, 'image').catch(_ => './Guru.jpg') 5 | conn.sendFile(m.chat, global.API('https://some-random-api.com', '/canvas/overlay/gay', { 6 | avatar: pp, 7 | }), 'gay.png', `🏳️‍🌈 *Gay :* ${name}\n\nWho wants to rape this gay☠️? `, m) 8 | } 9 | 10 | handler.help = ['gay @user'] 11 | handler.tags = ['fun'] 12 | handler.command = ['gay'] 13 | 14 | export default handler 15 | -------------------------------------------------------------------------------- /plugins/owner-unbanchat.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn, isOwner, isAdmin, isROwner }) => { 4 | if (!(isAdmin || isOwner)) return dfail('admin', m, conn) 5 | global.db.data.chats[m.chat].isBanned = false 6 | m.reply('⚡ Bᴏᴛ ᴀᴄᴛɪᴠᴀᴛᴇᴅ ғᴏʀ ᴛʜɪs ᴄʜᴀᴛ! 💥 \n🔥 Aʟʟ ᴄᴏᴍᴍᴀɴᴅs ᴀʀᴇ ɢᴏ! 🚀 𒆜') 7 | 8 | // Save the updated database 9 | if (global.db && typeof global.db.save === 'function') { 10 | await global.db.save() 11 | } 12 | } 13 | handler.help = ['unbanchat'] 14 | handler.tags = ['owner'] 15 | handler.command = ['boton', 'unbanchat'] 16 | 17 | export default handler 18 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | BOT_DIR="PRINCEMD" 3 | BOT_REPO="https://github.com/DASTAGHIR/$BOT_DIR" 4 | 5 | GREEN='\033[32m' 6 | BOLD='\033[1m' 7 | RESET='\033[0m' 8 | 9 | # Ensure you're in the correct directory 10 | cd /app 11 | 12 | if [ -d "$BOT_DIR" ]; then 13 | echo -e "${BOLD}${GREEN}Updating dependencies for $BOT_DIR...\n${RESET}" 14 | cd "$BOT_DIR" 15 | git pull origin main 16 | npm install --legacy-peer-deps 17 | echo -e "${BOLD}${GREEN}Starting $BOT_DIR...\n${RESET}" 18 | npm start 19 | else 20 | echo -e "${BOLD}${GREEN}$BOT_DIR directory not found, please ensure the bot is deployed correctly.\n${RESET}" 21 | fi 22 | -------------------------------------------------------------------------------- /plugins/main-blocklist.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn }) => { 3 | 4 | await conn.fetchBlocklist().then(async data => { 5 | let txt = `⭕ *Block List*\n\n*Total :* ${data.length}\n\n┌─⊷\n` 6 | for (let i of data) { 7 | txt += `╠ ○ @${i.split("@")[0]}\n` 8 | } 9 | txt += "╚•" 10 | return conn.reply(m.chat, txt, m, { mentions: await conn.parseMention(txt) }) 11 | }).catch(err => { 12 | console.log(err); 13 | throw 'No blocked numbers' 14 | }) 15 | } 16 | 17 | handler.help = ['blocklist'] 18 | handler.tags = ['owner'] 19 | handler.command = ['blocklist', 'listblock'] 20 | handler.rowner = true 21 | 22 | export default handler 23 | -------------------------------------------------------------------------------- /plugins/maker.loli.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn }) => { 2 | let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender 3 | conn.sendFile(m.chat, global.API('https://some-random-api.com', '/canvas/misc/lolice', { 4 | avatar: await conn.profilePictureUrl(who, 'image').catch(_ => 'https://telegra.ph/file/24fa902ead26340f3df2c.png'), 5 | }), 'error.png', '*🚔🚨 𝐋𝐎𝐋𝐈𝐂𝐎𝐍𝐒 like you only belong in jail 🚨🚔*', m) 6 | } 7 | handler.help = ['lolicon'] 8 | handler.tags = ['maker'] 9 | handler.command = /^(lolicon)$/i 10 | export default handler 11 | -------------------------------------------------------------------------------- /plugins/fun-dare.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | let handler = async (m, { conn }) => { 3 | let shizokeys = 'shizo' 4 | let res = await fetch(`https://shizoapi.onrender.com/api/texts/dare?apikey=${shizokeys}`) 5 | if (!res.ok) throw await res.text() 6 | let json = await res.json() 7 | 8 | let guru = `${json.result}` 9 | conn.sendMessage(m.chat, { text: guru, mentions: [m.sender] }, { quoted: m }) 10 | } 11 | handler.help = ['dare'] 12 | handler.tags = ['fun'] 13 | handler.command = /^(dare)$/i 14 | 15 | export default handler 16 | 17 | 18 | function pickRandom(list) { 19 | return list[Math.floor(list.length * Math.random())] 20 | } 21 | -------------------------------------------------------------------------------- /plugins/fun-waste.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn }) => { 2 | let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender 3 | let name = conn.getName(who) 4 | let pp = await conn.profilePictureUrl(who, 'image').catch(_ => './Guru.jpg') 5 | conn.sendFile(m.chat, global.API('https://some-random-api.com', '/canvas/overlay/wasted', { 6 | avatar: pp, 7 | }), 'waste.png', `*Ah! Shit :* ${name}\n\nWastedeeznuts`, m) 8 | } 9 | 10 | handler.help = ['waste @user'] 11 | handler.tags = ['fun'] 12 | handler.command = ['waste'] 13 | 14 | export default handler -------------------------------------------------------------------------------- /plugins/fun-flirt.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | let handler = async (m, { conn }) => { 3 | let shizokeys = 'shizo' 4 | let res = await fetch(`https://shizoapi.onrender.com/api/texts/flirt?apikey=${shizokeys}`) 5 | if (!res.ok) throw await res.text() 6 | let json = await res.json() 7 | 8 | let guru = `${json.result}` 9 | conn.sendMessage(m.chat, { text: guru, mentions: [m.sender] }, { quoted: m }) 10 | } 11 | handler.help = ['flirt'] 12 | handler.tags = ['fun'] 13 | handler.command = /^(flirt)$/i 14 | 15 | export default handler 16 | 17 | 18 | function pickRandom(list) { 19 | return list[Math.floor(list.length * Math.random())] 20 | } 21 | -------------------------------------------------------------------------------- /plugins/fun-truth.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | let handler = async (m, { conn }) => { 3 | let shizokeys = 'shizo' 4 | let res = await fetch(`https://shizoapi.onrender.com/api/texts/truth?apikey=${shizokeys}`) 5 | if (!res.ok) throw await res.text() 6 | let json = await res.json() 7 | 8 | let guru = `${json.result}` 9 | conn.sendMessage(m.chat, { text: guru, mentions: [m.sender] }, { quoted: m }) 10 | } 11 | handler.help = ['truth'] 12 | handler.tags = ['fun'] 13 | handler.command = /^(truth)$/i 14 | 15 | export default handler 16 | 17 | 18 | function pickRandom(list) { 19 | return list[Math.floor(list.length * Math.random())] 20 | } 21 | -------------------------------------------------------------------------------- /plugins/gp-groupprofile.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, usedPrefix, command }) => { 2 | if (!m.isGroup) throw '*Only work in groups!*' 3 | if (!m.quoted) throw `*Reply With a image you want keep on group profile*` 4 | if (!/image/.test(m.quoted.mimetype)) throw '*Reply with an image!*' 5 | 6 | let image = await m.quoted.download() 7 | await conn.updateProfilePicture(m.chat, image) 8 | m.reply('*Group DP successfully changed!*') 9 | } 10 | 11 | handler.help = ['setgdp'] 12 | handler.tags = ['group'] 13 | handler.command = /^(setgdp|setppgc|setgcpp|ppgc|gcpp)$/i 14 | handler.admin = true 15 | handler.botAdmin = true 16 | 17 | export default handler 18 | -------------------------------------------------------------------------------- /lib/logs.js: -------------------------------------------------------------------------------- 1 | let stdouts = [] 2 | export default (maxLength = 200) => { 3 | let oldWrite = process.stdout.write.bind(process.stdout) 4 | module.exports.disable = () => { 5 | module.exports.isModified = false 6 | return process.stdout.write = oldWrite 7 | } 8 | process.stdout.write = (chunk, encoding, callback) => { 9 | stdouts.push(Buffer.from(chunk, encoding)) 10 | oldWrite(chunk, encoding, callback) 11 | if (stdouts.length > maxLength) stdouts.shift() 12 | } 13 | module.exports.isModified = true 14 | return module.exports 15 | } 16 | 17 | export const isModified = false 18 | export function logs() { return Buffer.concat(stdouts)} 19 | 20 | -------------------------------------------------------------------------------- /plugins/tools-pdf.js: -------------------------------------------------------------------------------- 1 | import uploadImage from '../lib/uploadImage.js' 2 | let handler = async (m, { conn, text, usedPrefix, command, isOwner }) => { 3 | let q = m.quoted ? m.quoted : m 4 | let mime = (q.msg || q).mimetype || '' 5 | if (!mime) throw '*Respond / reply to an image*' 6 | let img = await q.download?.() 7 | let url = await uploadImage(img) 8 | let docname = text ? text : m.pushName || 'PrinceBot' 9 | conn.sendFile(m.chat, `http://api.lolhuman.xyz/api/convert/imgtopdf?apikey=${lolkeysapi}&img=${url}`, docname + '.pdf', '', m, false, { asDocument: true }) 10 | } 11 | handler.command = /^topdf$/i 12 | handler.tags = ['tools']; 13 | export default handler 14 | -------------------------------------------------------------------------------- /plugins/Wall-couplepp.js: -------------------------------------------------------------------------------- 1 | import fetch from "node-fetch" 2 | let handler = async (m, { conn }) => { 3 | 4 | let data = await (await fetch('https://raw.githubusercontent.com/KazukoGans/database/main/anime/ppcouple.json')).json() 5 | let cita = data[Math.floor(Math.random() * data.length)] 6 | 7 | let cowi = await(await fetch(cita.cowo)).buffer() 8 | await conn.sendFile(m.chat, cowi, '', '♂️', m) 9 | let ciwi = await(await fetch(cita.cewe)).buffer() 10 | await conn.sendFile(m.chat, ciwi, '', '♀️', m) 11 | } 12 | handler.help = ['ppcouple', 'ppcp'] 13 | handler.tags = ['img'] 14 | handler.command = ['couplepp','ppcouple'] 15 | 16 | 17 | export default handler 18 | -------------------------------------------------------------------------------- /plugins/cmd-del.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { text }) => { 4 | let hash = text 5 | if (m.quoted && m.quoted.fileSha256) hash = m.quoted.fileSha256.toString('hex') 6 | if (!hash) throw `✳️ Ingrese el nombre del comamdo` 7 | let sticker = global.db.data.sticker 8 | if (sticker[hash] && sticker[hash].locked) throw '✳️ No puedes borrar este comando' 9 | delete sticker[hash] 10 | m.reply(`✅ Comando eliminado`) 11 | } 12 | 13 | 14 | handler.help = ['cmd'].map(v => 'del' + v + ' ') 15 | handler.tags = ['cmd'] 16 | handler.command = ['delcmd'] 17 | handler.owner = true 18 | 19 | export default handler 20 | -------------------------------------------------------------------------------- /plugins/fun-shayeri.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | let handler = async (m, { conn }) => { 3 | let shizokeys = 'shizo' 4 | let res = await fetch(`https://shizoapi.onrender.com/api/texts/shayari?apikey=${shizokeys}`) 5 | if (!res.ok) throw await res.text() 6 | let json = await res.json() 7 | 8 | let guru = `${json.result}` 9 | conn.sendMessage(m.chat, { text: guru, mentions: [m.sender] }, { quoted: m }) 10 | } 11 | handler.help = ['shayari'] 12 | handler.tags = ['fun'] 13 | handler.command = /^(shayari)$/i 14 | 15 | export default handler 16 | 17 | 18 | function pickRandom(list) { 19 | return list[Math.floor(list.length * Math.random())] 20 | } 21 | -------------------------------------------------------------------------------- /plugins/bebot-botlist.js: -------------------------------------------------------------------------------- 1 | 2 | import ws from 'ws'; 3 | async function handler(m, { usedPrefix }) { 4 | let users = [...new Set([...global.conns.filter(conn => conn.user && conn.ws.socket && conn.ws.socket.readyState !== ws.CLOSED).map(conn => conn.user)])] 5 | let b = users.map((v, i) => `_*${i + 1}.*_ *${v.name}*\nwa.me/${v.jid.replace(/[^0-9]/g, '')}?text=${usedPrefix}help`).join('\n') 6 | m.reply(` 7 | ≡ *List of Active Sub Bots* 8 | 9 | ▢ *Total:* ${users.length} 10 | 11 | ${b}`) 12 | 13 | } 14 | handler.help = ['botlist'] 15 | handler.tags = ['bebot'] 16 | handler.command = ['listbot', 'listbots', 'bots', 'bebots', 'botlist'] 17 | 18 | export default handler 19 | -------------------------------------------------------------------------------- /plugins/gp-kick.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, usedPrefix, command }) => { 3 | 4 | if (!m.mentionedJid[0] && !m.quoted) return m.reply(`✳️ ${mssg.useCmd}\n\n*${usedPrefix + command}* @tag`) 5 | let user = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted.sender 6 | if (conn.user.jid.includes(user)) return m.reply(`✳️ I can't do a auto kick`) 7 | 8 | await conn.groupParticipantsUpdate(m.chat, [user], 'remove') 9 | m.reply(`✅ ${mssg.kick}`) 10 | 11 | } 12 | 13 | handler.help = ['kick @user'] 14 | handler.tags = ['group'] 15 | handler.command = ['kick', 'k'] 16 | handler.admin = true 17 | handler.group = true 18 | handler.botAdmin = true 19 | 20 | export default handler 21 | -------------------------------------------------------------------------------- /plugins/owner-banlist.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, usedPrefix }) => { 3 | let chats = Object.entries(global.db.data.chats).filter(chat => chat[1].isBanned) 4 | let users = Object.entries(global.db.data.users).filter(user => user[1].banned) 5 | 6 | m.reply(` 7 | ≡ *USERS BANNED* 8 | 9 | ▢ Total : *${users.length}* 10 | 11 | ${users ? '\n' + users.map(([jid], i) => ` 12 | ${i + 1}. ${conn.getName(jid) == undefined ? 'UNKNOWN' : conn.getName(jid)} 13 | ▢ ${jid} 14 | `.trim()).join('\n') : ''} 15 | `.trim()) 16 | } 17 | handler.help = ['listban'] 18 | handler.tags = ['owner'] 19 | handler.command = ['banlist', 'listban'] 20 | 21 | export default handler 22 | -------------------------------------------------------------------------------- /plugins/sticker-ttp.js: -------------------------------------------------------------------------------- 1 | 2 | import { sticker } from '../lib/sticker.js' 3 | import fg from 'api-dylux' 4 | let handler = async (m, { conn, text, usedPrefix, command }) => { 5 | 6 | if (!text) throw `✳️ Envie el texto\n\n📌Ejemplo *${usedPrefix + command}* dylux-fg` 7 | let color = '2FFF2E' //color 8 | let res = await fg.ttp(text, color) 9 | let stiker = await sticker(null, res.result, global.packname, global.author) 10 | if (stiker) return await conn.sendFile(m.chat, stiker, '', '', m, null, rpl) 11 | throw stiker.toString() 12 | } 13 | handler.help = ['ttp '] 14 | handler.tags = ['sticker'] 15 | handler.command = ['ttp'] 16 | 17 | export default handler 18 | -------------------------------------------------------------------------------- /plugins/tools-autolevelup.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | import { canLevelUp } from '../lib/levelling.js' 3 | 4 | export async function before(m, { conn }) { 5 | let user = global.db.data.users[m.sender] 6 | if (!user.autolevelup) 7 | return !0 8 | let before = user.level * 1 9 | while (canLevelUp(user.level, user.exp, global.multiplier)) 10 | user.level++ 11 | user.role = global.rpg.role(user.level).name 12 | if (before !== user.level) { 13 | m.reply(` 14 | * 🪩LEVEL UP🪩 * 15 | 16 | *${before}* ‣ *${user.level}* ✨ 17 | ROLE : *${user.role}* 18 | 19 | _to deactivate write_ 20 | _*/off autolevelup*_ 21 | `.trim()) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample.env: -------------------------------------------------------------------------------- 1 | DATABASE_URL= 2 | SESSION_ID= 3 | REMOVEBG_KEY= 4 | PREFIX=. 5 | MODE=public 6 | STATUSVIEW=true 7 | ANTI_LINK=true 8 | REJECTSCALLS=false 9 | REPLY_STATUS=true 10 | antidelete=true 11 | BOT_NAME=Prince 12 | AutoReaction=false 13 | OWNER_NUMBER=923092668108;PRINCE 14 | DL_MSG=Downloaded successfully 15 | STATUS_MSG=Status seen by prince 16 | owner_react_emojie=🤍 17 | AlwaysOnline=false 18 | autoreactions_emojies=💛,🤍,💗,♥️,💞 19 | StatusLikes=false 20 | StatusEmojies=♥️,🤗,❤️,💞,❣️,💙,💛,🤍,💚,😍,🥰,💝,💖,💗,💓,💞,💕,❣️,💘,💟,🖤,🤎,💜,💫,🌸 21 | CALLMSG=For now calls are restricted by my owner 22 | ANTIFAKE_USERS=1,212,63,44 23 | PACK_NAME=Prince♥️ 24 | BUSINESS_MODE=true 25 | MENU_IMAGE= 26 | -------------------------------------------------------------------------------- /plugins/cmd-list.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn }) => { 4 | conn.reply(m.chat, ` 5 | *LISTA DE COMANDOS* 6 | 7 | ▢ *Info:* Si esta en *negrita* esta bloqueado 8 | 9 | ────────────────── 10 | ${Object.entries(global.db.data.sticker).map(([key, value], index) => `${index + 1}. ${value.locked ? `(bloqueado) ${key}` : key} : ${value.text}`).join('\n')} 11 | 12 | `.trim(), null, { 13 | mentions: Object.values(global.db.data.sticker).map(x => x.mentionedJid).reduce((a, b) => [...a, ...b], []) 14 | }) 15 | } 16 | 17 | 18 | handler.help = ['listcmd'] 19 | handler.tags = ['cmd'] 20 | handler.command = ['listcmd'] 21 | 22 | export default handler 23 | -------------------------------------------------------------------------------- /plugins/rg-unreg.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | import { createHash } from 'crypto' 4 | let handler = async function (m, { conn, args, usedPrefix}) { 5 | if (!args[0]) throw `✳️ *Ingrese número de serie*\nVerifique su número de serie con el comando...\n\n*${usedPrefix}nserie*` 6 | let user = global.db.data.users[m.sender] 7 | let sn = createHash('md5').update(m.sender).digest('hex') 8 | if (args[0] !== sn) throw '⚠️ *Número de serie incorrecto*' 9 | user.registered = false 10 | m.reply(`✅ Registro eliminado`) 11 | } 12 | handler.help = ['unreg '] 13 | handler.tags = ['rg'] 14 | 15 | handler.command = ['unreg'] 16 | handler.register = true 17 | 18 | export default handler 19 | 20 | -------------------------------------------------------------------------------- /plugins/_checkLang.js: -------------------------------------------------------------------------------- 1 | 2 | import { en, es, id, pt, ar, ur } from '../lib/language/index.js' 3 | 4 | export async function before(m,{ conn }) { 5 | 6 | let lang = global.db.data.users[m.sender].language 7 | 8 | let translations 9 | if (lang === "en") { 10 | translations = en 11 | } else if (lang === "es") { 12 | translations = es 13 | } else if (lang === "id") { 14 | translations = id 15 | } else if (lang === "pt") { 16 | translations = pt 17 | } else if (lang === "ur") { 18 | translations = ur 19 | } else if (lang === "ar") { 20 | translations = ar 21 | } else { 22 | translations = en 23 | } 24 | 25 | global.mssg = translations 26 | 27 | } 28 | -------------------------------------------------------------------------------- /plugins/gp-delete.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, usedPrefix, command }) => { 3 | 4 | if (!m.quoted) throw `✳️ Reply to the message you want to delete` 5 | try { 6 | let delet = m.message.extendedTextMessage.contextInfo.participant 7 | let bang = m.message.extendedTextMessage.contextInfo.stanzaId 8 | return conn.sendMessage(m.chat, { delete: { remoteJid: m.chat, fromMe: false, id: bang, participant: delet }}) 9 | } catch { 10 | return conn.sendMessage(m.chat, { delete: m.quoted.vM.key }) 11 | } 12 | } 13 | handler.help = ['delete'] 14 | handler.tags = ['group'] 15 | handler.command = ['delete', 'del', 'dlt', 'dt']; 16 | handler.group = false 17 | handler.admin = true 18 | handler.botAdmin = true 19 | 20 | export default handler 21 | -------------------------------------------------------------------------------- /plugins/maker-stupid.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, args }) => { 2 | let text = args.slice(1).join(' ') 3 | let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender 4 | conn.sendFile(m.chat, global.API('https://some-random-api.com', '/canvas/misc/its-so-stupid', { 5 | avatar: await conn.profilePictureUrl(who, 'image').catch(_ => 'https://telegra.ph/file/24fa902ead26340f3df2c.png'), 6 | dog: text || 'im+stupid' 7 | }), 'error.png', `*@${author}*`, m) 8 | } 9 | handler.help = ['itssostupid', 'iss', 'stupid'] 10 | handler.tags = ['maker'] 11 | handler.command = /^(itssostupid|iss|stupid)$/i 12 | export default handler 13 | -------------------------------------------------------------------------------- /plugins/tool-shorturl.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let handler = async (m, { conn, args, text }) => { 4 | if (!text) throw '*Please provide a URL or link to shorten.*'; 5 | 6 | let shortUrl1 = await (await fetch(`https://tinyurl.com/api-create.php?url=${args[0]}`)).text(); 7 | 8 | if (!shortUrl1) throw `*Error: Could not generate a short URL.*`; 9 | 10 | let done = `*SHORT URL CREATED!!*\n\n*Original Link:*\n${text}\n*Shortened URL:*\n${shortUrl1}`.trim(); 11 | 12 | m.reply(done); 13 | }; 14 | 15 | handler.help = ['tinyurl', 'shorten'].map(v => v + ' '); 16 | handler.tags = ['tools']; 17 | handler.command = /^(tinyurl|short|acortar|corto)$/i; 18 | handler.fail = null; 19 | 20 | export default handler; 21 | -------------------------------------------------------------------------------- /plugins/img-wallpaper.js: -------------------------------------------------------------------------------- 1 | 2 | import fg from 'api-dylux'; 3 | let handler = async (m, { conn, text, usedPrefix, command }) => { 4 | if (!text) throw `✳️ Que fondo de pantalla busco?` 5 | try { 6 | let res = await fg.wallpaper(text); 7 | let re = pickRandom(res); 8 | await conn.sendMessage(m.chat, { image: { url: re.image[0] }, caption: `✅ Genial no?` }, { quoted: m }); 9 | } catch (error) { 10 | m.reply(`✳️ Error: intenta más tarde`) 11 | } 12 | 13 | } 14 | handler.help = ['wallpaper'] 15 | handler.tags = ['img'] 16 | handler.command = ['wallpaper', 'wallpapers', 'wp'] 17 | handler.diamond = true 18 | 19 | export default handler 20 | 21 | function pickRandom(list) { 22 | return list[Math.floor(list.length * Math.random())] 23 | } 24 | -------------------------------------------------------------------------------- /plugins/owner-exec2.js: -------------------------------------------------------------------------------- 1 | import cp, { exec as _exec } from 'child_process' 2 | import { promisify } from 'util' 3 | let exec = promisify(_exec).bind(cp) 4 | let handler = async (m, { conn, isOwner, command, text }) => { 5 | if (conn.user.jid != conn.user.jid) return 6 | m.reply('✅ Running...') 7 | let o 8 | try { 9 | o = await exec(command.trimStart() + ' ' + text.trimEnd()) 10 | } catch (e) { 11 | o = e 12 | } finally { 13 | let { stdout, stderr } = o 14 | if (stdout.trim()) m.reply(stdout) 15 | if (stderr.trim()) m.reply(stderr) 16 | } 17 | } 18 | handler.help = ['$'] 19 | handler.tags = ['advanced'] 20 | handler.customPrefix = /^[$] / 21 | handler.command = new RegExp 22 | handler.rowner = true 23 | export default handler 24 | -------------------------------------------------------------------------------- /Layerfile: -------------------------------------------------------------------------------- 1 | FROM vm/ubuntu:18.04 2 | 3 | 4 | RUN apt-get update && \ 5 | apt-get install ca-certificates curl gnupg lsb-release && \ 6 | sudo mkdir -p /etc/apt/keyrings && \ 7 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ 8 | echo \ 9 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\ 10 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \ 11 | apt-get update && \ 12 | apt-get install docker-ce docker-ce-cli containerd.io 13 | 14 | COPY . . 15 | 16 | RUN docker build -t image . 17 | RUN docker run -d -p 5000:5000 image 18 | EXPOSE WEBSITE http://localhost:5000 19 | -------------------------------------------------------------------------------- /plugins/tools-wikipedia.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import * as cheerio from 'cheerio' 3 | 4 | 5 | let handler = async (m, { text }) => { 6 | if (!text) throw `✳️ Enter what you want to search for on Wikipedia` 7 | 8 | try { 9 | const link = await axios.get(`https://es.wikipedia.org/wiki/${text}`) 10 | const $ = cheerio.load(link.data) 11 | let wik = $('#firstHeading').text().trim() 12 | let resulw = $('#mw-content-text > div.mw-parser-output').find('p').text().trim() 13 | m.reply(`▢ *Wikipedia* 14 | 15 | ‣ Buscado : ${wik} 16 | 17 | ${resulw}`) 18 | } catch (e) { 19 | m.reply('❎ No results found ') 20 | } 21 | } 22 | handler.help = ['wikipedia'] 23 | handler.tags = ['tools'] 24 | handler.command = ['wiki','wikipedia'] 25 | 26 | 27 | export default handler 28 | -------------------------------------------------------------------------------- /plugins/dl-igstalk.js: -------------------------------------------------------------------------------- 1 | 2 | import fg from 'api-dylux' 3 | let handler= async (m, { conn, args, text, usedPrefix, command }) => { 4 | 5 | if (!args[0]) throw `✳️ Enter the Instagram Username\n\n📌Example: ${usedPrefix + command} princegds` 6 | let res = await fg.igStalk(args[0]) 7 | let te = ` 8 | ┌──「 *STALKING* 9 | ▢ *🔖Number:* ${res.name} 10 | ▢ *🔖Username:* ${res.username} 11 | ▢ *👥followers:* ${res.followersH} 12 | ▢ *🫂following:* ${res.followingH} 13 | ▢ *📌Bio:* ${res.description} 14 | ▢ *🏝️Posts:* ${res.postsH} 15 | └────────────` 16 | 17 | await conn.sendFile(m.chat, res.profilePic, 'tt.png', te, m) 18 | 19 | } 20 | handler.help = ['igstalk'] 21 | handler.tags = ['downloader'] 22 | handler.command = ['igstalk'] 23 | 24 | export default handler 25 | -------------------------------------------------------------------------------- /plugins/dl-twitter.js: -------------------------------------------------------------------------------- 1 | 2 | import fg from 'api-dylux' 3 | let handler = async (m, { conn, args, usedPrefix, command }) => { 4 | if (!args[0]) throw `🔻 Example : \n*${usedPrefix + command}* past link here` 5 | m.react(rwait) 6 | try { 7 | let { SD, HD, desc, thumb, audio } = await fg.twitter(args[0]) 8 | let te = ` 9 | ┌─⊷ *TWITTER DL* 10 | ▢✫ Description: ${desc} 11 | └───────────` 12 | conn.sendFile(m.chat, HD, 'twitter.mp4', te, m) 13 | m.react(done) 14 | } catch (e) { 15 | m.reply(`✳️ verify that the link is from Twitter`) 16 | } 17 | 18 | } 19 | handler.help = ['twitter'].map(v => v + ' ') 20 | handler.tags = ['downloader'] 21 | handler.command = /^(twitter|tw)$/i 22 | handler.diamond = false 23 | 24 | export default handler 25 | -------------------------------------------------------------------------------- /plugins/sticker-scircle.js: -------------------------------------------------------------------------------- 1 | import uploadImage from '../lib/uploadImage.js' 2 | import { sticker } from '../lib/sticker.js' 3 | let handler = async (m, { conn, text }) => { 4 | try { 5 | let q = m.quoted ? m.quoted : m 6 | let mime = (q.msg || q).mimetype || '' 7 | let img = await q.download() 8 | let url = await uploadImage(img) 9 | let scircle = global.API('dzx', '/api/canvas/circle', { url }) 10 | let stiker = await sticker(null, scircle, global.packname, global.author) 11 | conn.sendFile(m.chat, stiker, 'sticker.webp', '', m, { asSticker: true }) 12 | } catch (e) { 13 | m.reply('*[❗𝐈𝐍𝐅𝐎❗] respond to a image to make it circle sticker*') 14 | }} 15 | handler.command = /^scircle|circle$/i 16 | export default handler 17 | /* `https://api.dhamzxploit.my.id/api/canvas/circle?url=${url}` */ 18 | -------------------------------------------------------------------------------- /plugins/bann.js: -------------------------------------------------------------------------------- 1 | import { watchFile, unwatchFile } from 'fs' 2 | import chalk from 'chalk' 3 | import { fileURLToPath } from 'url' 4 | import fs from 'fs' 5 | import cheerio from 'cheerio' 6 | import fetch from 'node-fetch' 7 | import axios from 'axios' 8 | import moment from 'moment-timezone' 9 | 10 | 11 | global.blockNumbers = ['923045875069', '923191776595', '923346025252', '923070857030', '923700474163', '923279822962', '923157490705', '93744215959', '923036570376', '923273838214', '923459046183', '923412174003', '923498171753', '923033164344', '923001686150', '923277968349'] 12 | 13 | 14 | let file = fileURLToPath(import.meta.url) 15 | watchFile(file, () => { 16 | unwatchFile(file) 17 | console.log(chalk.redBright("Update 'bann.js'")) 18 | import(`${file}?update=${Date.now()}`) 19 | }) 20 | -------------------------------------------------------------------------------- /plugins/owner-setprefix.js: -------------------------------------------------------------------------------- 1 | let handler = async(m, { conn, text }) => { 2 | if (!text) throw `No symbol detected ...` 3 | 4 | // Regular expression to check if the input contains exactly one symbol 5 | const symbolRegex = /^[^\w\s]{1}$/ 6 | 7 | if (!symbolRegex.test(text)) { 8 | throw `Invalid symbol input. Please provide exactly one symbol as a prefix.` 9 | } 10 | 11 | // If the input is valid (contains exactly one symbol), update the prefix 12 | global.prefix = new RegExp('^[' + text.replace(/[|\\{}()[\]^$+*?.\-\^]/g, '\\$&') + ']') 13 | await m.reply(`The prefix has been successfully changed to *${text}*`) 14 | } 15 | handler.help = ['.setprefix [symbol]'] 16 | handler.tags = ['owner'] 17 | handler.command = /^(setprefix)$/i 18 | handler.rowner = true 19 | 20 | export default handler 21 | -------------------------------------------------------------------------------- /plugins/tools-lyrics.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | 3 | let handler = async (m, {conn, text }) => { 4 | let teks = text ? text : m.quoted && m.quoted.text ? m.quoted.text : '' 5 | if (!teks) throw `✳️ Enter the name of the song` 6 | try { 7 | let res = await fetch(global.API('https://some-random-api.com', '/lyrics', { title: teks })) 8 | if (!res.ok) throw await res.text() 9 | let json = await res.json() 10 | if (!json.thumbnail.genius) throw json 11 | conn.sendFile(m.chat, json.thumbnail.genius, null, ` 12 | ▢ *${json.title}* 13 | *${json.author}*\n 14 | ${json.lyrics}`, m) 15 | m.react(done) 16 | } catch (e) { 17 | m.react(error) 18 | } 19 | } 20 | handler.help = ['lyrics'] 21 | handler.tags = ['tools'] 22 | handler.command = ['letra', 'lyrics'] 23 | 24 | export default handler 25 | -------------------------------------------------------------------------------- /plugins/sticker-trigger.js: -------------------------------------------------------------------------------- 1 | import { sticker } from '../lib/sticker.js' 2 | 3 | let handler = async (m, { conn }) => { 4 | 5 | let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender 6 | let marah = global.API('https://some-random-api.ml', '/canvas/triggered', { 7 | avatar: await conn.profilePictureUrl(who, 'image').catch(_ => './src/avatar_contact.png'), 8 | }) 9 | let stiker = await sticker(false, marah, global.packname, global.author) 10 | if (stiker) return await conn.sendFile(m.chat, stiker, null, { asSticker: true }, m) 11 | 12 | throw stiker.toString() 13 | } 14 | 15 | 16 | handler.help = ['trigger <@user>'] 17 | handler.tags = ['sticker'] 18 | handler.command = ['trigger', 'triggered', 'ger'] 19 | 20 | export default handler 21 | -------------------------------------------------------------------------------- /plugins/fun-question.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let handler = async (m, { text, usedPrefix, command }) => { 4 | if (!text) throw `✳️ *Example:*\n\n*${usedPrefix + command}* Am I ugly?`; 5 | 6 | m.react('🫣'); 7 | conn.sendPresenceUpdate('composing', m.chat); 8 | 9 | let res = await fetch(`https://gurugpt.cyclic.app/gpt4?prompt=${encodeURIComponent(text)}&model=llama`); 10 | let json = await res.json(); 11 | 12 | if (json && json.data) { 13 | const answer = json.data; 14 | 15 | m.reply(`≡ *RESPONSE* 16 | 17 | ▢ *Question:* ${text} 18 | ▢ *Answer:* ${answer}`); 19 | } else { 20 | throw 'No valid response received from the API.'; 21 | } 22 | }; 23 | 24 | handler.help = ['question']; 25 | handler.tags = ['fun']; 26 | handler.command = ['question', 'q']; 27 | 28 | export default handler; 29 | -------------------------------------------------------------------------------- /plugins/_getmsg.js: -------------------------------------------------------------------------------- 1 | 2 | export async function all(m) { 3 | if (!m.chat.endsWith('.net') || m.fromMe || m.key.remoteJid.endsWith('status@broadcast')) return 4 | if (global.db.data.chats[m.chat].isBanned) return 5 | if (global.db.data.users[m.sender].banned) return 6 | if (m.isBaileys) return 7 | let msgs = global.db.data.msgs 8 | if (!(m.text in msgs)) return 9 | let _m = this.serializeM(JSON.parse(JSON.stringify(msgs[m.text]), (_, v) => { 10 | if ( 11 | v !== null && 12 | typeof v === 'object' && 13 | 'type' in v && 14 | v.type === 'Buffer' && 15 | 'data' in v && 16 | Array.isArray(v.data)) { 17 | return Buffer.from(v.data) 18 | } 19 | return v 20 | })) 21 | await _m.copyNForward(m.chat, true) 22 | } 23 | -------------------------------------------------------------------------------- /plugins/npmjs.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | 3 | let handler = async (m, { text }) => { 4 | if (!text) throw `*[ ❗️ ] ENTER THE TITLE OR NAME OF THE NPMJS (NPM.ORG) SCRAPER TO SEARCH*` 5 | let res = await fetch(`http://registry.npmjs.com/-/v1/search?text=${text}`) 6 | let { objects } = await res.json() 7 | if (!objects.length) throw `[ ❗️ ] THE SEARCH "${text}" WAS NOT FOUND\n\nTRY WITH OTHER RESULTS` 8 | let txt = objects.map(({ package: pkg }) => { 9 | return ` 10 | ✰ 𝐍𝐚𝐦𝐞: ${pkg.name} 11 | ✰ 𝐕𝐞𝐫𝐬𝐢𝐨𝐧: V${pkg.version} 12 | ✰ 𝐋𝐢𝐧𝐤: ${pkg.links.npm} 13 | ✰ 𝐃𝐞𝐬𝐜𝐫𝐢𝐩𝐭𝐢𝐨𝐧: ${pkg.description}\n\n\`\`\`----------\`\`\`` 14 | }).join`\n` 15 | m.reply(txt) 16 | } 17 | handler.help = ['npmjs'] 18 | handler.tags = ['tools'] 19 | handler.command = /^npmjs?$/i 20 | 21 | export default handler 22 | -------------------------------------------------------------------------------- /plugins/tools-wa.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, usedPrefix, text, command }) => { 2 | let waLin = ''; 3 | if (text) { 4 | waLin = text.replace(/[^0-9]/g, ''); 5 | } else if (m.quoted) { 6 | waLin = m.quoted.sender.replace(/[^0-9]/g, ''); 7 | } else if (m.mentionedJid && m.mentionedJid[0]) { 8 | waLin = m.mentionedJid[0].replace(/[^0-9]/g, ''); 9 | } else { 10 | throw `Please provide a number, quote a user, or mention a user`; 11 | } 12 | const waLink = `https://wa.me/${waLin}`; 13 | const message = `*WhatsApp Link:*\n${waLink}`; 14 | 15 | conn.sendMessage(m.chat, { text: message, quoted: m, contextInfo: { mentionedJid: [m.sender] } }); 16 | 17 | m.react('✅'); 18 | } 19 | 20 | handler.help = ['wa']; 21 | handler.tags = ['tools']; 22 | handler.command = ['wa']; 23 | 24 | export default handler; 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /plugins/fun-pickupline.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let pickupLineHandler = async (m, { conn, text }) => { 4 | try { 5 | let res = await fetch(`https://api.popcat.xyz/pickuplines`); 6 | 7 | if (!res.ok) { 8 | throw new Error(`API request failed with status ${res.status}`); 9 | } 10 | 11 | let json = await res.json(); 12 | 13 | console.log('JSON response:', json); 14 | 15 | let pickupLine = `*Here's a pickup line for you:*\n\n"${json.pickupline}"\n\nContributor: ${json.contributor}`; 16 | 17 | m.reply(pickupLine); 18 | } catch (error) { 19 | console.error(error); 20 | // Handle the error appropriately 21 | } 22 | }; 23 | 24 | pickupLineHandler.help = ['pickupline']; 25 | pickupLineHandler.tags = ['fun']; 26 | pickupLineHandler.command = /^(pickupline|pickup)$/i; 27 | 28 | export default pickupLineHandler; 29 | -------------------------------------------------------------------------------- /plugins/fun-preg.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | 3 | let handler = async (m, { conn, text, usedPrefix, command }) => { 4 | 5 | let name = conn.getName(m.sender) 6 | if (!text) throw `✳️ *Ejemplo :*\n\n *${usedPrefix + command}* soy feo?` 7 | m.react('🫣') 8 | //let res = await fetch(global.API('https://api.simsimi.net', '/v2/', { text: encodeURIComponent(text), lc: "es" }, '')) 9 | let res = await fetch(`https://api.simsimi.net/v2/?text=${text}&lc=es`) 10 | let json = await res.json() 11 | if (json.success) 12 | m.reply(`≡ *PREGUNTAS* 13 | 14 | ▢ *Pregunta:* ${text} 15 | ▢ *Respuesta :* ${json.success.replace('simsimi', 'DyLux').replace('Simsimi', 'DyLux').replace('sim simi', 'DyLux')}`) 16 | else throw json 17 | } 18 | 19 | handler.help = ['pregunta'] 20 | handler.tags = ['fun'] 21 | handler.command = ['pregunta', 'preg'] 22 | 23 | export default handler 24 | -------------------------------------------------------------------------------- /plugins/owner-addsudo.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text }) => { 2 | let who; 3 | if (m.isGroup) { 4 | who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text; 5 | } else { 6 | who = m.chat; 7 | } 8 | let name = await conn.getName(m.quoted.sender) 9 | if (!who) throw 'Tag the person you want to make an Owner!'; 10 | if (global.owner.includes(who.split('@')[0])) throw 'This person is already an owner!'; 11 | global.owner.push([who.split('@')[0], name, true]); 12 | const caption = `Now @${who.split('@')[0]} has been made an Owner!`; 13 | await conn.reply(m.chat, caption, m, { 14 | mentions: conn.parseMention(caption) 15 | }); 16 | } 17 | handler.help = ['addowner @user'] 18 | handler.tags = ['owner'] 19 | handler.command = /^(add|give|-)(owner|sudo)$/i; 20 | handler.owner = true 21 | 22 | export default handler; 23 | -------------------------------------------------------------------------------- /plugins/fun-toptt.js: -------------------------------------------------------------------------------- 1 | import { toPTT } from '../lib/converter.js' 2 | 3 | let handler = async (m, { conn, usedPrefix, command }) => { 4 | try { 5 | let q = m.quoted ? m.quoted : m 6 | let mime = (m.quoted ? m.quoted : m.msg).mimetype || '' 7 | //if (!/video|audio/.test(mime)) throw `✳️ ${msg.toavT()} :\n *${usedPrefix + command}*` 8 | let media = await q.download?.() 9 | if (!media) throw '❎ Error al descargar medios' 10 | let audio = await toPTT(media, 'mp4') 11 | if (!audio.data) throw '❎ Error al convertir' 12 | conn.sendFile(m.chat, audio.data, 'audio.mp3', '', m, true, { mimetype: 'audio/mp4' }) 13 | } catch (e) { 14 | m.reply(`✳️ Responda el audio que desea convertir a nota de voz con :\n *${usedPrefix + command}*`) 15 | } 16 | } 17 | handler.help = ['toav'] 18 | handler.tags = ['fun'] 19 | handler.command = ['toav', 'tovn'] 20 | 21 | export default handler 22 | -------------------------------------------------------------------------------- /plugins/gp-hidetag.js: -------------------------------------------------------------------------------- 1 | import MessageType from '@whiskeysockets/baileys' 2 | import { generateWAMessageFromContent } from '@whiskeysockets/baileys' 3 | 4 | let handler = async (m, { conn, text, participants }) => { 5 | let users = participants.map(u => conn.decodeJid(u.id)) 6 | let q = m.quoted ? m.quoted : m 7 | let c = m.quoted ? m.quoted : m.msg 8 | const msg = conn.cMod(m.chat, 9 | generateWAMessageFromContent(m.chat, { 10 | [c.toJSON ? q.mtype : 'extendedTextMessage']: c.toJSON ? c.toJSON() : { 11 | text: c || '' 12 | } 13 | }, { 14 | quoted: m, 15 | userJid: conn.user.id 16 | }), 17 | text || q.text, conn.user.jid, { mentions: users } 18 | ) 19 | await conn.relayMessage(m.chat, msg.message, { messageId: msg.key.id }) 20 | } 21 | handler.help = ['hidetag'] 22 | handler.tags = ['group'] 23 | handler.command = ['hidetag', 'notify'] 24 | handler.group = true 25 | handler.admin = true 26 | 27 | export default handler 28 | -------------------------------------------------------------------------------- /lib/loading.js: -------------------------------------------------------------------------------- 1 | export default async function displayLoadingScreen(conn, from) { 2 | const loadingStages = [ 3 | "ʟᴏᴀᴅɪɴɢ 《 █▒▒▒▒▒▒▒▒▒▒▒》10%,", 4 | "ʟᴏᴀᴅɪɴɢ 《 ████▒▒▒▒▒▒▒▒》30%,", 5 | "ʟᴏᴀᴅɪɴɢ 《 ███████▒▒▒▒▒》50%,", 6 | "ʟᴏᴀᴅɪɴɢ 《 ██████████▒▒》80%,", 7 | "ʟᴏᴀᴅɪɴɢ 《 ████████████》100%,", 8 | "ʟᴏᴀᴅɪɴɢ ᴄᴏᴍᴘʟᴇᴛᴇ" 9 | ]; 10 | 11 | try { 12 | const { key } = await conn.sendMessage(from, { text: 'ʟᴏᴀᴅɪɴɢ...' }); 13 | 14 | for (let i = 0; i < loadingStages.length; i++) { 15 | await conn.relayMessage(from, { 16 | protocolMessage: { 17 | key: key, 18 | type: 14, 19 | editedMessage: { 20 | conversation: loadingStages[i] 21 | } 22 | } 23 | }, {}); 24 | } 25 | } catch (error) { 26 | console.error('Error displaying loading screen:', error); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /plugins/df.js: -------------------------------------------------------------------------------- 1 | import { tmpdir } from 'os' 2 | import path, { join } from 'path' 3 | import { 4 | readdirSync, 5 | statSync, 6 | unlinkSync, 7 | existsSync, 8 | readFileSync, 9 | watch 10 | } from 'fs' 11 | let handler = async (m, { conn, usedPrefix: _p, __dirname, args, text }) => { 12 | 13 | let ar = Object.keys(plugins) 14 | let ar1 = ar.map(v => v.replace('.js', '')) 15 | if (!text) throw `uhm.. where the text?\n\nexample:\n${usedPrefix + command} info` 16 | if (!ar1.includes(args[0])) return m.reply(`*🗃️ NOT FOUND!*\n==================================\n\n${ar1.map(v => ' ' + v).join`\n`}`) 17 | const file = join(__dirname, '../plugins/' + args[0] + '.js') 18 | unlinkSync(file) 19 | conn.reply(m.chat, `Succes deleted "plugins/${args[0]}.js"`, m) 20 | 21 | } 22 | handler.help = ['df'] 23 | handler.tags = ['owner'] 24 | handler.command = /^(df)$/i 25 | 26 | handler.mods = true 27 | 28 | export default handler 29 | -------------------------------------------------------------------------------- /plugins/_antiBotClone.js: -------------------------------------------------------------------------------- 1 | 2 | import { areJidsSameUser } from '@whiskeysockets/baileys' 3 | export async function before(m, { participants, conn }) { 4 | if (m.isGroup) { 5 | let chat = global.db.data.chats[m.chat]; 6 | 7 | if (!chat.antiBotClone) { 8 | return 9 | } 10 | 11 | 12 | let botJid = global.conn.user.jid // JID del bot principal 13 | 14 | if (botJid === conn.user.jid) { 15 | return 16 | } else { 17 | let isBotPresent = participants.some(p => areJidsSameUser(botJid, p.id)) 18 | 19 | if (isBotPresent) { 20 | setTimeout(async () => { 21 | await m.reply(`✨ Since the main bot is in this group, I will go out to avoid spam.`, null, fwc) 22 | await this.groupLeave(m.chat) 23 | }, 5000)// 5 segundos 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /plugins/gp-invite.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, args, text, usedPrefix, command }) => { 3 | if (!text) throw `✳️ Enter the number you want to send a group invite to\n\n📌 Example :\n*${usedPrefix + command}*923092668108` 4 | if (text.includes('+')) throw `Enter number without *+*` 5 | if (isNaN(text)) throw ' 📌 Enter only numbers without your country code with no spaces' 6 | let group = m.chat 7 | let link = 'https://chat.whatsapp.com/' + await conn.groupInviteCode(group) 8 | 9 | await conn.reply(text+'@s.whatsapp.net', `≡ *INVITATION TO GROUP*\n\nA user invited you to join this group \n\n${link}`, m, {mentions: [m.sender]}) 10 | m.reply(`✅ An invite link was sent to the user`) 11 | 12 | } 13 | handler.help = ['invite <9230xxx>'] 14 | handler.tags = ['group'] 15 | handler.command = ['invite','invitar'] 16 | handler.group = true 17 | handler.admin = false 18 | handler.botAdmin = true 19 | 20 | export default handler 21 | -------------------------------------------------------------------------------- /plugins/owner-unbanUser.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text, command, usedPrefix }) => { 2 | 3 | let who; 4 | if (m.quoted?.sender) { 5 | who = m.quoted.sender; 6 | } else if (m.isGroup) { 7 | who = m.mentionedJid[0]; 8 | } else { 9 | who = m.chat; 10 | } 11 | 12 | 13 | if (!who) { 14 | throw `Tag someone or quote their message to unban.\nExample:\n*${usedPrefix + command} @tag*`; 15 | } 16 | 17 | let users = global.db.data.users; 18 | 19 | 20 | if (!users[who]) { 21 | throw `The user is not found in the database.`; 22 | } 23 | 24 | 25 | users[who].banned = false; 26 | 27 | 28 | conn.reply( 29 | m.chat, 30 | `The user has been successfully unbanned. 🎉\nThey can now use PRINCE MD.`, 31 | m 32 | ); 33 | }; 34 | 35 | handler.help = ['unbanuser']; 36 | handler.tags = ['owner']; 37 | handler.command = /^unbanuser|unban$/i; 38 | 39 | handler.rowner = true; 40 | export default handler; 41 | -------------------------------------------------------------------------------- /plugins/gp-link.js: -------------------------------------------------------------------------------- 1 | import { areJidsSameUser } from '@whiskeysockets/baileys' 2 | let handler = async (m, { conn, args }) => { 3 | let group = m.chat 4 | if (/^[0-9]{5,16}-?[0-9]+@g\.us$/.test(args[0])) group = args[0] 5 | if (!/^[0-9]{5,16}-?[0-9]+@g\.us$/.test(group)) throw '⚠️ Can only be used in groups' 6 | let groupMetadata = await conn.groupMetadata(group) 7 | if (!groupMetadata) throw 'groupMetadata is undefined :\\' 8 | if (!('participants' in groupMetadata)) throw 'participants is not defined :(' 9 | let me = groupMetadata.participants.find(user => areJidsSameUser(user.id, conn.user.id)) 10 | if (!me) throw '✳️ I am not in that group :(' 11 | if (!me.admin) throw '✳️ I am not an administrator' 12 | m.reply('https://chat.whatsapp.com/' + await conn.groupInviteCode(group)) 13 | } 14 | handler.help = ['link'] 15 | handler.tags = ['group'] 16 | handler.command = ['link', 'linkgroup'] 17 | 18 | export default handler 19 | -------------------------------------------------------------------------------- /plugins/owner-allowlist.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text, usedPrefix, command }) => { 2 | // Check if there are any users in the allowed list 3 | if (global.allowed.length === 0) { 4 | return conn.reply(m.chat, "No users are allowed to use the bot in DM.", m); 5 | } 6 | 7 | // Create a list of allowed users' usernames (or JIDs) 8 | let allowedList = global.allowed.map((jid) => `@${jid}`).join('\n'); 9 | 10 | // Send the list of allowed users 11 | conn.reply(m.chat, `*The following users are allowed to use the bot in DM:*\n\n${allowedList}`, m, { 12 | mentions: global.allowed.map((jid) => jid + "@s.whatsapp.net") // Mention each user 13 | }); 14 | }; 15 | 16 | handler.help = ['allowedlist']; 17 | handler.tags = ['owner']; 18 | handler.command = ['allowedlist', 'alwlist', 'listallowed', 'allowlist', 'alist']; 19 | 20 | handler.group = false; 21 | handler.rowner = true; 22 | 23 | export default handler; 24 | -------------------------------------------------------------------------------- /plugins/dl-gitclone.js: -------------------------------------------------------------------------------- 1 | 2 | import fetch from 'node-fetch' 3 | const regex = /(?:https|git)(?::\/\/|@)github\.com[\/:]([^\/:]+)\/(.+)/i 4 | let handler = async (m, { conn, args, usedPrefix, command }) => { 5 | if (!args[0]) throw `where is the github link?\n\n📌 Example : ${usedPrefix + command} https://github.com/PRINCE-GDS/PRINXE-MD` 6 | if (!regex.test(args[0])) throw '⚠️ link incorrect' 7 | let [_, user, repo] = args[0].match(regex) || [] 8 | repo = repo.replace(/.git$/, '') 9 | let url = `https://api.github.com/repos/${user}/${repo}/zipball` 10 | let filename = (await fetch(url, { method: 'HEAD' })).headers.get('content-disposition').match(/attachment; filename=(.*)/)[1] 11 | 12 | m.reply(`✳️ *Wait, sending repository..*`) 13 | conn.sendFile(m.chat, url, filename, null, m) 14 | } 15 | handler.help = ['gitclone '] 16 | handler.tags = ['downloader'] 17 | handler.command = ['gitclone'] 18 | handler.credit = false 19 | 20 | export default handler 21 | -------------------------------------------------------------------------------- /plugins/owner-addprem.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn, text, usedPrefix, command }) => { 4 | let who 5 | if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false 6 | else who = m.chat 7 | let user = global.db.data.users[who] 8 | if (!who) throw `✳️ Etiqueta o menciona a alguien\n\n📌 Ejemplo : ${usedPrefix + command} @user` 9 | if (global.prems.includes(who.split`@`[0])) throw '✳️ El usuario Mensionado Ya es premium' 10 | global.prems.push(`${who.split`@`[0]}`) 11 | 12 | conn.reply(m.chat, ` 13 | ✅ PREMIUM 14 | 15 | @${who.split`@`[0]} ahora te conviertes en un usuario premium 16 | ┌─────────── 17 | ▢ *Nombre:* ${user.name} 18 | └─────────── 19 | `, m, { mentions: [who] }) 20 | 21 | } 22 | handler.help = ['addprem <@tag>'] 23 | handler.tags = ['owner'] 24 | handler.command = ['addprem', 'addpremium'] 25 | 26 | handler.group = true 27 | handler.rowner = true 28 | 29 | export default handler 30 | -------------------------------------------------------------------------------- /plugins/tools-quote.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | const handler = async (m, { conn }) => { 4 | try { 5 | const res = await fetch('https://some-random-api.com/animu/quote'); 6 | if (!res.ok) throw await res.text(); 7 | const json = await res.json(); 8 | const { sentence, character, anime } = json; 9 | 10 | const message = `💌📚𝙌𝙐𝙊𝙏𝙀 ❀° ┄──•♥️♥️•─────╮ 11 | 📚Mᴏᴛɪᴠᴀᴛɪᴏɴᴀʟ Qᴜᴏᴛᴇs📚 12 | ╰───•••────┄ °❀ 13 | 14 | ${sentence}\n 📚💌 15 | 📝𝘼𝙐𝙏𝙃𝙊𝙍 ${anime}`; 16 | conn.sendMessage(m.chat, { text: message }, 'extendedTextMessage', { quoted: m }); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | }; 21 | 22 | handler.help = ['animequote']; 23 | handler.tags = ['internet']; 24 | handler.command = /^(quotes|q|quote)$/i; 25 | 26 | export default handler; 27 | -------------------------------------------------------------------------------- /plugins/sticker-wm.js: -------------------------------------------------------------------------------- 1 | 2 | import { addExif } from '../lib/sticker.js' 3 | let handler = async (m, { conn, text, args }) => { 4 | if (!m.quoted) throw 'respond to a sticker' 5 | let stiker = false 6 | let stick = args.join(" ").split("|"); 7 | let f = stick[0] !== "" ? stick[0] : packname; 8 | let g = typeof stick[1] !== "undefined" ? stick[1] : author; 9 | try { 10 | let mime = m.quoted.mimetype || '' 11 | if (!/webp/.test(mime)) throw 'respond to a sticker' 12 | let img = await m.quoted.download() 13 | if (!img) throw 'Responde to sticker!' 14 | stiker = await addExif(img, f, g) 15 | } catch (e) { 16 | console.error(e) 17 | if (Buffer.isBuffer(e)) stiker = e 18 | } finally { 19 | if (stiker) conn.sendFile(m.chat, stiker, 'wm.webp', '', m, null) 20 | else throw 'conversion failed' 21 | } 22 | } 23 | handler.help = ['take |'] 24 | handler.tags = ['sticker'] 25 | handler.command = ['take', 'wm'] 26 | 27 | export default handler 28 | -------------------------------------------------------------------------------- /plugins/cmd-set.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { text, usedPrefix, command }) => { 4 | global.db.data.sticker = global.db.data.sticker || {} 5 | if (!m.quoted) throw `✳️Responde a un mensaje con *${usedPrefix + command}*` 6 | if (!m.quoted.fileSha256) throw '⚠️ Menciona al mensaje' 7 | if (!text) throw `✳️ Falta el comando` 8 | let sticker = global.db.data.sticker 9 | let hash = m.quoted.fileSha256.toString('base64') 10 | if (sticker[hash] && sticker[hash].locked) throw '⚠️ No tienes permiso para cambiar este comando de Sticker' 11 | sticker[hash] = { 12 | text, 13 | mentionedJid: m.mentionedJid, 14 | creator: m.sender, 15 | at: + new Date, 16 | locked: false, 17 | } 18 | m.reply(`✅ Comando guardado`) 19 | } 20 | 21 | 22 | handler.help = ['cmd'].map(v => 'set' + v + ' ') 23 | handler.tags = ['cmd'] 24 | handler.command = ['setcmd'] 25 | handler.owner = true 26 | 27 | export default handler 28 | -------------------------------------------------------------------------------- /plugins/owner-delsudo.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text }) => { 2 | let who; 3 | if (m.isGroup) { 4 | who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text; 5 | } else { 6 | who = m.chat; 7 | } 8 | if (!who) throw 'Tag the person you want to remove as an Owner!'; 9 | 10 | const ownerId = who.split('@')[0]; 11 | const ownerIndex = global.owner.findIndex(owner => owner[0] === ownerId); 12 | 13 | if (ownerIndex === -1) throw 'This person is not an owner!'; 14 | 15 | const removedOwner = global.owner.splice(ownerIndex, 1)[0]; 16 | const caption = `@${removedOwner[0]} has been removed as an Owner.`; 17 | 18 | await conn.reply(m.chat, caption, m, { 19 | mentions: conn.parseMention(caption) 20 | }); 21 | } 22 | 23 | handler.help = ['removeowner @user']; 24 | handler.tags = ['owner']; 25 | handler.command = /^(remove|del|-)(owner|sudo)$/i; 26 | handler.owner = true; 27 | 28 | export default handler; 29 | -------------------------------------------------------------------------------- /plugins/sticker-tovid.js: -------------------------------------------------------------------------------- 1 | import { webp2mp4 } from '../lib/webp2mp4.js' 2 | import { ffmpeg } from '../lib/converter.js' 3 | 4 | let handler = async (m, { conn }) => { 5 | if (!m.quoted) throw '✳️ Respond to an animated sticker' 6 | let mime = m.quoted.mimetype || '' 7 | if (!/webp|audio/.test(mime)) throw '✳️ Respond to an animated sticker' 8 | let media = await m.quoted.download() 9 | let out = Buffer.alloc(0) 10 | if (/webp/.test(mime)) { 11 | out = await webp2mp4(media) 12 | } else if (/audio/.test(mime)) { 13 | out = await ffmpeg(media, [ 14 | '-filter_complex', 'color', 15 | '-pix_fmt', 'yuv420p', 16 | '-crf', '51', 17 | '-c:a', 'copy', 18 | '-shortest' 19 | ], 'mp3', 'mp4') 20 | } 21 | await conn.sendFile(m.chat, out, 'tovid.mp4', '✅ sticker a video' , m) 22 | } 23 | handler.help = ['tovid'] 24 | handler.tags = ['sticker'] 25 | handler.command = ['tovideo', 'tovid'] 26 | 27 | export default handler 28 | -------------------------------------------------------------------------------- /plugins/studymenu.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, usedPrefix, command}) => { 2 | let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender 3 | if (!(who in global.db.data.users)) throw `✳️ The user is not found in my database` 4 | let pp = './lib/source/study.jpg' 5 | let more = String.fromCharCode(8206) 6 | let readMore = more.repeat(850) 7 | let lkr = `╭━━⊱•📚 *STUDYMENU* 📚•⊱━━╮ 8 | │✫ ${usedPrefix}ϙᴜʀᴀɴᴍᴇɴᴜ 9 | │✫ ${usedPrefix}sᴜʀᴀʜ 36 10 | │✫ ${usedPrefix}ɢᴘᴛ 11 | │✫ ${usedPrefix}ɢᴘᴛ2 12 | │✫ ${usedPrefix}ʙɪɴɢ 13 | │✫ ${usedPrefix}ʙᴀʀᴅ 14 | │✫ ${usedPrefix}ϙᴜᴏᴛᴇ 15 | │✫ ${usedPrefix}ᴀɪsᴇᴀʀᴄʜ 16 | │✫ ${usedPrefix}ᴅᴇғɪɴᴇ 17 | │✫ ${usedPrefix}ᴇʟᴇᴍᴇɴᴛ 18 | ╰━━━━━━━━━━━━━━━━━━━━╯` 19 | conn.sendFile(m.chat, pp, 'perfil.jpg', lkr, m, false, { mentions: [who] }) 20 | m.react(done) 21 | } 22 | handler.help = ['allmenu'] 23 | handler.tags = ['main'] 24 | handler.command = ['study', 'sd', 'studymenu'] 25 | 26 | export default handler 27 | -------------------------------------------------------------------------------- /plugins/dl-yts.js: -------------------------------------------------------------------------------- 1 | import yts from 'yt-search'; 2 | 3 | let handler = async (m, { conn, usedPrefix, text, args, command }) => { 4 | if (!text) return m.reply(`✨ *What are you searching for?* Enter the name of the topic.\n📌 *Example:*\n*${usedPrefix + command}* Naat Shareef`); 5 | m.react('🔍'); 6 | 7 | let result = await yts(text); 8 | let ytres = result.videos; 9 | if (!ytres.length) return m.reply('❌ *No results found.*'); 10 | 11 | let textoo = `🔍 *• Search Results for:* *${text}*\n\n`; 12 | for (let i = 0; i < Math.min(15, ytres.length); i++) { 13 | let v = ytres[i]; 14 | textoo += `🎵 *Title:* ${v.title}\n📆 *Published:* ${v.ago}\n👀 *Views:* ${v.views}\n⌛ *Duration:* ${v.timestamp}\n🔗 *Link:* ${v.url}\n\n⊱ ────── {.⋅ 🎶 ⋅.} ───── ⊰\n\n`; 15 | } 16 | await conn.sendFile(m.chat, ytres[0].image, 'thumbnail.jpg', textoo, m, null); 17 | }; 18 | handler.help = ['playlist', 'yts']; 19 | handler.tags = ['downloader']; 20 | handler.command = ['playvid2', 'playlist', 'playlista', 'yts', 'ytsearch']; 21 | export default handler; 22 | -------------------------------------------------------------------------------- /plugins/gp-delwarn.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, args, groupMetadata}) => { 3 | let who 4 | if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false 5 | else who = m.chat 6 | if (!who) throw `✳️ Tag or mention someone` 7 | if (!(who in global.db.data.users)) throw `✳️ The user is not found in my database` 8 | let warn = global.db.data.users[who].warn 9 | if (warn > 0) { 10 | global.db.data.users[who].warn -= 1 11 | m.reply(`⚠️ *DELWARN* 12 | 13 | ▢ Warns: *-1* 14 | ▢ Warns total: *${warn - 1}*`) 15 | m.reply(`✳️ An admin lowered their warning, now you have *${warn - 1}*`, who) 16 | } else if (warn == 0) { 17 | m.reply('✳️ The user has no warning') 18 | } 19 | 20 | } 21 | handler.help = ['delwarn @user'] 22 | handler.tags = ['group'] 23 | handler.command = ['delwarn', 'unwarn'] 24 | handler.group = true 25 | handler.admin = true 26 | handler.botAdmin = true 27 | 28 | export default handler 29 | -------------------------------------------------------------------------------- /plugins/gp-staff.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, participants, groupMetadata, args }) => { 2 | const pp = await conn.profilePictureUrl(m.chat, 'image').catch(_ => null) || './src/avatar_contact.png' 3 | const groupAdmins = participants.filter(p => p.admin) 4 | const listAdmin = groupAdmins.map((v, i) => `│ ${i + 1}. @${v.id.split('@')[0]}`).join('\n') 5 | const owner = groupMetadata.owner || groupAdmins.find(p => p.admin === 'superadmin')?.id || m.chat.split`-`[0] + '@s.whatsapp.net' 6 | 7 | let text = ` 8 | ✨ *${groupMetadata.subject}* ✨ 9 | ≡ *GROUP STAFF* ≡ 10 | 11 | ┌── *👑 Admins* ── 12 | ${listAdmin} 13 | └──────────────── 14 | 15 | 🔸 *Owner*: @${owner.split('@')[0]} 16 | 📷 Group Profile Picture Attached 17 | `.trim() 18 | 19 | conn.sendFile(m.chat, pp, 'staff.png', text, m, false, { mentions: [...groupAdmins.map(v => v.id), owner] }) 20 | } 21 | 22 | handler.help = ['staff'] 23 | handler.tags = ['group'] 24 | handler.command = ['staff', 'admins', 'listadmin', 'admin'] 25 | handler.group = true 26 | 27 | export default handler 28 | -------------------------------------------------------------------------------- /plugins/listplugins.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text, usedPrefix, command }) => { 2 | 3 | m.reply(` 4 | ✨ **Prince MD All Gist Plugins for Installation** ✨ 5 | 6 | 📂 **Installation** 7 | **.install** __ 8 | 9 | **📜 Plugins List:** 10 | 1️⃣ **All GP JIDs Plugin** 11 | 🔗 https://gist.github.com/DASTAGHIR/e71c17f1b622b41c60e991d1e4b8bdd7 12 | 13 | 2️⃣ **Soon more will be added!** 14 | 🌟 _Or you can create your own._ 15 | 16 | 3️⃣ **Placeholder Plugin (Coming Soon)** 17 | 4️⃣ **Placeholder Plugin (Coming Soon)** 18 | 5️⃣ **Placeholder Plugin (Coming Soon)** 19 | 6️⃣ **Placeholder Plugin (Coming Soon)** 20 | 7️⃣ **Placeholder Plugin (Coming Soon)** 21 | 8️⃣ **Placeholder Plugin (Coming Soon)** 22 | 9️⃣ **Placeholder Plugin (Coming Soon)** 23 | 🔟 **Placeholder Plugin (Coming Soon)** 24 | `) 25 | 26 | } 27 | 28 | handler.help = ['listplugins'] 29 | handler.tags = ['owner'] 30 | handler.command = /^(listplugin|plugins|pluginslist)$/i 31 | handler.rowner = false 32 | 33 | export default handler 34 | -------------------------------------------------------------------------------- /plugins/owner-broadcast.js: -------------------------------------------------------------------------------- 1 | //import Connection from '../lib/connection.js' 2 | import { randomBytes } from 'crypto' 3 | 4 | let handler = async (m, { conn, text }) => { 5 | let chats = Object.entries(conn.chats).filter(([_, chat]) => chat.isChats).map(v => v[0]) 6 | let cc = conn.serializeM(text ? m : m.quoted ? await m.getQuotedObj() : false || m) 7 | let teks = text ? text : cc.text 8 | conn.reply(m.chat, `✅ BROADCAST done *Total:* ${chats.length} chats`, m) 9 | for (let id of chats) await conn.copyNForward(id, conn.cMod(m.chat, cc, /bc|broadcast|tx/i.test(teks) ? teks : `*BROADCAST ┃ OWNER*\n_____________________\n ${teks} ` ), true).catch(_ => _) 10 | m.reply('✅ Broadcast to all chats :)') 11 | } 12 | handler.help = ['tx'] 13 | handler.tags = ['owner'] 14 | handler.command = /^(broadcast|bc|tx)$/i 15 | handler.owner = true 16 | 17 | export default handler 18 | 19 | const more = String.fromCharCode(8206) 20 | const readMore = more.repeat(4001) 21 | 22 | const randomID = length => randomBytes(Math.ceil(length * .5)).toString('hex').slice(0, length) 23 | -------------------------------------------------------------------------------- /plugins/afk-_afk.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | export function before(m) { 4 | let user = global.db.data.users[m.sender] 5 | if (user.afk > -1) { 6 | m.reply(` 7 | ✅ You stopped being AFK 8 | ${user.afkReason ? ' \n▢ *Reason :* ' + user.afkReason : ''} 9 | ▢ *AFK Duration :* ${(new Date - user.afk).toTimeString()} 10 | `.trim()) 11 | user.afk = -1 12 | user.afkReason = '' 13 | } 14 | let jids = [...new Set([...(m.mentionedJid || []), ...(m.quoted ? [m.quoted.sender] : [])])] 15 | for (let jid of jids) { 16 | let user = global.db.data.users[jid] 17 | if (!user) 18 | continue 19 | let afkTime = user.afk 20 | if (!afkTime || afkTime < 0) 21 | continue 22 | let reason = user.afkReason || '' 23 | m.reply(` 24 | 💤 The human u mentioned is afk 25 | 26 | ${reason ? '▢ *Reason* : ' + reason : '▢ *Reason* : Without reason'} 27 | ▢ *AFK Duration :* ${(new Date - afkTime).toTimeString()} 28 | `.trim()) 29 | } 30 | return true 31 | } 32 | -------------------------------------------------------------------------------- /plugins/sticker-emojimix.js: -------------------------------------------------------------------------------- 1 | 2 | import fetch from 'node-fetch' 3 | import { sticker } from '../lib/sticker.js' 4 | let handler = async (m, { conn, text, args, usedPrefix, command }) => { 5 | 6 | if (!args[0]) throw `🎴 Example: ${usedPrefix + command} 😎+🥰` 7 | if (!text.includes('+')) throw `✳️ Separate the emoji with a *+* sign\n\n📌 Example: \n*${usedPrefix + command}* 😎+🥰` 8 | let [emoji, emoji2] = text.split`+` 9 | let anu = await (await fetch(`https://tenor.googleapis.com/v2/featured?key=AIzaSyAyimkuYQYF_FXVALexPuGQctUWRURdCYQ&contentfilter=high&media_filter=png_transparent&component=proactive&collection=emoji_kitchen_v5&q=${encodeURIComponent(emoji)}_${encodeURIComponent(emoji2)}`) ).json() 10 | for (let res of anu.results) { 11 | let stiker = await sticker(false, res.url, global.packname, global.author) 12 | conn.sendFile(m.chat, stiker, null, { asSticker: true }, m) 13 | }} 14 | 15 | handler.help = ['emojimix '] 16 | handler.tags = ['sticker'] 17 | handler.command = ['emojimix', 'emix'] 18 | handler.diamond = false 19 | 20 | export default handler 21 | -------------------------------------------------------------------------------- /plugins/swssnd.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn }) => { 2 | // Check if the message is quoting a status broadcast 3 | if (m.quoted?.chat != 'status@broadcast') { 4 | // Do nothing if it's not quoting a status message 5 | return; 6 | } 7 | 8 | try { 9 | // Download the content of the quoted status message 10 | let buffer = await m.quoted.download(); 11 | 12 | // Send the file back to the sender with the quoted message text 13 | await conn.sendFile(m.sender, buffer, '', m.quoted.text || '', null, false, { quoted: m }); 14 | } catch (error) { 15 | // Reply with the quoted text in case of error 16 | m.reply(m.quoted.text || ''); 17 | } 18 | }; 19 | 20 | // Help and tag definitions for the handler 21 | handler.help = ['statussave']; 22 | handler.tags = ['tools']; 23 | 24 | // Regular expression to match custom prefixes 25 | handler.customPrefix = /send(kro|bro|bhai)|bhejo|Send|send(me|bro|kro|bhai)/i; 26 | 27 | // Define the command for the handler (matches all commands) 28 | handler.command = new RegExp; 29 | 30 | export default handler; 31 | -------------------------------------------------------------------------------- /plugins/tools-translate.js: -------------------------------------------------------------------------------- 1 | import {translate} from '@vitalets/google-translate-api' 2 | const defaultLang = 'en' 3 | const tld = 'cn' 4 | 5 | let handler = async (m, { args, usedPrefix, command }) => { 6 | let err = ` 7 | 📌 *Example:* 8 | 9 | *${usedPrefix + command}* [text] 10 | *${usedPrefix + command}* en Hello World 11 | 12 | ≡ *List of supported languages:* 13 | 14 | https://cloud.google.com/translate/docs/languages 15 | `.trim() 16 | 17 | let lang = args[0] 18 | let text = args.slice(1).join(' ') 19 | if ((args[0] || '').length !== 2) { 20 | lang = defaultLang 21 | text = args.join(' ') 22 | } 23 | if (!text && m.quoted && m.quoted.text) text = m.quoted.text 24 | 25 | try { 26 | let result = await translate(text, { to: lang, autoCorrect: true }).catch(_ => null) 27 | m.reply(result.text) 28 | } catch (e) { 29 | throw err 30 | } 31 | 32 | } 33 | handler.help = ['translate '] 34 | handler.tags = ['tools'] 35 | handler.command = ['translate', 'tl', 'trt', 'tr'] 36 | 37 | export default handler 38 | -------------------------------------------------------------------------------- /plugins/gp-tagall.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text, participants, isAdmin, isOwner, groupMetadata }) => { 2 | const botNumber = conn.user.jid; 3 | const users = participants.map(u => u.id).filter(v => v !== conn.user.jid); 4 | if (m.sender !== botNumber && !isOwner && !isAdmin) { 5 | m.reply("🛡️ This command is only for *Group Admins*"); 6 | return; 7 | } 8 | 9 | const groupInfo = `┃💗⊹ 𝗚𝗥𝗢𝗨𝗣 : *${groupMetadata.subject}*\n\n`; 10 | const membersInfo = `┃💗⊹ 𝗠𝗘𝗠𝗕𝗘𝗥𝗦 : *${participants.length}*${text ? `\n┃💗⊹ 𝗠𝗘𝗦𝗦𝗔𝗚𝗘 : ${text}\n` : ''}`; 11 | const mentions = users.map(v => '┃💗⊹ @' + v.replace(/@.+/, '')).join`\n`; 12 | const footer = '\n└──✪ ⚡𝑷-𝑴𝑫⚡ ┃ ᴮᴼᵀ ✪──'; 13 | 14 | const tagAllMessage = `${groupInfo}${membersInfo}\n\n┌───⊷ 𝗠𝗘𝗡𝗧𝗜𝗢𝗡𝗦\n${mentions}${footer}`; 15 | 16 | 17 | m.reply(tagAllMessage, null, { mentions: users }); 18 | }; 19 | 20 | handler.help = ['tagall']; 21 | handler.tags = ['group']; 22 | handler.command = ['tagall', 'invo']; 23 | handler.admin = false; 24 | handler.group = true; 25 | 26 | export default handler; 27 | -------------------------------------------------------------------------------- /plugins/gp-demote.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn,usedPrefix, command, text }) => { 2 | if(isNaN(text) && !text.match(/@/g)){ 3 | 4 | }else if(isNaN(text)) { 5 | var number = text.split`@`[1] 6 | }else if(!isNaN(text)) { 7 | var number = text 8 | } 9 | if(!text && !m.quoted) return conn.reply(m.chat, `✳️ Using the command \n *${usedPrefix + command}* @tag`, m) 10 | if(number.length > 13 || (number.length < 11 && number.length > 0)) return conn.reply(m.chat, `✳️ Number incorrect`, m) 11 | 12 | try { 13 | if(text) { 14 | var user = number + '@s.whatsapp.net' 15 | } else if(m.quoted.sender) { 16 | var user = m.quoted.sender 17 | } else if(m.mentionedJid) { 18 | var user = number + '@s.whatsapp.net' 19 | } 20 | } catch (e) { 21 | } finally { 22 | conn.groupParticipantsUpdate(m.chat, [user], 'demote') 23 | m.reply(`✅ 𝐔𝐬𝐞𝐫 𝐡𝐚𝐬 𝐛𝐞𝐞𝐧 𝐝𝐞𝐦𝐨𝐭𝐞𝐝`) 24 | } 25 | 26 | } 27 | handler.help = ['demote (@tag)'] 28 | handler.tags = ['group'] 29 | handler.command = ['demote', 'degradar', 'd'] 30 | handler.group = true 31 | handler.admin = true 32 | handler.botAdmin = true 33 | handler.fail = null 34 | 35 | export default handler 36 | -------------------------------------------------------------------------------- /plugins/maker-tweet.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text }) => { 2 | if (!text) throw 'No Text'; 3 | 4 | const avatar = await conn.profilePictureUrl(m.sender, 'image').catch(_ => 'https://telegra.ph/file/24fa902ead26340f3df2c.png'); 5 | const displayName = conn.getName(m.sender); 6 | const username = m.sender.split('@')[0]; 7 | const replies = '69'; // Replace with the desired value 8 | const retweets = '69'; // Replace with the desired value 9 | const theme = 'dark'; // Replace with the desired value 10 | 11 | const url = `https://some-random-api.com/canvas/misc/tweet?displayname=${encodeURIComponent(displayName)}&username=${encodeURIComponent(username)}&avatar=${encodeURIComponent(avatar)}&comment=${encodeURIComponent(text)}&replies=${encodeURIComponent(replies)}&retweets=${encodeURIComponent(retweets)}&theme=${encodeURIComponent(theme)}`; 12 | 13 | conn.sendFile(m.chat, url, 'tweet.png', '*THANKS FOR TWEETING*', m); 14 | }; 15 | 16 | handler.help = ['tweet ']; 17 | handler.tags = ['maker']; 18 | handler.command = /^(tweet)$/i; 19 | 20 | export default handler; 21 | -------------------------------------------------------------------------------- /plugins/_autobio.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = m => m 3 | handler.all = async function (m) { 4 | let setting = global.db.data.settings[this.user.jid] 5 | 6 | let bot = global.db.data.settings[this.user.jid] || {}; 7 | if (bot.autoBio) { 8 | let _muptime 9 | if (process.send) { 10 | process.send('uptime') 11 | _muptime = await new Promise(resolve => { 12 | process.once('message', resolve) 13 | setTimeout(resolve, 1000) 14 | }) * 1000 15 | } 16 | let muptime = clockString(_muptime) 17 | let bio = `\n ⏰ Activated since ${muptime}\n\n ┃ PRINCE MD❤️ \n ${botname}` 18 | await this.updateProfileStatus(bio).catch(_ => _) 19 | setting.status = new Date() * 1 20 | } 21 | } 22 | export default handler 23 | 24 | function clockString(ms) { 25 | let d = isNaN(ms) ? '--' : Math.floor(ms / 86400000) 26 | let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) % 24 27 | let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 28 | let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 29 | return [d, ' Day(s) ️', h, ' Hour(s) ', m, ' Minute(s)'].map(v => v.toString().padStart(2, 0)).join('') 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 DASTAGHIR 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /plugins/tools-carbon.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | 3 | let handler = async (m, { conn, args }) => { 4 | if (!args[0]) { 5 | return conn.reply(m.chat, 'Please provide some text to generate the code image.', m) 6 | } 7 | 8 | let codeText = args.join(' ') 9 | 10 | try { 11 | let response = await fetch('https://carbonara.solopov.dev/api/cook', { 12 | method: 'POST', 13 | headers: { 14 | 'Content-Type': 'application/json', 15 | }, 16 | body: JSON.stringify({ 17 | code: codeText, 18 | backgroundColor: '#1F816D', 19 | }), 20 | }); 21 | 22 | if (!response.ok) { 23 | throw new Error('Failed to generate the code image.') 24 | } 25 | 26 | let imageBuffer = await response.buffer(); 27 | conn.sendFile(m.chat, imageBuffer, 'code.png', 'Here is the code image:', m) 28 | } catch (error) { 29 | console.error(error); 30 | conn.reply(m.chat, 'An error occurred while generating the code image.', m) 31 | } 32 | } 33 | 34 | handler.help = ['.carbon '] 35 | handler.tags = ['tools'] 36 | handler.command = /^carbon$/i; 37 | 38 | export default handler 39 | -------------------------------------------------------------------------------- /plugins/owner-delprem.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn, usedPrefix, command, text }) => { 4 | let who 5 | if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text ? text.replace(/[^0-9]/g, '') + '@s.whatsapp.net' : false 6 | else who = text ? text.replace(/[^0-9]/g, '') + '@s.whatsapp.net' : m.chat 7 | let user = global.db.data.users[who] 8 | if (!who) return m.reply(`✳️ Mention the user\n\n📌 *Example* :\n${usedPrefix + command} @tag`) 9 | if (!global.prems.includes(who.split`@`[0])) throw '✳️ The user is not Premium' 10 | let index = global.prems.findIndex(v => (v.replace(/[^0-9]/g, '') + '@s.whatsapp.net') === (who.replace(/[^0-9]/g, '') + '@s.whatsapp.net')) 11 | global.prems.splice(index, 1) 12 | conn.reply(m.chat, `✅ Premium removed \n\n@${who.split('@')[0]} you are no longer premium`, m, { mentions: [who] }) 13 | 14 | } 15 | handler.help = ['delprem @user'] 16 | handler.tags = ['owner'] 17 | handler.command = ['delprem', 'delpremium'] 18 | 19 | handler.group = true 20 | handler.rowner = true 21 | 22 | export default handler 23 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import path, { dirname } from 'path' 3 | import assert from 'assert' 4 | import { spawn } from 'child_process' 5 | import syntaxError from 'syntax-error' 6 | import { fileURLToPath } from 'url' 7 | import { createRequire } from 'module' 8 | 9 | const __filename = fileURLToPath(import.meta.url) 10 | const __dirname = dirname(__filename) 11 | const require = createRequire(__dirname) 12 | 13 | let folders = ['.', ...Object.keys(require(path.join(__dirname, './package.json')).directories)] 14 | let files = [] 15 | for (let folder of folders) 16 | for (let file of fs.readdirSync(folder).filter(v => v.endsWith('.js'))) 17 | files.push(path.resolve(path.join(folder, file))) 18 | for (let file of files) { 19 | if (file == __filename) continue 20 | console.error('Checking', file) 21 | const error = syntaxError(fs.readFileSync(file, 'utf8'), file, { 22 | sourceType: 'module', 23 | allowReturnOutsideFunction: true, 24 | allowAwaitOutsideFunction: true 25 | }) 26 | if (error) assert.ok(error.length < 1, file + '\n\n' + error) 27 | assert.ok(file) 28 | console.log('Done', file) 29 | } 30 | -------------------------------------------------------------------------------- /plugins/bebot-broadcastBots.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, usedPrefix, text }) => { 3 | if (conn.user.jid !== global.conn.user.jid) throw false 4 | let users = [...new Set([...global.conns.filter(conn => conn.user && conn.state !== 'close').map(conn => conn.user.jid)])] 5 | let cc = text ? m : m.quoted ? await m.getQuotedObj() : false || m 6 | let teks = text ? text : cc.text 7 | conn.reply(m.chat, `✅ Transmission sent *Total:* *${users.length}* sub bots\n\n${users.map((v, i) => `*${i + 1}.* wa.me/${v.replace(/[^0-9]/g, '')}?text=${usedPrefix}help`).join('\n')}`.trim(), m) 8 | 9 | let content = conn.cMod(m.chat, cc, /txbot|broadcast/i.test(teks) ? teks : `Transmission ┃ SUB BOTS\n_____________________\n\n${teks}`) 10 | for (let id of users) { 11 | await delay(1500) 12 | await conn.copyNForward(id, content, true) 13 | } 14 | //m.reply('✅ Se transmitió a todos los Sub-Bots') 15 | 16 | } 17 | handler.help = ['txbot'] 18 | handler.tags = ['bebot'] 19 | handler.command = ['txbot'] 20 | handler.rowner = true 21 | 22 | export default handler 23 | 24 | const delay = time => new Promise(res => setTimeout(res, time)) 25 | -------------------------------------------------------------------------------- /plugins/fun-chacter.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, command, text, usedPrefix, participants }) => { 2 | if (!text) throw "Mention whose you want to check character" 3 | const mentionedUser = m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : args[2] ? (args[2].replace(/[@ .+-]/g, '') + '@s.whatsapp.net') : '' 4 | const userChar = [ 5 | "Sigma", 6 | "Generous", 7 | "Grumpy", 8 | "Overconfident", 9 | "Obedient", 10 | "Good", 11 | "Simp", 12 | "Kind", 13 | "Patient", 14 | "Pervert", 15 | "Cool", 16 | "Helpful", 17 | "Brilliant", 18 | "Sexy", 19 | "Hot", 20 | "Gorgeous", 21 | "Cute", 22 | ] 23 | const userCharacterSeletion = 24 | userChar[Math.floor(Math.random() * userChar.length)] 25 | 26 | let message = `Character of @${mentionedUser.split("@")[0]} is *${userCharacterSeletion}* 🔥⚡` 27 | 28 | conn.sendMessage(m.chat, { text: message, mentions: [mentionedUser] }, { quoted: m }) 29 | 30 | } 31 | handler.help = ["character @tag"] 32 | handler.tags = ['fun'] 33 | handler.command = /^(character)/i 34 | 35 | export default handler -------------------------------------------------------------------------------- /plugins/tools-define.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let handler = async (m, { conn, text }) => { 4 | if (!text) throw 'Please provide a word to search for.'; 5 | m.react("🔎") 6 | 7 | const url = `https://api.urbandictionary.com/v0/define?term=${encodeURIComponent(text)}`; 8 | 9 | const response = await fetch(url); 10 | const json = await response.json(); 11 | 12 | if (!response.ok) { 13 | throw `An error occurred: ${json.message}`; 14 | m.react("❌") 15 | } 16 | 17 | if (!json.list.length) { 18 | throw 'Word not found in the dictionary.'; 19 | m.react("☹️") 20 | } 21 | 22 | const firstEntry = json.list[0]; 23 | const definition = firstEntry.definition; 24 | const example = firstEntry.example ? `*Example📖:* ${firstEntry.example}` : ''; 25 | 26 | const message = `*Word📚:* ${text}\n 27 | 28 | *Definition📚:* ${definition}\n 29 | 30 | ${example}`; 31 | conn.sendMessage(m.chat, { text: message }, 'extendedTextMessage', { quoted: m }); 32 | m.react("✅") 33 | }; 34 | 35 | handler.help = ['define ']; 36 | handler.tags = ['study']; 37 | handler.command = ['define', 'mean'] 38 | 39 | export default handler; 40 | -------------------------------------------------------------------------------- /lib/Gifbuffer.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs/promises'; 2 | import { promisify } from 'util'; 3 | import { exec } from 'child_process'; 4 | import path from 'path'; 5 | 6 | const __dirname = path.resolve(); 7 | 8 | const sleep = promisify(setTimeout); 9 | 10 | const GIFBufferToVideoBuffer = async (image) => { 11 | try { 12 | const filename = `${Math.random().toString(36)}`; 13 | const gifFilePath = path.join(__dirname, 'tmp', `${filename}.gif`); 14 | const mp4FilePath = path.join(__dirname, 'tmp', `${filename}.mp4`); 15 | 16 | await fs.writeFile(gifFilePath, image); 17 | 18 | const ffmpegCommand = `ffmpeg -i "${gifFilePath}" -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "${mp4FilePath}"`; 19 | 20 | await promisify(exec)(ffmpegCommand); 21 | 22 | await sleep(4000); 23 | 24 | const videoBuffer = await fs.readFile(mp4FilePath); 25 | 26 | await Promise.all([fs.unlink(gifFilePath), fs.unlink(mp4FilePath)]); 27 | 28 | return videoBuffer; 29 | } catch (error) { 30 | console.error(error); 31 | throw new Error('Error processing GIF to video.'); 32 | } 33 | }; 34 | 35 | export default GIFBufferToVideoBuffer; 36 | -------------------------------------------------------------------------------- /plugins/owner-checkexpired.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, args, usedPrefix, command }) => { 3 | 4 | if (global.db.data.chats[m.chat].expired < 1) throw `✳️ Este grupo no está configurado para caducar` 5 | let who 6 | if (m.isGroup) who = args[1] ? args[1] : m.chat 7 | else who = args[1] 8 | 9 | var nDays = 86400000 * args[0] 10 | var now = new Date() * 1 11 | 12 | m.reply(`✳️ Su alquiler expira en 13 | 14 | ${msToDate(global.db.data.chats[who].expired - now)} 15 | 16 | _Despues el bot saldrá automáticamente del grupo_`) 17 | 18 | } 19 | handler.help = ['checkexpired'] 20 | handler.tags = ['group'] 21 | handler.command = /^(checkexpired|cexpired)$/i 22 | handler.group = true 23 | 24 | export default handler 25 | 26 | function msToDate(ms) { 27 | let d = isNaN(ms) ? '--' : Math.floor(ms / 86400000) 28 | let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) % 24 29 | let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 30 | let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 31 | return [d, ' *Días*\n ', h, ' *Horas*\n ', m, ' *Minutos*\n ', s, ' *Segundos* '].map(v => v.toString().padStart(2, 0)).join('') 32 | } 33 | -------------------------------------------------------------------------------- /plugins/tools-acloudai.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | 3 | let handler = async (m, { args, usedPrefix, command }) => { 4 | if (!args[0]) throw `✳️ Please provide a query.\nExample: *${usedPrefix + command} Hi*` 5 | 6 | m.react('⏳') // React with waiting emoji 7 | 8 | try { 9 | // Fetch response from BK9 ACloudAI API 10 | let res = await fetch(`https://bk9.fun/ai/acloudai?q=${encodeURIComponent(args.join(' '))}`) 11 | if (!res.ok) throw `❎ Failed to fetch response from ACloudAI. Please try again.` 12 | 13 | // Parse the response 14 | let data = await res.json() 15 | if (!data.status) throw `❎ Error: ${data.err || 'Unknown error'}` 16 | 17 | // Send ACloudAI's response 18 | m.react('✅') // React with done emoji 19 | m.reply(data.BK9 || '❎ No response available.') 20 | } catch (error) { 21 | console.error('Error:', error) 22 | m.reply(`❎ Failed to process your request. Please try again.`) 23 | } 24 | } 25 | 26 | handler.help = ['acloudai '] 27 | handler.tags = ['study'] 28 | handler.command = ['acloudai'] 29 | 30 | export default handler 31 | -------------------------------------------------------------------------------- /plugins/owner-AllowPm.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text, usedPrefix, command }) => { 2 | let who; 3 | 4 | // Check if it's a group message and if there's a mention or quoted user 5 | if (m.isGroup) { 6 | who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false; 7 | } else { 8 | who = m.chat; 9 | } 10 | 11 | if (!who) throw `✳️ Tag or mention someone\n\n📌 Example: ${usedPrefix + command} @user`; 12 | 13 | let user = global.db.data.users[who]; 14 | 15 | // Check if the user is already allowed 16 | if (global.allowed.includes(who.split`@`[0])) throw 'The user Mentioned is already allowed to use the bot in DM'; 17 | 18 | // Add the user to the allowed list 19 | global.allowed.push(`${who.split`@`[0]}`); 20 | 21 | // Send the confirmation reply 22 | conn.reply(m.chat, `@${who.split`@`[0]} got the ultimate pass to use the bot in DM`, m, { mentions: [who] }); 23 | }; 24 | 25 | handler.help = ['allow <@tag>']; 26 | handler.tags = ['owner']; 27 | handler.command = ['allow', 'makeallow', 'alw']; 28 | 29 | handler.group = false; 30 | handler.rowner = true; 31 | 32 | export default handler; 33 | -------------------------------------------------------------------------------- /plugins/plugin-remove.js: -------------------------------------------------------------------------------- 1 | //https://github.com/Fabri115/botwhaita/blob/main/plugins/OWNER_deleteplugin.js 2 | 3 | import { tmpdir } from 'os'; 4 | import path, { join } from 'path'; 5 | import { 6 | readdirSync, 7 | statSync, 8 | unlinkSync, 9 | existsSync, 10 | readFileSync, 11 | watch, 12 | } from 'fs'; 13 | 14 | const handler = async (m, { conn, usedPrefix: _p, __dirname, args, text }) => { 15 | const ar = Object.keys(plugins); 16 | const ar1 = ar.map((v) => v.replace('.js', '')); 17 | 18 | if (!text) throw `📌 *_Example usage:_*\n*#deleteplugin main-menu*`; 19 | 20 | if (!ar1.includes(args[0])) { 21 | return m.reply(`*🗃️ This plugin doesn't exist!*` + 22 | `\n•••••••••••••••••••••••••••••••••••••••••••••••••••••••\n\n${ar1.map((v) => ' ' + v).join(`\n`)}`); 23 | } 24 | 25 | const file = join(__dirname, '../plugins/' + args[0] + '.js'); 26 | unlinkSync(file); 27 | conn.reply(m.chat, `⚠️ *_The "plugins/${args[0]}.js" plugin has been deleted._*`, m); 28 | }; 29 | 30 | handler.help = ['deleteplugin ']; 31 | handler.tags = ['owner']; 32 | handler.command = /^(deleteplugin|dp|remove)$/i; 33 | 34 | handler.owner = true; 35 | 36 | export default handler; 37 | -------------------------------------------------------------------------------- /plugins/tool-fetch.js: -------------------------------------------------------------------------------- 1 | 2 | import fetch from 'node-fetch' 3 | import { format } from 'util' 4 | let handler = async (m, { text, conn }) => { 5 | if (!text && !(m.quoted && m.quoted.text)) { 6 | if (!/^https?:\/\//.test(text)) throw `✳️ provide a link...` 7 | } 8 | if (!text && m.quoted && m.quoted.text) { 9 | text = m.quoted.text; 10 | } 11 | let _url = new URL(text) 12 | let url = global.API(_url.origin, _url.pathname, Object.fromEntries(_url.searchParams.entries()), 'APIKEY') 13 | let res = await fetch(url) 14 | if (res.headers.get('content-length') > 100 * 1024 * 1024 * 1024) { 15 | // delete res 16 | throw `Content-Length: ${res.headers.get('content-length')}` 17 | } 18 | if (!/text|json/.test(res.headers.get('content-type'))) return conn.sendFile(m.chat, url, 'file', text, m) 19 | let txt = await res.buffer() 20 | try { 21 | txt = format(JSON.parse(txt + '')) 22 | } catch (e) { 23 | txt = txt + '' 24 | } finally { 25 | m.reply(txt.slice(0, 65536) + '') 26 | } 27 | } 28 | handler.help = ['get'] 29 | handler.tags = ['tools'] 30 | handler.command = /^(fetch|get)$/i 31 | 32 | export default handler 33 | -------------------------------------------------------------------------------- /plugins/tools-fakeReply.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, text, usedPrefix, command }) => { 3 | if (!text) return m.reply(`✳️ Uso del comando\n\n*${usedPrefix + command}* hola que? @${m.sender.split`@`[0]} nada y tu`, null, { mentions: [m.sender] }) 4 | let cm = copy(m) 5 | let who 6 | if (text.includes('@0')) who = '0@s.whatsapp.net' 7 | else if (m.isGroup) who = cm.participant = m.mentionedJid[0] 8 | else who = m.chat 9 | if (!who) return m.reply(`✳️ Uso del comando\n\n*${usedPrefix + command}* hola que? @${m.sender.split`@`[0]} nada y tu`, null, { mentions: [m.sender] }) 10 | cm.key.fromMe = false 11 | cm.message[m.mtype] = copy(m.msg) 12 | let sp = '@' + who.split`@`[0] 13 | let [fake, ...real] = text.split(sp) 14 | conn.fakeReply(m.chat, real.join(sp).trimStart(), who, fake.trimEnd(), m.isGroup ? m.chat : false, { 15 | contextInfo: { 16 | mentionedJid: conn.parseMention(real.join(sp).trim()) 17 | } 18 | }) 19 | } 20 | handler.help = ['fake @user '] 21 | handler.tags = ['tools'] 22 | handler.command = /^(fitnah|fakereply|fake)$/ 23 | 24 | export default handler 25 | 26 | function copy(obj) { 27 | return JSON.parse(JSON.stringify(obj)) 28 | } 29 | -------------------------------------------------------------------------------- /lib/modapk.js: -------------------------------------------------------------------------------- 1 | import { download } from 'aptoide-scraper'; 2 | 3 | let handler = async (m, { conn, usedPrefix: prefix, command, text }) => { 4 | try { 5 | if (command === 'modapk') { 6 | if (!text) throw `*[❗] Please provide the APK Name you want to download.*`; 7 | 8 | await conn.reply(m.chat, global.wait, m); 9 | let data = await download(text); 10 | 11 | if (data.size.replace(' MB', '') > 200) { 12 | return await conn.sendMessage(m.chat, { text: '*[⛔] The file is too large.*' }, { quoted: m }); 13 | } 14 | 15 | if (data.size.includes('GB')) { 16 | return await conn.sendMessage(m.chat, { text: '*[⛔] The file is too large.*' }, { quoted: m }); 17 | } 18 | 19 | await conn.sendMessage( 20 | m.chat, 21 | { document: { url: data.dllink }, mimetype: 'application/vnd.android.package-archive', fileName: data.name + '.apk', caption: null }, 22 | { quoted: m } 23 | ) 24 | } 25 | } catch { 26 | throw `*[❗] An error occurred. Make sure to provide a valid link.*`; 27 | } 28 | }; 29 | 30 | handler.help = ['modapk'] 31 | handler.tags = ['downloader'] 32 | handler.command = /^modapk|apk$/i; 33 | export default handler; 34 | -------------------------------------------------------------------------------- /plugins/owner-un-block.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { text, conn, usedPrefix, command }) => { 2 | let why = `*ERROR, EXAMPLE:*\n*—◉ ${usedPrefix + command} @${m.sender.split("@")[0]}*` 3 | let who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text ? text.replace(/[^0-9]/g, '') + '@s.whatsapp.net' : false 4 | if (!who) conn.reply(m.chat, why, m, { mentions: [m.sender] }) 5 | let res = []; 6 | switch (command) { 7 | case "block": 8 | case "unblock": 9 | if (who) await conn.updateBlockStatus(who, "block").then(() => { res.push(who); }) 10 | else conn.reply(m.chat, why, m, { mentions: [m.sender] }) 11 | break; 12 | case "unblock": 13 | case "unblock": 14 | if (who) await conn.updateBlockStatus(who, "unblock").then(() => { res.push(who); }) 15 | else conn.reply(m.chat, why, m, { mentions: [m.sender] }) 16 | break; 17 | } 18 | if (res[0]) conn.reply(m.chat, `*SUCCESS! USER ${command} ACTION PERFORMED ON ${res ? `${res.map(v => '@' + v.split("@")[0])}` : ''}*`, m, { mentions: res }) 19 | } 20 | 21 | handler.command = /^(block|unblock)$/i 22 | handler.rowner = true 23 | export default handler 24 | -------------------------------------------------------------------------------- /lib/levelling.js: -------------------------------------------------------------------------------- 1 | export const growth = Math.pow(Math.PI / Math.E, 1.618) * Math.E * .75 2 | export function xpRange(level, multiplier = global.multiplier || 1) { 3 | if (level < 0) 4 | throw new TypeError('level cannot be negative value') 5 | level = Math.floor(level) 6 | let min = level === 0 ? 0 : Math.round(Math.pow(level, growth) * multiplier) + 1 7 | let max = Math.round(Math.pow(++level, growth) * multiplier) 8 | return { 9 | min, 10 | max, 11 | xp: max - min 12 | } 13 | } 14 | export function findLevel(xp, multiplier = global.multiplier || 1) { 15 | if (xp === Infinity) 16 | return Infinity 17 | if (isNaN(xp)) 18 | return NaN 19 | if (xp <= 0) 20 | return -1 21 | let level = 0 22 | do 23 | level++ 24 | while (xpRange(level, multiplier).min <= xp) 25 | return --level 26 | } 27 | export function canLevelUp(level, xp, multiplier = global.multiplier || 1) { 28 | if (level < 0) 29 | return false 30 | if (xp === Infinity) 31 | return true 32 | if (isNaN(xp)) 33 | return false 34 | if (xp <= 0) 35 | return false 36 | return level < findLevel(xp, multiplier) 37 | } -------------------------------------------------------------------------------- /plugins/gp-polling.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { 2 | conn, 3 | text, 4 | args, 5 | usedPrefix, 6 | command 7 | }) => { 8 | // Split the message text using the '|' character and slice the array to remove the first element. 9 | let a = text.split("|").slice(1) 10 | if (!a[1]) throw "Format\n" + usedPrefix + command + " hello |yes|no" 11 | if (a[12]) throw "Too many options, Format\n" + usedPrefix + command + " hello |yes|no" 12 | // Check for duplicate options in the poll. 13 | if (checkDuplicate(a)) throw "Duplicate options in the message!" 14 | let cap = "*Polling Request By* " + m.name + "\n*Message:* " + text.split("|")[0] 15 | 16 | 17 | const pollMessage = { 18 | name: cap, 19 | values: a, 20 | multiselect: false, 21 | selectableCount: 1 22 | } 23 | 24 | await conn.sendMessage(m.chat, { 25 | poll: pollMessage 26 | }) 27 | } 28 | 29 | handler.help = ["poll question|option|option"] 30 | handler.tags = ["group"] 31 | handler.command = /^po(l((l?ing|ls)|l)|ols?)$/i 32 | 33 | export default handler 34 | 35 | // Function to check for duplicate elements in an array. 36 | function checkDuplicate(arr) { 37 | return new Set(arr).size !== arr.length 38 | } 39 | -------------------------------------------------------------------------------- /plugins/tools-weather.js: -------------------------------------------------------------------------------- 1 | import axios from "axios" 2 | let handler = async (m, { args }) => { 3 | if (!args[0]) throw "*Give a place to search*" 4 | try { 5 | const response = axios.get(`https://api.openweathermap.org/data/2.5/weather?q=${args}&units=metric&appid=060a6bcfa19809c2cd4d97a212b19273`) 6 | const res = await response 7 | const name = res.data.name 8 | const Country = res.data.sys.country 9 | const Weather = res.data.weather[0].description 10 | const Temperature = res.data.main.temp + "°C" 11 | const Minimum_Temperature = res.data.main.temp_min + "°C" 12 | const Maximum_Temperature = res.data.main.temp_max + "°C" 13 | const Humidity = res.data.main.humidity + "%" 14 | const Wind = res.data.wind.speed + "km/h" 15 | const wea = `ʜᴇʀᴇ ɪs ʏᴏᴜʀ ɢɪᴠᴇɴ ᴘʟᴀᴄᴇ ᴡᴇᴀᴛʜᴇʀ\n\n「 📍 」ᴘʟᴀᴄᴇ: ${name}\n「 🗺️ 」ᴄᴏᴜɴᴛʀʏ: ${Country}\n「 🌤️ 」ᴠɪᴇᴡ: ${Weather}\n「 🌡️ 」 ᴛᴇᴍᴘᴇʀᴀᴛᴜʀᴇ: ${Temperature}\n「 💠 」 ᴍɪɴɪᴍᴜᴍ ᴛᴇᴍᴘᴇʀᴀᴛᴜʀᴇ: ${Minimum_Temperature}\n「 📛 」 ᴍᴀxɪᴍᴜᴍ ᴛᴇᴍᴘᴇʀᴀᴛᴜʀᴇ: ${Maximum_Temperature}\n「 💦 」 ʜᴜᴍɪᴅɪᴛʏ: ${Humidity}\n「 🌬️ 」 ᴡɪɴᴅsᴘᴇᴇᴅ: ${Wind}\n\n🛡️ᴛʜᴇ-ᴘʀɪɴᴄᴇ-ʙᴏᴛ🛡️` 16 | m.reply(wea) 17 | } catch { 18 | return "*ERROR*"}} 19 | handler.help = ['weather **'] 20 | handler.tags = ['tools'] 21 | handler.command = /^(climate|weather|mosam)$/i 22 | export default handler 23 | -------------------------------------------------------------------------------- /plugins/Broadcastgc.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, isROwner, text }) => { 2 | const delay = time => new Promise(res => setTimeout(res, time)) 3 | let getGroups = await conn.groupFetchAllParticipating() 4 | let groups = Object.entries(getGroups).slice(0).map(entry => entry[1]) 5 | let anu = groups.map(v => v.id) 6 | var pesan = m.quoted && m.quoted.text ? m.quoted.text : text 7 | if(!pesan) throw '*ENTER THE MESSAGE YOU WANT TO BROADCAST*' 8 | for (let i of anu) { 9 | await delay(500) 10 | conn.relayMessage(i, 11 | { liveLocationMessage: { 12 | degreesLatitude: 35.685506276233525, 13 | degreesLongitude: 139.75270667105852, 14 | accuracyInMeters: 0, 15 | degreesClockwiseFromMagneticNorth: 2, 16 | caption: '[ATTENTION]\n\n' + pesan + '\n\nTHIS IS AN OFFICIAL STATEMENT', 17 | sequenceNumber: 2, 18 | timeOffset: 3, 19 | contextInfo: m, 20 | }}, {}).catch(_ => _) 21 | } 22 | m.reply(`*MESSAGE SENT TO ${anu.length} GROUP/S*\n\n*NOTE: THIS COMMAND MAY FAIL AND NOT BE SENT TO ALL CHATS, SORRY FOR THE TIME BEING*`) 23 | } 24 | handler.help = ['broadcastgroup', 'bcgc'].map(v => v + ' ') 25 | handler.tags = ['owner'] 26 | handler.command = /^(broadcast|bc)(group|grup|gc)$/i 27 | handler.owner = true 28 | 29 | export default handler 30 | -------------------------------------------------------------------------------- /plugins/game-math_answer.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = m => m 4 | handler.before = async function (m) { 5 | if (!/^-?[0-9]+(\.[0-9]+)?$/.test(m.text)) return !0 6 | let id = m.chat 7 | if (!m.quoted || !m.quoted.fromMe || !m.text || !/^▢ HOW MUCH IS IT/i.test(m.quoted.text)) return !0 8 | this.math = this.math ? this.math : {} 9 | if (!(id in this.math)) return this.reply(m.chat, 'The game is over', m) 10 | if (m.quoted.id == this.math[id][0].id) { 11 | let math = JSON.parse(JSON.stringify(this.math[id][1])) 12 | if (m.text == math.result) { 13 | global.db.data.users[m.sender].exp += math.bonus 14 | clearTimeout(this.math[id][3]) 15 | delete this.math[id] 16 | m.reply(`✅ *Correct answer!*\n\n‣ won : *+${math.bonus} XP*`) 17 | } else { 18 | if (--this.math[id][2] == 0) { 19 | clearTimeout(this.math[id][3]) 20 | delete this.math[id] 21 | m.reply(`*The opportunities are over*\n\n Response : *${math.result}*`) 22 | } else m.reply(`❎ *Wrong answer*\n\nThere are still ${this.math[id][2]} opportuniities`) 23 | } 24 | } 25 | return !0 26 | } 27 | 28 | export default handler 29 | -------------------------------------------------------------------------------- /plugins/tools-calc.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text }) => { 2 | let id = m.chat 3 | conn.math = conn.math ? conn.math : {} 4 | if (id in conn.math) { 5 | clearTimeout(conn.math[id][3]) 6 | delete conn.math[id] 7 | m.reply('.... ') 8 | } 9 | let val = text 10 | .replace(/[^0-9\-\/+*×÷πEe()piPI/]/g, '') 11 | .replace(/×/g, '*') 12 | .replace(/÷/g, '/') 13 | .replace(/π|pi/gi, 'Math.PI') 14 | .replace(/e/gi, 'Math.E') 15 | .replace(/\/+/g, '/') 16 | .replace(/\++/g, '+') 17 | .replace(/-+/g, '-') 18 | let format = val 19 | .replace(/Math\.PI/g, 'π') 20 | .replace(/Math\.E/g, 'e') 21 | .replace(/\//g, '÷') 22 | .replace(/\*×/g, '×') 23 | try { 24 | console.log(val) 25 | let result = (new Function('return ' + val))() 26 | if (!result) throw result 27 | m.reply(`*${format}* = _${result}_`) 28 | } catch (e) { 29 | if (e == undefined) throw '✳️ enter the equation\n\ncompatible symbols -, +, *, /, ×, ÷, π, e, (, )' 30 | throw 'Incorrect format, only 0-9 and symbol -, +, *, /, ×, ÷, π, e, (, ) what can you use' 31 | } 32 | } 33 | handler.help = ['cal '] 34 | handler.tags = ['tools'] 35 | handler.command = ['cal', 'calc', 'calculate', 'calculator'] 36 | export default handler 37 | -------------------------------------------------------------------------------- /plugins/owner-broadcastgc.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, isROwner, text }) => { 2 | const delay = time => new Promise(res => setTimeout(res, time)) 3 | let getGroups = await conn.groupFetchAllParticipating() 4 | let groups = Object.entries(getGroups).slice(0).map(entry => entry[1]) 5 | let anu = groups.map(v => v.id) 6 | var pesan = m.quoted && m.quoted.text ? m.quoted.text : text 7 | if(!pesan) throw '*ENTER THE MESSAGE YOU WANT TO BROADCAST*' 8 | for (let i of anu) { 9 | await delay(500) 10 | conn.relayMessage(i, 11 | { liveLocationMessage: { 12 | degreesLatitude: 35.685506276233525, 13 | degreesLongitude: 139.75270667105852, 14 | accuracyInMeters: 0, 15 | degreesClockwiseFromMagneticNorth: 2, 16 | caption: '[ATTENTION]\n\n' + pesan + '\n\nTHIS IS AN OFFICIAL STATEMENT', 17 | sequenceNumber: 2, 18 | timeOffset: 3, 19 | contextInfo: m, 20 | }}, {}).catch(_ => _) 21 | } 22 | m.reply(`*MESSAGE SENT TO ${anu.length} GROUP/S*\n\n*NOTE: THIS COMMAND MAY FAIL AND NOT BE SENT TO ALL CHATS, SORRY FOR THE TIME BEING*`) 23 | } 24 | handler.help = ['broadcastgroup', 'bcgc'].map(v => v + ' ') 25 | handler.tags = ['owner'] 26 | handler.command = /^(broadcast|bc)(group|grup|gc)$/i 27 | handler.owner = true 28 | 29 | export default handler 30 | -------------------------------------------------------------------------------- /plugins/owner-removeallow.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, text, usedPrefix, command }) => { 2 | let who; 3 | 4 | // Check if it's a group message and if there's a mention or quoted user 5 | if (m.isGroup) { 6 | who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false; 7 | } else { 8 | who = m.chat; 9 | } 10 | 11 | if (!who) throw `✳️ Tag or mention someone\n\n📌 Example: ${usedPrefix + command} @user`; 12 | 13 | let user = global.db.data.users[who]; 14 | 15 | // Check if the user is not in the allowed list 16 | if (!global.allowed.includes(who.split`@`[0])) throw 'The user mentioned is not allowed to use the bot in DM'; 17 | 18 | // Remove the user from the allowed list 19 | global.allowed = global.allowed.filter(jid => jid !== who.split`@`[0]); 20 | 21 | // Send the confirmation reply 22 | conn.reply(m.chat, `@${who.split`@`[0]} has been removed from the list of users allowed to use the bot in DM`, m, { mentions: [who] }); 23 | }; 24 | 25 | handler.help = ['removeallow <@tag>']; 26 | handler.tags = ['owner']; 27 | handler.command = ['removeallow', 'delallow', 'removealw']; 28 | 29 | handler.group = false; 30 | handler.rowner = true; 31 | 32 | export default handler; 33 | -------------------------------------------------------------------------------- /plugins/tool-resize.js: -------------------------------------------------------------------------------- 1 | import uploadImage from '../lib/uploadImage.js'; 2 | import fetch from 'node-fetch'; 3 | 4 | let handler = async (m, { conn, usedPrefix, command, args, text }) => { 5 | let q = m.quoted ? m.quoted : m; 6 | let mime = (q.msg || q).mimetype || ''; 7 | 8 | if (!mime) throw '⚠️️ Reply to an image or video.'; 9 | if (!text) throw '⚠️️ Enter the new file size for the image/video.'; 10 | if (isNaN(text)) throw '🔢 Only numbers are allowed.'; 11 | 12 | if (!/image\/(jpe?g|png)|video|document/.test(mime)) throw '⚠️️ Unsupported format.'; 13 | 14 | let img = await q.download(); 15 | let url = await uploadImage(img); 16 | 17 | if (/image\/(jpe?g|png)/.test(mime)) { 18 | conn.sendMessage(m.chat, { image: { url: url }, caption: `Here you go`, fileLength: `${text}`, mentions: [m.sender] }, { ephemeralExpiration: 24 * 3600, quoted: m }); 19 | } else if (/video/.test(mime)) { 20 | return conn.sendMessage(m.chat, { video: { url: url }, caption: `Here you go`, fileLength: `${text}`, mentions: [m.sender] }, { ephemeralExpiration: 24 * 3600, quoted: m }); 21 | } 22 | }; 23 | 24 | handler.tags = ['tools']; 25 | handler.help = ['length ']; 26 | handler.command = /^(length|filelength|edittamaño|totamaño|tamaño)$/i; 27 | 28 | export default handler; 29 | -------------------------------------------------------------------------------- /plugins/game-guessFlag.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | let timeout = 120000 3 | let poin = 4999 4 | let handler = async (m, { conn, command, usedPrefix }) => { 5 | conn.tebakbendera = conn.tebakbendera ? conn.tebakbendera : {} 6 | let id = m.chat 7 | if (id in conn.tebakbendera) { 8 | conn.reply(m.chat, 'There are still unanswered questions in this chat', conn.tebakbendera[id][0]) 9 | throw false 10 | } 11 | let src = await (await fetch('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakbendera2.json')).json() 12 | let json = src[Math.floor(Math.random() * src.length)] 13 | let caption = `*${command.toUpperCase()}* 14 | Timeout *${(timeout / 1000).toFixed(2)} second* 15 | use ${usedPrefix}fhint for hint 16 | Reward: ${poin} XP 17 | `.trim() 18 | conn.tebakbendera[id] = [ 19 | await conn.sendFile(m.chat, json.img, '', caption, m), 20 | json, poin, 21 | setTimeout(() => { 22 | if (conn.tebakbendera[id]) conn.reply(m.chat, `Time's up!\nThe answer is *${json.name}*`, conn.tebakbendera[id][0]) 23 | delete conn.tebakbendera[id] 24 | }, timeout) 25 | ] 26 | } 27 | handler.help = ['guessflag'] 28 | handler.tags = ['game'] 29 | handler.command = /^guessflag/i 30 | 31 | export default handler 32 | 33 | -------------------------------------------------------------------------------- /plugins/tools-element.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let elementHandler = async (m, { conn, text }) => { 4 | if (!text) throw 'Please provide an element symbol or name'; 5 | 6 | try { 7 | let res = await fetch(`https://api.popcat.xyz/periodic-table?element=${text}`); 8 | 9 | if (!res.ok) { 10 | throw new Error(`API request failed with status ${res.status}`); 11 | } 12 | 13 | let buffer = await res.arrayBuffer(); 14 | let json = JSON.parse(Buffer.from(buffer).toString()); 15 | 16 | console.log('JSON response:', json); 17 | 18 | let elementInfo = 19 | `*Element Information:*\n 20 | • *Name:* ${json.name}\n 21 | • *Symbol:* ${json.symbol}\n 22 | • *Atomic Number:* ${json.atomic_number}\n 23 | • *Atomic Mass:* ${json.atomic_mass}\n 24 | • *Period:* ${json.period}\n 25 | • *Phase:* ${json.phase}\n 26 | • *Discovered By:* ${json.discovered_by}\n 27 | • *Summary:* ${json.summary}`; 28 | 29 | conn.sendFile(m.chat, json.image, 'element.jpg', elementInfo, m); 30 | } catch (error) { 31 | console.error(error); 32 | // Handle the error appropriately 33 | } 34 | }; 35 | 36 | elementHandler.help = ['element']; 37 | elementHandler.tags = ['tools']; 38 | elementHandler.command = /^(element|ele)$/i; 39 | 40 | export default elementHandler; 41 | -------------------------------------------------------------------------------- /plugins/gp-kickkk.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, participants, usedPrefix, command }) => { 2 | 3 | let kickte = `✳️ Correct use of the command\n*${usedPrefix + command}* @tag\n\n*${usedPrefix + command}* for Remove + Delete Msg + Block in inbox` 4 | 5 | if (!m.mentionedJid[0] && !m.quoted) return m.reply(kickte, m.chat, { mentions: conn.parseMention(kickte) }) 6 | let user = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted.sender 7 | let owr = m.chat.split`-`[0] 8 | 9 | try { 10 | let delet = m.message.extendedTextMessage.contextInfo.participant 11 | let bang = m.message.extendedTextMessage.contextInfo.stanzaId 12 | await conn.sendMessage(m.chat, { delete: { remoteJid: m.chat, fromMe: false, id: bang, participant: delet }}) 13 | } catch { 14 | await conn.sendMessage(m.chat, { delete: m.quoted.vM.key }) 15 | } 16 | 17 | await conn.groupParticipantsUpdate(m.chat, [user], 'remove'); 18 | await conn.updateBlockStatus(user, 'block'); 19 | 20 | m.reply(`✅ ᴜsᴇʀ ʜᴀs ʙᴇᴇɴ ᴇʟɪᴍɪɴᴀᴛᴇᴅ ᴀɴᴅ ʜɪs ᴍᴇssᴀɢᴇ ʜᴀs ʙᴇᴇɴ ᴅᴇʟᴇᴛᴇᴅ + ʙʟᴏᴄᴋᴇᴅ ɪɴ ᴅᴍ👋🏻`); 21 | } 22 | 23 | handler.help = ['kick3 @user', 'kkk @user'] 24 | handler.tags = ['group'] 25 | handler.command = ['kick3', 'expulsar3', 'k3', 'kkk'] 26 | handler.admin = true 27 | handler.group = true 28 | handler.botAdmin = true 29 | 30 | export default handler; 31 | -------------------------------------------------------------------------------- /plugins/sticker-getsticker.js: -------------------------------------------------------------------------------- 1 | 2 | import fg from 'api-dylux' 3 | import fetch from 'node-fetch' 4 | import { sticker } from '../lib/sticker.js' 5 | let handler = async (m, { conn, args, text, usedPrefix, command }) => { 6 | if (!args[0]) throw `✳️ ingrese lo que quiere buscar \n\n📌*Ejemplo:*\n${usedPrefix + command} homero` 7 | 8 | //Resultados de https://getstickerpack.com/ 9 | try { 10 | /*let res = await fetch(global.API('fgmods', '/api/getsticker', { q:text }, 'apikey')) 11 | let json = await res.json()*/ 12 | let json = await fg.StickerSearch(text) 13 | m.reply(` 14 | ✅ Resultado 15 | 16 | ▢ *Titulo:* ${json.title} 17 | ▢ *Total stickers:* ${json.sticker_url.length} 18 | ▢ *Tiempo estimado de envio:* _*${json.sticker_url.length * 2} s*_`) 19 | for (let i of json.sticker_url) { 20 | const stiker = await sticker(false, i, global.packname, global.author) 21 | await conn.sendFile(m.chat, stiker, 'sticker.webp', '', m) 22 | //await delay(1500) 23 | } 24 | } catch (e) { 25 | m.reply(`❇️ Error: prueba con otro`) 26 | } 27 | } 28 | handler.help = ['getsticker'] 29 | handler.tags = ['sticker'] 30 | handler.command = ['getsticker', 'getstick', 'stickersearch', 'sticksearch'] 31 | handler.diamond = 3 32 | 33 | export default handler 34 | 35 | const delay = time => new Promise(res => setTimeout(res, time)) 36 | -------------------------------------------------------------------------------- /plugins/_antifake.js: -------------------------------------------------------------------------------- 1 | let handler = m => m; 2 | 3 | handler.before = async function (m, { conn, isAdmin, isBotAdmin, isOwner, isROwner }) { 4 | if (!m.isGroup) return !1; 5 | let chat = global.db.data.chats[m.chat]; 6 | let bot = global.db.data.settings[conn.user.jid] || {}; 7 | 8 | if (isBotAdmin && chat.antifake && !isAdmin && !isOwner && !isROwner) { 9 | const fkontak = {"key": { "participants": "0@s.whatsapp.net", "remoteJid": "status@broadcast", "fromMe": false, "id": "Halo" }, "message": { "contactMessage": { "vcard": `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` } }, "participant": "0@s.whatsapp.net" }; 10 | 11 | const prefijosProhibidos = process.env.ANTIFAKE_USERS.split(','); 12 | 13 | const senderNumber = m.sender.split('@')[0]; 14 | if (prefijosProhibidos.some(prefijo => senderNumber.startsWith(prefijo))) { 15 | let texto = `*@${senderNumber}* In this group antifake number is not allowed, you will be expelled...`; 16 | 17 | try { 18 | await conn.reply(m.chat, texto, fkontak, m); 19 | let response = await conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); 20 | if (response[0].status === "404") return; 21 | } catch (error) { 22 | console.error(`Error al expulsar a ${senderNumber}:`, error); 23 | }}} 24 | return !0; 25 | }; 26 | 27 | export default handler; 28 | -------------------------------------------------------------------------------- /plugins/tools-itunes.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let itunesHandler = async (m, { conn, text }) => { 4 | if (!text) throw 'Please provide a song name'; 5 | 6 | try { 7 | let res = await fetch(`https://api.popcat.xyz/itunes?q=${encodeURIComponent(text)}`); 8 | 9 | if (!res.ok) { 10 | throw new Error(`API request failed with status ${res.status}`); 11 | } 12 | 13 | let json = await res.json(); 14 | 15 | console.log('JSON response:', json); 16 | 17 | let songInfo = 18 | `*Song Information:*\n 19 | • *Name:* ${json.name}\n 20 | • *Artist:* ${json.artist}\n 21 | • *Album:* ${json.album}\n 22 | • *Release Date:* ${json.release_date}\n 23 | • *Price:* ${json.price}\n 24 | • *Length:* ${json.length}\n 25 | • *Genre:* ${json.genre}\n 26 | • *URL:* ${json.url}`; 27 | 28 | // Check if thumbnail is present, then send it with songInfo as caption 29 | if (json.thumbnail) { 30 | await conn.sendFile(m.chat, json.thumbnail, 'thumbnail.jpg', songInfo, m); 31 | } else { 32 | m.reply(songInfo); 33 | } 34 | 35 | } catch (error) { 36 | console.error(error); 37 | // Handle the error appropriately 38 | } 39 | }; 40 | 41 | itunesHandler.help = ['itunes']; 42 | itunesHandler.tags = ['tools']; 43 | itunesHandler.command = /^(itunes)$/i; 44 | 45 | export default itunesHandler; 46 | -------------------------------------------------------------------------------- /plugins/tools-simsimi.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | 3 | let handler = async (m, { conn, args, usedPrefix, command }) => { 4 | if (!args[0]) throw `✳️ ${mssg.useCmd}\n *${usedPrefix + command}* enter your search query` 5 | m.react(rwait) 6 | 7 | try { 8 | let res = await fetch(`https://bk9.fun/ai/ai-search?q=${encodeURIComponent(args[0])}`) 9 | if (!res.ok) throw `❎ ${mssg.error}` 10 | let data = await res.json() 11 | 12 | // Check if the response contains 'BK9' field 13 | if (data.BK9) { 14 | m.react(done) // React with thumbs-up if result is found 15 | // Send the result as a message 16 | conn.sendMessage(m.chat, { 17 | text: `⚡ **Answer:**\n\n${data.BK9}`, 18 | quoted: m 19 | }) 20 | } else { 21 | m.react('❌') // React with a cross if no result is found 22 | m.reply(`❎ No relevant information found.`) // Send a message if no result 23 | } 24 | } catch (error) { 25 | m.react('❌') // React with a cross if there's an error 26 | m.reply(`❎ An error occurred, please try again later.`) // Send error message 27 | } 28 | } 29 | 30 | handler.help = ['aisearch ', 'bot '] 31 | handler.tags = ['study'] 32 | handler.command = ['aisearch', 'bot'] 33 | 34 | export default handler 35 | -------------------------------------------------------------------------------- /plugins/whatmusic.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import acrcloud from 'acrcloud' 3 | let acr = new acrcloud({ 4 | host: 'identify-eu-west-1.acrcloud.com', 5 | access_key: 'c33c767d683f78bd17d4bd4991955d81', 6 | access_secret: 'bvgaIAEtADBTbLwiPGYlxupWqkNGIjT7J9Ag2vIu' 7 | }) 8 | 9 | let handler = async (m) => { 10 | let q = m.quoted ? m.quoted : m 11 | let mime = (q.msg || q).mimetype || '' 12 | if (/audio|video/.test(mime)) { 13 | let media = await q.download() 14 | let ext = mime.split('/')[1] 15 | fs.writeFileSync(`./tmp/${m.sender}.${ext}`, media) 16 | let res = await acr.identify(fs.readFileSync(`./tmp/${m.sender}.${ext}`)) 17 | let { code, msg } = res.status 18 | if (code !== 0) throw msg 19 | let { title, artists, album, genres, release_date } = res.metadata.music[0] 20 | let txt = ` 21 | 𝚁𝙴𝚂𝚄𝙻𝚃 22 | • 📌 *TITLE*: ${title} 23 | • 👨‍🎤 𝙰𝚁𝚃𝙸𝚂𝚃: ${artists !== undefined ? artists.map(v => v.name).join(', ') : 'NOT FOUND'} 24 | • 💾 𝙰𝙻𝙱𝚄𝙼: ${album.name || 'NOT FOUND'} 25 | • 🌐 𝙶𝙴𝙽𝙴𝚁: ${genres !== undefined ? genres.map(v => v.name).join(', ') : 'NOT FOUND'} 26 | • 📆 RELEASE DATE: ${release_date || 'NOT FOUND'} 27 | `.trim() 28 | fs.unlinkSync(`./tmp/${m.sender}.${ext}`) 29 | m.reply(txt) 30 | } else throw '*𝚁𝙴𝚂𝙿𝙾𝙽𝙳 𝙰𝚄𝙳𝙸𝙾*' 31 | } 32 | 33 | handler.help = ['shazam'] 34 | handler.tags = ['tools'] 35 | handler.command = /^quemusica|shazam|whatmusic|find$/i 36 | export default handler 37 | -------------------------------------------------------------------------------- /plugins/tools-tts.js: -------------------------------------------------------------------------------- 1 | import gtts from 'node-gtts' 2 | import { readFileSync, unlinkSync } from 'fs' 3 | import { join } from 'path' 4 | 5 | const defaultLang = 'en' 6 | let handler = async (m, { conn, args, usedPrefix, command }) => { 7 | 8 | let lang = args[0] 9 | let text = args.slice(1).join(' ') 10 | if ((args[0] || '').length !== 2) { 11 | lang = defaultLang 12 | text = args.join(' ') 13 | } 14 | if (!text && m.quoted?.text) text = m.quoted.text 15 | 16 | let res 17 | try { res = await tts(text, lang) } 18 | catch (e) { 19 | m.reply(e + '') 20 | text = args.join(' ') 21 | if (!text) throw `📌 Example : \n${usedPrefix}${command} en hello world` 22 | res = await tts(text, defaultLang) 23 | } finally { 24 | if (res) conn.sendFile(m.chat, res, 'tts.opus', null, m, true) 25 | } 26 | } 27 | handler.help = ['tts '] 28 | handler.tags = ['tools'] 29 | handler.command = ['tts', 'voz'] 30 | 31 | export default handler 32 | 33 | function tts(text, lang = 'en-en') { 34 | console.log(lang, text) 35 | return new Promise((resolve, reject) => { 36 | try { 37 | let tts = gtts(lang) 38 | let filePath = join(global.__dirname(import.meta.url), '../tmp', (1 * new Date) + '.wav') 39 | tts.save(filePath, text, () => { 40 | resolve(readFileSync(filePath)) 41 | unlinkSync(filePath) 42 | }) 43 | } catch (e) { reject(e) } 44 | }) 45 | } 46 | -------------------------------------------------------------------------------- /plugins/sticker-smaker.js: -------------------------------------------------------------------------------- 1 | import uploadImage from '../lib/uploadImage.js' 2 | import { sticker } from '../lib/sticker.js' 3 | 4 | const effects = ['jail', 'gay', 'glass', 'wasted' ,'triggered', 'lolice', 'simpcard', 'horny'] 5 | 6 | let handler = async (m, { conn, usedPrefix, text, command }) => { 7 | let effect = text.trim().toLowerCase() 8 | if (!effects.includes(effect)) throw ` 9 | 10 | ┌─⊷ *EFFECTS* 11 | ${effects.map(effect => `▢ ${effect}`).join('\n')} 12 | └─────────── 13 | 14 | 📌 *Example:* 15 | ${usedPrefix + command} wasted 16 | `.trim() 17 | let q = m.quoted ? m.quoted : m 18 | let mime = (q.msg || q).mimetype || '' 19 | if (!mime) throw '✳️ Respond to an image' 20 | if (!/image\/(jpe?g|png)/.test(mime)) throw `✳️ Format not supported` 21 | let img = await q.download() 22 | let url = await uploadImage(img) 23 | let apiUrl = global.API('https://some-random-api.com/canvas/', encodeURIComponent(effect), { 24 | avatar: url 25 | }) 26 | try { 27 | let stiker = await sticker(null, apiUrl, global.packname, global.author) 28 | conn.sendFile(m.chat, stiker, null, { asSticker: true }, m) 29 | } catch (e) { 30 | m.reply('Conversion to sticker error, send as image instead') 31 | await conn.sendFile(m.chat, apiUrl, 'smaker.png', null, m) 32 | }} 33 | handler.help = ['smaker'] 34 | handler.tags = ['sticker'] 35 | handler.command = ['stickmaker', 'stickermaker', 'smaker'] 36 | handler.diamond = false 37 | 38 | export default handler 39 | -------------------------------------------------------------------------------- /plugins/tools-textstyle.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | import { JSDOM } from 'jsdom'; 3 | 4 | let handler = async (m, { conn, text }) => { 5 | const inputText = text || "PRINCE BOT"; 6 | console.log('📥 Input text:', inputText); 7 | 8 | const styledText = await stylizeText(inputText); 9 | const entries = Object.entries(styledText); 10 | 11 | let replyText = entries.map(([name, value]) => { 12 | return `*${name}*\n${value}`; 13 | }).join('\n\n'); 14 | 15 | console.log('✨ Generated styles:'); 16 | console.log(replyText); 17 | 18 | await conn.reply(m.chat, replyText, m); 19 | }; 20 | 21 | handler.help = ['fancy'].map(v => v + ' '); 22 | handler.tags = ['tools']; 23 | handler.command = /^(fancy(text)?)$/i; 24 | handler.exp = 0; 25 | 26 | export default handler; 27 | 28 | async function stylizeText(text) { 29 | const res = await fetch('http://qaz.wtf/u/convert.cgi?text=' + encodeURIComponent(text)); 30 | const html = await res.text(); 31 | const dom = new JSDOM(html); 32 | const table = dom.window.document.querySelector('table').children[0].children; 33 | const obj = {}; 34 | 35 | for (let tr of table) { 36 | let name = tr.querySelector('.aname').innerHTML; 37 | let content = tr.children[1].textContent.replace(/^\n/, '').replace(/\n$/, ''); 38 | obj[name + (obj[name] ? ' Reversed' : '')] = content; 39 | } 40 | 41 | return obj; 42 | } 43 | -------------------------------------------------------------------------------- /plugins/gp-settings.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, args, usedPrefix, command }) => { 2 | // Determine group setting based on command 3 | let isClose = { 4 | 'open': 'not_announcement', // Open group for all members 5 | 'unmute': 'not_announcement', // Alias for open 6 | 'close': 'announcement', // Restrict group to admin-only 7 | 'mute': 'announcement' // Alias for close 8 | }[command]; // Map the command to the group setting 9 | 10 | // Validate the command 11 | if (!isClose) { 12 | return m.reply(` 13 | 💱 ${mssg.gpSetting} 14 | 15 | *⚙️ ${usedPrefix}close / ${usedPrefix}mute* - Restrict group to admin-only 16 | *⚙️ ${usedPrefix}open / ${usedPrefix}unmute* - Allow all members to send messages 17 | `); 18 | } 19 | 20 | // Update group settings 21 | try { 22 | await conn.groupSettingUpdate(m.chat, isClose); 23 | m.reply(`✅ Group successfully set to *${command}* mode.`); 24 | } catch (e) { 25 | m.reply(`❌ Failed to update group settings. Make sure I am an admin.`); 26 | } 27 | }; 28 | 29 | // Command metadata 30 | handler.help = ['mute', 'close', 'unmute', 'open']; 31 | handler.tags = ['group']; 32 | handler.command = ['mute', 'close', 'unmute', 'open']; // Commands supported 33 | handler.admin = true; // User must be an admin 34 | handler.botAdmin = true; // Bot must be an admin 35 | handler.group = true; // Only applicable in groups 36 | 37 | export default handler; 38 | -------------------------------------------------------------------------------- /plugins/game-guessFlag_Ans.js: -------------------------------------------------------------------------------- 1 | import similarity from 'similarity' 2 | const threshold = 0.72 3 | export async function before(m) { 4 | let id = m.chat 5 | if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys || !m.text || !/use.*fhint/i.test(m.quoted.text) || /.*hhint/i.test(m.text)) 6 | return !0 7 | this.tebakbendera = this.tebakbendera ? this.tebakbendera : {} 8 | if (!(id in this.tebakbendera)) 9 | return this.reply(m.chat, 'The game was over', m) 10 | if (m.quoted.id == this.tebakbendera[id][0].id) { 11 | let isSurrender = /^((me)?nyerah|surr?ender)$/i.test(m.text) 12 | if (isSurrender) { 13 | clearTimeout(this.tebakbendera[id][3]) 14 | delete this.tebakbendera[id] 15 | return this.reply(m.chat, '*Yeah, give up :( !*', m) 16 | } 17 | let json = JSON.parse(JSON.stringify(this.tebakbendera[id][1])) 18 | 19 | if (m.text.toLowerCase() == json.name.toLowerCase().trim()) { 20 | global.db.data.users[m.sender].exp += this.tebakbendera[id][2] 21 | this.reply(m.chat, `✅ *correct!*\n+${this.tebakbendera[id][2]} XP`, m) 22 | clearTimeout(this.tebakbendera[id][3]) 23 | delete this.tebakbendera[id] 24 | } else if (similarity(m.text.toLowerCase(), json.name.toLowerCase().trim()) >= threshold) 25 | m.reply(`❗ *A Little More!*`) 26 | else 27 | this.reply(m.chat, `❌ *Wrong!*`, m) 28 | } 29 | return !0 30 | } 31 | export const exp = 0 32 | 33 | -------------------------------------------------------------------------------- /plugins/pmblocker.js: -------------------------------------------------------------------------------- 1 | //to use this grouponly mustbe off(using a sigle prefix is preferred) 2 | export async function before(m, { conn, isAdmin, isBotAdmin, isOwner, isROwner }) { 3 | // Ignore messages sent by the bot itself 4 | if (m.isBaileys && m.fromMe) return true; 5 | 6 | // Allow the owner's messages 7 | if (isOwner) return false; 8 | 9 | // Ignore messages sent in group chats 10 | if (m.isGroup) return false; 11 | 12 | const allowlist = global.allowed || []; 13 | if (allowlist.includes(m.sender.split('@')[0])) return false; 14 | 15 | // If the message is not sent in a group, it's a private message 16 | if (!m.isGroup) { 17 | // Fetch chat data and bot settings 18 | let chat = global.db.data.chats[m.chat]; 19 | let bot = global.db.data.settings[this.user.jid] || {}; 20 | 21 | // Check if the "PM Blocker" feature is enabled, and the sender is not an owner or real owner 22 | if (bot.pmblocker && !isOwner && !isROwner) { 23 | // Block the sender unconditionally for any private message sent 24 | await m.reply(`*Hello @${m.sender.split`@`[0]}, messaging the bot privately is currently disabled. You have been blocked from using the bot. Contact owner if you know his contact number*`, false, { mentions: [m.sender] }); 25 | await this.updateBlockStatus(m.chat, 'block'); 26 | m.react("✅ ") 27 | // Return true to indicate that the private message should be blocked 28 | return true; 29 | } 30 | } 31 | 32 | 33 | return true; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /plugins/tools-npm.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let handler = async (m, { args, usedPrefix, command }) => { 4 | if (!args[0]) throw `✳️ Please use the command like this:\n *${usedPrefix + command}* `; 5 | const packageName = args[0].trim(); 6 | m.react('⏳'); // Indicate processing 7 | 8 | try { 9 | let res = await fetch(`https://bk9.fun/stalk/npm?package=${encodeURIComponent(packageName)}`); 10 | if (!res.ok) throw `❎ Unable to fetch details. Please try again later.`; 11 | 12 | let data = await res.json(); 13 | if (!data.status || !data.BK9) throw `❎ Package "${packageName}" not found.`; 14 | 15 | const pkg = data.BK9; 16 | 17 | // Extract only the relevant info fields 18 | const info = ` 19 | 📈 *Weekly Downloads*: ${pkg.info.find(i => i.type === 'DownloadsWeekly Downloads')?.result || 'No download data available'} 20 | 🔖 *Version*: ${pkg.info.find(i => i.type === 'Version')?.result || 'No version available'} 21 | 🗓️ *Last Publish*: ${pkg.info.find(i => i.type === 'Last publish')?.result || 'No last publish date available'} 22 | 🔑 *License*: ${pkg.info.find(i => i.type === 'License')?.result || 'No license data available'} 23 | `.trim(); 24 | 25 | m.reply(info); 26 | } catch (error) { 27 | console.error(error); 28 | m.reply(`❎ Failed to fetch package details. Please try again later.`); 29 | } 30 | }; 31 | 32 | handler.help = ['npm ']; 33 | handler.tags = ['tools']; 34 | handler.command = ['npm', 'npmpackage']; 35 | 36 | export default handler; 37 | -------------------------------------------------------------------------------- /plugins/tools-subreddit.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let subredditHandler = async (m, { conn, text }) => { 4 | if (!text) throw 'Please provide a subreddit name'; 5 | 6 | try { 7 | let res = await fetch(`https://api.popcat.xyz/subreddit/${encodeURIComponent(text)}`); 8 | 9 | if (!res.ok) { 10 | throw new Error(`API request failed with status ${res.status}`); 11 | } 12 | 13 | let json = await res.json(); 14 | 15 | console.log('JSON response:', json); 16 | 17 | let subredditInfo = 18 | `*Subreddit Information:*\n 19 | • *Name:* ${json.name}\n 20 | • *Title:* ${json.title}\n 21 | • *Active Users:* ${json.active_users}\n 22 | • *Members:* ${json.members}\n 23 | • *Description:* ${json.description}\n 24 | • *Allow Videos:* ${json.allow_videos ? 'Yes' : 'No'}\n 25 | • *Allow Images:* ${json.allow_images ? 'Yes' : 'No'}\n 26 | • *Over 18:* ${json.over_18 ? 'Yes' : 'No'}\n 27 | • *URL:* ${json.url}`; 28 | 29 | // if icon is not null or undefined, send it along with the subreddit information as caption 30 | // otherwise, only send the subreddit information 31 | if (json.icon) { 32 | await conn.sendFile(m.chat, json.icon, 'icon.jpg', subredditInfo, m); 33 | } else { 34 | m.reply(subredditInfo); 35 | } 36 | 37 | } catch (error) { 38 | console.error(error); 39 | // Handle the error appropriately 40 | } 41 | }; 42 | 43 | subredditHandler.help = ['subreddit']; 44 | subredditHandler.tags = ['tools']; 45 | subredditHandler.command = /^(subreddit|reddit)$/i; 46 | 47 | export default subredditHandler; 48 | -------------------------------------------------------------------------------- /plugins/tools-removebg.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import FormData from 'form-data'; 3 | import fs from 'fs'; 4 | import path from 'path'; 5 | import dotenv from 'dotenv'; 6 | 7 | dotenv.config(); // Load environment variables from .env file 8 | 9 | const handler = async (m, { conn, text }) => { 10 | try { 11 | const q = m.quoted ? m.quoted : m; 12 | const mime = (q.msg || q).mimetype || ''; 13 | const img = await q.download(); 14 | const apikey = process.env.REMOVEBG_KEY; // Use the API_KEY from the environment variable 15 | 16 | const formData = new FormData(); 17 | formData.append('size', 'auto'); 18 | formData.append('image_file', img, 'file.jpg'); 19 | 20 | const response = await axios.post('https://api.remove.bg/v1.0/removebg', formData, { 21 | headers: { 22 | ...formData.getHeaders(), 23 | 'X-Api-Key': apikey, 24 | }, 25 | responseType: 'arraybuffer', 26 | encoding: null, 27 | }); 28 | 29 | if (response.status !== 200) { 30 | throw new Error(`Error: ${response.status} ${response.statusText}`); 31 | } 32 | 33 | const imageData = response.data; 34 | 35 | fs.writeFileSync('no-bg.png', imageData); 36 | 37 | // Add the caption to the image 38 | const caption = `MADE BY ${botname}`; 39 | conn.sendFile(m.chat, 'no-bg.png', '', caption, m); 40 | } catch (e) { 41 | console.error(e); 42 | m.reply('Sorry, an error occurred while processing the image, maybe check your api key.'); 43 | } 44 | }; 45 | 46 | handler.help = ['removebg']; 47 | handler.tags = ['tools']; 48 | handler.command = /^rmbg|removebg$/i; 49 | export default handler; 50 | 51 | -------------------------------------------------------------------------------- /plugins/plugin-install.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import fs from 'fs'; 3 | import path from 'path'; 4 | 5 | let handler = async (m, { text, usedPrefix, command }) => { 6 | if (!text) throw `Please provide a plugin URL`; 7 | 8 | // Extract the Gist ID from the URL 9 | const gistId = text.match(/(?:\/|gist\.github\.com\/)([a-fA-F0-9]+)/); 10 | 11 | 12 | if (!gistId) throw `Invalid plugin URL`; 13 | 14 | const gistName = gistId[1]; 15 | const gistURL = `https://api.github.com/gists/${gistName}`; 16 | 17 | try { 18 | const response = await axios.get(gistURL); 19 | const gistData = response.data; 20 | 21 | if (!gistData || !gistData.files) { 22 | throw `No valid files found in the Gist`; 23 | } 24 | 25 | for (const file of Object.values(gistData.files)) { 26 | // Use the Gist file name as the plugin name 27 | const pluginName = file.filename; 28 | 29 | // Construct the path to save the plugin 30 | const pluginPath = path.join('plugins', `${pluginName}`); 31 | 32 | // Write the Gist file content to the plugin file 33 | await fs.promises.writeFile(pluginPath, file.content); 34 | m.reply(`𝙨𝙪𝙘𝙘𝙚𝙨𝙨𝙛𝙪𝙡𝙡𝙮 𝙞𝙣𝙨𝙩𝙖𝙡𝙡𝙚𝙙 𝙩𝙝𝙚 𝙥𝙡𝙪𝙜𝙞𝙣 𝙩𝙤 𝙋𝙍𝙄𝙉𝘾𝙀 𝘽𝙊𝙏`); 35 | } 36 | } catch (error) { 37 | throw `Error fetching or saving the plugin: ${error.message}`; 38 | } 39 | }; 40 | 41 | handler.help = ['install'].map((v) => v + ' '); 42 | handler.tags = ['plugin']; 43 | handler.command = /^install$/i; 44 | 45 | handler.owner = true; 46 | 47 | export default handler; 48 | -------------------------------------------------------------------------------- /plugins/gp-simulate.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, usedPrefix, command, args: [event], text }) => { 3 | 4 | let chat = global.db.data.chats[m.chat] 5 | if (!chat.welcome) throw `✳️ To use this command you must activate the Welcomes with *${usedPrefix}on* welcome` 6 | let te = ` 7 | ┌─⊷ *EVENTS* 8 | ▢ welcome 9 | ▢ bye 10 | ▢ promote 11 | ▢ demote 12 | └─────────── 13 | 14 | 📌 Example : 15 | 16 | *${usedPrefix + command}* welcome @user` 17 | 18 | if (!event) return await m.reply(te) 19 | 20 | let mentions = text.replace(event, '').trimStart() 21 | let who = mentions ? conn.parseMention(mentions) : [] 22 | let part = who.length ? who : [m.sender] 23 | let act = false 24 | m.reply(`✅ simulating ${event}...`) 25 | switch (event.toLowerCase()) { 26 | case 'add': 27 | case 'bienvenida': 28 | case 'invite': 29 | case 'welcome': 30 | act = 'add' 31 | break 32 | case 'bye': 33 | case 'despedida': 34 | case 'leave': 35 | case 'remove': 36 | act = 'remove' 37 | break 38 | 39 | case 'promote': 40 | case 'promover': 41 | act = 'promote' 42 | break 43 | 44 | case 'demote': 45 | case 'degradar': 46 | act = 'demote' 47 | break 48 | 49 | default: 50 | 51 | throw te 52 | } 53 | if (act) return conn.participantsUpdate({ 54 | id: m.chat, 55 | participants: part, 56 | action: act 57 | }) 58 | } 59 | handler.help = ['simulate @user'] 60 | handler.tags = ['group'] 61 | handler.command = ['simular', 'simulate'] 62 | handler.admin = true 63 | handler.group = true 64 | 65 | export default handler 66 | -------------------------------------------------------------------------------- /plugins/main-runtime.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, args, usedPrefix, command }) => { 2 | let pp = '' 3 | m.react('⏳') 4 | let _muptime 5 | if (process.send) { 6 | process.send('uptime') 7 | _muptime = await new Promise(resolve => { 8 | process.once('message', resolve) 9 | setTimeout(resolve, 1000) 10 | }) * 1000 11 | } 12 | let muptime = clockString(_muptime) 13 | let str = `🟢ᴘʀɪɴᴄᴇ ᴍᴅ ᴜᴘᴛɪᴍᴇ\n\n🎗️ʙᴏᴛ ᴀᴄᴛɪᴠᴇ ᴅᴜʀᴀᴛɪᴏɴ\n *${muptime}⏰*` 14 | conn.sendMessage(m.chat, { 15 | text: str, 16 | contextInfo: { 17 | 18 | mentionedJid: [m.sender], 19 | isForwarded: true, 20 | forwardedNewsletterMessageInfo: { 21 | newsletterJid: '120363199257221654@newsletter', 22 | newsletterName: global.author, 23 | serverMessageId: -1 24 | }, 25 | forwardingScore: 999, 26 | externalAdReply: { 27 | title: "🎗️ᴘʀɪɴᴄᴇ ᴍᴅ🎗️", 28 | body: "ʀᴜɴɪɴɢ sɪɴᴄᴇ", 29 | thumbnailUrl: pp, 30 | sourceUrl: '', 31 | mediaType: 1, 32 | renderLargerThumbnail: false 33 | }}}) 34 | m.react('✅') 35 | } 36 | handler.help = ['runtime'] 37 | handler.tags = ['main'] 38 | handler.command = ['runtime', 'uptime', 'run'] 39 | export default handler 40 | 41 | function clockString(ms) { 42 | let d = isNaN(ms) ? '--' : Math.floor(ms / 86400000) 43 | let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) % 24 44 | let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 45 | let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 46 | return [d, 'd ', h, 'h ', m, 'm ', s, 's '].map(v => v.toString().padStart(2, 0)).join('') 47 | } 48 | -------------------------------------------------------------------------------- /plugins/main-language.js: -------------------------------------------------------------------------------- 1 | 2 | let handler = async (m, { conn, text, args, usedPrefix, command }) => { 3 | 4 | let te = `✳️ ${mssg.langList}\n- ur (Urdu)\n- es (Spanish)\n- en (English)\n- id (Indonesia)\n- pt (Portugues)\n- ar (Arabic)\n\n📌 ${mssg.example}: *${usedPrefix + command}* en\nHelp us translate the bot into your language` 5 | if (!text) throw te 6 | let user = global.db.data.users[m.sender] 7 | if (args[0] === "es") { 8 | user.language = args[0] 9 | m.reply("✅ *Español Seleccionado*\n\nAhora el bot responderá a su mensaje en Español") 10 | } else if (args[0] === "en") { 11 | user.language = args[0] 12 | m.reply("✅ *Selected English*\n\nNow the bot will reply to your message in English") 13 | } else if (args[0] === "ur") { 14 | user.language = args[0] 15 | m.reply("✅ *منتخب کردہ اردو*\n\nاب بوٹ آپ کے پیغام کا جواب اردو میں دے گا") 16 | } else if (args[0] === "id") { 17 | user.language = args[0] 18 | m.reply("✅ *Bahasa Indonesia terpilih*\n\nSekarang bot akan membalas pesanmu dengan bahasa Indonesia") 19 | } else if (args[0] === "pt") { 20 | user.language = args[0] 21 | m.reply("✅ *Português selecionados*\n\nAgora o bot vai responder a sua mensagem em Português") 22 | } else if (args[0] === "ar") { 23 | user.language = args[0] 24 | m.reply("✅ *تم اختيار اللغة العربية*\n\nالآن سيقوم البوت بالرد على رسائلك باللغة العربية") 25 | } else { 26 | m.reply(te) 27 | } 28 | 29 | } 30 | handler.help = ['language '] 31 | handler.tags = ['main'] 32 | handler.command = ['language', 'lenguaje', 'lang', 'idioma'] 33 | 34 | export default handler 35 | -------------------------------------------------------------------------------- /plugins/Jarvis.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | import gtts from 'node-gtts'; 3 | import { readFileSync, unlinkSync } from 'fs'; 4 | import { join } from 'path'; 5 | 6 | const defaultLang = 'hi'; 7 | 8 | 9 | export async function before(m, { conn }) { 10 | if (m.isBaileys && m.fromMe) { 11 | return true; 12 | } 13 | 14 | if (!m.isGroup) { 15 | return false; 16 | } 17 | 18 | let chat = global.db.data.chats[m.chat] 19 | 20 | if (!chat.jarvis) { 21 | return true; 22 | } 23 | 24 | const options = { 25 | method: 'POST', 26 | headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, 27 | body: `text=${encodeURIComponent(m.text)}&lc=en&key=` 28 | } 29 | 30 | const res = await fetch('https://api.simsimi.vn/v1/simtalk', options); 31 | const json = await res.json(); 32 | 33 | let reply; 34 | if (json.status === '200') { 35 | reply = json.message; 36 | } else { 37 | throw 'Invalid response from SimSimi.'; 38 | } 39 | 40 | let speech; 41 | try { 42 | speech = await tts(reply, defaultLang); 43 | } catch (e) { 44 | m.reply(e + ''); 45 | throw 'Error occurred during text-to-speech conversion.'; 46 | } finally { 47 | if (speech) conn.sendFile(m.chat, speech, 'tts.opus', null, m, true); 48 | } 49 | } 50 | 51 | function tts(text, lang = 'en') { 52 | return new Promise((resolve, reject) => { 53 | try { 54 | let tts = gtts(lang); 55 | let filePath = join(global.__dirname(import.meta.url), '../tmp', (1 * new Date) + '.wav'); 56 | tts.save(filePath, text, () => { 57 | resolve(readFileSync(filePath)); 58 | unlinkSync(filePath); 59 | }); 60 | } catch (e) { reject(e); } 61 | }); 62 | } 63 | -------------------------------------------------------------------------------- /lib/tempclear.js: -------------------------------------------------------------------------------- 1 | import Helper from './helper.js'; 2 | import { promises as fs } from 'fs'; 3 | import { tmpdir, platform } from 'os'; 4 | import { join } from 'path'; 5 | 6 | const maxtime = 1000 * 60 * 2; 7 | 8 | const __dirname = Helper.__dirname(import.meta); 9 | 10 | export default async function clearTmp() { 11 | const tmp = [tmpdir(), join(__dirname, '../tmp')]; 12 | const deletedFiles = []; // Array to store deleted file paths 13 | 14 | await Promise.allSettled( 15 | tmp.map(async (dir) => { 16 | const files = await fs.readdir(dir); 17 | for (const file of files) { 18 | if (!file.endsWith('.file')) { 19 | const filePath = join(dir, file); 20 | const stat = await fs.stat(filePath); 21 | if (stat.isFile() && Date.now() - stat.mtimeMs >= maxtime) { 22 | // Check if the file can be opened (Windows-specific) 23 | if (platform() === 'win32') { 24 | let fileHandle; 25 | try { 26 | fileHandle = await fs.open(filePath, 'r+'); 27 | } catch (e) { 28 | // Log the error but continue with other files 29 | console.error('[clearTmp] Error opening file:', e.message); 30 | continue; 31 | } finally { 32 | await fileHandle?.close(); 33 | } 34 | } 35 | // Delete the file 36 | await fs.unlink(filePath); 37 | deletedFiles.push(filePath); // Add the deleted file to the array 38 | } 39 | } 40 | } 41 | }) 42 | ); 43 | 44 | // Log the number of deleted files 45 | console.log(`[💻clearTmp] 📂Files ${deletedFiles.length} Recycled✅ .`); 46 | } 47 | -------------------------------------------------------------------------------- /plugins/gp-groupInfo.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn, participants, groupMetadata }) => { 4 | const pp = await conn.profilePictureUrl(m.chat, 'image').catch(_ => null) || './src/avatar_contact.png' 5 | const { isBanned, welcome, detect, sWelcome, sBye, sPromote, sDemote, antiLink, delete: del } = global.db.data.chats[m.chat] 6 | const groupAdmins = participants.filter(p => p.admin) 7 | const listAdmin = groupAdmins.map((v, i) => `${i + 1}. @${v.id.split('@')[0]}`).join('\n') 8 | const owner = groupMetadata.owner || groupAdmins.find(p => p.admin === 'superadmin')?.id || m.chat.split`-`[0] + '@s.whatsapp.net' 9 | let text = ` 10 | ┌──「 *INFO GROUP* 」 11 | ▢ *♻️ID:* 12 | • ${groupMetadata.id} 13 | ▢ *🔖NAME* : 14 | • ${groupMetadata.subject} 15 | ▢ *👥Members* : 16 | • ${participants.length} 17 | ▢ *🤿Group Owner:* 18 | • @${owner.split('@')[0]} 19 | ▢ *🕵🏻‍♂️Admins:* 20 | ${listAdmin} 21 | ▢ *🪢 group configuration:* 22 | • ${isBanned ? '✅' : '❎'} Banned 23 | • ${welcome ? '✅' : '❎'} Welcome 24 | • ${detect ? '✅' : '❎'} Detector 25 | • ${del ? '❎' : '✅'} Anti Delete 26 | • ${antiLink ? '✅' : '❎'} Anti Link WhatsApp 27 | 28 | *▢ 📬 message settings:* 29 | • Welcome: ${sWelcome} 30 | • Farewell: ${sBye} 31 | • Promoted: ${sPromote} 32 | • Degraded: ${sDemote} 33 | 34 | ▢ *📌Description* : 35 | • ${groupMetadata.desc?.toString() || 'unknown'} 36 | `.trim() 37 | conn.sendFile(m.chat, pp, 'pp.jpg', text, m, false, { mentions: [...groupAdmins.map(v => v.id), owner] }) 38 | } 39 | 40 | handler.help = ['infogp'] 41 | handler.tags = ['group'] 42 | handler.command = ['infogrupo', 'groupinfo', 'infogp'] 43 | handler.group = true 44 | 45 | export default handler 46 | -------------------------------------------------------------------------------- /plugins/gp-profile.js: -------------------------------------------------------------------------------- 1 | import { createHash } from 'crypto' 2 | import { canLevelUp, xpRange } from '../lib/levelling.js' 3 | 4 | let handler = async (m, { conn, usedPrefix, command}) => { 5 | 6 | let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender 7 | if (!(who in global.db.data.users)) throw `✳️ The user is not found in my database` 8 | let pp = await conn.profilePictureUrl(who, 'image').catch(_ => './Guru.jpg') 9 | let user = global.db.data.users[who] 10 | let about = (await conn.fetchStatus(who).catch(console.error) || {}).status || '' 11 | let { name, exp, credit, lastclaim, registered, regTime, age, level, role, wealth, warn } = global.db.data.users[who] 12 | let { min, xp, max } = xpRange(user.level, global.multiplier) 13 | let username = conn.getName(who) 14 | let math = max - xp 15 | let prem = global.prems.includes(who.split`@`[0]) 16 | let sn = createHash('md5').update(who).digest('hex') 17 | 18 | // • @${who.replace(/@.+/, '')} 19 | let str = `*🪪 Name:* ${username}${about ? '\n\n 🎌 *Bio:* ' + about : ''} 20 | 21 | *⚠️ Warnings:* ${warn}/${maxwarn} 22 | 23 | *💰 Gold :* ${credit} 24 | 25 | *✨ Level* : ${level} 26 | 27 | *⬆️ XP* : Total ${exp} (${user.exp - min} / ${xp})\n${math <= 0 ? `Ready for *${usedPrefix}levelup*` : `*${math}xp* missing to level up`} 28 | 29 | *🏆 Rank:* ${role} 30 | 31 | *📇 Registered :* ${registered ? 'Yes': 'No'} 32 | 33 | *⭐ Premium* : ${prem ? 'Yes' : 'No'} 34 | ` 35 | conn.sendFile(m.chat, pp, 'profil.jpg', str, m, false, { mentions: [who] }) 36 | m.react(done) 37 | 38 | } 39 | handler.help = ['profile'] 40 | handler.tags = ['group'] 41 | handler.command = ['profile'] 42 | 43 | export default handler 44 | -------------------------------------------------------------------------------- /lib/cloudDBAdapter.js: -------------------------------------------------------------------------------- 1 | import got from 'got' 2 | 3 | const stringify = obj => JSON.stringify(obj, null, 2) 4 | const parse = str => JSON.parse(str, (_, v) => { 5 | if ( 6 | v !== null && 7 | typeof v === 'object' && 8 | 'type' in v && 9 | v.type === 'Buffer' && 10 | 'data' in v && 11 | Array.isArray(v.data)) { 12 | return Buffer.from(v.data) 13 | } 14 | return v 15 | }) 16 | class CloudDBAdapter { 17 | constructor(url, { 18 | serialize = stringify, 19 | deserialize = parse, 20 | fetchOptions = {} 21 | } = {}) { 22 | this.url = url 23 | this.serialize = serialize 24 | this.deserialize = deserialize 25 | this.fetchOptions = fetchOptions 26 | } 27 | 28 | async read() { 29 | try { 30 | let res = await got(this.url, { 31 | method: 'GET', 32 | headers: { 33 | 'Accept': 'application/json;q=0.9,text/plain' 34 | }, 35 | ...this.fetchOptions 36 | }) 37 | if (res.statusCode !== 200) throw res.statusMessage 38 | return this.deserialize(res.body) 39 | } catch (e) { 40 | return null 41 | } 42 | } 43 | 44 | async write(obj) { 45 | let res = await got(this.url, { 46 | method: 'POST', 47 | headers: { 48 | 'Content-Type': 'application/json' 49 | }, 50 | ...this.fetchOptions, 51 | body: this.serialize(obj) 52 | }) 53 | if (res.statusCode !== 200) throw res.statusMessage 54 | return res.body 55 | } 56 | } 57 | 58 | export default CloudDBAdapter 59 | -------------------------------------------------------------------------------- /lib/uploadImage.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | import { FormData, Blob } from 'formdata-node' 3 | import { fileTypeFromBuffer } from 'file-type' 4 | 5 | /** 6 | * Upload file to qu.ax 7 | * Supported mimetypes: 8 | * - `image/jpeg` 9 | * - `image/jpg` 10 | * - `image/png` 11 | * - `video/mp4` 12 | * - `video/webm` 13 | * - `audio/mpeg` 14 | * - `audio/wav` 15 | * @param {Buffer} buffer File Buffer 16 | * @return {Promise} 17 | */ 18 | export default async (buffer) => { 19 | const { ext, mime } = await fileTypeFromBuffer(buffer) 20 | const form = new FormData() 21 | const blob = new Blob([buffer.toArrayBuffer()], { type: mime }) 22 | form.append('files[]', blob, 'tmp.' + ext) 23 | const res = await fetch('https://qu.ax/upload.php', { method: 'POST', body: form }) 24 | const result = await res.json() 25 | if (result && result.success) { 26 | return result.files[0].url 27 | } else { 28 | throw new Error('Failed to upload the file to qu.ax') 29 | }} 30 | 31 | /** 32 | * Upload file to qu.ax 33 | * Supported mimetypes: 34 | * - `image/jpeg` 35 | * - `image/jpg` 36 | * - `image/png` 37 | * - `video/mp4` 38 | * - `video/webm` 39 | * - `audio/mpeg` 40 | * - `audio/wav` 41 | * @param {Buffer} buffer File Buffer 42 | * @return {Promise} 43 | */ 44 | 45 | /*export default async (buffer) => { 46 | const {ext, mime} = await fileTypeFromBuffer(buffer) 47 | const form = new FormData() 48 | const blob = new Blob([buffer.toArrayBuffer()], {type: mime}) 49 | form.append('file', blob, 'tmp.' + ext) 50 | const res = await fetch('https://telegra.ph/upload', { 51 | method: 'POST', 52 | body: form, 53 | }) 54 | const img = await res.json() 55 | if (img.error) throw img.error 56 | return 'https://telegra.ph' + img[0].src 57 | }*/ 58 | -------------------------------------------------------------------------------- /plugins/gp-kickk.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, participants, usedPrefix, command }) => { 2 | let kickte = `✳️ Correct use of the command\n*${usedPrefix + command}* @tag\n\n*${usedPrefix + command}* for Remove + Delete Msg`; 3 | 4 | // Check if a user is mentioned or if a quoted message exists 5 | if (!m.mentionedJid[0] && !m.quoted) 6 | return m.reply(kickte, m.chat, { mentions: conn.parseMention(kickte) }); 7 | 8 | let user = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted.sender; 9 | 10 | try { 11 | // Attempt to delete the message (if supported by the platform) 12 | if (m.message.extendedTextMessage) { 13 | let delet = m.message.extendedTextMessage.contextInfo.participant; 14 | let bang = m.message.extendedTextMessage.contextInfo.stanzaId; 15 | await conn.sendMessage(m.chat, { 16 | delete: { remoteJid: m.chat, fromMe: false, id: bang, participant: delet } 17 | }); 18 | } else if (m.quoted) { 19 | await conn.sendMessage(m.chat, { delete: m.quoted.vM.key }); 20 | } 21 | } catch (e) { 22 | // Log errors to avoid breaking execution 23 | console.error("Error deleting message:", e); 24 | } 25 | 26 | // Remove the user from the group 27 | await conn.groupParticipantsUpdate(m.chat, [user], 'remove'); 28 | 29 | // Notify the group about the action 30 | m.reply(`✅ User has been removed and His message has been deleted. 👋🏻`); 31 | }; 32 | 33 | handler.help = ['kick2 @user', 'kk @user']; 34 | handler.tags = ['group']; 35 | handler.command = ['kick2', 'expulsar32', 'k2', 'kk']; 36 | handler.admin = true; 37 | handler.group = true; 38 | handler.botAdmin = true; 39 | 40 | export default handler; 41 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | import express from 'express' 2 | import { createServer } from 'http' 3 | import path from 'path' 4 | import { Socket } from 'socket.io' 5 | import { toBuffer } from 'qrcode' 6 | import fetch from 'node-fetch' 7 | 8 | function connect(conn, PORT) { 9 | let app = global.app = express() 10 | console.log(app) 11 | let server = global.server = createServer(app) 12 | // app.use(express.static(path.join(__dirname, 'views'))) 13 | let _qr = 'invalid' 14 | 15 | conn.ev.on('connection.update', function appQR({ qr }) { 16 | if (qr) _qr = qr 17 | }) 18 | 19 | app.use(async (req, res) => { 20 | res.setHeader('content-type', 'image/png') 21 | res.end(await toBuffer(_qr)) 22 | }) 23 | 24 | // let io = new Socket(server) 25 | // io.on('connection', socket => { 26 | // let { unpipeEmit } = pipeEmit(conn, socket, 'conn-') 27 | // socket.on('disconnect', unpipeEmit) 28 | // }) 29 | 30 | server.listen(PORT, () => { 31 | console.log('App listened on port', PORT) 32 | if (opts['keepalive']) keepAlive() 33 | }) 34 | } 35 | 36 | function pipeEmit(event, event2, prefix = '') { 37 | let old = event.emit 38 | event.emit = function (event, ...args) { 39 | old.emit(event, ...args) 40 | event2.emit(prefix + event, ...args) 41 | } 42 | return { 43 | unpipeEmit() { 44 | event.emit = old 45 | } 46 | } 47 | } 48 | 49 | function keepAlive() { 50 | const url = `https://${process.env.REPL_SLUG}.${process.env.REPL_OWNER}.repl.co` 51 | if (/(\/\/|\.)undefined\./.test(url)) return 52 | setInterval(() => { 53 | fetch(url).catch(console.error) 54 | }, 5 * 1000 * 60) 55 | } 56 | 57 | 58 | export default connect 59 | -------------------------------------------------------------------------------- /plugins/dl-tiktokstalk.js: -------------------------------------------------------------------------------- 1 | import fg from 'api-dylux' 2 | let handler = async (m, { conn, text, args }) => { 3 | if (!text) throw `✳️ Enter the Username of a TikTok user` 4 | m.react("⌛"); 5 | try { 6 | const apiUrl = `https://deliriussapi-oficial.vercel.app/tools/tiktokstalk?q=${encodeURIComponent(args[0])}`; 7 | const apiResponse = await fetch(apiUrl); 8 | const delius = await apiResponse.json(); 9 | if (!delius || !delius.result || !delius.result.users) return m.react("❌"); 10 | const profile = delius.result.users; 11 | const stats = delius.result.stats; 12 | const txt = `👤 *TikTok Profile*: 13 | *• Username*: ${profile.username} 14 | *• Nickname*: ${profile.nickname} 15 | *• Verified*: ${profile.verified ? 'Yes' : 'No'} 16 | *• Followers*: ${stats.followerCount.toLocaleString()} 17 | *• Following*: ${stats.followingCount.toLocaleString()} 18 | *• Total Likes*: ${stats.heartCount.toLocaleString()} 19 | *• Videos*: ${stats.videoCount.toLocaleString()} 20 | *• Bio*: ${profile.signature} 21 | *• URL*: 22 | ${profile.url}`; 23 | 24 | await conn.sendFile(m.chat, profile.avatarLarger, 'tt.png', txt, m, null); 25 | m.react("✅"); 26 | } catch (e2) { 27 | try { 28 | let res = await fg.ttStalk(args[0]) 29 | let txt = `👤 *TikTok Profile*: 30 | *• Name:* ${res.name} 31 | *• Username:* ${res.username} 32 | *• Followers:* ${res.followers} 33 | *• Following:* ${res.following} 34 | *• Description:* ${res.desc} 35 | *• Link* : https://tiktok.com/${res.username}` 36 | await conn.sendFile(m.chat, res.profile, 'tt.png', txt, m, null, fake) 37 | m.react("✅"); 38 | } catch (e) { 39 | await m.react(`❌`) 40 | m.reply('⚠️ AN ERROR OCCURRED ⚠️') 41 | console.log(e) 42 | }}} 43 | handler.help = ['tiktokstalk'] 44 | handler.tags = ['downloader'] 45 | handler.command = /^t(tstalk|iktokstalk|iktoksearch|tsearch)$/i 46 | export default handler 47 | -------------------------------------------------------------------------------- /plugins/owner-resetUser.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn, text }) => { 4 | function no(number){ 5 | return number.replace(/\s/g,'').replace(/([@+-])/g,'') 6 | } 7 | 8 | text = no(text) 9 | 10 | if(isNaN(text)) { 11 | var number = text.split`@`[1] 12 | } else if(!isNaN(text)) { 13 | var number = text 14 | } 15 | 16 | if(!text && !m.quoted) return conn.reply(`*❏USER RESET*\n\nTag the user, type the number or reply to the message of the user you want to RESET`, m) 17 | //let exists = await conn.isOnWhatsApp(number) 18 | // if (exists) return conn.reply(m.chat, `*The number is not registered in WhatsApp*`, m) 19 | if(isNaN(number)) return conn.reply(m.chat, `*❏ USER RESET*\n\nThe number you entered is invalid`, m) 20 | // if(number.length > 8) return conn.reply(m.chat, `*❏ USER RESET*\n\nThe number you entered is invalid!`, m) 21 | try { 22 | if(text) { 23 | var user = number + '@s.whatsapp.net' 24 | } else if(m.quoted.sender) { 25 | var user = m.quoted.sender 26 | } else if(m.mentionedJid) { 27 | var user = number + '@s.whatsapp.net' 28 | } 29 | } catch (e) { 30 | } finally { 31 | 32 | let groupMetadata = m.isGroup ? await conn.groupMetadata(m.chat) : {} 33 | let participants = m.isGroup ? groupMetadata.participants : [] 34 | let users = m.isGroup ? participants.find(u => u.jid == user) : {} 35 | let number = user.split('@')[0] 36 | 37 | delete global.global.db.data.users[user] 38 | 39 | conn.reply(m.chat, `*❏ USER RESET*\n\n✅ Rebooted to @${number} from the *DATABASE*`, null, { mentions: [user] }) 40 | 41 | 42 | } 43 | } 44 | handler.help = ['reset <92xxx>'] 45 | handler.tags = ['owner'] 46 | handler.command = ['reset'] 47 | handler.admin = false 48 | handler.rowner = true 49 | 50 | export default handler 51 | -------------------------------------------------------------------------------- /lib/converter.js: -------------------------------------------------------------------------------- 1 | import { promises } from 'fs' 2 | import { join } from 'path' 3 | import { spawn } from 'child_process' 4 | 5 | function ffmpeg(buffer, args = [], ext = '', ext2 = '') { 6 | return new Promise(async (resolve, reject) => { 7 | try { 8 | let tmp = join(global.__dirname(import.meta.url), '../tmp', + new Date + '.' + ext) 9 | let out = tmp + '.' + ext2 10 | await promises.writeFile(tmp, buffer) 11 | spawn('ffmpeg', [ 12 | '-y', 13 | '-i', tmp, 14 | ...args, 15 | out 16 | ]) 17 | .on('error', reject) 18 | .on('close', async (code) => { 19 | try { 20 | await promises.unlink(tmp) 21 | if (code !== 0) return reject(code) 22 | resolve({ 23 | data: await promises.readFile(out), 24 | filename: out, 25 | delete() { 26 | return promises.unlink(out) 27 | } 28 | }) 29 | } catch (e) { 30 | reject(e) 31 | } 32 | }) 33 | } catch (e) { 34 | reject(e) 35 | } 36 | }) 37 | } 38 | 39 | function toPTT(buffer, ext) { 40 | return ffmpeg(buffer, [ 41 | '-vn', 42 | '-c:a', 'libopus', 43 | '-b:a', '128k', 44 | '-vbr', 'on', 45 | ], ext, 'ogg') 46 | } 47 | 48 | function toAudio(buffer, ext) { 49 | return ffmpeg(buffer, [ 50 | '-vn', 51 | '-c:a', 'libopus', 52 | '-b:a', '128k', 53 | '-vbr', 'on', 54 | '-compression_level', '10' 55 | ], ext, 'opus') 56 | } 57 | 58 | function toVideo(buffer, ext) { 59 | return ffmpeg(buffer, [ 60 | '-c:v', 'libx264', 61 | '-c:a', 'aac', 62 | '-ab', '128k', 63 | '-ar', '44100', 64 | '-crf', '32', 65 | '-preset', 'slow' 66 | ], ext, 'mp4') 67 | } 68 | 69 | export { toAudio, toPTT, toVideo, ffmpeg } 70 | -------------------------------------------------------------------------------- /plugins/tools-cccption.js: -------------------------------------------------------------------------------- 1 | let generateWAMessageFromContent = await (await import('@whiskeysockets/baileys')).default; 2 | import * as fs from 'fs'; 3 | 4 | 5 | 6 | global.md = "https://github.com/PRINCE-GDS/MR-PRINCE-BOT" 7 | 8 | 9 | const handler = async (m, { conn, text, isOwner, isAdmin }) => { 10 | try { 11 | const q = m.quoted ? m.quoted : m; 12 | const c = m.quoted ? await m.getQuotedObj() : m; 13 | const msg = conn.cMod(m.chat, { 14 | [m.quoted ? q.mtype : 'extendedTextMessage']: m.quoted 15 | ? c.message[q.mtype] 16 | : { text: '' || c }, 17 | }, { quoted: m, userJid: conn.user.id }); 18 | await conn.relayMessage(m.chat, msg.message, { messageId: msg.key.id }); 19 | } catch { 20 | const quoted = m.quoted ? m.quoted : m; 21 | const mime = (quoted.msg || quoted).mimetype || ''; 22 | const isMedia = /image|video|sticker|audio/.test(mime); 23 | const more = String.fromCharCode(8206); 24 | const masss = more.repeat(850); 25 | const htextos = `${text ? text : '*Huh..🙃*'}`; 26 | if ((isMedia && quoted.mtype === 'imageMessage') && htextos) { 27 | var mediax = await quoted.download?.(); 28 | conn.sendMessage(m.chat, { image: mediax, caption: htextos }, { quoted: m }); 29 | } else if ((isMedia && quoted.mtype === 'videoMessage') && htextos) { 30 | var mediax = await quoted.download?.(); 31 | conn.sendMessage(m.chat, { video: mediax, mimetype: 'video/mp4', caption: htextos }, { quoted: m }); 32 | } else { 33 | await conn.relayMessage(m.chat, { extendedTextMessage: { text: `${masss}\n${htextos}\n`, ...{ contextInfo: { externalAdReply: { thumbnail: imagen1, sourceUrl: md } } } } }, {}); 34 | } 35 | } 36 | }; 37 | handler.command = /^(caption|cap|cp)$/i; 38 | handler.tags = ['tools']; 39 | handler.group = false; 40 | handler.admin = false; 41 | export default handler; 42 | -------------------------------------------------------------------------------- /plugins/owner-exec.js: -------------------------------------------------------------------------------- 1 | import syntaxerror from 'syntax-error' 2 | import { format } from 'util' 3 | import { fileURLToPath } from 'url' 4 | import { dirname } from 'path' 5 | import { createRequire } from 'module' 6 | 7 | const __dirname = dirname(fileURLToPath(import.meta.url)) 8 | const require = createRequire(__dirname) 9 | 10 | let handler = async (m, _2) => { 11 | let { conn, usedPrefix, noPrefix, args, groupMetadata } = _2 12 | let _return 13 | let _syntax = '' 14 | let _text = (/^=/.test(usedPrefix) ? 'return ' : '') + noPrefix 15 | let old = m.exp * 1 16 | try { 17 | let i = 15 18 | let f = { 19 | exports: {} 20 | } 21 | let exec = new (async () => { }).constructor('print', 'm', 'handler', 'require', 'conn', 'Array', 'process', 'args', 'groupMetadata', 'module', 'exports', 'argument', _text) 22 | _return = await exec.call(conn, (...args) => { 23 | if (--i < 1) return 24 | console.log(...args) 25 | return conn.reply(m.chat, format(...args), m) 26 | }, m, handler, require, conn, CustomArray, process, args, groupMetadata, f, f.exports, [conn, _2]) 27 | } catch (e) { 28 | let err = syntaxerror(_text, 'Execution Function', { 29 | allowReturnOutsideFunction: true, 30 | allowAwaitOutsideFunction: true, 31 | sourceType: 'module' 32 | }) 33 | if (err) _syntax = '```' + err + '```\n\n' 34 | _return = e 35 | } finally { 36 | conn.reply(m.chat, _syntax + format(_return), m) 37 | m.exp = old 38 | } 39 | } 40 | handler.help = [': ', '=: '] 41 | handler.tags = ['advanced'] 42 | handler.customPrefix = /^=?: / 43 | handler.command = /(?:)/i 44 | 45 | handler.rowner = true 46 | 47 | export default handler 48 | 49 | class CustomArray extends Array { 50 | constructor(...args) { 51 | if (typeof args[0] == 'number') return super(Math.min(args[0], 10000)) 52 | else return super(...args) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /plugins/gp-promote.js: -------------------------------------------------------------------------------- 1 | var handler = async (m, { conn, usedPrefix, command, text }) => { 2 | // Ignore system messages or Baileys-generated events 3 | if (m.key.fromMe || m.key.remoteJid === 'status@broadcast') return; 4 | 5 | if (isNaN(text) && !text.match(/@/g)) { 6 | // If the input is not a number and does not contain an @ symbol 7 | } else if (isNaN(text)) { 8 | var number = text.split`@`[1]; // Extract the number after the @ symbol 9 | } else if (!isNaN(text)) { 10 | var number = text; // If input is a number 11 | } 12 | 13 | if (!text && !m.quoted) 14 | return conn.reply(m.chat, `🚩 *Please respond to a group member to assign them as admin.*`, m); 15 | 16 | if (number.length > 13 || (number.length < 11 && number.length > 0)) 17 | return conn.reply(m.chat, `✨️ *You must reply to or mention a person to use this command.*`, m); 18 | 19 | try { 20 | let user; 21 | if (text) { 22 | user = number + '@s.whatsapp.net'; // Assign the WhatsApp user ID 23 | } else if (m.quoted && m.quoted.sender) { 24 | user = m.quoted.sender; // Get the sender from the quoted message 25 | } else if (m.mentionedJid) { 26 | user = number + '@s.whatsapp.net'; // Assign the mentioned user 27 | } 28 | 29 | await conn.groupParticipantsUpdate(m.chat, [user], 'promote'); // Promote the user to admin 30 | conn.reply(m.chat, `✅ *Successfully promoted as group admin.*`, m); 31 | } catch (e) { 32 | conn.reply(m.chat, `❌ *An error occurred while promoting the member.*`, m); 33 | } 34 | }; 35 | 36 | handler.help = ['promote']; 37 | handler.tags = ['group']; 38 | handler.command = ['promote', 'makeadmin', 'p']; 39 | 40 | handler.group = true; // Command works only in groups 41 | handler.admin = true; // The user running the command must be an admin 42 | handler.botAdmin = true; // The bot must be an admin 43 | handler.fail = null; 44 | 45 | export default handler; 46 | -------------------------------------------------------------------------------- /plugins/owner-inspect.js: -------------------------------------------------------------------------------- 1 | import * as baileys from '@whiskeysockets/baileys'; 2 | 3 | let handler = async (m, { conn, text }) => { 4 | let [, code] = text.match(/chat\.whatsapp\.com\/(?:invite\/)?([0-9A-Za-z]{20,24})/i) || []; 5 | if (!code) throw '*[❗INFO❗] Please provide a valid group link.*'; 6 | 7 | let res = await conn.query({ tag: 'iq', attrs: { type: 'get', xmlns: 'w:g2', to: '@g.us' }, content: [{ tag: 'invite', attrs: { code } }] }); 8 | let data = extractGroupMetadata(res); 9 | let txt = Object.keys(data).map(v => `*${v.capitalize()}:* ${data[v]}`).join('\n'); 10 | 11 | let pp = await conn.profilePictureUrl(data.id, 'image').catch(console.error); 12 | if (pp) { 13 | return conn.sendMessage(m.chat, { image: { url: pp }, caption: txt }, { quoted: m }); 14 | } else { 15 | let groupinfo = `❖ ID: ${data.id}\n❖ Name: ${data.subject}\n❖ Created on: ${data.creation}\n❖ Owner: ${data.owner}\n❖ Description:\n${data.desc}`; 16 | await conn.reply(m.chat, groupinfo, m); 17 | } 18 | }; 19 | 20 | handler.command = /^(inspect)$/i; 21 | 22 | export default handler; 23 | 24 | const extractGroupMetadata = (result) => { 25 | const group = baileys.getBinaryNodeChild(result, 'group'); 26 | const descChild = baileys.getBinaryNodeChild(group, 'description'); 27 | let desc; 28 | if (descChild) desc = baileys.getBinaryNodeChild(descChild, 'body')?.content; 29 | 30 | const metadata = { 31 | id: group.attrs.id.includes('@') ? group.attrs.id : baileys.jidEncode(group.attrs.id, 'g.us'), 32 | subject: group.attrs.subject, 33 | creation: new Date(+group.attrs.creation * 1000).toLocaleString('id', { timeZone: 'Asia/Jakarta' }), 34 | owner: group.attrs.creator ? 'wa.me/' + baileys.jidNormalizedUser(group.attrs.creator).split('@')[0] : 35 | group.attrs.id.includes('-') ? 'wa.me/' + group.attrs.id.split('-')[0] : '', 36 | desc 37 | }; 38 | 39 | return metadata; 40 | }; 41 | -------------------------------------------------------------------------------- /lib/gdrive.js: -------------------------------------------------------------------------------- 1 | import { join } from 'path' 2 | import { promises as fs } from 'fs' 3 | import { promisify } from 'util' 4 | import { google } from 'googleapis' 5 | 6 | 7 | // If modifying these scopes, delete token.json. 8 | const SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly'] 9 | // The file token.json stores the user's access and refresh tokens, and is 10 | // created automatically when the authorization flow completes for the first 11 | // time. 12 | const TOKEN_PATH = join(__dirname, '..', 'token.json') 13 | 14 | class GoogleAuth extends EventEmitter { 15 | constructor() { 16 | super() 17 | } 18 | 19 | async authorize(credentials) { 20 | let token 21 | const { client_secret, client_id } = credentials 22 | const oAuth2Client = new google.auth.OAuth2(client_id, client_secret, `http://localhost:${port}`) 23 | try { 24 | token = JSON.parse(await fs.readFile(TOKEN_PATH)) 25 | } catch (e) { 26 | const authUrl = oAuth2Client.generateAuthUrl({ 27 | access_type: 'offline', 28 | scope: SCOPES 29 | }) 30 | this.emit('auth', authUrl) 31 | let code = await promisify(this.once).bind(this)('token') 32 | token = await oAuth2Client.getToken(code) 33 | await fs.writeFile(TOKEN_PATH, JSON.stringify(token)) 34 | } finally { 35 | await oAuth2Client.setCredentials(token) 36 | } 37 | } 38 | 39 | token(code) { 40 | this.emit('token', code) 41 | } 42 | } 43 | 44 | class GoogleDrive extends GoogleAuth { 45 | constructor() { 46 | super() 47 | this.path = '/drive/api' 48 | } 49 | 50 | async getFolderID(path) { 51 | 52 | } 53 | 54 | async infoFile(path) { 55 | 56 | } 57 | 58 | async folderList(path) { 59 | 60 | } 61 | 62 | async downloadFile(path) { 63 | 64 | } 65 | 66 | async uploadFile(path) { 67 | 68 | } 69 | } 70 | 71 | export { 72 | GoogleAuth, 73 | GoogleDrive, 74 | } 75 | -------------------------------------------------------------------------------- /plugins/gp-gctime.js: -------------------------------------------------------------------------------- 1 | const handler = async (m, {conn, isAdmin, isOwner, args, usedPrefix, command}) => { 2 | if (!(isAdmin || isOwner)) { 3 | global.dfail('admin', m, conn); 4 | throw false; 5 | } 6 | const isClose = {'open': 'not_announcement', 7 | 'buka': 'not_announcement', 8 | 'on': 'not_announcement', 9 | '1': 'not_announcement', 10 | 'close': 'announcement', 11 | 'tutup': 'announcement', 12 | 'off': 'announcement', 13 | '0': 'announcement', 14 | }[(args[0] || '')]; 15 | 16 | if (isClose === undefined) { 17 | const caption = `*• Example:*\n${usedPrefix + command} open 1\n${usedPrefix + command} close 1\n\n*• Usage example:* ${usedPrefix + command} close 1\n\n> *_🌿 To keep the group closed for one hour._*`; 18 | m.reply(caption); 19 | throw false; 20 | } 21 | const timeoutset = 86400000 * args[1] / 24; 22 | await conn.groupSettingUpdate(m.chat, isClose).then(async (_)=> { 23 | m.reply(`⚠️ *_Group ${isClose == 'announcement' ? 'closed' : 'open'} ${args[1] ? `for *${clockString(timeoutset)}_*` : ''}`)}); 24 | if (args[1]) { 25 | setTimeout(async () => { 26 | await conn.groupSettingUpdate(m.chat, `${isClose == 'announcement' ? 'not_announcement' : 'announcement'}`).then(async (_)=>{ 27 | conn.reply(m.chat, `${isClose == 'not_announcement' ? '*The group has been closed, now only admins can send messages!*' : '*The group has been opened, now all members can send messages!*'}!`); 28 | })}, timeoutset)}}; 29 | handler.help = ['grouptime ** **']; 30 | handler.tags = ['group']; 31 | handler.command = /^(grouptime|gctime)$/i; 32 | handler.register = true 33 | handler.botAdmin = true; 34 | handler.group = true; 35 | 36 | export default handler; 37 | 38 | function clockString(ms) { 39 | const h = Math.floor(ms / 3600000); 40 | const m = Math.floor(ms / 60000) % 60; 41 | const s = Math.floor(ms / 1000) % 60; 42 | console.log({ms, h, m, s}); 43 | return [h, m, s].map((v) => v.toString().padStart(2, 0) ).join(':'); 44 | } 45 | -------------------------------------------------------------------------------- /lib/database.js: -------------------------------------------------------------------------------- 1 | import { resolve, dirname as _dirname } from 'path' 2 | import _fs, { existsSync, readFileSync } from 'fs' 3 | const { promises: fs } = _fs 4 | 5 | class Database { 6 | /** 7 | * Create new Database 8 | * @param {String} filepath Path to specified json database 9 | * @param {...any} args JSON.stringify arguments 10 | */ 11 | constructor(filepath, ...args) { 12 | this.file = resolve(filepath) 13 | this.logger = console 14 | 15 | this._load() 16 | 17 | this._jsonargs = args 18 | this._state = false 19 | this._queue = [] 20 | this._interval = setInterval(async () => { 21 | if (!this._state && this._queue && this._queue[0]) { 22 | this._state = true 23 | await this[this._queue.shift()]().catch(this.logger.error) 24 | this._state = false 25 | } 26 | }, 1000) 27 | 28 | } 29 | 30 | get data() { 31 | return this._data 32 | } 33 | 34 | set data(value) { 35 | this._data = value 36 | this.save() 37 | } 38 | 39 | /** 40 | * Queue Load 41 | */ 42 | load() { 43 | this._queue.push('_load') 44 | } 45 | 46 | /** 47 | * Queue Save 48 | */ 49 | save() { 50 | this._queue.push('_save') 51 | } 52 | 53 | _load() { 54 | try { 55 | return this._data = existsSync(this.file) ? JSON.parse(readFileSync(this.file)) : {} 56 | } catch (e) { 57 | this.logger.error(e) 58 | return this._data = {} 59 | } 60 | } 61 | 62 | async _save() { 63 | let dirname = _dirname(this.file) 64 | if (!existsSync(dirname)) await fs.mkdir(dirname, { recursive: true }) 65 | await fs.writeFile(this.file, JSON.stringify(this._data, ...this._jsonargs)) 66 | return this.file 67 | } 68 | } 69 | 70 | export default Database 71 | 72 | -------------------------------------------------------------------------------- /lib/uploadFile.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | import { FormData, Blob } from 'formdata-node' 3 | import { fileTypeFromBuffer } from 'file-type' 4 | /** 5 | * Upload epheremal file to file.io 6 | * `Expired in 1 day` 7 | * `100MB Max Filesize` 8 | * @param {Buffer} buffer File Buffer 9 | */ 10 | const fileIO = async buffer => { 11 | const { ext, mime } = await fileTypeFromBuffer(buffer) || {} 12 | let form = new FormData() 13 | const blob = new Blob([buffer.toArrayBuffer()], { type: mime }) 14 | form.append('file', blob, 'tmp.' + ext) 15 | let res = await fetch('https://file.io/?expires=1d', { // 1 Day Expiry Date 16 | method: 'POST', 17 | body: form 18 | }) 19 | let json = await res.json() 20 | if (!json.success) throw json 21 | return json.link 22 | } 23 | 24 | /** 25 | * Upload file to storage.restfulapi.my.id 26 | * @param {Buffer|ReadableStream|(Buffer|ReadableStream)[]} inp File Buffer/Stream or Array of them 27 | * @returns {string|null|(string|null)[]} 28 | */ 29 | const RESTfulAPI = async inp => { 30 | let form = new FormData() 31 | let buffers = inp 32 | if (!Array.isArray(inp)) buffers = [inp] 33 | for (let buffer of buffers) { 34 | const blob = new Blob([buffer.toArrayBuffer()]) 35 | form.append('file', blob) 36 | } 37 | let res = await fetch('https://storage.restfulapi.my.id/upload', { 38 | method: 'POST', 39 | body: form 40 | }) 41 | let json = await res.text() 42 | try { 43 | json = JSON.parse(json) 44 | if (!Array.isArray(inp)) return json.files[0].url 45 | return json.files.map(res => res.url) 46 | } catch (e) { 47 | throw json 48 | } 49 | } 50 | 51 | /** 52 | * 53 | * @param {Buffer} inp 54 | * @returns {Promise} 55 | */ 56 | export default async function (inp) { 57 | let err = false 58 | for (let upload of [RESTfulAPI, fileIO]) { 59 | try { 60 | return await upload(inp) 61 | } catch (e) { 62 | err = e 63 | } 64 | } 65 | if (err) throw err 66 | } -------------------------------------------------------------------------------- /plugins/rg-register.js: -------------------------------------------------------------------------------- 1 | import { createHash } from 'crypto'; 2 | let Reg = /\|?(.*)([.|] *?)([0-9]*)$/i; 3 | let handler = async function (m, { conn, text, usedPrefix, command }) { 4 | let user = global.db.data.users[m.sender]; 5 | let name2 = conn.getName(m.sender); 6 | 7 | // ✋ Prevent duplicate registrations 8 | if (user.registered === true) throw `✳️ You're already registered! 9 | 10 | Want to re-register? 11 | 12 | 📌 Use this command to remove your registration: 13 | *${usedPrefix}unreg* `; 14 | 15 | // ⚠️ Validate input format 16 | if (!Reg.test(text)) throw `⚠️ Invalid format! 17 | 18 | ✳️ Use the command like this: 19 | *${usedPrefix + command} name.age* 20 | 21 | 📌 Example: *${usedPrefix + command}* ${name2}.22`; 22 | 23 | // 📋 Extract and validate name and age 24 | let [_, name, splitter, age] = text.match(Reg); 25 | if (!name) throw '✳️ Name cannot be empty!'; 26 | if (!age) throw '✳️ Age cannot be empty!'; 27 | if (name.length >= 30) throw '✳️ Name is too long!'; 28 | 29 | // 👶 Age validation 30 | age = parseInt(age); 31 | if (age > 100) throw '👴 Wow, Grandpa wants to play with the bot!'; 32 | if (age < 5) throw '🚼 Baby Grandpa wants to register!'; 33 | 34 | // 💾 Save user details 35 | user.name = name.trim(); 36 | user.age = age; 37 | user.regTime = +new Date(); 38 | user.registered = true; 39 | let sn = createHash('md5').update(m.sender).digest('hex'); 40 | 41 | // 📜 Reply with registration details 42 | m.reply(` 43 | ╭◉ *🌟 REGISTERED 🌟*• 44 | ╠ ○ *Name:* ${name} 45 | ╠ ○ *Age:* ${age} years 46 | ╠ ○ *Serial Number:* 47 | ╠ ○ ${sn} 48 | ╚• 49 | 50 | 📌 Use *${usedPrefix}help* to view the menu! 51 | `.trim()); 52 | }; 53 | 54 | handler.help = ['reg', 'register'].map(v => v + ' '); 55 | handler.tags = ['rg']; 56 | handler.command = ['verify', 'reg', 'register', 'registrar']; 57 | 58 | export default handler; 59 | -------------------------------------------------------------------------------- /plugins/tools-movie.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let imdbHandler = async (m, { conn, text }) => { 4 | if (!text) throw 'Please provide a movie title'; 5 | 6 | try { 7 | let res = await fetch(`https://api.popcat.xyz/imdb?q=${encodeURIComponent(text)}`); 8 | 9 | if (!res.ok) { 10 | throw new Error(`API request failed with status ${res.status}`); 11 | } 12 | 13 | let json = await res.json(); 14 | 15 | console.log('JSON response:', json); 16 | 17 | let ratings = json.ratings.map(rating => `• *${rating.source}:* ${rating.value}`).join('\n'); 18 | 19 | let movieInfo = 20 | `*Movie Information:*\n 21 | • *Title:* ${json.title}\n 22 | • *Year:* ${json.year}\n 23 | • *Seasons:* ${json.totalseasons}\n 24 | • *Rated:* ${json.rated}\n 25 | • *Released:* ${json.released}\n 26 | • *Runtime:* ${json.runtime}\n 27 | • *Genres:* ${json.genres}\n 28 | • *Director:* ${json.director}\n 29 | • *Writer:* ${json.writer}\n 30 | • *Actors:* ${json.actors}\n 31 | • *Plot:* ${json.plot}\n 32 | • *Languages:* ${json.languages}\n 33 | • *Country:* ${json.country}\n 34 | • *Awards:* ${json.awards}\n 35 | • *Metascore:* ${json.metascore}\n 36 | • *Rating:* ${json.rating}\n 37 | • *Votes:* ${json.votes}\n 38 | • *IMDB ID:* ${json.imdbid}\n 39 | • *Type:* ${json.type}\n 40 | • *DVD:* ${json.dvd}\n 41 | • *Box Office:* ${json.boxoffice}\n 42 | • *Production:* ${json.production}\n 43 | • *Website:* ${json.website}\n\n 44 | *Ratings:*\n${ratings}`; 45 | 46 | // send the movie poster along with the movie information as caption 47 | await conn.sendFile(m.chat, json.poster, 'poster.jpg', movieInfo, m); 48 | } catch (error) { 49 | console.error(error); 50 | // Handle the error appropriately 51 | } 52 | }; 53 | 54 | imdbHandler.help = ['imdb']; 55 | imdbHandler.tags = ['tools']; 56 | imdbHandler.command = /^(imdb|movie)$/i; 57 | 58 | export default imdbHandler; 59 | -------------------------------------------------------------------------------- /plugins/owner-getfile.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import syntaxError from 'syntax-error' 3 | import path from 'path' 4 | 5 | const _fs = fs.promises 6 | 7 | let handler = async (m, { text, usedPrefix, command, __dirname }) => { 8 | if (!text) throw ` 9 | ✳️ user : ${usedPrefix + command} 10 | 11 | 📌 Example: 12 | ${usedPrefix}getfile main.js 13 | ${usedPrefix}getplugin owner 14 | `.trim() 15 | if (/p(lugin)?/i.test(command)) { 16 | const filename = text.replace(/plugin(s)\//i, '') + (/\.js$/i.test(text) ? '' : '.js') 17 | const pathFile = path.join(__dirname, filename) 18 | const file = await _fs.readFile(pathFile, 'utf8') 19 | m.reply(file) 20 | const error = syntaxError(file, filename, { 21 | sourceType: 'module', 22 | allowReturnOutsideFunction: true, 23 | allowAwaitOutsideFunction: true 24 | }) 25 | if (error) { 26 | await m.reply(` 27 | ❎ bug found in *${filename}*: 28 | 29 | ${error} 30 | 31 | `.trim()) 32 | } 33 | 34 | } else { 35 | const isJavascript = /\.js/.test(text) 36 | if (isJavascript) { 37 | const file = await _fs.readFile(text, 'utf8') 38 | m.reply(file) 39 | const error = syntaxError(file, text, { 40 | sourceType: 'module', 41 | allowReturnOutsideFunction: true, 42 | allowAwaitOutsideFunction: true 43 | }) 44 | if (error) { 45 | await m.reply(` 46 | ❎ bug found in *${text}*: 47 | 48 | ${error} 49 | 50 | `.trim()) 51 | } 52 | } else { 53 | const file = await _fs.readFile(text, 'base64') 54 | await m.reply(Buffer.from(file, 'base64')) 55 | } 56 | } 57 | } 58 | handler.help = ['plugin', 'file'].map(v => `get${v} `) 59 | handler.tags = ['owner'] 60 | handler.command = /^g(et)?(p(lugin)?|f(ile)?)$/i 61 | 62 | handler.rowner = true 63 | 64 | export default handler 65 | -------------------------------------------------------------------------------- /plugins/dl-mega.js: -------------------------------------------------------------------------------- 1 | import { File } from "megajs"; 2 | import path from "path"; 3 | 4 | let handler = async (m, { conn, args, usedPrefix, text, command }) => { 5 | try { 6 | if (!text) return m.reply(`${usedPrefix + command} https://mega.nz/file/ovJTHaQZ#yAbkrvQgykcH_NDKQ8eIc0zvsN7jonBbHZ_HTQL6lZ8`); 7 | 8 | const file = File.fromURL(text); 9 | await file.loadAttributes(); 10 | 11 | if (file.size >= 300000000) return m.reply('Error: File size is too large (Maximum Size: 300MB)'); 12 | 13 | const downloadingMessage = `🌩️ Downloading file... Please wait.`; 14 | m.reply(downloadingMessage); 15 | 16 | const caption = `*_Successfully downloaded..._*\nFile: ${file.name}\nSize: ${formatBytes(file.size)}`; 17 | 18 | const data = await file.downloadBuffer(); 19 | 20 | const fileExtension = path.extname(file.name).toLowerCase(); 21 | const mimeTypes = { 22 | ".mp4": "video/mp4", 23 | ".pdf": "application/pdf", 24 | ".zip": "application/zip", 25 | ".rar": "application/x-rar-compressed", 26 | ".7z": "application/x-7z-compressed", 27 | ".jpg": "image/jpeg", 28 | ".jpeg": "image/jpeg", 29 | ".png": "image/png", 30 | }; 31 | 32 | let mimetype = mimeTypes[fileExtension] || "application/octet-stream"; 33 | 34 | await conn.sendFile(m.chat, data, file.name, caption, m, null, { mimetype, asDocument: true }); 35 | 36 | } catch (error) { 37 | return m.reply(`Error: ${error.message}`); 38 | } 39 | } 40 | 41 | handler.help = ["mega"] 42 | handler.tags = ["downloader"] 43 | handler.command = /^(mega)$/i 44 | export default handler 45 | 46 | function formatBytes(bytes) { 47 | if (bytes === 0) return '0 Bytes'; 48 | 49 | const k = 1024; 50 | const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; 51 | const i = Math.floor(Math.log(bytes) / Math.log(k)); 52 | 53 | return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; 54 | } 55 | -------------------------------------------------------------------------------- /plugins/dl-tiktok.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | let handler = async (m, { conn, args, usedPrefix, command }) => { 4 | if (!args[0]) throw `✳️ Past your tiktok video url here:\n *${usedPrefix + command}* tiktok url here...`; 5 | m.react('⏳'); 6 | 7 | try { 8 | let res = await fetch(`https://api.apigratis.tech/downloader/tiktok?url=${encodeURIComponent(args[0])}`); 9 | if (!res.ok) throw `❎ Failed to fetch content details. Please try again later.`; 10 | 11 | let data = await res.json(); 12 | if (!data.status || !data.result) throw `❎ Failed to process content.`; 13 | 14 | let result = data.result; 15 | 16 | if (result.type === 'video') { 17 | 18 | let videoUrl = result.download.original || result.download.watermark; 19 | if (!videoUrl) throw `❎ Video URL not found.`; 20 | 21 | 22 | await conn.sendFile(m.chat, videoUrl, 'tiktok.mp4', '', m); 23 | } else if (result.type === 'image') { 24 | 25 | let images = result.download.images; 26 | let audioUrl = result.download.music; 27 | 28 | if (images && images.length > 0) { 29 | 30 | for (let img of images) { 31 | await conn.sendFile(m.chat, img, 'tiktok_image.jpg', '', m); 32 | } 33 | } else { 34 | throw `❎ No images found in the post.`; 35 | } 36 | 37 | 38 | if (audioUrl) { 39 | await conn.sendFile(m.chat, audioUrl, 'tiktok_audio.mp3', '', m); 40 | } 41 | } else { 42 | throw `❎ Unsupported content type.`; 43 | } 44 | 45 | m.react('✅'); 46 | } catch (error) { 47 | console.error(error); 48 | m.reply(`❎ Error: Unable to download content. Please check the link or try again later.`); 49 | m.react('❌'); 50 | } 51 | }; 52 | 53 | handler.help = ['tiktok2 ']; 54 | handler.tags = ['downloader']; 55 | handler.command = ['tiktok2', 'tk2', 'ttdl2', 'tt2']; 56 | 57 | export default handler; 58 | -------------------------------------------------------------------------------- /plugins/dl-gdrive.js: -------------------------------------------------------------------------------- 1 | import fg from 'api-dylux'; 2 | 3 | let handler = async (m, { conn, args, usedPrefix, command }) => { 4 | if (!args[0]) throw `✨ *Enter a valid Google Drive link!* ✨`; 5 | m.react(rwait); 6 | 7 | try { 8 | let res = await fg.GDriveDl(args[0]); 9 | let fileName = res.fileName; 10 | let downloadUrl = res.downloadUrl; 11 | let fileSize = res.fileSize; 12 | let mimetype = res.mimetype; 13 | 14 | // Infer MIME type based on file extension if it's invalid or missing 15 | if (!mimetype || mimetype === 'application/octet-stream') { 16 | const extension = fileName.split('.').pop().toLowerCase(); 17 | const mimeTypes = { 18 | pdf: 'application/pdf', 19 | doc: 'application/msword', 20 | docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 21 | xls: 'application/vnd.ms-excel', 22 | xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 23 | txt: 'text/plain', 24 | jpg: 'image/jpeg', 25 | png: 'image/png', 26 | zip: 'application/zip', 27 | rar: 'application/vnd.rar', 28 | }; 29 | 30 | mimetype = mimeTypes[extension] || 'application/octet-stream'; // Default to BIN type if unknown 31 | } 32 | 33 | // Fancy reply with emojis and bold font 34 | await m.reply(` 35 | 🎯 *Google Drive File Details:* 36 | 37 | 📝 *File Name:* *${fileName}* 38 | 📦 *File Size:* *${fileSize}* 39 | 📂 *File Type:* *${mimetype}* 40 | 41 | ⏬ _Sending your file now..._ ⏬ 42 | `); 43 | 44 | // Send the file 45 | conn.sendMessage(m.chat, { 46 | document: { url: downloadUrl }, 47 | fileName, 48 | mimetype, 49 | }, { quoted: m }); 50 | 51 | m.react(done); 52 | 53 | } catch (e) { 54 | console.error(e); 55 | m.reply('⚠️ *Error:* Check the link or try another link!'); 56 | } 57 | }; 58 | 59 | handler.help = ['gdrive']; 60 | handler.tags = ['downloader']; 61 | handler.command = ['drive', 'gdrive']; 62 | handler.credit = false; 63 | handler.premium = false; 64 | 65 | export default handler; 66 | -------------------------------------------------------------------------------- /plugins/game-ppt.js: -------------------------------------------------------------------------------- 1 | //import db from '../lib/database.js' 2 | 3 | let handler = async (m, { conn, text, usedPrefix, command }) => { 4 | let poin = 300 5 | let reseqv = `✳️ Select rock/paper/scissors\n\nExample : *${usedPrefix + command}* paper\n` 6 | if (!text) throw reseqv 7 | var astro = Math.random() 8 | 9 | if (astro < 0.34) { 10 | astro = 'rock' 11 | } else if (astro > 0.34 && astro < 0.67) { 12 | astro = 'scissors' 13 | } else { 14 | astro = 'paper' 15 | } 16 | 17 | 18 | if (text == astro) { 19 | global.db.data.users[m.sender].exp += 100 20 | m.reply(`▢ *A tie*\n\n‣ You : ${text}\n‣ Guru : ${astro}\n\n🎁 Points (±)100 XP`) 21 | } else if (text == 'rock') { 22 | if (astro == 'scissors') { 23 | global.db.data.users[m.sender].exp += 300 24 | m.reply(`▢ *Won* 🎊\n\n‣ You : ${text}\n‣ GURU : ${astro}\n\n🎁 Points *+${poin} XP*`) 25 | } else { 26 | global.db.data.users[m.sender].exp -= 300 27 | m.reply(`▢ *lost*\n\n‣ You : ${text}\n‣ GURU : ${astro}\n\n Points *-${poin} XP*`) 28 | } 29 | } else if (text == 'scissors') { 30 | if (astro == 'paper') { 31 | global.db.data.users[m.sender].exp += 300 32 | m.reply(`▢ *won* 🎊\n\n‣ You : ${text}\n‣ GURU : ${astro}\n\n🎁 Points *+${poin} XP*`) 33 | } else { 34 | global.db.data.users[m.sender].exp -= 300 35 | m.reply(`▢ *lost*\n\n‣ You : ${text}\n‣ GURU : ${astro}\n\nPoints *-${poin} XP*`) 36 | } 37 | } else if (text == 'paper') { 38 | if (astro == 'rock') { 39 | global.db.data.users[m.sender].exp += 300 40 | m.reply(`▢ *won* 🎊\n\n‣ You : ${text}\n‣ GURU : ${astro}\n\n🎁 Points *+${poin} XP*`) 41 | } else { 42 | global.db.data.users[m.sender].exp -= 300 43 | m.reply(`▢ *You lost*\n\n‣ You : ${text}\n‣ GURU : ${astro}\n\nPoints *-${poin} XP*`) 44 | } 45 | } else { 46 | throw reseqv 47 | } 48 | } 49 | handler.help = ['ppt '] 50 | handler.tags = ['game'] 51 | handler.command = ['ppt'] 52 | handler.register = false 53 | 54 | export default handler 55 | -------------------------------------------------------------------------------- /plugins/gp-warning.js: -------------------------------------------------------------------------------- 1 | let war = global.maxwarn; 2 | let handler = async (m, { conn, text, args, groupMetadata, usedPrefix, command }) => { 3 | let who; 4 | if (m.isGroup) { 5 | who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false; 6 | } else { 7 | who = m.chat; 8 | } 9 | if (!who) throw `⚠️ *Tag or mention someone!*\n\n💡 *Example:* ${usedPrefix + command} @user`; 10 | 11 | if (!(who in global.db.data.users)) throw `⚠️ *User not found in the database!*`; 12 | 13 | let name = conn.getName(m.sender); 14 | let warn = global.db.data.users[who].warn; 15 | 16 | if (warn < war) { 17 | global.db.data.users[who].warn += 1; 18 | 19 | m.reply(` 20 | ╔══════════════════╗ 21 | 🚨 *Warning Issued* 🚨 22 | ╚══════════════════╝ 23 | 24 | 👮‍♂️ *Admin:* ${name} 25 | 👤 *User:* @${who.split`@`[0]} 26 | ⚠️ *Warns:* ${warn + 1}/${war} 27 | 📝 *Reason:* ${text || "No reason provided"} 28 | 29 | 📩 *Check your inbox for detailed warning information!* 30 | `, null, { mentions: [who] }); 31 | 32 | m.reply(` 33 | ⚠️ *Caution! ⚠️* 34 | You have received a warning from the admin. 35 | 36 | 🔢 *Warns:* ${warn + 1}/${war} 37 | 💀 If you receive *${war}* warnings, you will be removed from the group. 38 | `, who); 39 | } else if (warn == war) { 40 | global.db.data.users[who].warn = 0; 41 | 42 | m.reply(` 43 | ⛔ *Warning Limit Exceeded!* 44 | The user has reached the maximum warning limit of *${war}*. They will now be removed from the group. 45 | `); 46 | 47 | await time(3000); // Wait for 3 seconds 48 | await conn.groupParticipantsUpdate(m.chat, [who], 'remove'); 49 | 50 | m.reply(` 51 | ♻️ You were removed from the group *${groupMetadata.subject}* because you were warned *${war}* times. 52 | `, who); 53 | } 54 | }; 55 | 56 | handler.help = ['warn @user']; 57 | handler.tags = ['group']; 58 | handler.command = ['warn']; 59 | handler.group = true; 60 | handler.admin = true; 61 | handler.botAdmin = true; 62 | 63 | export default handler; 64 | 65 | const time = async (ms) => { 66 | return new Promise(resolve => setTimeout(resolve, ms)); 67 | }; 68 | -------------------------------------------------------------------------------- /plugins/savestatus.js: -------------------------------------------------------------------------------- 1 | const _0x1dea99=_0x21d3;function _0x21d3(_0x900a08,_0x20863){const _0x1939dd=_0x1506();_0x21d3=function(_0x5a26b1,_0x599e58){_0x5a26b1=_0x5a26b1-(0x10a9+0x915+-0x18f0);let _0x9a46d1=_0x1939dd[_0x5a26b1];return _0x9a46d1;};return _0x21d3(_0x900a08,_0x20863);}(function(_0x18e25d,_0x6c176b){const _0x167688=_0x21d3;const _0x2c903b=_0x18e25d();while(!![]){try{const _0x45c38a=parseInt(_0x167688(0xd0))/(-0x31*-0x7+-0x1e01+0x1cab)+-parseInt(_0x167688(0xe1))/(-0x2261*-0x1+-0x236+-0x2029)+parseInt(_0x167688(0xd7))/(-0x1*-0x1505+-0x4*-0x317+-0x215e)+-parseInt(_0x167688(0xdc))/(0x1447+-0x12d0+0x7*-0x35)*(parseInt(_0x167688(0xce))/(0x1*-0x4ef+0x18a2+-0x13ae))+parseInt(_0x167688(0xdf))/(-0x26ad+0xb1e*-0x1+0x31d1)+-parseInt(_0x167688(0xdd))/(-0xd9*-0xf+0x281*-0x6+0x256)+-parseInt(_0x167688(0xd8))/(0x1*0x1ea1+0x124b+-0x12a*0x2a);if(_0x45c38a===_0x6c176b){break;}else{_0x2c903b['push'](_0x2c903b['shift']());}}catch(_0x151055){_0x2c903b['push'](_0x2c903b['shift']());}}}(_0x1506,-0x55fa1+0x22d42*-0x1+0x45*0x2f81));const handler=async(_0x5a3051,{conn:_0x3875c0})=>{const _0xba2b19=_0x21d3;const _0x47ad19={};_0x47ad19[_0xba2b19(0xe2)]=_0xba2b19(0xd4);_0x47ad19['ReDsr']=_0xba2b19(0xd1);const _0x233d28=_0x47ad19;if(_0x233d28['HEqDv']!=_0x5a3051[_0xba2b19(0xd5)]?.[_0xba2b19(0xda)])return _0x3875c0['reply'](_0x5a3051['chat'],_0x233d28[_0xba2b19(0xd3)],_0x5a3051);try{let _0x154e43=await _0x5a3051[_0xba2b19(0xd5)]?.[_0xba2b19(0xd2)]();await _0x3875c0[_0xba2b19(0xe0)](_0x5a3051[_0xba2b19(0xda)],_0x154e43,'',_0x5a3051[_0xba2b19(0xd5)]?.[_0xba2b19(0xd9)]||'',null,![],{'quoted':_0x5a3051});}catch(_0x11ed52){console[_0xba2b19(0xde)](_0x11ed52);await _0x3875c0['reply'](_0x5a3051[_0xba2b19(0xda)],_0x5a3051[_0xba2b19(0xd5)]?.[_0xba2b19(0xd9)],_0x5a3051);}};handler[_0x1dea99(0xd6)]=[_0x1dea99(0xcf),'sw',_0x1dea99(0xdb)];function _0x1506(){const _0x13f4a6=['208272hUwSnO','*Please\x20reply\x20to\x20a\x20WhatsApp\x20status\x20to\x20download\x20its\x20content*','download','ReDsr','status@broadcast','quoted','command','1118208pwWFsO','910448JsEoUg','text','chat','save','4MsXNyp','1575343mqGPKu','log','3567642NpiOmG','sendFile','7108vMPsHT','HEqDv','2444580qQGDsM','status'];_0x1506=function(){return _0x13f4a6;};return _0x1506();}export default handler; 2 | -------------------------------------------------------------------------------- /plugins/main-creator.js: -------------------------------------------------------------------------------- 1 | const _0x4b757a=_0x5a89;(function(_0x59214f,_0x369d8b){const _0x44d0a7=_0x5a89;const _0x4132c7=_0x59214f();while(!![]){try{const _0x282ced=-parseInt(_0x44d0a7(0x119))/(-0x2486+-0xd3*0xa+0x2cc5*0x1)*(-parseInt(_0x44d0a7(0x117))/(-0xddd+0x1*-0x844+0x1623))+parseInt(_0x44d0a7(0x121))/(-0x1c56+-0x10a4+0xb*0x417)*(-parseInt(_0x44d0a7(0x10e))/(-0x18c2+-0x1*-0x1b19+-0x253))+parseInt(_0x44d0a7(0x111))/(0x1ab7+0x7*-0x49e+0x5a0)*(-parseInt(_0x44d0a7(0x115))/(0x328*0x5+0x92a+0xb*-0x244))+parseInt(_0x44d0a7(0x113))/(-0x1*0xbd7+-0x10dc+0x1cba)*(parseInt(_0x44d0a7(0x11b))/(0x17cc+-0x7ee+-0xfd6*0x1))+-parseInt(_0x44d0a7(0x123))/(-0x6b6*0x4+-0x14a4+0x2f85)+parseInt(_0x44d0a7(0x118))/(0x7*0x5f+-0x145e+0x11cf)*(-parseInt(_0x44d0a7(0x11e))/(0xfc5+-0x1021+-0x67*-0x1))+-parseInt(_0x44d0a7(0x110))/(-0x9*0x15+-0x578+0x1*0x641)*(-parseInt(_0x44d0a7(0x112))/(-0x326*0x3+-0x1866+0x21e5));if(_0x282ced===_0x369d8b){break;}else{_0x4132c7['push'](_0x4132c7['shift']());}}catch(_0xbb3606){_0x4132c7['push'](_0x4132c7['shift']());}}}(_0x17f3,-0x1*0x55748+-0x50a4*-0x2b+0x1*0x3dacb));function handler(_0x3f3257){const _0x5c11af=_0x5a89;const _0x321605=global[_0x5c11af(0x126)][_0x5c11af(0x11c)](([_0x51dcd5,_0x4bd924])=>[_0x51dcd5,_0x4bd924||'Unknown',_0x51dcd5,_0x5c11af(0x114),_0x5c11af(0x127),_0x5c11af(0x10f)]);console[_0x5c11af(0x11f)](_0x5c11af(0x125),_0x321605);this['sendContact'](_0x3f3257[_0x5c11af(0x120)],_0x321605,_0x3f3257);}function _0x5a89(_0x318fff,_0x179192){const _0x3904ac=_0x17f3();_0x5a89=function(_0x30956c,_0x2e40ba){_0x30956c=_0x30956c-(0x21cb+-0x3*-0x34a+-0x2a9b);let _0x54f88f=_0x3904ac[_0x30956c];return _0x54f88f;};return _0x5a89(_0x318fff,_0x179192);}handler[_0x4b757a(0x11d)]=['owner'];function _0x17f3(){const _0x5950ae=['creator','12314151xwSgkP','command','Sending\x20Contacts:','owner','https://github.com/DASTAGHIR/PRINCEAI','33724YoZlld','💫OWNER\x20NUMBER','2143128kuVqRM','1406800ubaOaT','338eJRKlY','35jtizva','princegds333@yahoo.com','12FngbWA','main','425998GQkEBy','20OKYkJE','3dyAVRp','tags','748168zjESmQ','map','help','8126228LgKgls','log','chat','552mEQYIs'];_0x17f3=function(){return _0x5950ae;};return _0x17f3();}handler[_0x4b757a(0x11a)]=[_0x4b757a(0x116)];handler[_0x4b757a(0x124)]=[_0x4b757a(0x126),_0x4b757a(0x122)];export default handler; 2 | -------------------------------------------------------------------------------- /plugins/tools-google.js: -------------------------------------------------------------------------------- 1 | import google from 'google-it'; 2 | import axios from 'axios'; 3 | 4 | let handler = async (m, { conn, command, args, usedPrefix }) => { 5 | const fetch = (await import('node-fetch')).default; 6 | const text = args.join` `; 7 | if (!text) return m.reply(`⚠️ What are you searching for? 🤔 Please type what you want to search for.\n• Example: ${usedPrefix + command} cats`); 8 | m.react("⌛"); 9 | 10 | try { 11 | const res = await fetch(`https://api.example.com/search/googlesearch?query=${encodeURIComponent(text)}`); 12 | const data = await res.json(); 13 | 14 | if (data.status && data.data && data.data.length > 0) { 15 | let resultText = `🔍 *Search Results for:* ${text}\n\n`; 16 | for (let result of data.data.slice(0, 5)) { // Limiting to 5 results 17 | resultText += `*${result.title}*\n_${result.url}_\n_${result.description}_\nWebsite Link: _${result.website}_\n\n─────────────────\n\n`; 18 | } 19 | 20 | const screenshot = `https://image.thum.io/get/fullpage/https://google.com/search?q=${encodeURIComponent(text)}`; 21 | conn.sendFile(m.chat, screenshot, 'result.png', resultText, m, false); 22 | m.react("✅"); 23 | handler.limit = 1; 24 | } 25 | } catch (error) { 26 | try { 27 | const url = 'https://google.com/search?q=' + encodeURIComponent(text); 28 | google({ query: text }).then(results => { 29 | let resultText = `🔍 *Search Results for:* ${text}\n\n*${url}*\n\n`; 30 | for (let g of results.slice(0, 5)) { // Limiting to 5 results 31 | resultText += `_${g.title}_\n_${g.link}_\n_${g.snippet}_\nWebsite Link: _${g.link}_\n\n─────────────────\n\n`; 32 | } 33 | const screenshot = `https://image.thum.io/get/fullpage/${url}`; 34 | conn.sendFile(m.chat, screenshot, 'error.png', resultText, m, false); 35 | }); 36 | m.react("✅"); 37 | handler.limit = 1; 38 | } catch (e) { 39 | handler.limit = 0; 40 | console.error(e); 41 | m.react("❌"); 42 | } 43 | } 44 | }; 45 | 46 | handler.help = ['google', 'googlef'].map(v => v + ' '); 47 | handler.tags = ['study']; 48 | handler.command = /^googlef?$/i; 49 | handler.register = false; 50 | export default handler; 51 | --------------------------------------------------------------------------------