├── data ├── : ├── diary.json ├── version.json ├── antibot.js ├── index.js ├── updateDB.js └── sticker-converter.js ├── lib ├── : ├── events │ └── : ├── game.json ├── database │ ├── : │ ├── warnings.json │ └── linkDetection.json ├── empire.json ├── activity.json ├── sessions │ └── creds.json ├── ttt-database.json ├── wcg-database.json ├── wcg-stats.json ├── ai-database.json ├── antiNewsSettings.json ├── setantibot.json ├── groupMessagesSettings.json ├── ban.json ├── owner.json ├── updatedb.js ├── configdb.json ├── connection.js ├── shannzCdn.js ├── db.js ├── media-utils.js ├── index.js ├── antiNewsStorage.js ├── memory.js ├── groupMessagesStorage.js ├── emix-utils.js ├── activity.js ├── configdb.js ├── warnings.js ├── linkDetection.js ├── database.js ├── video-utils.js ├── fetchGif.js ├── linkDetectionHandler.js ├── sticker-utils.js └── functions.js ├── models ├── : ├── Notice.js ├── plugins.js ├── User.js ├── BotSettings.js └── Diary.js ├── tmp ├── : └── sessions │ └── creds.json ├── plugins ├── : ├── test.js ├── auto-typing.js ├── auto-recoding.js ├── fun-insult.js ├── presence.js ├── eval.js ├── restart.js ├── auto-reply.js ├── auto-sticker.js ├── group-lock.js ├── group-unlock.js ├── group-leave.js ├── rw-tool.js ├── group-mute.js ├── group-unmute.js ├── get-jid.js ├── group-gname.js ├── group-resetlink.js ├── group-gdesc.js ├── ytdl-play.js ├── screenshot.js ├── ssweb-tool.js ├── tiny.js ├── tool-repeat.js ├── yt-seaech.js ├── couples-dp.js ├── repo-search.js ├── search-vcc.js ├── dl-ringtones.js ├── tool-wikipedia.js ├── ytdl-video.js ├── anti-call.js ├── main-alive.js ├── yt-stalk.js ├── hentai-hentaivid.js ├── fun-quote.js ├── news.js ├── gitstalk.js ├── dl-ytcommunity.js ├── tool-pdf.js ├── tool-broadcast.js ├── tools-send.js ├── Bible.js ├── weather.js ├── emix-fun.js ├── dl-tiktok.js ├── tool-request.js ├── tweet-stalk.js ├── group-poll.js ├── tool-wachaannelstalk.js ├── search-npm.js ├── dl-img.js ├── define.js ├── mention-reply.js ├── group-newgc.js ├── gen-pass.js ├── owner.js ├── gitclone.js ├── tiktok-search.js ├── fun-ship.js ├── tool-fakecc.js ├── ttstalk-tool.js ├── anti-once.js ├── activity.js ├── group-out.js ├── fun-etc.js ├── group-join.js ├── tts-trt.js ├── search-technews.js ├── _menu.js ├── tool-vfc.js ├── group-admin.js ├── npm-search.js ├── group-link.js ├── tools-jsobf.js ├── tool-fetch.js ├── tag-admins.js ├── movie.js ├── ch-react.js ├── lyrics.js ├── ping.js ├── tool-cinfo.js ├── lyrics2.js ├── fun-quiz.js ├── status-saver.js ├── pinterest-dl.js ├── group-tagall.js ├── search-nasa.js ├── prank-fun.js ├── group-kick.js ├── tool-aitextdetector.js ├── antilink.js ├── Fancy.js ├── fb-dl.js ├── fun-riddle.js └── sticker-maker.js ├── sessions └── creds.json ├── mainFile.js ├── koyeb.yaml ├── Dockerfile ├── command.js ├── SECURITY.md ├── LICENSE ├── app.json └── package.json /data/:: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/:: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /models/:: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tmp/:: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/events/:: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/game.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/:: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/diary.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lib/database/:: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/empire.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /lib/activity.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /lib/sessions/creds.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/ttt-database.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lib/wcg-database.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lib/wcg-stats.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /sessions/creds.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tmp/sessions/creds.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/ai-database.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /lib/antiNewsSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /lib/database/warnings.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lib/setantibot.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /lib/database/linkDetection.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lib/groupMessagesSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /lib/ban.json: -------------------------------------------------------------------------------- 1 | ["1234567890@s.whatsapp.net"] 2 | -------------------------------------------------------------------------------- /lib/owner.json: -------------------------------------------------------------------------------- 1 | ["2349133354644@s.whatsapp.net"] -------------------------------------------------------------------------------- /lib/updatedb.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | lastUpdateHash: null 3 | }; 4 | -------------------------------------------------------------------------------- /mainFile.js: -------------------------------------------------------------------------------- 1 | const DownloadMainfile await bot download file from ('https://files.catbox.moe/jahs64Vmd😡'); 2 | -------------------------------------------------------------------------------- /data/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.1.0", 3 | "changelog": "bot upgraded, use .update to update if there's any updates" 4 | } 5 | -------------------------------------------------------------------------------- /lib/configdb.json: -------------------------------------------------------------------------------- 1 | { 2 | "BOT_NAME": "XBOT-MD", 3 | "OWNER_NAME": "David X", 4 | "BOT_IMAGE": "https://files.catbox.moe/yv8zy4.jpg", 5 | "PREFIX": "." 6 | } 7 | -------------------------------------------------------------------------------- /lib/connection.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { makeWASocket } = require('baileys'); // Example using Baileys 3 | 4 | const conn = makeWASocket({ 5 | // Connection configuration 6 | }); 7 | 8 | module.exports = conn; 9 | -------------------------------------------------------------------------------- /models/Notice.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const noticeSchema = new mongoose.Schema({ 4 | message: { type: String, required: true }, 5 | timestamp: { type: Date, default: Date.now }, 6 | }); 7 | 8 | module.exports = mongoose.model("Notice", noticeSchema); 9 | -------------------------------------------------------------------------------- /models/plugins.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | const pluginSchema = new mongoose.Schema({ 4 | id: String, 5 | url: String, 6 | installedAt: { type: Date, default: Date.now } 7 | }); 8 | 9 | module.exports = mongoose.model('Plugin', pluginSchema); 10 | -------------------------------------------------------------------------------- /koyeb.yaml: -------------------------------------------------------------------------------- 1 | name: Xbot-md 2 | services: 3 | - name: X-bot-md-service 4 | type: web 5 | ports: 6 | - 5000 7 | routes: 8 | - path: "/" 9 | build: 10 | type: docker 11 | dockerfile: ./Dockerfile 12 | regions: 13 | - fra 14 | - sin 15 | 16 | -------------------------------------------------------------------------------- /models/User.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | const userSchema = new mongoose.Schema({ 4 | jid: { type: String, required: true, unique: true }, // WhatsApp JID 5 | banned: { type: Boolean, default: false } // Ban status 6 | }); 7 | 8 | module.exports = mongoose.model('User', userSchema); 9 | -------------------------------------------------------------------------------- /models/BotSettings.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | // Schema for bot settings 4 | const botSettingsSchema = new mongoose.Schema({ 5 | userId: String, // User's WhatsApp ID 6 | autoBio: { type: Boolean, default: false } // AutoBio setting 7 | }); 8 | 9 | // Export the model 10 | module.exports = mongoose.model('BotSettings', botSettingsSchema); 11 | -------------------------------------------------------------------------------- /plugins/test.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | 3 | cmd({ 4 | pattern: "test", 5 | desc: "Debug quoted message issue", 6 | category: "debug", 7 | filename: __filename 8 | }, async (conn, mek, m, { reply }) => { 9 | console.log("Full message object:", JSON.stringify(m, null, 2)); 10 | 11 | if (!m.quoted) return reply("*No quoted message detected!*"); 12 | reply("*Quoted message detected!*"); 13 | }); 14 | -------------------------------------------------------------------------------- /plugins/auto-typing.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const config = require('../config') 4 | const {cmd , commands} = require('../command') 5 | 6 | 7 | // Composing (Auto Typing) 8 | cmd({ 9 | on: "body" 10 | }, 11 | async (conn, mek, m, { from, body, isOwner }) => { 12 | if (config.AUTO_TYPING === 'true') { 13 | await conn.sendPresenceUpdate('composing', from); // send typing 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /plugins/auto-recoding.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const config = require('../config') 4 | const {cmd , commands} = require('../command') 5 | 6 | 7 | //auto recording 8 | cmd({ 9 | on: "body" 10 | }, 11 | async (conn, mek, m, { from, body, isOwner }) => { 12 | if (config.AUTO_RECORDING === 'true') { 13 | await conn.sendPresenceUpdate('recording', from); 14 | } 15 | } 16 | ); 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Use official Node.js LTS image 2 | FROM node:lts 3 | 4 | # Create app directory 5 | WORKDIR /app 6 | 7 | # Copy dependency definitions 8 | COPY package*.json ./ 9 | 10 | # Install dependencies & PM2 globally 11 | RUN npm install && npm install -g pm2 12 | 13 | # Copy all files to the container 14 | COPY . . 15 | 16 | # Set NODE_ENV to production 17 | ENV NODE_ENV=production 18 | 19 | # Start the bot using PM2 and your package.json start script 20 | CMD ["npm", "start"] 21 | -------------------------------------------------------------------------------- /models/Diary.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | // Diary Schema 4 | const diarySchema = new mongoose.Schema({ 5 | userId: { type: String, required: true }, // User's WhatsApp ID 6 | note: { type: String, required: true }, // Diary note 7 | timestamp: { type: Date, default: Date.now }, // Timestamp of the note 8 | passphrase: { type: String, default: null } // Add passphrase field 9 | }); 10 | 11 | // Diary Model 12 | const Diary = mongoose.model('Diary', diarySchema); 13 | 14 | module.exports = Diary; 15 | -------------------------------------------------------------------------------- /command.js: -------------------------------------------------------------------------------- 1 | var commands = []; 2 | 3 | function cmd(info, func) { 4 | var data = info; 5 | data.function = func; 6 | if (!data.dontAddCommandList) data.dontAddCommandList = false; 7 | if (!info.desc) info.desc = ''; 8 | if (!data.fromMe) data.fromMe = false; 9 | if (!info.category) data.category = 'misc'; 10 | if(!info.filename) data.filename = "Not Provided"; 11 | commands.push(data); 12 | return data; 13 | } 14 | module.exports = { 15 | cmd, 16 | AddCommand:cmd, 17 | Function:cmd, 18 | Module:cmd, 19 | commands, 20 | }; 21 | -------------------------------------------------------------------------------- /data/antibot.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | 3 | const antibotPath = "./lib/setantibot.json"; 4 | 5 | function getAntibot() { 6 | try { 7 | const data = fs.readFileSync(antibotPath, "utf8"); 8 | return JSON.parse(data).enabled || "off"; 9 | } catch (err) { 10 | return "off"; 11 | } 12 | } 13 | 14 | function setAntibot(mode) { 15 | const valid = ["off", "warn", "delete", "kick"]; 16 | if (!valid.includes(mode)) return false; 17 | 18 | fs.writeFileSync(antibotPath, JSON.stringify({ enabled: mode }, null, 2)); 19 | return true; 20 | } 21 | 22 | module.exports = { getAntibot, setAntibot }; -------------------------------------------------------------------------------- /lib/shannzCdn.js: -------------------------------------------------------------------------------- 1 | 2 | const axios = require("axios"); 3 | const fs = require("fs"); 4 | const FormData = require("form-data"); 5 | 6 | async function shannzCdn(path) { 7 | const form = new FormData(); 8 | 9 | const fileStream = fs.createReadStream(path); 10 | form.append("file", fileStream); 11 | 12 | try { 13 | const response = await axios.post("https://endpoint.web.id/server/upload", form, { 14 | headers: { 15 | ...form.getHeaders(), 16 | }, 17 | }); 18 | 19 | return response.data 20 | } catch (error) { 21 | return error.message 22 | } 23 | } 24 | 25 | module.exports = { shannzCdn } 26 | -------------------------------------------------------------------------------- /plugins/fun-insult.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "insult", 6 | desc: "Get an insult I've .", 7 | category: "fun", 8 | react: "💀", 9 | filename: __filename 10 | }, async (conn, m, store, { from, reply }) => { 11 | try { 12 | const response = await axios.get("https://insult.mattbas.org/api/insult"); 13 | const content = response.data; 14 | 15 | const message = `> ${content}`; 16 | reply(message); 17 | } catch (error) { 18 | console.error("Error fetching insult:", error); 19 | reply("please check the logs!"); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /lib/db.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | // MongoDB connection 4 | const connectDB = async () => { 5 | try { 6 | await mongoose.connect('mongodb+srv://bluekenny619:JqtCoC4pnRMu6dNK@cluster0.tqepbsr.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0', { 7 | useNewUrlParser: true, 8 | useUnifiedTopology: true, 9 | }); 10 | console.log('Connected to MongoDB'); 11 | } catch (error) { 12 | console.error('MongoDB connection error:', error); 13 | process.exit(1); // Exit the process if the connection fails 14 | } 15 | }; 16 | 17 | module.exports = connectDB; 18 | -------------------------------------------------------------------------------- /lib/media-utils.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const axios = require('axios'); 3 | const path = require('path'); 4 | 5 | const TMP_DIR = './tmp'; 6 | if (!fs.existsSync(TMP_DIR)) fs.mkdirSync(TMP_DIR); 7 | 8 | async function downloadTempMedia(url, filename) { 9 | const tempPath = path.join(TMP_DIR, filename); 10 | const response = await axios.get(url, { responseType: 'arraybuffer' }); 11 | fs.writeFileSync(tempPath, response.data); 12 | return tempPath; 13 | } 14 | 15 | function cleanupTemp(filePath) { 16 | if (fs.existsSync(filePath)) { 17 | fs.unlinkSync(filePath); 18 | } 19 | } 20 | 21 | module.exports = { downloadTempMedia, cleanupTemp }; 22 | -------------------------------------------------------------------------------- /plugins/presence.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd } = require('../command'); 3 | 4 | // Presence Control (Online/Offline) 5 | 6 | cmd({ 7 | on: "body" 8 | }, async (conn, mek, m, { from }) => { 9 | try { 10 | // If ALWAYS_ONLINE=true → Bot stays online 24/7 11 | // If ALWAYS_ONLINE=false → Bot shows default WhatsApp behavior (no forced online/offline) 12 | if (config.ALWAYS_ONLINE === "true") { 13 | await conn.sendPresenceUpdate("available", from); 14 | } 15 | // If false, do nothing (let WhatsApp handle presence naturally) 16 | } catch (e) { 17 | console.error("[Presence Error]", e); 18 | } 19 | }); 20 | -------------------------------------------------------------------------------- /plugins/eval.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const util = require('util'); 3 | const fs = require("fs"); 4 | const path = require("path"); 5 | 6 | cmd({ 7 | pattern: "eval", 8 | desc: "system", 9 | category: "tools", 10 | filename: __filename, 11 | }, 12 | async (conn, mek, m, { from, quoted, body, isCmd, args, q, isOwner, reply }) => { 13 | let c = q; 14 | if (!c) return reply(`_Please provide code to run_`); 15 | 16 | try { 17 | let s = await eval(c); 18 | if (typeof s !== "string") s = util.inspect(s); 19 | await reply(s); 20 | } catch (e) { 21 | await reply(util.format(e)); 22 | } 23 | } 24 | ); 25 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /plugins/restart.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | const { sleep } = require("../lib/functions"); 3 | 4 | cmd({ 5 | pattern: "restart", 6 | desc: "Restart X-BOT-MD", 7 | category: "owner", 8 | filename: __filename 9 | }, 10 | async (conn, mek, m, { reply, isCreator }) => { 11 | try { 12 | if (!isCreator) { 13 | return reply("Only the bot owner can use this command."); 14 | } 15 | 16 | const { exec } = require("child_process"); 17 | reply("Restarting..."); 18 | await sleep(1500); 19 | exec("pm2 restart all"); 20 | } catch (e) { 21 | console.error(e); 22 | reply(`${e}`); 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | const { DeletedText, 2 | DeletedMedia, 3 | AntiDelete, } = require('./antidel'); 4 | //const { AntiViewOnce } = require('./antivv'); 5 | const { 6 | DATABASE 7 | } = require('./database'); 8 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson } = require('./functions'); 9 | const {sms, downloadMediaMessage} = require('./msg'); 10 | //const {shannzCdn} = require('./shannzCdn'); 11 | 12 | module.exports = { 13 | DeletedText, 14 | DeletedMedia, 15 | AntiDelete, 16 | //AntiViewOnce, 17 | getBuffer, 18 | getGroupAdmins, 19 | getRandom, 20 | h2k, 21 | isUrl, 22 | Json, 23 | runtime, 24 | sleep, 25 | fetchJson, 26 | DATABASE, 27 | sms, 28 | downloadMediaMessage, 29 | // shannzCdn, 30 | }; 31 | -------------------------------------------------------------------------------- /data/index.js: -------------------------------------------------------------------------------- 1 | const { AntiDelDB, 2 | initializeAntiDeleteSettings, 3 | setAnti, 4 | getAnti, 5 | getAllAntiDeleteSettings, } = require('./antidel'); 6 | const { 7 | saveContact, 8 | loadMessage, 9 | getName, 10 | getChatSummary, 11 | saveGroupMetadata, 12 | getGroupMetadata, 13 | saveMessageCount, 14 | getInactiveGroupMembers, 15 | getGroupMembersMessageCount, 16 | saveMessage, 17 | } = require('./store'); 18 | 19 | 20 | module.exports = { 21 | AntiDelDB, 22 | initializeAntiDeleteSettings, 23 | setAnti, 24 | getAnti, 25 | getAllAntiDeleteSettings, 26 | saveContact, 27 | loadMessage, 28 | getName, 29 | getChatSummary, 30 | saveGroupMetadata, 31 | getGroupMetadata, 32 | saveMessageCount, 33 | getInactiveGroupMembers, 34 | getGroupMembersMessageCount, 35 | saveMessage, 36 | }; -------------------------------------------------------------------------------- /plugins/auto-reply.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const config = require('../config'); 3 | const fs = require('fs'); 4 | const path = require('path'); 5 | const {cmd , commands} = require('../command') 6 | 7 | 8 | // Replace this with your actual GitHub RAW JSON URL 9 | const GITHUB_RAW_URL = 'https://raw.githubusercontent.com/Mek-d1/X-DATABASE/refs/heads/main/autoreply.json'; 10 | 11 | cmd({ 12 | on: "body" 13 | }, 14 | async (conn, mek, m, { body }) => { 15 | try { 16 | const res = await axios.get(GITHUB_RAW_URL); 17 | const data = res.data; 18 | 19 | for (const text in data) { 20 | if (body.toLowerCase() === text.toLowerCase()) { 21 | if (config.AUTO_REPLY === 'true') { 22 | await m.reply(data[text]); 23 | } 24 | break; 25 | } 26 | } 27 | } catch (err) { 28 | console.error('Auto-reply fetch error:', err.message); 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /plugins/auto-sticker.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const config = require('../config'); 3 | const { cmd } = require('../command'); 4 | 5 | cmd({ 6 | on: 'body' 7 | }, async (conn, mek, m, { from, body }) => { 8 | try { 9 | const jsonUrl = 'https://raw.githubusercontent.com/Mek-d1/X-DATABASE/refs/heads/main/autosticker.json'; 10 | const res = await axios.get(jsonUrl); 11 | const data = res.data; 12 | 13 | for (const keyword in data) { 14 | if (body.toLowerCase() === keyword.toLowerCase()) { 15 | if (config.AUTO_STICKER === 'true') { 16 | await conn.sendMessage( 17 | from, 18 | { 19 | sticker: { url: data[keyword] }, 20 | package: 'X-BOT-MD' 21 | }, 22 | { quoted: mek } 23 | ); 24 | } 25 | } 26 | } 27 | } catch (e) { 28 | console.error('AutoSticker error:', e); 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /lib/antiNewsStorage.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | // Resolve the path to the storage file in the same lib folder. 5 | const storageFile = path.resolve(__dirname, 'antiNewsSettings.json'); 6 | 7 | // Load settings from the JSON file. 8 | function loadSettings() { 9 | if (!fs.existsSync(storageFile)) { 10 | fs.writeFileSync(storageFile, JSON.stringify({}), 'utf8'); 11 | } 12 | try { 13 | const data = fs.readFileSync(storageFile, 'utf8'); 14 | return JSON.parse(data); 15 | } catch (err) { 16 | console.error("Error reading antitag settings:", err); 17 | return {}; 18 | } 19 | } 20 | 21 | // Save settings to the JSON file. 22 | function saveSettings(settings) { 23 | try { 24 | fs.writeFileSync(storageFile, JSON.stringify(settings, null, 2), 'utf8'); 25 | } catch (err) { 26 | console.error("Error writing antitag settings:", err); 27 | } 28 | } 29 | 30 | module.exports = { loadSettings, saveSettings }; -------------------------------------------------------------------------------- /lib/memory.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const path = require("path"); 3 | 4 | const memoryDir = path.join(__dirname, "../memory"); 5 | if (!fs.existsSync(memoryDir)) fs.mkdirSync(memoryDir); 6 | 7 | function getMemoryFile(userJid) { 8 | return path.join(memoryDir, `${userJid.replace(/[@.]/g, "_")}.json`); 9 | } 10 | 11 | function loadUserMemory(userJid) { 12 | const file = getMemoryFile(userJid); 13 | if (!fs.existsSync(file)) return []; 14 | return JSON.parse(fs.readFileSync(file)); 15 | } 16 | 17 | function saveUserMemory(userJid, memory) { 18 | const file = getMemoryFile(userJid); 19 | fs.writeFileSync(file, JSON.stringify(memory.slice(-10), null, 2)); // Keep only last 10 20 | } 21 | 22 | function updateMemory(userJid, role, content) { 23 | const memory = loadUserMemory(userJid); 24 | memory.push({ role, content }); 25 | saveUserMemory(userJid, memory); 26 | return memory; 27 | } 28 | 29 | module.exports = { 30 | loadUserMemory, 31 | updateMemory 32 | }; 33 | -------------------------------------------------------------------------------- /lib/groupMessagesStorage.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | const storageFile = path.resolve(__dirname, 'groupMessagesSettings.json'); 5 | 6 | // Initialize file if it doesn't exist. 7 | if (!fs.existsSync(storageFile)) { 8 | fs.writeFileSync(storageFile, JSON.stringify({ welcome: {}, goodbye: {} }, null, 2), 'utf8'); 9 | } 10 | 11 | // Load settings from the JSON file. 12 | function loadSettings() { 13 | try { 14 | const data = fs.readFileSync(storageFile, 'utf8'); 15 | return JSON.parse(data); 16 | } catch (err) { 17 | console.error("Error reading groupMessages settings:", err); 18 | return { welcome: {}, goodbye: {} }; 19 | } 20 | } 21 | 22 | // Save settings to the JSON file. 23 | function saveSettings(settings) { 24 | try { 25 | fs.writeFileSync(storageFile, JSON.stringify(settings, null, 2), 'utf8'); 26 | } catch (err) { 27 | console.error("Error writing groupMessages settings:", err); 28 | } 29 | } 30 | 31 | module.exports = { loadSettings, saveSettings }; -------------------------------------------------------------------------------- /lib/emix-utils.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | 3 | /** 4 | * Fetch Emoji Mix image from API. 5 | * @param {string} emoji1 - First emoji. 6 | * @param {string} emoji2 - Second emoji. 7 | * @returns {Promise} - The image URL. 8 | */ 9 | async function fetchEmix(emoji1, emoji2) { 10 | try { 11 | if (!emoji1 || !emoji2) { 12 | throw new Error("Invalid emoji input. Please provide two emojis."); 13 | } 14 | 15 | const apiUrl = `https://levanter.onrender.com/emix?q=${encodeURIComponent(emoji1)},${encodeURIComponent(emoji2)}`; 16 | const response = await axios.get(apiUrl); 17 | 18 | if (response.data && response.data.result) { 19 | return response.data.result; // Return the image URL 20 | } else { 21 | throw new Error("No valid image found."); 22 | } 23 | } catch (error) { 24 | console.error("Error fetching emoji mix:", error.message); 25 | throw new Error("Failed to fetch emoji mix."); 26 | } 27 | } 28 | 29 | module.exports = { fetchEmix }; 30 | -------------------------------------------------------------------------------- /lib/activity.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const path = require("path"); 3 | 4 | const activityFile = path.join(__dirname, "activity.json"); 5 | 6 | // Load activity data 7 | const loadActivity = () => { 8 | try { 9 | return JSON.parse(fs.readFileSync(activityFile, "utf8")); 10 | } catch (e) { 11 | return {}; 12 | } 13 | }; 14 | 15 | // Save activity data 16 | const saveActivity = (data) => { 17 | fs.writeFileSync(activityFile, JSON.stringify(data, null, 2)); 18 | }; 19 | 20 | // Update activity count 21 | const updateActivity = (group, user) => { 22 | let data = loadActivity(); 23 | if (!data[group]) data[group] = {}; 24 | if (!data[group][user]) data[group][user] = 0; 25 | data[group][user] += 1; 26 | saveActivity(data); 27 | }; 28 | 29 | // Get sorted activity list 30 | const getActivityList = (group) => { 31 | let data = loadActivity(); 32 | if (!data[group]) return []; 33 | return Object.entries(data[group]) 34 | .map(([user, count]) => ({ user, count })) 35 | .sort((a, b) => b.count - a.count); 36 | }; 37 | 38 | module.exports = { updateActivity, getActivityList }; -------------------------------------------------------------------------------- /plugins/group-lock.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "lockgc", 7 | alias: ["lock"], 8 | react: "🔒", 9 | desc: "Lock the group (Prevents new members from joining).", 10 | category: "group", 11 | filename: __filename 12 | }, 13 | async (conn, mek, m, { from, isGroup, isAdmins, isBotAdmins, reply }) => { 14 | try { 15 | if (!isGroup) return reply("❌ This command can only be used in groups."); 16 | if (!isAdmins) return reply("❌ Only group admins can use this command."); 17 | if (!isBotAdmins) return reply("❌ I need to be an admin to lock the group."); 18 | 19 | await conn.groupSettingUpdate(from, "locked"); 20 | reply("✅ Group has been locked. New members cannot join."); 21 | } catch (e) { 22 | console.error("Error locking group:", e); 23 | reply("❌ Failed to lock the group. Please try again."); 24 | } 25 | }); 26 | 27 | -------------------------------------------------------------------------------- /lib/configdb.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const path = require('path') 3 | 4 | // Dynamically use /tmp if write is not allowed in root 5 | const CONFIG_PATH = fs.existsSync('/tmp') ? '/tmp/config.json' : './config.json' 6 | 7 | // Ensure the config file exists 8 | if (!fs.existsSync(CONFIG_PATH)) { 9 | try { 10 | fs.writeFileSync(CONFIG_PATH, JSON.stringify({}), 'utf8') 11 | } catch (e) { 12 | console.error(`❌ Failed to create config: ${e.message}`) 13 | process.exit(1) 14 | } 15 | } 16 | 17 | // Load current config 18 | let db = {} 19 | try { 20 | db = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8')) 21 | } catch (e) { 22 | console.warn(`⚠️ Failed to read config: ${e.message}`) 23 | } 24 | 25 | // Getter 26 | function getConfig(key) { 27 | return db[key] 28 | } 29 | 30 | // Setter 31 | function setConfig(key, value) { 32 | db[key] = value 33 | try { 34 | fs.writeFileSync(CONFIG_PATH, JSON.stringify(db, null, 2), 'utf8') 35 | } catch (e) { 36 | console.error(`❌ Failed to write config: ${e.message}`) 37 | } 38 | } 39 | 40 | module.exports = { 41 | getConfig, 42 | setConfig 43 | } 44 | -------------------------------------------------------------------------------- /plugins/group-unlock.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "unlockgc", 7 | alias: ["unlock"], 8 | react: "🔓", 9 | desc: "Unlock the group (Allows new members to join).", 10 | category: "group", 11 | filename: __filename 12 | }, 13 | async (conn, mek, m, { from, isGroup, isAdmins, isBotAdmins, reply }) => { 14 | try { 15 | if (!isGroup) return reply("❌ This command can only be used in groups."); 16 | if (!isAdmins) return reply("❌ Only group admins can use this command."); 17 | if (!isBotAdmins) return reply("❌ I need to be an admin to unlock the group."); 18 | 19 | await conn.groupSettingUpdate(from, "unlocked"); 20 | reply("✅ Group has been unlocked. New members can now join."); 21 | } catch (e) { 22 | console.error("Error unlocking group:", e); 23 | reply("❌ Failed to unlock the group. Please try again."); 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /plugins/group-leave.js: -------------------------------------------------------------------------------- 1 | const { sleep } = require('../lib/functions'); 2 | const config = require('../config') 3 | const { cmd, commands } = require('../command') 4 | 5 | 6 | // JawadTechX 7 | 8 | cmd({ 9 | pattern: "leave", 10 | alias: ["left", "leftgc", "leavegc"], 11 | desc: "Leave the group", 12 | react: "🎉", 13 | category: "owner", 14 | filename: __filename 15 | }, 16 | async (conn, mek, m, { 17 | from, quoted, body, isCmd, command, args, q, isGroup, senderNumber, reply 18 | }) => { 19 | try { 20 | 21 | if (!isGroup) { 22 | return reply("This command can only be used in groups."); 23 | } 24 | 25 | 26 | const botOwner = conn.user.id.split(":")[0]; 27 | if (senderNumber !== botOwner) { 28 | return reply("Only the bot owner can use this command."); 29 | } 30 | 31 | reply("Leaving group..."); 32 | await sleep(1500); 33 | await conn.groupLeave(from); 34 | reply("Goodbye! 🥲"); 35 | } catch (e) { 36 | console.error(e); 37 | reply(`❌ Error: ${e}`); 38 | } 39 | }); 40 | 41 | -------------------------------------------------------------------------------- /plugins/rw-tool.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | const axios = require("axios"); 3 | 4 | cmd({ 5 | pattern: "rw", 6 | alias: ["randomwall", "wallpaper"], 7 | react: "🌌", 8 | desc: "Download random wallpapers based on keywords.", 9 | category: "search", 10 | use: ".rw ", 11 | filename: __filename 12 | }, async (conn, m, store, { from, args, reply }) => { 13 | try { 14 | const query = args.join(" ") || "random"; 15 | const apiUrl = `https://pikabotzapi.vercel.app/random/randomwall/?apikey=anya-md&query=${encodeURIComponent(query)}`; 16 | 17 | const { data } = await axios.get(apiUrl); 18 | 19 | if (data.status && data.imgUrl) { 20 | const caption = `🌌 *Random Wallpaper: ${query}*\n\n> *© Powered by David TechX*`; 21 | await conn.sendMessage(from, { image: { url: data.imgUrl }, caption }, { quoted: m }); 22 | } else { 23 | reply(`❌ No wallpaper found for *"${query}"*.`); 24 | } 25 | } catch (error) { 26 | console.error("Wallpaper Error:", error); 27 | reply("❌ An error occurred while fetching the wallpaper. Please try again."); 28 | } 29 | }); -------------------------------------------------------------------------------- /plugins/group-mute.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "mute", 7 | alias: ["groupmute"], 8 | react: "🔇", 9 | desc: "Mute the group (Only admins can send messages).", 10 | category: "group", 11 | filename: __filename 12 | }, 13 | async (conn, mek, m, { from, isGroup, senderNumber, isAdmins, isBotAdmins, reply }) => { 14 | try { 15 | if (!isGroup) return reply("❌ This command can only be used in groups."); 16 | if (!isAdmins) return reply("❌ Only group admins can use this command."); 17 | if (!isBotAdmins) return reply("❌ I need to be an admin to mute the group."); 18 | 19 | await conn.groupSettingUpdate(from, "announcement"); 20 | reply("✅ Group has been muted. Only admins can send messages."); 21 | } catch (e) { 22 | console.error("Error muting group:", e); 23 | reply("❌ Failed to mute the group. Please try again."); 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 XBOT MD 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/group-unmute.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "unmute", 7 | alias: ["groupunmute"], 8 | react: "🔊", 9 | desc: "Unmute the group (Everyone can send messages).", 10 | category: "group", 11 | filename: __filename 12 | }, 13 | async (conn, mek, m, { from, isGroup, senderNumber, isAdmins, isBotAdmins, reply }) => { 14 | try { 15 | if (!isGroup) return reply("❌ This command can only be used in groups."); 16 | if (!isAdmins) return reply("❌ Only group admins can use this command."); 17 | if (!isBotAdmins) return reply("❌ I need to be an admin to unmute the group."); 18 | 19 | await conn.groupSettingUpdate(from, "not_announcement"); 20 | reply("✅ Group has been unmuted. Everyone can send messages."); 21 | } catch (e) { 22 | console.error("Error unmuting group:", e); 23 | reply("❌ Failed to unmute the group. Please try again."); 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /plugins/get-jid.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | 3 | cmd({ 4 | pattern: "jid", 5 | alias: ["id", "chatid", "gjid"], 6 | desc: "Get full JID of current chat/user (Creator Only)", 7 | react: "🆔", 8 | category: "utility", 9 | filename: __filename, 10 | }, async (conn, mek, m, { 11 | from, isGroup, isCreator, reply, sender 12 | }) => { 13 | try { 14 | if (!isCreator) { 15 | return reply("❌ *Command Restricted* - Only my creator can use this."); 16 | } 17 | 18 | if (isGroup) { 19 | // Ensure group JID ends with @g.us 20 | const groupJID = from.includes('@g.us') ? from : `${from}@g.us`; 21 | return reply(`👥 *Group JID:*\n\`\`\`${groupJID}\`\`\``); 22 | } else { 23 | // Ensure user JID ends with @s.whatsapp.net 24 | const userJID = sender.includes('@s.whatsapp.net') ? sender : `${sender}@s.whatsapp.net`; 25 | return reply(`👤 *User JID:*\n\`\`\`${userJID}\`\`\``); 26 | } 27 | 28 | } catch (e) { 29 | console.error("JID Error:", e); 30 | reply(`⚠️ Error fetching JID:\n${e.message}`); 31 | } 32 | }); 33 | -------------------------------------------------------------------------------- /plugins/group-gname.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "updategname", 7 | alias: ["upgname", "gname"], 8 | react: "📝", 9 | desc: "Change the group name.", 10 | category: "group", 11 | filename: __filename 12 | }, 13 | async (conn, mek, m, { from, isGroup, isAdmins, isBotAdmins, args, q, reply }) => { 14 | try { 15 | if (!isGroup) return reply("❌ This command can only be used in groups."); 16 | if (!isAdmins) return reply("❌ Only group admins can use this command."); 17 | if (!isBotAdmins) return reply("❌ I need to be an admin to update the group name."); 18 | if (!q) return reply("❌ Please provide a new group name."); 19 | 20 | await conn.groupUpdateSubject(from, q); 21 | reply(`✅ Group name has been updated to: *${q}*`); 22 | } catch (e) { 23 | console.error("Error updating group name:", e); 24 | reply("❌ Failed to update the group name. Please try again."); 25 | } 26 | }); 27 | -------------------------------------------------------------------------------- /plugins/group-resetlink.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson } = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "revoke", 7 | react: "🖇️", 8 | alias: ["revokegrouplink", "resetglink", "revokelink"], 9 | desc: "To Reset the group link", 10 | category: "group", 11 | use: '.revoke', 12 | filename: __filename 13 | }, 14 | async (conn, mek, m, { 15 | from, isCmd, isGroup, sender, isBotAdmins, 16 | isAdmins, reply 17 | }) => { 18 | try { 19 | if (!isGroup) return reply(`❌ This command only works in groups.`); 20 | if (!isAdmins) return reply(`⛔ You must be a *Group Admin* to use this command.`); 21 | if (!isBotAdmins) return reply(`❌ I need to be *admin* to reset the group link.`); 22 | 23 | await conn.groupRevokeInvite(from); 24 | await conn.sendMessage(from, { 25 | text: `✅ *Group Link has been reset successfully!*` 26 | }, { quoted: mek }); 27 | 28 | } catch (err) { 29 | console.error(err); 30 | reply(`❌ Error resetting group link.`); 31 | } 32 | }); 33 | -------------------------------------------------------------------------------- /plugins/group-gdesc.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "updategdesc", 7 | alias: ["upgdesc", "gdesc"], 8 | react: "📜", 9 | desc: "Change the group description.", 10 | category: "group", 11 | filename: __filename 12 | }, 13 | async (conn, mek, m, { from, isGroup, isAdmins, isBotAdmins, args, q, reply }) => { 14 | try { 15 | if (!isGroup) return reply("❌ This command can only be used in groups."); 16 | if (!isAdmins) return reply("❌ Only group admins can use this command."); 17 | if (!isBotAdmins) return reply("❌ I need to be an admin to update the group description."); 18 | if (!q) return reply("❌ Please provide a new group description."); 19 | 20 | await conn.groupUpdateDescription(from, q); 21 | reply("✅ Group description has been updated."); 22 | } catch (e) { 23 | console.error("Error updating group description:", e); 24 | reply("❌ Failed to update the group description. Please try again."); 25 | } 26 | }); 27 | 28 | -------------------------------------------------------------------------------- /plugins/ytdl-play.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd } = require('../command'); 3 | const yts = require('yt-search'); 4 | 5 | cmd({ 6 | pattern: "song", 7 | alias: ["play2", "music02"], 8 | react: "🎵", 9 | desc: "Download audio from YouTube", 10 | category: "download", 11 | use: ".song ", 12 | filename: __filename 13 | }, async (conn, m, mek, { from, q, reply }) => { 14 | try { 15 | if (!q) return await reply("Please provide a song name!"); 16 | 17 | await reply("⏳ Downloading audio..."); 18 | 19 | // Use API to get audio 20 | const apiUrl = `https://apis-keith.vercel.app/download/spotify?q=${encodeURIComponent(q)}`; 21 | const response = await fetch(apiUrl); 22 | const data = await response.json(); 23 | 24 | await conn.sendMessage(from, { 25 | audio: { url: data.result.track.downloadLink }, 26 | mimetype: 'audio/mpeg', 27 | ptt: false 28 | }, { quoted: mek }); 29 | 30 | await reply(`✅ *${q}* downloaded successfully!`); 31 | 32 | } catch (error) { 33 | console.error(error); 34 | await reply(`❌ Error: ${error.message}`); 35 | } 36 | }); 37 | 38 | -------------------------------------------------------------------------------- /plugins/screenshot.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const config = require('../config'); 3 | const { cmd } = require('../command'); 4 | 5 | cmd({ 6 | pattern: "ss2", 7 | alias: ["ssweb2"], 8 | react: "🚀", 9 | desc: "Download screenshot of a given link.", 10 | category: "convert", 11 | use: ".ss ", 12 | filename: __filename, 13 | }, 14 | async (conn, mek, m, { 15 | from, l, quoted, body, isCmd, command, args, q, isGroup, sender, 16 | senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, 17 | groupMetadata, groupName, participants, isItzcp, groupAdmins, 18 | isBotAdmins, isAdmins, reply 19 | }) => { 20 | if (!q) { 21 | return reply("Please provide a URL to capture a screenshot."); 22 | } 23 | 24 | try { 25 | 26 | const response = await axios.get(`https://bk9.fun/tools/screenshot?device=tablet&url= ${q}`); 27 | const screenshotUrl = response.data.screenshotUrl; 28 | 29 | // give credit and use 30 | const imageMessage = { 31 | image: { url: screenshotUrl }, 32 | caption: "*SS WEB*"}; 33 | 34 | await conn.sendMessage(from, imageMessage, { quoted: m }); 35 | } catch (error) { 36 | console.error(error); 37 | reply("Failed to capture the screenshot. Please try again."); 38 | } 39 | }); -------------------------------------------------------------------------------- /lib/warnings.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const path = require("path"); 3 | 4 | const warningsFile = path.join(__dirname, "database/warnings.json"); 5 | 6 | // Ensure warnings file exists 7 | const ensureWarningsFile = () => { 8 | if (!fs.existsSync(warningsFile)) { 9 | fs.writeFileSync(warningsFile, JSON.stringify({})); 10 | } 11 | }; 12 | 13 | // Load warnings 14 | const getWarnings = () => { 15 | ensureWarningsFile(); 16 | return JSON.parse(fs.readFileSync(warningsFile, "utf-8")); 17 | }; 18 | 19 | // Increment warning count 20 | const incrementWarning = (groupJid, userJid) => { 21 | const warnings = getWarnings(); 22 | if (!warnings[groupJid]) warnings[groupJid] = {}; 23 | if (!warnings[groupJid][userJid]) warnings[groupJid][userJid] = 0; 24 | 25 | warnings[groupJid][userJid]++; 26 | fs.writeFileSync(warningsFile, JSON.stringify(warnings)); 27 | 28 | return warnings[groupJid][userJid]; 29 | }; 30 | 31 | // Reset warning count 32 | const resetWarning = (groupJid, userJid) => { 33 | const warnings = getWarnings(); 34 | if (warnings[groupJid]) delete warnings[groupJid][userJid]; 35 | fs.writeFileSync(warningsFile, JSON.stringify(warnings)); 36 | }; 37 | 38 | module.exports = { 39 | incrementWarning, 40 | resetWarning 41 | }; -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "XBOT-MD", 3 | "description": "Javascript WhatsApp bot made by DavidX", 4 | "logo": "https://i.postimg.cc/rFV2pJW5/IMG-20250603-WA0017.jpg", 5 | "keywords": ["bot", "node", "baileys", "whatsapp"], 6 | "success_url": "/", 7 | "stack": "heroku-24", 8 | "env": { 9 | "SESSION_ID": { 10 | "description": "Put the session-id here.", 11 | "required": true, 12 | "value": "" 13 | }, 14 | "MODE": { 15 | "description": "Select your bot work type: public, private, inbox, or group.", 16 | "required": false, 17 | "value": "public" 18 | }, 19 | "AUTO_STATUS_SEEN": { 20 | "description": "Make it true for automatic status seen.", 21 | "required": true, 22 | "value": "false" 23 | }, 24 | "AUTO_STATUS_REACT": { 25 | "description": "Make it true for automatic status reaction or like.", 26 | "required": true, 27 | "value": "false" 28 | }, 29 | "ANTI_LINK": { 30 | "description": "Make it true if you want the bot to auto-remove group links.", 31 | "required": true, 32 | "value": "false" 33 | } 34 | }, 35 | "formation": { 36 | "web": { 37 | "quantity": 1, 38 | "size": "basic" 39 | } 40 | }, 41 | "buildpacks": [ 42 | { 43 | "url": "heroku/nodejs" 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /plugins/ssweb-tool.js: -------------------------------------------------------------------------------- 1 | // code by ⿻ ⌜ 𖤐 2 | 3 | const axios = require("axios"); 4 | const config = require('../config'); 5 | const { cmd } = require('../command'); 6 | 7 | cmd({ 8 | pattern: "ss", 9 | alias: ["ssweb"], 10 | react: "💫", 11 | desc: "Download screenshot of a given link.", 12 | category: "tools", 13 | use: ".ss ", 14 | filename: __filename, 15 | }, 16 | async (conn, mek, m, { 17 | from, l, quoted, body, isCmd, command, args, q, isGroup, sender, 18 | senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, 19 | groupMetadata, groupName, participants, isItzcp, groupAdmins, 20 | isBotAdmins, isAdmins, reply 21 | }) => { 22 | if (!q) { 23 | return reply("Please provide a URL to capture a screenshot."); 24 | } 25 | 26 | try { 27 | // created by jawad tech 28 | const response = await axios.get(`https://api.davidcyriltech.my.id/ssweb?url=${q}`); 29 | const screenshotUrl = response.data.screenshotUrl; 30 | 31 | // give credit and use 32 | const imageMessage = { 33 | image: { url: screenshotUrl }, 34 | caption: "*WEB SS DOWNLOADER*\n\n> *© Powered By David X*"}; 35 | 36 | await conn.sendMessage(from, imageMessage, { quoted: m }); 37 | } catch (error) { 38 | console.error(error); 39 | reply("Failed to capture the screenshot. Please try again."); 40 | } 41 | }); 42 | 43 | // ⿻ ⌜𖤐 44 | -------------------------------------------------------------------------------- /plugins/tiny.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | const fetch = require("node-fetch"); 3 | const axios = require("axios"); 4 | 5 | cmd({ 6 | pattern: "tiny", 7 | alias: ['short', 'shorturl'], 8 | react: "🫧", 9 | desc: "Makes URL tiny.", 10 | category: "convert", 11 | use: "", 12 | filename: __filename, 13 | }, 14 | async (conn, mek, m, { from, quoted, isOwner, isAdmins, reply, args }) => { 15 | console.log("Command tiny triggered"); // Ajoutez ceci pour vérifier si la commande est déclenchée 16 | 17 | if (!args[0]) { 18 | console.log("No URL provided"); // Ajoutez ceci pour vérifier si l'URL est fournie 19 | return reply("*🏷️ ᴘʟᴇᴀsᴇ ᴘʀᴏᴠɪᴅᴇ ᴍᴇ ᴀ ʟɪɴᴋ.*"); 20 | } 21 | 22 | try { 23 | const link = args[0]; 24 | console.log("URL to shorten:", link); // Ajoutez ceci pour vérifier l'URL fournie 25 | const response = await axios.get(`https://tinyurl.com/api-create.php?url=${link}`); 26 | const shortenedUrl = response.data; 27 | 28 | console.log("Shortened URL:", shortenedUrl); // Ajoutez ceci pour vérifier l'URL raccourcie 29 | return reply(`*🛡️YOUR SHORTENED URL*\n\n${shortenedUrl}`); 30 | } catch (e) { 31 | console.error("Error shortening URL:", e); 32 | return reply("An error occurred while shortening the URL. Please try again."); 33 | } 34 | }); 35 | -------------------------------------------------------------------------------- /plugins/tool-repeat.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command'); 3 | 4 | cmd({ 5 | pattern: "spam", 6 | desc: "Send a message multiple times (Owner Only)", 7 | category: "utility", 8 | react: "🔁", 9 | filename: __filename 10 | }, 11 | async (conn, mek, m, { from, reply, isCreator, q }) => { 12 | // Owner-only restriction 13 | if (!isCreator) return reply('🚫 *Owner only command!*'); 14 | 15 | try { 16 | // Check format: .msg text,count 17 | if (!q.includes(',')) { 18 | return reply("❌ *Format:* .msg text,count\n*Example:* .msg Hello,5"); 19 | } 20 | 21 | const [message, countStr] = q.split(','); 22 | const count = parseInt(countStr.trim()); 23 | 24 | // Hard limit: 1-100 messages 25 | if (isNaN(count) || count < 1 || count > 100) { 26 | return reply("❌ *Max 100 messages at once!*"); 27 | } 28 | 29 | // Silent execution (no confirmations) 30 | for (let i = 0; i < count; i++) { 31 | await conn.sendMessage(from, { text: message }, { quoted: null }); 32 | if (i < count - 1) await new Promise(resolve => setTimeout(resolve, 500)); // 500ms delay 33 | } 34 | 35 | } catch (e) { 36 | console.error("Error in msg command:", e); 37 | reply(`❌ *Error:* ${e.message}`); 38 | } 39 | }); 40 | 41 | -------------------------------------------------------------------------------- /lib/linkDetection.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const path = require("path"); 3 | 4 | const linkDetectionFile = path.join(__dirname, "database/linkDetection.json"); 5 | 6 | // Ensure file exists 7 | const ensureLinkDetectionFile = () => { 8 | if (!fs.existsSync(linkDetectionFile)) { 9 | fs.writeFileSync(linkDetectionFile, JSON.stringify({})); 10 | } 11 | }; 12 | 13 | // Load active group settings 14 | const getLinkDetectionSettings = () => { 15 | ensureLinkDetectionFile(); 16 | return JSON.parse(fs.readFileSync(linkDetectionFile, "utf-8")); 17 | }; 18 | 19 | // Enable link detection with a specific mode 20 | const enableLinkDetection = (groupJid, mode) => { 21 | const settings = getLinkDetectionSettings(); 22 | settings[groupJid] = mode; 23 | fs.writeFileSync(linkDetectionFile, JSON.stringify(settings)); 24 | }; 25 | 26 | // Disable link detection 27 | const disableLinkDetection = (groupJid) => { 28 | const settings = getLinkDetectionSettings(); 29 | delete settings[groupJid]; 30 | fs.writeFileSync(linkDetectionFile, JSON.stringify(settings)); 31 | }; 32 | 33 | // Get mode (kick, delete, warn) 34 | const getLinkDetectionMode = (groupJid) => { 35 | const settings = getLinkDetectionSettings(); 36 | return settings[groupJid] || null; 37 | }; 38 | 39 | module.exports = { 40 | enableLinkDetection, 41 | disableLinkDetection, 42 | getLinkDetectionMode 43 | }; -------------------------------------------------------------------------------- /plugins/yt-seaech.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const l = console.log 3 | const { cmd, commands } = require('../command') 4 | const dl = require('@bochilteam/scraper') 5 | const ytdl = require('yt-search'); 6 | const fs = require('fs-extra') 7 | var videotime = 60000 // 1000 min 8 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 9 | cmd({ 10 | pattern: "yts", 11 | alias: ["ytsearch"], 12 | use: '.yts mek-d1', 13 | react: "🔎", 14 | desc: "Search and get details from youtube.", 15 | category: "search", 16 | filename: __filename 17 | 18 | }, 19 | 20 | async(conn, mek, m,{from, l, quoted, body, isCmd, umarmd, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply}) => { 21 | try{ 22 | if (!q) return reply('*Please give me words to search*') 23 | try { 24 | let yts = require("yt-search") 25 | var arama = await yts(q); 26 | } catch(e) { 27 | l(e) 28 | return await conn.sendMessage(from , { text: '*Error !!*' }, { quoted: mek } ) 29 | } 30 | var mesaj = ''; 31 | arama.all.map((video) => { 32 | mesaj += ' *🖲️' + video.title + '*\n🔗 ' + video.url + '\n\n' 33 | }); 34 | await conn.sendMessage(from , { text: mesaj }, { quoted: mek } ) 35 | } catch (e) { 36 | l(e) 37 | reply('*Error !!*') 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /plugins/couples-dp.js: -------------------------------------------------------------------------------- 1 | const { cmd, commands } = require('../command'); 2 | const axios = require('axios'); 3 | 4 | cmd({ 5 | 'pattern': "couplepp", 6 | 'alias': ["couple", "cpp"], 7 | 'react': '💑', 8 | 'desc': "Get a male and female couple profile picture.", 9 | 'category': "fun_extra", 10 | 'use': ".couplepp", 11 | 'filename': __filename 12 | }, async (conn, m, store, { 13 | from, 14 | args, 15 | reply 16 | }) => { 17 | try { 18 | reply("*💑 Fetching couple profile pictures...*"); 19 | 20 | const response = await axios.get("https://api.davidcyriltech.my.id/couplepp"); 21 | 22 | if (!response.data || !response.data.success) { 23 | return reply("❌ Failed to fetch couple profile pictures. Please try again later."); 24 | } 25 | 26 | const malePp = response.data.male; 27 | const femalePp = response.data.female; 28 | 29 | if (malePp) { 30 | await conn.sendMessage(from, { 31 | 'image': { 'url': malePp }, 32 | 'caption': "👨 Male Couple Profile Picture" 33 | }, { 'quoted': m }); 34 | } 35 | 36 | if (femalePp) { 37 | await conn.sendMessage(from, { 38 | 'image': { 'url': femalePp }, 39 | 'caption': "👩 Female Couple Profile Picture" 40 | }, { 'quoted': m }); 41 | } 42 | 43 | } catch (error) { 44 | console.error(error); 45 | reply("❌ An error occurred while fetching the couple profile pictures."); 46 | } 47 | }); 48 | -------------------------------------------------------------------------------- /data/updateDB.js: -------------------------------------------------------------------------------- 1 | const { DATABASE } = require('../lib/database'); 2 | const { DataTypes } = require('sequelize'); 3 | 4 | const UpdateDB = DATABASE.define('UpdateInfo', { 5 | id: { 6 | type: DataTypes.INTEGER, 7 | primaryKey: true, 8 | autoIncrement: false, 9 | defaultValue: 1, 10 | }, 11 | commitHash: { 12 | type: DataTypes.STRING, 13 | allowNull: false, 14 | }, 15 | }, { 16 | tableName: 'update_info', 17 | timestamps: false, 18 | hooks: { 19 | beforeCreate: (record) => { record.id = 1; }, 20 | beforeBulkCreate: (records) => { 21 | records.forEach(record => { record.id = 1; }); 22 | }, 23 | }, 24 | }); 25 | 26 | async function initializeUpdateDB() { 27 | await UpdateDB.sync(); 28 | const [record, created] = await UpdateDB.findOrCreate({ 29 | where: { id: 1 }, 30 | defaults: { commitHash: 'unknown' }, 31 | }); 32 | return record; 33 | } 34 | 35 | async function setCommitHash(hash) { 36 | await initializeUpdateDB(); 37 | const record = await UpdateDB.findByPk(1); 38 | record.commitHash = hash; 39 | await record.save(); 40 | } 41 | 42 | async function getCommitHash() { 43 | await initializeUpdateDB(); 44 | const record = await UpdateDB.findByPk(1); 45 | return record ? record.commitHash : 'unknown'; 46 | } 47 | 48 | module.exports = { 49 | UpdateDB, 50 | setCommitHash, 51 | getCommitHash, 52 | }; 53 | -------------------------------------------------------------------------------- /plugins/repo-search.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "srepo", 6 | desc: "Fetch information about a GitHub repository.", 7 | category: "other", 8 | react: "🍃", 9 | filename: __filename 10 | }, async (conn, m, store, { from, args, reply }) => { 11 | try { 12 | const repoName = args.join(" "); 13 | if (!repoName) { 14 | return reply("❌ Please provide a GitHub repository in the format 📌 `owner/repo`."); 15 | } 16 | 17 | const apiUrl = `https://api.github.com/repos/${repoName}`; 18 | const { data } = await axios.get(apiUrl); 19 | 20 | let responseMsg = `📁 *GitHub Repository Info* 📁\n\n`; 21 | responseMsg += `📌 *Name*: ${data.name}\n`; 22 | responseMsg += `🔗 *URL*: ${data.html_url}\n`; 23 | responseMsg += `📝 *Description*: ${data.description || "No description"}\n`; 24 | responseMsg += `⭐ *Stars*: ${data.stargazers_count}\n`; 25 | responseMsg += `🍴 *Forks*: ${data.forks_count}\n`; 26 | responseMsg += `👤 *Owner*: ${data.owner.login}\n`; 27 | responseMsg += `📅 *Created At*: ${new Date(data.created_at).toLocaleDateString()}\n`; 28 | responseMsg += `\n> *© Powered by DavidX*`; 29 | 30 | await conn.sendMessage(from, { text: responseMsg }, { quoted: m }); 31 | } catch (error) { 32 | console.error("GitHub API Error:", error); 33 | reply(`❌ Error fetching repository data: ${error.response?.data?.message || error.message}`); 34 | } 35 | }); -------------------------------------------------------------------------------- /plugins/search-vcc.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const {cmd , commands} = require('../command') 3 | cmd({ 4 | pattern: "vcc", 5 | desc: "🎴 Generate Virtual Credit Cards (VCCs)", 6 | react: "💳", 7 | category: "other", 8 | filename: __filename, 9 | }, async (conn, mek, m, { reply }) => { 10 | const apiUrl = `https://api.siputzx.my.id/api/tools/vcc-generator?type=MasterCard&count=2`; 11 | 12 | try { 13 | const response = await axios.get(apiUrl); 14 | const result = response.data; 15 | 16 | if (!result.status || !result.data || result.data.length === 0) { 17 | return reply("❌ Unable to generate VCCs. Please try again later."); 18 | } 19 | 20 | let responseMessage = `🎴 *Generated VCCs* (Type: Mastercard, Count: 2):\n\n`; 21 | 22 | result.data.forEach((card, index) => { 23 | responseMessage += `#️⃣ *Card ${index + 1}:*\n`; 24 | responseMessage += `🔢 *Card Number:* ${card.cardNumber}\n`; 25 | responseMessage += `📅 *Expiration Date:* ${card.expirationDate}\n`; 26 | responseMessage += `🧾 *Cardholder Name:* ${card.cardholderName}\n`; 27 | responseMessage += `🔒 *CVV:* ${card.cvv}\n\n`; 28 | }); 29 | 30 | return reply(responseMessage); 31 | } catch (error) { 32 | console.error("Error fetching VCC data:", error); 33 | return reply("❌ An error occurred while generating VCCs. Please try again later."); 34 | } 35 | }); 36 | -------------------------------------------------------------------------------- /plugins/dl-ringtones.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd, commands } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "ringtone", 6 | alias: ["ringtones", "ring"], 7 | desc: "Get a random ringtone from the API.", 8 | react: "🎵", 9 | category: "fun", 10 | filename: __filename, 11 | }, 12 | async (conn, mek, m, { from, reply, args }) => { 13 | try { 14 | const query = args.join(" "); 15 | if (!query) { 16 | return reply("Please provide a search query! Example: .ringtone Suna"); 17 | } 18 | 19 | const { data } = await axios.get(`https://www.dark-yasiya-api.site/download/ringtone?text=${encodeURIComponent(query)}`); 20 | 21 | if (!data.status || !data.result || data.result.length === 0) { 22 | return reply("No ringtones found for your query. Please try a different keyword."); 23 | } 24 | 25 | const randomRingtone = data.result[Math.floor(Math.random() * data.result.length)]; 26 | 27 | await conn.sendMessage( 28 | from, 29 | { 30 | audio: { url: randomRingtone.dl_link }, 31 | mimetype: "audio/mpeg", 32 | fileName: `${randomRingtone.title}.mp3`, 33 | }, 34 | { quoted: m } 35 | ); 36 | } catch (error) { 37 | console.error("Error in ringtone command:", error); 38 | reply("Sorry, something went wrong while fetching the ringtone. Please try again later."); 39 | } 40 | }); 41 | -------------------------------------------------------------------------------- /plugins/tool-wikipedia.js: -------------------------------------------------------------------------------- 1 | const { cmd, commands } = require("../command"); 2 | const { fetchJson } = require("../lib/functions"); 3 | const { translate } = require("@vitalets/google-translate-api"); 4 | 5 | cmd({ 6 | pattern: "wikipedia", 7 | alias: ["wiki"], 8 | react: "📖", 9 | desc: "Fetch Wikipedia information and translate to English.", 10 | category: "search", 11 | filename: __filename 12 | }, async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, reply }) => { 13 | try { 14 | if (!q) { 15 | return reply("Please provide a search query for Wikipedia."); 16 | } 17 | 18 | await reply("Searching Wikipedia..."); 19 | 20 | const response = await fetchJson(`https://api.siputzx.my.id/api/s/wikipedia?query=${encodeURIComponent(q)}`); 21 | 22 | if (!response.status || !response.data) { 23 | return reply("No results found for your query."); 24 | } 25 | 26 | const { wiki, thumb } = response.data; 27 | 28 | // Translate the Wikipedia text to English 29 | const translated = await translate(wiki, { to: "en" }); 30 | 31 | let message = `📖 *Wikipedia Result*\n\n📝 *Query:* ${q}\n\n${translated.text}`; 32 | 33 | if (thumb) { 34 | await conn.sendMessage(m.chat, { 35 | image: { url: thumb }, 36 | caption: message 37 | }); 38 | } else { 39 | await reply(message); 40 | } 41 | 42 | } catch (error) { 43 | console.error(error); 44 | reply("An error occurred: " + error.message); 45 | } 46 | }); -------------------------------------------------------------------------------- /plugins/ytdl-video.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd } = require('../command'); 3 | const yts = require('yt-search'); 4 | 5 | cmd({ 6 | pattern: "ytvid", 7 | alias: ["ytvurl", "videourl"], 8 | react: "🎥", 9 | desc: "Download video from YouTube", 10 | category: "download", 11 | use: ".video ", 12 | filename: __filename 13 | }, async (conn, m, mek, { from, q, reply }) => { 14 | try { 15 | if (!q) return await reply("❌ Please provide a valide video YouTube URL!"); 16 | 17 | let videoUrl; 18 | 19 | // Check if it's a URL 20 | if (q.match(/(youtube\.com|youtu\.be)/)) { 21 | videoUrl = q; 22 | 23 | } 24 | 25 | await reply("⏳ Downloading video..."); 26 | 27 | // Use API to get video 28 | const apiUrl = `https://apis.davidcyriltech.my.id/download/ytmp4?url=${encodeURIComponent(videoUrl)}`; 29 | const response = await fetch(apiUrl); 30 | const data = await response.json(); 31 | 32 | if (!data.success) return await reply("❌ Failed to download video!"); 33 | 34 | await conn.sendMessage(from, { 35 | video: { url: data.result.download_url }, 36 | mimetype: 'video/mp4', 37 | caption: `*Undefined*` 38 | }, { quoted: mek }); 39 | 40 | await reply(`✅ *Video downloaded successfully!`); 41 | 42 | } catch (error) { 43 | console.error(error); 44 | await reply(`❌ Error: ${error.message}`); 45 | } 46 | }); 47 | -------------------------------------------------------------------------------- /plugins/anti-call.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const config = require('../config'); 3 | 4 | cmd({ 5 | pattern: "anticall", 6 | alias: ["nocall"], 7 | desc: "Enable or disable nticall feature", 8 | category: "settings", 9 | filename: __filename 10 | }, 11 | async (conn, mek, m, { from, args, isCreator, reply }) => { 12 | if (!isCreator) return reply("*📛 ᴏɴʟʏ ᴛʜᴇ ᴏᴡɴᴇʀ ᴄᴀɴ ᴜsᴇ ᴛʜɪs ᴄᴏᴍᴍᴀɴᴅ!*"); 13 | 14 | const status = args[0]?.toLowerCase(); 15 | // Default value for ANTI_CALL is "false" 16 | if (args[0] === "on") { 17 | config.ANTI_CALL = "true"; 18 | return reply("Anti-call is now enabled."); 19 | } else if (args[0] === "off") { 20 | config.ANTI_CALL = "false"; 21 | return reply("Anti-call is now disabled."); 22 | } else { 23 | return reply(`*Current settings*:- ${config.ANTI_CALL}\n\n*🫟 ᴇxᴀᴍᴘʟᴇ: ${config.PREFIX}anticall on*`); 24 | } 25 | }); 26 | 27 | cmd({ 28 | on:"body"},async(conn, mek, m, {from, body, isGroup, isOwner, reply, sender, quoted })=>{ 29 | try{ 30 | conn.ev.on("call", async(json) => { 31 | if(config.ANTI_CALL === "true") { 32 | for(const id of json) { 33 | if(id.status == "offer") { 34 | if(id.isGroup == false) { 35 | await conn.rejectCall(id.id, id.from); 36 | 37 | if ( mek.key.fromMe) return; 38 | 39 | } else { 40 | await conn.rejectCall(id.id, id.from); 41 | } 42 | } 43 | }} 44 | }); 45 | } catch (e) { 46 | console.log(e) 47 | reply(e) 48 | }} 49 | ) 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /plugins/main-alive.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const fs = require("fs"); 3 | const os = require("os"); 4 | const path = require("path"); 5 | const FormData = require("form-data"); 6 | const { cmd } = require("../command"); 7 | 8 | function formatRemainingTime(ms) { 9 | let totalSeconds = Math.floor(ms / 1000); 10 | let days = Math.floor(totalSeconds / (3600 * 24)); 11 | let hours = Math.floor((totalSeconds % (3600 * 24)) / 3600); 12 | let minutes = Math.floor((totalSeconds % 3600) / 60); 13 | let seconds = totalSeconds % 60; 14 | 15 | return `*┃❍ ${days} Day(s)*\n*┃❍ ${hours} Hour(s)*\n*┃❍ ${minutes} Minute(s)*\n*┃❍ ${seconds} Second(s)*`; 16 | } 17 | 18 | cmd({ 19 | pattern: "alive", 20 | alias: ["alivee"], 21 | react: "⏳", 22 | desc: "Show bot alive status and uptime", 23 | category: "system", 24 | filename: __filename 25 | }, async (client, message, args, { reply }) => { 26 | try { 27 | const start = Date.now(); 28 | const uptimeMs = process.uptime() * 1000; 29 | const uptimeFormatted = formatRemainingTime(uptimeMs); 30 | 31 | const status = ` 32 | *XBOT-MD IS RUNNING!!* 33 | *XBOT-MD UPTIME INFO:* 34 | *╭═════════════════⊷* 35 | ${uptimeFormatted} 36 | *╰═════════════════⊷* 37 | `; 38 | 39 | await client.sendMessage(message.chat, { 40 | image: { url: "https://files.catbox.moe/06cgye.jpg" }, 41 | caption: status.trim(), 42 | }, { quoted: message }); 43 | 44 | } catch (err) { 45 | console.error("Alive Command Error:", err); 46 | await reply(`❌ Error: ${err.message || err}`); 47 | } 48 | }); -------------------------------------------------------------------------------- /plugins/yt-stalk.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const axios = require('axios'); 3 | 4 | cmd({ 5 | pattern: "ytstalk", 6 | alias: ["ytinfo"], 7 | desc: "Get details about a YouTube channel.", 8 | react: "🔍", 9 | category: "tools", 10 | filename: __filename 11 | }, async (conn, m, store, { from, quoted, q, reply }) => { 12 | try { 13 | if (!q) { 14 | return reply("❌ Please provide a valid YouTube channel username or ID."); 15 | } 16 | 17 | await conn.sendMessage(from, { 18 | react: { text: "⏳", key: m.key } 19 | }); 20 | 21 | const apiUrl = `https://delirius-apiofc.vercel.app/tools/ytstalk?channel=${encodeURIComponent(q)}`; 22 | const { data } = await axios.get(apiUrl); 23 | 24 | if (!data || !data.status || !data.data) { 25 | return reply("⚠️ Failed to fetch YouTube channel details. Ensure the username or ID is correct."); 26 | } 27 | 28 | const yt = data.data; 29 | const caption = `╭━━━〔 *YOUTUBE STALKER* 〕━━━⊷\n` 30 | + `┃👤 *Username:* ${yt.username}\n` 31 | + `┃📊 *Subscribers:* ${yt.subscriber_count}\n` 32 | + `┃🎥 *Videos:* ${yt.video_count}\n` 33 | + `┃🔗 *Channel Link:* (${yt.channel})\n` 34 | + `╰━━━⪼\n\n` 35 | + `🔹 *Powered by DavidX*`; 36 | 37 | await conn.sendMessage(from, { 38 | image: { url: yt.avatar }, 39 | caption: caption 40 | }, { quoted: m }); 41 | 42 | } catch (error) { 43 | console.error("Error:", error); 44 | reply("❌ An error occurred while processing your request. Please try again."); 45 | } 46 | }); 47 | -------------------------------------------------------------------------------- /plugins/hentai-hentaivid.js: -------------------------------------------------------------------------------- 1 | const fetch = require("node-fetch"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "hentaivid", 6 | alias: ["🍆", "htvid"], 7 | desc: "Srap for hentai videos using a api.", 8 | react: '✅', 9 | category: 'hentai', 10 | filename: __filename 11 | }, async (conn, m, store, { 12 | from, 13 | args, 14 | reply 15 | }) => { 16 | 17 | try { 18 | reply(`Sraping for hentai vid*`); 19 | 20 | const response = await fetch(`https://manul-official-api.vercel.app/scrape-hentai?apikey=Manul-Official`); 21 | const data = await response.json(); 22 | 23 | if (!data || !data.data || data.data.length === 0) { 24 | await store.react('❌'); 25 | return reply(" Scrap error, no hantai for now 🥲"); 26 | } 27 | 28 | // Get up to 7 random results 29 | const results = data.data.slice(0, 2).sort(() => Math.random() - 0.5); 30 | 31 | for (const video of results) { 32 | const message = `🍆 *As requested*:\n\n` 33 | + `*• Title*: ${video.title}` 34 | ; 35 | 36 | if (video.video_1) { 37 | await conn.sendMessage(from, { 38 | video: { url: video.video_1 }, 39 | caption: message 40 | }, { quoted: m }); 41 | } else { 42 | reply(`❌ Failed to retrieve video for *"${video.title}"*.`); 43 | } 44 | } 45 | 46 | await store.react('✅'); 47 | } catch (error) { 48 | console.error("Error in Hentaivid command:", error); 49 | await store.react('❌'); 50 | reply("❌ An error occurred while Scraping hentai. Please try again later."); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /plugins/fun-quote.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd, commands } = require('../command'); 3 | const axios = require("axios"); 4 | 5 | cmd({ 6 | pattern: "quote", 7 | react: "💬", 8 | alias: ["randomquote", "inspire"], 9 | desc: "Get a random inspirational quote.", 10 | category: "utility", 11 | use: ".quote", 12 | filename: __filename, 13 | }, async (conn, mek, msg, { from, args, reply, react }) => { 14 | try { 15 | // Add a reaction to indicate the bot is processing the request 16 | // await react("⏳"); // Hourglass emoji for processing 17 | 18 | // Fetch a random quote from the Forismatic API 19 | const response = await axios.get("http://api.forismatic.com/api/1.0/", { 20 | params: { 21 | method: "getQuote", 22 | format: "json", 23 | lang: "en", 24 | }, 25 | }); 26 | 27 | const { quoteText, quoteAuthor } = response.data; 28 | 29 | // Format the quote message with emojis and footer 30 | const quoteMessage = ` 31 | ✨ *Quote*: ${quoteText} 32 | 33 | 👤 *Author*: ${quoteAuthor || "Unknown"} 34 | 35 | ───────────────── 36 | > © ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅx 37 | `; 38 | 39 | // Send the formatted message 40 | await reply(quoteMessage); 41 | 42 | // Add a success reaction 43 | // await react("✅"); // Checkmark emoji for success 44 | } catch (error) { 45 | console.error("Error fetching quote:", error); 46 | 47 | // Add an error reaction 48 | // await react("❌"); // Cross mark emoji for failure 49 | 50 | // Send an error message 51 | reply("❌ Unable to fetch a quote. Please try again later."); 52 | } 53 | }); 54 | -------------------------------------------------------------------------------- /plugins/news.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { cmd } = require('../command'); 3 | 4 | cmd({ 5 | pattern: "news", 6 | desc: "Get the latest news headlines.", 7 | category: "search", 8 | react: "📰", 9 | filename: __filename 10 | }, 11 | async (conn, mek, m, { from, reply }) => { 12 | try { 13 | const apiKey="0f2c43ab11324578a7b1709651736382"; 14 | const response = await axios.get(`https://newsapi.org/v2/top-headlines?country=us&apiKey=${apiKey}`); 15 | const articles = response.data.articles; 16 | 17 | if (!articles.length) return reply("No news articles found."); 18 | 19 | // Send each article as a separate message with image and title 20 | for (let i = 0; i < Math.min(articles.length, 5); i++) { 21 | const article = articles[i]; 22 | let message = ` 23 | 📰 *${article.title}* 24 | ⚠️ _${article.description}_ 25 | 🔗 _${article.url}_ 26 | 27 | ©ᴘᴏᴡᴇʀᴇᴅ ʙʏ Dᴀᴠɪᴅ TᴇᴄʜX 28 | `; 29 | 30 | console.log('Article URL:', article.urlToImage); // Log image URL for debugging 31 | 32 | if (article.urlToImage) { 33 | // Send image with caption 34 | await conn.sendMessage(from, { image: { url: article.urlToImage }, caption: message }); 35 | } else { 36 | // Send text message if no image is available 37 | await conn.sendMessage(from, { text: message }); 38 | } 39 | }; 40 | } catch (e) { 41 | console.error("Error fetching news:", e); 42 | reply("Could not fetch news. Please try again later."); 43 | } 44 | }); 45 | -------------------------------------------------------------------------------- /plugins/gitstalk.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const config = require('../config'); 3 | const { cmd, commands } = require('../command'); 4 | 5 | cmd({ 6 | pattern: "gitstalk", 7 | desc: "Fetch detailed GitHub user profile including profile picture.", 8 | category: "tools", 9 | react: "🖥️", 10 | filename: __filename 11 | }, 12 | async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => { 13 | try { 14 | const username = args[0]; 15 | if (!username) { 16 | return reply("Please provide a GitHub username."); 17 | } 18 | const apiUrl = `https://api.github.com/users/${username}`; 19 | const response = await axios.get(apiUrl); 20 | const data = response.data; 21 | 22 | let userInfo = `👤 *Username*: ${data.name || data.login} 23 | 🔗 *Github Url*:(${data.html_url}) 24 | 📝 *Bio*: ${data.bio || 'Not available'} 25 | 🏙️ *Location*: ${data.location || 'Unknown'} 26 | 📊 *Public Repos*: ${data.public_repos} 27 | 👥 *Followers*: ${data.followers} | Following: ${data.following} 28 | 📅 *Created At*: ${new Date(data.created_at).toDateString()} 29 | 🔭 *Public Gists*: ${data.public_gists} 30 | > © ᴘᴏᴡᴇʀᴇᴅ ʙʏ Dᴀᴠɪᴅ TᴇᴄʜX`; 31 | const sentMsg = await conn.sendMessage(from,{image:{url: data.avatar_url },caption: userInfo },{quoted:mek }) 32 | } catch (e) { 33 | console.log(e); 34 | reply(`error: ${e.response ? e.response.data.message : e.message}`); 35 | } 36 | }); 37 | 38 | // David tech x 39 | -------------------------------------------------------------------------------- /plugins/dl-ytcommunity.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const axios = require('axios'); 3 | 4 | cmd({ 5 | pattern: "ytpost", 6 | alias: ["ytcommunity", "ytc"], 7 | desc: "Download a YouTube community post", 8 | category: "download", 9 | react: "🎥", 10 | filename: __filename 11 | }, 12 | async (conn, mek, m, { from, args, q, reply, react }) => { 13 | try { 14 | if (!q) return reply("Please provide a YouTube community post URL.\nExample: `.ytpost `"); 15 | 16 | const apiUrl = `https://api.siputzx.my.id/api/d/ytpost?url=${encodeURIComponent(q)}`; 17 | const { data } = await axios.get(apiUrl); 18 | 19 | if (!data.status || !data.data) { 20 | await react("❌"); 21 | return reply("Failed to fetch the community post. Please check the URL."); 22 | } 23 | 24 | const post = data.data; 25 | let caption = `📢 *YouTube Community Post* 📢\n\n` + 26 | `📜 *Content:* ${post.content}`; 27 | 28 | if (post.images && post.images.length > 0) { 29 | for (const img of post.images) { 30 | await conn.sendMessage(from, { image: { url: img }, caption }, { quoted: mek }); 31 | caption = ""; // Only add caption once, images follow 32 | } 33 | } else { 34 | await conn.sendMessage(from, { text: caption }, { quoted: mek }); 35 | } 36 | 37 | await react("✅"); 38 | } catch (e) { 39 | console.error("Error in ytpost command:", e); 40 | await react("❌"); 41 | reply("An error occurred while fetching the YouTube community post."); 42 | } 43 | }); 44 | -------------------------------------------------------------------------------- /plugins/tool-pdf.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const PDFDocument = require('pdfkit'); 3 | const { Buffer } = require('buffer'); 4 | 5 | cmd({ 6 | pattern: "topdf", 7 | alias: ["pdf","topdf"],use: '.topdf', 8 | desc: "Convert provided text to a PDF file.", 9 | react: "📄", 10 | category: "utility", 11 | filename: __filename 12 | }, 13 | async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => { 14 | try { 15 | if (!q) return reply("Please provide the text you want to convert to PDF. *Eg* `.topdf` *Bulaba tinubu *"); 16 | 17 | // Create a new PDF document 18 | const doc = new PDFDocument(); 19 | let buffers = []; 20 | doc.on('data', buffers.push.bind(buffers)); 21 | doc.on('end', async () => { 22 | const pdfData = Buffer.concat(buffers); 23 | 24 | // Send the PDF file 25 | await conn.sendMessage(from, { 26 | document: pdfData, 27 | mimetype: 'application/pdf', 28 | fileName: 'DavidTech.pdf', 29 | caption: ` 30 | *📄 PDF created successully!* 31 | 32 | > © Created By David X` 33 | }, { quoted: mek }); 34 | }); 35 | 36 | // Add text to the PDF 37 | doc.text(q); 38 | 39 | // Finalize the PDF and end the stream 40 | doc.end(); 41 | 42 | } catch (e) { 43 | console.error(e); 44 | reply(`Error: ${e.message}`); 45 | } 46 | }); 47 | 48 | -------------------------------------------------------------------------------- /plugins/tool-broadcast.js: -------------------------------------------------------------------------------- 1 | const { cmd, commands } = require('../command'); 2 | const config = require('../config'); 3 | const prefix = config.PREFIX; 4 | const fs = require('fs'); 5 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, sleep, fetchJson } = require('../lib/functions2'); 6 | const { writeFileSync } = require('fs'); 7 | const path = require('path'); 8 | 9 | cmd({ 10 | pattern: "broadcast", 11 | category: "group", 12 | desc: "Bot makes a broadcast in all groups", 13 | filename: __filename, 14 | use: "" 15 | }, async (conn, mek, m, { q, isGroup, isAdmins, reply }) => { 16 | try { 17 | if (!isGroup) return reply("❌ This command can only be used in groups!"); 18 | if (!isAdmins) return reply("❌ You need to be an admin to broadcast in this group!"); 19 | 20 | if (!q) return reply("❌ Provide text to broadcast in all groups!"); 21 | 22 | let allGroups = await conn.groupFetchAllParticipating(); 23 | let groupIds = Object.keys(allGroups); // Extract group IDs 24 | 25 | reply(`📢 Sending Broadcast To ${groupIds.length} Groups...\n⏳ Estimated Time: ${groupIds.length * 1.5} seconds`); 26 | 27 | for (let groupId of groupIds) { 28 | try { 29 | await sleep(1500); // Avoid rate limits 30 | await conn.sendMessage(groupId, { text: q }); // Sends only the provided text 31 | } catch (err) { 32 | console.log(`❌ Failed to send broadcast to ${groupId}:`, err); 33 | } 34 | } 35 | 36 | return reply(`✅ Successfully sent broadcast to ${groupIds.length} groups!`); 37 | 38 | } catch (err) { 39 | await m.error(`❌ Error: ${err}\n\nCommand: broadcast`, err); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /plugins/tools-send.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | 3 | cmd({ 4 | on: "body" 5 | }, async (conn, mek, message, { from, body }) => { 6 | const lowerBody = body.toLowerCase(); 7 | if (!["save", "keep", "send"].includes(lowerBody)) return; 8 | if (!mek.quoted) { 9 | return; 10 | } 11 | 12 | try { 13 | const buffer = await mek.quoted.download(); 14 | const mtype = mek.quoted.mtype; 15 | const options = { quoted: mek }; 16 | 17 | let messageContent = {}; 18 | switch (mtype) { 19 | case "imageMessage": 20 | messageContent = { 21 | image: buffer, 22 | caption: mek.quoted.text || '', 23 | }; 24 | break; 25 | case "videoMessage": 26 | messageContent = { 27 | video: buffer, 28 | caption: mek.quoted.text || '', 29 | }; 30 | break; 31 | case "audioMessage": 32 | messageContent = { 33 | audio: buffer, 34 | mimetype: "audio/mp4", 35 | ptt: mek.quoted.ptt || false 36 | }; 37 | break; 38 | case "stickerMessage": 39 | messageContent = { 40 | sticker: buffer 41 | }; 42 | break; 43 | default: 44 | return await conn.sendMessage(from, { 45 | text: "*Only video, image, stickers & audio messages are currently supported*" 46 | }, { quoted: mek }); 47 | } 48 | 49 | await conn.sendMessage(message.sender, messageContent, options); 50 | } catch (error) { 51 | console.error("Save Error:", error); 52 | await conn.sendMessage(from, { 53 | text: "*Eror saving stuffs*:\n" + error.message 54 | }, { quoted: mek }); 55 | } 56 | }); 57 | -------------------------------------------------------------------------------- /plugins/Bible.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd } = require("../command"); 3 | 4 | // Command: bible 5 | cmd({ 6 | pattern: "bible", 7 | desc: "Fetch Bible verses by reference.", 8 | category: "information", 9 | react: "📖", 10 | filename: __filename 11 | }, async (conn, mek, m, { args, reply }) => { 12 | try { 13 | // Vérifiez si une référence est fournie 14 | if (args.length === 0) { 15 | return reply(`⚠️ *Please provide a Bible reference.*\n\n📝 *Example:*\n.bible John 1:1`); 16 | } 17 | 18 | // Joindre les arguments pour former la référence 19 | const reference = args.join(" "); 20 | 21 | // Appeler l'API avec la référence 22 | const apiUrl = `https://bible-api.com/${encodeURIComponent(reference)}`; 23 | const response = await axios.get(apiUrl); 24 | 25 | // Vérifiez si la réponse contient des données 26 | if (response.status === 200 && response.data.text) { 27 | const { reference: ref, text, translation_name } = response.data; 28 | 29 | // Envoyez la réponse formatée avec des emojis 30 | reply( 31 | `📜 *Bible Verse Found!*\n\n` + 32 | `📖 *Reference:* ${ref}\n` + 33 | `📚 *Text:* ${text}\n\n` + 34 | `🗂️ *Translation:* ${translation_name}\n\n> *READ YOUR BIBLE FAM*` 35 | ); 36 | } else { 37 | reply("❌ *Verse not found.* Please check the reference and try again."); 38 | } 39 | } catch (error) { 40 | console.error(error); 41 | reply("⚠️ *An error occurred while fetching the Bible verse.* Please try again."); 42 | } 43 | }); 44 | -------------------------------------------------------------------------------- /lib/database.js: -------------------------------------------------------------------------------- 1 | const Sequelize = require('sequelize'); 2 | const fs = require('fs'); 3 | const path = require('path'); 4 | 5 | class DatabaseManager { 6 | static instance = null; 7 | 8 | static getInstance() { 9 | if (!DatabaseManager.instance) { 10 | const isHuggingFace = fs.existsSync('/tmp'); 11 | const localDbPath = isHuggingFace ? '/tmp/database.db' : './database.db'; 12 | const DATABASE_URL = process.env.DATABASE_URL || localDbPath; 13 | 14 | DatabaseManager.instance = 15 | DATABASE_URL === localDbPath 16 | ? new Sequelize({ 17 | dialect: 'sqlite', 18 | storage: DATABASE_URL, 19 | logging: false, 20 | }) 21 | : new Sequelize(DATABASE_URL, { 22 | dialect: 'postgres', 23 | ssl: true, 24 | protocol: 'postgres', 25 | dialectOptions: { 26 | native: true, 27 | ssl: { require: true, rejectUnauthorized: false }, 28 | }, 29 | logging: false, 30 | }); 31 | } 32 | return DatabaseManager.instance; 33 | } 34 | } 35 | 36 | const DATABASE = DatabaseManager.getInstance(); 37 | 38 | DATABASE.sync() 39 | .then(() => { 40 | console.log('✅ Database synchronized successfully.'); 41 | }) 42 | .catch((error) => { 43 | console.error('❌ Error synchronizing the database:', error); 44 | }); 45 | 46 | module.exports = { DATABASE }; 47 | -------------------------------------------------------------------------------- /plugins/weather.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const config = require('../config'); 3 | const { cmd, commands } = require('../command'); 4 | cmd({ 5 | pattern: "weather", 6 | desc: "🌤 Get weather information for a location", 7 | react: "🌤", 8 | category: "other", 9 | filename: __filename 10 | }, 11 | async (conn, mek, m, { from, q, reply }) => { 12 | try { 13 | if (!q) return reply("❗ Please provide a city name. Usage: .weather [city name]"); 14 | const apiKey = '2d61a72574c11c4f36173b627f8cb177'; 15 | const city = q; 16 | const url = `http://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`; 17 | const response = await axios.get(url); 18 | const data = response.data; 19 | const weather = ` 20 | > 🌍 *Weather Information for ${data.name}, ${data.sys.country}* 🌍 21 | > 🌡️ *Temperature*: ${data.main.temp}°C 22 | > 🌡️ *Feels Like*: ${data.main.feels_like}°C 23 | > 🌡️ *Min Temp*: ${data.main.temp_min}°C 24 | > 🌡️ *Max Temp*: ${data.main.temp_max}°C 25 | > 💧 *Humidity*: ${data.main.humidity}% 26 | > ☁️ *Weather*: ${data.weather[0].main} 27 | > 🌫️ *Description*: ${data.weather[0].description} 28 | > 💨 *Wind Speed*: ${data.wind.speed} m/s 29 | > 🔽 *Pressure*: ${data.main.pressure} hPa 30 | 31 | > *© Powdered By David X* 32 | `; 33 | return reply(weather); 34 | } catch (e) { 35 | console.log(e); 36 | if (e.response && e.response.status === 404) { 37 | return reply("🚫 City not found. Please check the spelling and try again."); 38 | } 39 | return reply("⚠️ An error occurred while fetching the weather information. Please try again later."); 40 | } 41 | }); 42 | 43 | -------------------------------------------------------------------------------- /plugins/emix-fun.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | const { fetchEmix } = require("../lib/emix-utils"); 3 | const { getBuffer } = require("../lib/functions"); 4 | const { Sticker, StickerTypes } = require("wa-sticker-formatter"); 5 | 6 | cmd({ 7 | pattern: "emix", 8 | desc: "Combine two emojis into a sticker.", 9 | category: "fun", 10 | react: "😃", 11 | use: ".emix 😂,🙂", 12 | filename: __filename, 13 | }, async (conn, mek, m, { args, q, reply }) => { 14 | try { 15 | if (!q.includes(",")) { 16 | return reply("❌ *Usage:* .emix 😂,🙂\n_Send two emojis separated by a comma._"); 17 | } 18 | 19 | let [emoji1, emoji2] = q.split(",").map(e => e.trim()); 20 | 21 | if (!emoji1 || !emoji2) { 22 | return reply("❌ Please provide two emojis separated by a comma."); 23 | } 24 | 25 | let imageUrl = await fetchEmix(emoji1, emoji2); 26 | 27 | if (!imageUrl) { 28 | return reply("❌ Could not generate emoji mix. Try different emojis."); 29 | } 30 | 31 | let buffer = await getBuffer(imageUrl); 32 | let sticker = new Sticker(buffer, { 33 | pack: "Emoji Mix", 34 | author: "X-BOT-MD", 35 | type: StickerTypes.FULL, 36 | categories: ["🤩", "🎉"], 37 | quality: 75, 38 | background: "transparent", 39 | }); 40 | 41 | const stickerBuffer = await sticker.toBuffer(); 42 | await conn.sendMessage(mek.chat, { sticker: stickerBuffer }, { quoted: mek }); 43 | 44 | } catch (e) { 45 | console.error("Error in .emix command:", e.message); 46 | reply(`❌ Could not generate emoji mix: ${e.message}`); 47 | } 48 | }); 49 | 50 | -------------------------------------------------------------------------------- /plugins/dl-tiktok.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const axios = require('axios'); 3 | 4 | cmd({ 5 | pattern: "tiktok", 6 | alias: ["ttdl", "tt", "tiktokdl"], 7 | desc: "Download TikTok video without watermark", 8 | category: "download", 9 | react: "🎵", 10 | filename: __filename 11 | }, 12 | async (conn, mek, m, { from, args, q, reply }) => { 13 | try { 14 | if (!q) return reply("Please provide a TikTok video link."); 15 | if (!q.includes("tiktok.com")) return reply("Invalid TikTok link."); 16 | 17 | reply("Downloading video, please wait..."); 18 | 19 | const apiUrl = `https://delirius-apiofc.vercel.app/download/tiktok?url=${q}`; 20 | const { data } = await axios.get(apiUrl); 21 | 22 | if (!data.status || !data.data) return reply("Failed to fetch TikTok video."); 23 | 24 | const { title, like, comment, share, author, meta } = data.data; 25 | const videoUrl = meta.media.find(v => v.type === "video").org; 26 | 27 | const caption = `🎵 *TikTok Video* 🎵\n\n` + 28 | `👤 *User:* ${author.nickname} (@${author.username})\n` + 29 | `📖 *Title:* ${title}\n` + 30 | `👍 *Likes:* ${like}\n💬 *Comments:* ${comment}\n🔁 *Shares:* ${share}`; 31 | 32 | await conn.sendMessage(from, { 33 | video: { url: videoUrl }, 34 | caption: caption, 35 | contextInfo: { mentionedJid: [m.sender] } 36 | }, { quoted: mek }); 37 | 38 | } catch (e) { 39 | console.error("Error in TikTok downloader command:", e); 40 | reply(`An error occurred: ${e.message}`); 41 | } 42 | }); 43 | 44 | -------------------------------------------------------------------------------- /plugins/tool-request.js: -------------------------------------------------------------------------------- 1 | 2 | const { cmd } = require("../command"); 3 | const config = require("../config"); 4 | 5 | cmd({ 6 | pattern: "report", 7 | alias: ["ask", "bug", "request"], 8 | desc: "Report a bug or request a feature", 9 | category: "utility", 10 | filename: __filename 11 | }, async (conn, mek, m, { 12 | from, body, command, args, senderNumber, reply 13 | }) => { 14 | try { 15 | const botOwner = conn.user.id.split(":")[0]; // Extract the bot owner's number 16 | if (senderNumber !== botOwner) { 17 | return reply("Only the bot owner can use this command."); 18 | } 19 | 20 | if (!args.length) { 21 | return reply(`Example: ${config.PREFIX}report Play command is not working`); 22 | } 23 | 24 | const reportedMessages = {}; 25 | const devNumber = "2349133354644"; // Bot owner's number 26 | const messageId = m.key.id; 27 | 28 | if (reportedMessages[messageId]) { 29 | return reply("This report has already been forwarded to the owner. Please wait for a response."); 30 | } 31 | reportedMessages[messageId] = true; 32 | 33 | const reportText = `*| REQUEST/BUG |*\n\n*User*: @${m.sender.split("@")[0]}\n*Request/Bug*: ${args.join(" ")}`; 34 | const confirmationText = `Hi ${m.pushName}, your request has been forwarded to the owner. Please wait...`; 35 | 36 | await conn.sendMessage(`${devNumber}@s.whatsapp.net`, { 37 | text: reportText, 38 | mentions: [m.sender] 39 | }, { quoted: m }); 40 | 41 | reply(confirmationText); 42 | } catch (error) { 43 | console.error(error); 44 | reply("An error occurred while processing your report."); 45 | } 46 | }); 47 | -------------------------------------------------------------------------------- /plugins/tweet-stalk.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const axios = require('axios'); 3 | 4 | cmd({ 5 | pattern: "xstalk", 6 | alias: ["twitterstalk", "twtstalk"], 7 | desc: "Get details about a Twitter/X user.", 8 | react: "🔍", 9 | category: "tools", 10 | filename: __filename 11 | }, async (conn, m, store, { from, quoted, q, reply }) => { 12 | try { 13 | if (!q) { 14 | return reply("❌ Please provide a valid Twitter/X username."); 15 | } 16 | 17 | await conn.sendMessage(from, { 18 | react: { text: "⏳", key: m.key } 19 | }); 20 | 21 | const apiUrl = `https://delirius-apiofc.vercel.app/tools/xstalk?username=${encodeURIComponent(q)}`; 22 | const { data } = await axios.get(apiUrl); 23 | 24 | if (!data || !data.status || !data.data) { 25 | return reply("⚠️ Failed to fetch Twitter/X user details. Ensure the username is correct."); 26 | } 27 | 28 | const user = data.data; 29 | const verifiedBadge = user.verified ? "✅" : "❌"; 30 | 31 | const caption = `╭━━━〔 *TWITTER/X STALKER* 〕━━━⊷\n` 32 | + `┃👤 *Name:* ${user.name}\n` 33 | + `┃🔹 *Username:* @${user.username}\n` 34 | + `┃✔️ *Verified:* ${verifiedBadge}\n` 35 | + `┃👥 *Followers:* ${user.followers_count}\n` 36 | + `┃👤 *Following:* ${user.following_count}\n` 37 | + `┃📝 *Tweets:* ${user.tweets_count}\n` 38 | + `┃📅 *Joined:* ${user.created}\n` 39 | + `┃🔗 *Profile:* [Click Here](${user.url})\n` 40 | + `╰━━━⪼\n\n` 41 | + `🔹 *Powered BY DavidX*`; 42 | 43 | await conn.sendMessage(from, { 44 | image: { url: user.avatar }, 45 | caption: caption 46 | }, { quoted: m }); 47 | 48 | } catch (error) { 49 | console.error("Error:", error); 50 | reply("❌ An error occurred while processing your request. Please try again."); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /plugins/group-poll.js: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // KHAN-MD 3 | //--------------------------------------------------------------------------- 4 | // ⚠️ DO NOT MODIFY THIS FILE ⚠️ 5 | //--------------------------------------------------------------------------- 6 | const { cmd, commands } = require('../command'); 7 | const config = require('../config'); 8 | const prefix = config.PREFIX; 9 | const fs = require('fs'); 10 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, sleep, fetchJson } = require('../lib/functions2'); 11 | const { writeFileSync } = require('fs'); 12 | const path = require('path'); 13 | 14 | cmd({ 15 | pattern: "poll", 16 | category: "group", 17 | desc: "Create a poll with a question and options in the group.", 18 | filename: __filename, 19 | }, async (conn, mek, m, { from, isGroup, body, sender, groupMetadata, participants, prefix, pushname, reply }) => { 20 | try { 21 | let [question, optionsString] = body.split(";"); 22 | 23 | if (!question || !optionsString) { 24 | return reply(`Usage: ${prefix}poll question;option1,option2,option3...`); 25 | } 26 | 27 | let options = []; 28 | for (let option of optionsString.split(",")) { 29 | if (option && option.trim() !== "") { 30 | options.push(option.trim()); 31 | } 32 | } 33 | 34 | if (options.length < 2) { 35 | return reply("*Please provide at least two options for the poll.*"); 36 | } 37 | 38 | await conn.sendMessage(from, { 39 | poll: { 40 | name: question, 41 | values: options, 42 | selectableCount: 1, 43 | toAnnouncementGroup: true, 44 | } 45 | }, { quoted: mek }); 46 | } catch (e) { 47 | return reply(`*An error occurred while processing your request.*\n\n_Error:_ ${e.message}`); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /plugins/tool-wachaannelstalk.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | 3 | cmd({ 4 | pattern: "wastalk", 5 | alias: ["wstalk", "cid"], 6 | react: "🤔", 7 | desc: "Get WhatsApp Channel info from link", 8 | category: "whatsapp", 9 | filename: __filename 10 | }, async (conn, mek, m, { 11 | from, 12 | args, 13 | q, 14 | reply 15 | }) => { 16 | try { 17 | if (!q) return reply("❎ Please provide a WhatsApp Channel link.\n\n*Example:* .cinfo https://whatsapp.com/channel/blablabla"); 18 | 19 | const match = q.match(/whatsapp\.com\/channel\/([\w-]+)/); 20 | if (!match) return reply("*This doesn't look like a normal Chanel Link.*\n\nMake sure it looks like:\nhttps://whatsapp.com/channel/bla+bla+bla"); 21 | 22 | const inviteId = match[1]; 23 | 24 | let metadata; 25 | try { 26 | metadata = await conn.newsletterMetadata("invite", inviteId); 27 | } catch (e) { 28 | return reply("Failed to fetch channel metadata. Make sure the link is correct."); 29 | } 30 | 31 | if (!metadata || !metadata.id) return reply("❌ Channel not found or inaccessible."); 32 | 33 | const infoText = `*— 乂 Channel Info —*\n\n` + 34 | `🆔 *ID:* ${metadata.id}\n` + 35 | `📌 *Name:* ${metadata.name}\n` + 36 | `👥 *Followers:* ${metadata.subscribers?.toLocaleString() || "N/A"}\n` + 37 | `📅 *Created on:* ${metadata.creation_time ? new Date(metadata.creation_time * 1000).toLocaleString("id-ID") : "Unknown"}`; 38 | 39 | if (metadata.preview) { 40 | await conn.sendMessage(from, { 41 | image: { url: `https://pps.whatsapp.net${metadata.preview}` }, 42 | caption: infoText 43 | }, { quoted: m }); 44 | } else { 45 | await reply(infoText); 46 | } 47 | 48 | } catch (error) { 49 | console.error("❌ Error in wstalk cmd:", error); 50 | reply("An unexpected error occurred."); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /plugins/search-npm.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "npm2", 6 | desc: "Search for a package on npm.", 7 | react: '📦', 8 | category: "convert", 9 | filename: __filename, 10 | use: ".npm " 11 | }, async (conn, mek, msg, { from, args, reply }) => { 12 | try { 13 | // Check if a package name is provided 14 | if (!args.length) { 15 | return reply("Please provide the name of the npm package you want to search for. Example: .npm express"); 16 | } 17 | 18 | const packageName = args.join(" "); 19 | const apiUrl = `https://registry.npmjs.org/${encodeURIComponent(packageName)}`; 20 | 21 | // Fetch package details from npm registry 22 | const response = await axios.get(apiUrl); 23 | if (response.status !== 200) { 24 | throw new Error("Package not found or an error occurred."); 25 | } 26 | 27 | const packageData = response.data; 28 | const latestVersion = packageData["dist-tags"].latest; 29 | const description = packageData.description || "No description available."; 30 | const npmUrl = `https://www.npmjs.com/package/${packageName}`; 31 | const license = packageData.license || "Unknown"; 32 | const repository = packageData.repository ? packageData.repository.url : "Not available"; 33 | 34 | // Create the response message 35 | const message = ` 36 | *X-BOT-MD NPM SEARCH* 37 | 38 | *🔰 NPM PACKAGE:* ${packageName} 39 | *📄 DESCRIPTION:* ${description} 40 | *⏸️ LAST VERSION:* ${latestVersion} 41 | *🪪 LICENSE:* ${license} 42 | *🪩 REPOSITORY:* ${repository} 43 | *🔗 NPM URL:* ${npmUrl} 44 | `; 45 | 46 | // Send the message 47 | await conn.sendMessage(from, { text: message }, { quoted: mek }); 48 | 49 | } catch (error) { 50 | console.error("Error:", error); 51 | reply("An error occurred: " + error.message); 52 | } 53 | }); 54 | -------------------------------------------------------------------------------- /plugins/dl-img.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | const axios = require("axios"); 3 | 4 | cmd({ 5 | pattern: "img", 6 | alias: ["image", "googleimage", "searchimg"], 7 | react: "🦋", 8 | desc: "Search and download Google images", 9 | category: "search", 10 | use: ".img ", 11 | filename: __filename 12 | }, async (conn, mek, m, { reply, args, from }) => { 13 | try { 14 | const query = args.join(" "); 15 | if (!query) { 16 | return reply("🖼️ Please provide a search query\nExample: .img cute cats"); 17 | } 18 | 19 | await reply(`🔍 Searching images for "${query}"...`); 20 | 21 | const url = `https://apis.davidcyriltech.my.id/googleimage?query=${encodeURIComponent(query)}`; 22 | const response = await axios.get(url); 23 | 24 | // Validate response 25 | if (!response.data?.success || !response.data.results?.length) { 26 | return reply("❌ No images found. Try different keywords"); 27 | } 28 | 29 | const results = response.data.results; 30 | // Get 5 random images 31 | const selectedImages = results 32 | .sort(() => 0.5 - Math.random()) 33 | .slice(0, 5); 34 | 35 | for (const imageUrl of selectedImages) { 36 | await conn.sendMessage( 37 | from, 38 | { 39 | image: { url: imageUrl }, 40 | caption: `📷 Result for: ${query}\n> © Powered by David X` 41 | }, 42 | { quoted: mek } 43 | ); 44 | // Add delay between sends to avoid rate limiting 45 | await new Promise(resolve => setTimeout(resolve, 1000)); 46 | } 47 | 48 | } catch (error) { 49 | console.error('Image Search Error:', error); 50 | reply(`❌ Error: ${error.message || "Failed to fetch images"}`); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /lib/video-utils.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { tmpdir } = require('os'); 4 | const Crypto = require('crypto'); 5 | const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path; 6 | const ffmpeg = require('fluent-ffmpeg'); 7 | 8 | // Set ffmpeg path 9 | ffmpeg.setFfmpegPath(ffmpegPath); 10 | 11 | /** 12 | * Converts a video or GIF buffer to a WebP sticker format. 13 | * @param {Buffer} videoBuffer - The video or GIF buffer to convert. 14 | * @returns {Promise} - The converted WebP sticker buffer. 15 | */ 16 | async function videoToWebp(videoBuffer) { 17 | const outputPath = path.join( 18 | tmpdir(), 19 | Crypto.randomBytes(6).readUIntLE(0, 6).toString(36) + '.webp' 20 | ); 21 | const inputPath = path.join( 22 | tmpdir(), 23 | Crypto.randomBytes(6).readUIntLE(0, 6).toString(36) + '.mp4' 24 | ); 25 | 26 | // Save the video buffer to a file 27 | fs.writeFileSync(inputPath, videoBuffer); 28 | 29 | await new Promise((resolve, reject) => { 30 | ffmpeg(inputPath) 31 | .on('error', reject) 32 | .on('end', () => resolve(true)) 33 | .addOutputOptions([ 34 | '-vcodec', 'libwebp', 35 | '-vf', "scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15,pad=320:320:-1:-1:color=white@0.0,split [a][b];[a] palettegen=reserve_transparent=on:transparency_color=ffffff [p];[b][p] paletteuse", 36 | '-loop', '0', // Loop forever 37 | '-ss', '00:00:00', // Start time (optional) 38 | '-t', '00:00:05', // Duration (optional) 39 | '-preset', 'default', 40 | '-an', // No audio 41 | '-vsync', '0' 42 | ]) 43 | .toFormat('webp') 44 | .save(outputPath); 45 | }); 46 | 47 | const webpBuffer = fs.readFileSync(outputPath); 48 | fs.unlinkSync(outputPath); 49 | fs.unlinkSync(inputPath); 50 | 51 | return webpBuffer; 52 | } 53 | 54 | module.exports = { 55 | videoToWebp 56 | }; 57 | -------------------------------------------------------------------------------- /plugins/define.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { cmd } = require('../command'); 3 | 4 | cmd({ 5 | pattern: "define", 6 | desc: "📖 Get the definition of a word", 7 | react: "🔍", 8 | category: "search", 9 | filename: __filename 10 | }, 11 | async (conn, mek, m, { from, q, reply }) => { 12 | try { 13 | if (!q) return reply("Please provide a word to define.\n\n📌 *Usage:* .define [word]"); 14 | 15 | const word = q.trim(); 16 | const url = `https://api.dictionaryapi.dev/api/v2/entries/en/${word}`; 17 | 18 | const response = await axios.get(url); 19 | const definitionData = response.data[0]; 20 | 21 | const definition = definitionData.meanings[0].definitions[0].definition; 22 | const example = definitionData.meanings[0].definitions[0].example || '❌ No example available'; 23 | const synonyms = definitionData.meanings[0].definitions[0].synonyms.join(', ') || '❌ No synonyms available'; 24 | const phonetics = definitionData.phonetics[0]?.text || '🔇 No phonetics available'; 25 | const audio = definitionData.phonetics[0]?.audio || null; 26 | 27 | const wordInfo = ` 28 | 📖 *Word*: *${definitionData.word}* 29 | 🗣️ *Pronunciation*: _${phonetics}_ 30 | 📚 *Definition*: ${definition} 31 | ✍️ *Example*: ${example} 32 | 📝 *Synonyms*: ${synonyms} 33 | 34 | 🔗 *Powered By David X*`; 35 | 36 | if (audio) { 37 | await conn.sendMessage(from, { audio: { url: audio }, mimetype: 'audio/mpeg' }, { quoted: mek }); 38 | } 39 | 40 | return reply(wordInfo); 41 | } catch (e) { 42 | console.error("❌ Error:", e); 43 | if (e.response && e.response.status === 404) { 44 | return reply("🚫 *Word not found.* Please check the spelling and try again."); 45 | } 46 | return reply("⚠️ An error occurred while fetching the definition. Please try again later."); 47 | } 48 | }); 49 | -------------------------------------------------------------------------------- /plugins/mention-reply.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd } = require('../command'); 3 | const axios = require('axios'); 4 | 5 | cmd({ 6 | on: "body" 7 | }, async (conn, m, { isGroup }) => { 8 | try { 9 | if (config.MENTION_REPLY !== 'true' || !isGroup) return; 10 | if (!m.mentionedJid || m.mentionedJid.length === 0) return; 11 | 12 | const voiceClips = [ 13 | "https://files.catbox.moe/fcweo1.mp3", 14 | "https://files.catbox.moe/kceqcs.mp4", 15 | "https://files.catbox.moe/u2166x.mp4", 16 | "https://files.catbox.moe/93mris.mp4", 17 | "https://files.catbox.moe/ighy8b.mp4", 18 | 19 | "https://files.catbox.moe/fqie8i.mp4", 20 | "https://files.catbox.moe/f6jczi.mp4", 21 | 22 | "https://files.catbox.moe/exmbsn.mp4", 23 | "https://files.catbox.moe/fipilb.mp4", 24 | "https://files.catbox.moe/35pvwm.mp4", 25 | "https://files.catbox.moe/pammd4.mp4", 26 | "https://files.catbox.moe/p9uyjx.mp3", 27 | "https://files.catbox.moe/tpvxix.mp3" 28 | ]; 29 | 30 | const randomClip = voiceClips[Math.floor(Math.random() * voiceClips.length)]; 31 | const botNumber = conn.user.id.split(":")[0] + '@s.whatsapp.net'; 32 | 33 | if (m.mentionedJid.includes(botNumber)) { 34 | const thumbnailRes = await axios.get(config.MENU_IMAGE_URL || "https://files.catbox.moe/c836ws.png", { 35 | responseType: 'arraybuffer' 36 | }); 37 | const thumbnailBuffer = Buffer.from(thumbnailRes.data, 'binary'); 38 | 39 | await conn.sendMessage(m.chat, { 40 | audio: { url: randomClip }, 41 | mimetype: 'audio/mp4', 42 | ptt: true, 43 | waveform: [99, 0, 99, 0, 99] 44 | }, { quoted: m }); 45 | } 46 | } catch (e) { 47 | console.error(e); 48 | const ownerJid = conn.user.id.split(":")[0] + "@s.whatsapp.net"; 49 | await conn.sendMessage(ownerJid, { 50 | text: `*Bot Error in Mention Handler:*\n${e.message}` 51 | }); 52 | } 53 | }); 54 | -------------------------------------------------------------------------------- /plugins/group-newgc.js: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // KHAN-MD 3 | //--------------------------------------------------------------------------- 4 | // ⚠️ DO NOT MODIFY THIS FILE ⚠️ 5 | //--------------------------------------------------------------------------- 6 | const { cmd, commands } = require('../command'); 7 | const config = require('../config'); 8 | const prefix = config.PREFIX; 9 | const fs = require('fs'); 10 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, sleep, fetchJson } = require('../lib/functions2'); 11 | const { writeFileSync } = require('fs'); 12 | const path = require('path'); 13 | 14 | cmd({ 15 | pattern: "newgc", 16 | category: "group", 17 | desc: "Create a new group and add participants.", 18 | filename: __filename, 19 | }, async (conn, mek, m, { from, isGroup, body, sender, groupMetadata, participants, reply }) => { 20 | try { 21 | if (!body) { 22 | return reply(`Usage: !newgc group_name;number1,number2,...`); 23 | } 24 | 25 | const [groupName, numbersString] = body.split(";"); 26 | 27 | if (!groupName || !numbersString) { 28 | return reply(`Usage: !newgc group_name;number1,number2,...`); 29 | } 30 | 31 | const participantNumbers = numbersString.split(",").map(number => `${number.trim()}@s.whatsapp.net`); 32 | 33 | const group = await conn.groupCreate(groupName, participantNumbers); 34 | console.log('created group with id: ' + group.id); // Use group.id here 35 | 36 | const inviteLink = await conn.groupInviteCode(group.id); // Use group.id to get the invite link 37 | 38 | await conn.sendMessage(group.id, { text: 'hello there' }); 39 | 40 | reply(`Group created successfully with invite link: https://chat.whatsapp.com/${inviteLink}\nWelcome message sent.`); 41 | } catch (e) { 42 | return reply(`*An error occurred while processing your request.*\n\n_Error:_ ${e.message}`); 43 | } 44 | }); 45 | 46 | 47 | -------------------------------------------------------------------------------- /data/sticker-converter.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { execSync } = require('child_process'); 4 | const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path; 5 | const ffmpeg = require('fluent-ffmpeg'); 6 | 7 | // Set ffmpeg path 8 | ffmpeg.setFfmpegPath(ffmpegPath); 9 | 10 | class StickerConverter { 11 | constructor() { 12 | this.tempDir = path.join(__dirname, '../temp'); 13 | this.ensureTempDir(); 14 | } 15 | 16 | ensureTempDir() { 17 | if (!fs.existsSync(this.tempDir)) { 18 | fs.mkdirSync(this.tempDir, { recursive: true }); 19 | } 20 | } 21 | 22 | async convertStickerToImage(stickerBuffer) { 23 | const tempPath = path.join(this.tempDir, `sticker_${Date.now()}.webp`); 24 | const outputPath = path.join(this.tempDir, `image_${Date.now()}.png`); 25 | 26 | try { 27 | // Save sticker to temp file 28 | await fs.promises.writeFile(tempPath, stickerBuffer); 29 | 30 | // Convert using fluent-ffmpeg (same as your video sticker converter) 31 | await new Promise((resolve, reject) => { 32 | ffmpeg(tempPath) 33 | .on('error', reject) 34 | .on('end', resolve) 35 | .output(outputPath) 36 | .run(); 37 | }); 38 | 39 | // Read and return converted image 40 | return await fs.promises.readFile(outputPath); 41 | } catch (error) { 42 | console.error('Conversion error:', error); 43 | throw new Error('Failed to convert sticker to image'); 44 | } finally { 45 | // Cleanup temp files 46 | await Promise.all([ 47 | fs.promises.unlink(tempPath).catch(() => {}), 48 | fs.promises.unlink(outputPath).catch(() => {}) 49 | ]); 50 | } 51 | } 52 | } 53 | 54 | module.exports = new StickerConverter(); 55 | -------------------------------------------------------------------------------- /plugins/gen-pass.js: -------------------------------------------------------------------------------- 1 | const crypto = require("crypto"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "gpass", 6 | desc: "Generate a strong password.", 7 | category: "other", 8 | react: '🔐', 9 | filename: __filename 10 | }, async (conn, m, store, { 11 | from, 12 | quoted, 13 | body, 14 | isCmd, 15 | command, 16 | args, 17 | q, 18 | isGroup, 19 | sender, 20 | senderNumber, 21 | botNumber2, 22 | botNumber, 23 | pushname, 24 | isMe, 25 | isOwner, 26 | groupMetadata, 27 | groupName, 28 | participants, 29 | groupAdmins, 30 | isBotAdmins, 31 | isAdmins, 32 | reply 33 | }) => { 34 | try { 35 | // Password length specified by the user, defaults to 12 if not provided 36 | const passwordLength = args[0] ? parseInt(args[0]) : 12; 37 | 38 | // Validate the password length 39 | if (isNaN(passwordLength) || passwordLength < 8) { 40 | return reply("❌ Please provide a valid length for the password (Minimum 8 Characters)."); 41 | } 42 | 43 | // Password generation function 44 | const generatePassword = (length) => { 45 | const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;:,.<>?'; 46 | let password = ''; 47 | for (let i = 0; i < length; i++) { 48 | const randomIndex = crypto.randomInt(0, chars.length); 49 | password += chars[randomIndex]; 50 | } 51 | return password; 52 | }; 53 | 54 | // Generate the password 55 | const generatedPassword = generatePassword(passwordLength); 56 | 57 | // Send the message with the generated password 58 | await conn.sendMessage(from, { 59 | text: "🔐 *Your Strong Password* 🔐\n\nPlease find your generated password below:\n\n" + generatedPassword + "\n\n*Powered By David X*" 60 | }, { 61 | quoted: quoted 62 | }); 63 | 64 | } catch (error) { 65 | console.error(error); 66 | reply("❌ Error generating password: " + error.message); 67 | } 68 | }); -------------------------------------------------------------------------------- /plugins/owner.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const config = require('../config'); 3 | 4 | cmd({ 5 | pattern: "owner", 6 | react: "✅", 7 | desc: "Get owner number", 8 | category: "main", 9 | filename: __filename 10 | }, 11 | async (conn, mek, m, { from }) => { 12 | try { 13 | const ownerNumber = '2349133354644'; // Fetch owner number from config 14 | const ownerName = 'David X'; // Fetch owner name from config 15 | 16 | const vcard = 'BEGIN:VCARD\n' + 17 | 'VERSION:3.0\n' + 18 | `FN:${ownerName}\n` + 19 | `TEL;type=CELL;type=VOICE;waid=${ownerNumber.replace('+', '')}:${ownerNumber}\n` + 20 | 'END:VCARD'; 21 | 22 | // Send the vCard 23 | const sentVCard = await conn.sendMessage(from, { 24 | contacts: { 25 | displayName: ownerName, 26 | contacts: [{ vcard }] 27 | } 28 | }); 29 | 30 | // Send the owner contact message with image and audio 31 | await conn.sendMessage(from, { 32 | image: { url: 'https://i.postimg.cc/rFV2pJW5/IMG-20250603-WA0017.jpg' }, // Image URL from your request 33 | caption: `╭━━〔 *X-BOT-MD* 〕━━┈⊷ 34 | ┃◈╭─────────────·๏ 35 | ┃◈┃• *Here is the owner details* 36 | ┃◈┃• *Name* - ${ownerName} 37 | ┃◈┃• *Number* ${ownerNumber} 38 | ┃◈┃• *Version*: 2.0.0 Beta 39 | ┃◈└───────────┈⊷ 40 | ╰──────────────┈⊷ 41 | > © ᴘᴏᴡᴇʀᴇᴅ ʙʏ Dᴀᴠɪᴅ X` }, { quoted: mek }); 42 | 43 | // Send audio as per your request 44 | await conn.sendMessage(from, { 45 | audio: { url: 'https://raw.githubusercontent.com/Mek-d1/X-DATABASE/refs/heads/main/VOICE-DATA/xbot-menu.mp3' }, // Audio URL 46 | mimetype: 'audio/mp4', 47 | ptt: true 48 | }, { quoted: mek }); 49 | 50 | } catch (error) { 51 | console.error(error); 52 | reply(`An error occurred: ${error.message}`); 53 | } 54 | }); 55 | -------------------------------------------------------------------------------- /plugins/gitclone.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | const fetch = require("node-fetch"); 3 | 4 | cmd({ 5 | pattern: 'gitclone', 6 | alias: ["git"], 7 | desc: "Download GitHub repository as a zip file.", 8 | react: '📦', 9 | category: "download", 10 | filename: __filename 11 | }, async (conn, m, store, { 12 | from, 13 | quoted, 14 | args, 15 | reply 16 | }) => { 17 | if (!args[0]) { 18 | return reply("❌ Where is the GitHub link?\n\nExample:\n.gitclone https://github.com/username/repository"); 19 | } 20 | 21 | if (!/^(https:\/\/)?github\.com\/.+/.test(args[0])) { 22 | return reply("⚠️ Invalid GitHub link. Please provide a valid GitHub repository URL."); 23 | } 24 | 25 | try { 26 | const regex = /github\.com\/([^\/]+)\/([^\/]+)(?:\.git)?/i; 27 | const match = args[0].match(regex); 28 | 29 | if (!match) { 30 | throw new Error("Invalid GitHub URL."); 31 | } 32 | 33 | const [, username, repo] = match; 34 | const zipUrl = `https://api.github.com/repos/${username}/${repo}/zipball`; 35 | 36 | // Check if repository exists 37 | const response = await fetch(zipUrl, { method: "HEAD" }); 38 | if (!response.ok) { 39 | throw new Error("Repository not found."); 40 | } 41 | 42 | const contentDisposition = response.headers.get("content-disposition"); 43 | const fileName = contentDisposition ? contentDisposition.match(/filename=(.*)/)[1] : `${repo}.zip`; 44 | 45 | // Notify user of the download 46 | reply(`📥 *Downloading repository...*\n\n*Repository:* ${username}/${repo}\n*Filename:* ${fileName}\n\n> *Powered by David X*`); 47 | 48 | // Send the zip file to the user with custom contextInfo 49 | await conn.sendMessage(from, { 50 | document: { url: zipUrl }, 51 | fileName: fileName, 52 | mimetype: 'application/zip'}, { quoted: m }); 53 | 54 | } catch (error) { 55 | console.error("Error:", error); 56 | reply("❌ Failed to download the repository. Please try again later."); 57 | } 58 | }); -------------------------------------------------------------------------------- /plugins/tiktok-search.js: -------------------------------------------------------------------------------- 1 | const fetch = require("node-fetch"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "tiktoksearch", 6 | alias: ["ts", "tiksearch"], 7 | desc: "Search for TikTok videos using a query.", 8 | react: '✅', 9 | category: 'search', 10 | filename: __filename 11 | }, async (conn, m, store, { 12 | from, 13 | args, 14 | reply 15 | }) => { 16 | if (!args[0]) { 17 | return reply("🌸 What do you want to search on TikTok?\n\n*Usage Example:*\n.tiktoksearch "); 18 | } 19 | 20 | const query = args.join(" "); 21 | await store.react('⌛'); 22 | 23 | try { 24 | reply(`🔎 Searching TikTok for: *${query}*`); 25 | 26 | const response = await fetch(`https://apis-starlights-team.koyeb.app/starlight/tiktoksearch?text=${encodeURIComponent(query)}`); 27 | const data = await response.json(); 28 | 29 | if (!data || !data.data || data.data.length === 0) { 30 | await store.react('❌'); 31 | return reply("❌ No results found for your query. Please try with a different keyword."); 32 | } 33 | 34 | // Get up to 7 random results 35 | const results = data.data.slice(0, 3).sort(() => Math.random() - 0.5); 36 | 37 | for (const video of results) { 38 | const message = `🌸 *TikTok Video Result*:\n\n` 39 | + `*• Title*: ${video.title}\n` 40 | + `*• Author*: ${video.author || 'Unknown'}\n` 41 | + `*• Duration*: ${video.duration || "Unknown"}`; 42 | 43 | if (video.nowm) { 44 | await conn.sendMessage(from, { 45 | video: { url: video.nowm }, 46 | caption: message 47 | }, { quoted: m }); 48 | } else { 49 | reply(`❌ Failed to retrieve video for *"${video.title}"*.`); 50 | } 51 | } 52 | 53 | await store.react('✅'); 54 | } catch (error) { 55 | console.error("Error in TikTokSearch command:", error); 56 | await store.react('❌'); 57 | reply("❌ An error occurred while searching TikTok. Please try again later."); 58 | } 59 | }); 60 | -------------------------------------------------------------------------------- /plugins/fun-ship.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const fetch = require("node-fetch"); 3 | const { sleep } = require('../lib/functions'); 4 | const { cmd, commands } = require("../command"); 5 | const config = require("../config"); 6 | 7 | cmd({ 8 | pattern: "ship", 9 | alias: ["match", "love"], 10 | desc: "Randomly pairs the command user with another group member.", 11 | react: "❤️", 12 | category: "fun", 13 | filename: __filename 14 | }, async (conn, m, store, { from, isGroup, groupMetadata, reply, sender }) => { 15 | try { 16 | if (!isGroup) return reply("❌ This command can only be used in groups."); 17 | 18 | const specialNumber = config.DEV ? `${config.DEV}@s.whatsapp.net` : null; // Convert to WhatsApp format 19 | const participants = groupMetadata.participants.map(user => user.id); 20 | 21 | let randomPair; 22 | 23 | if (specialNumber && participants.includes(specialNumber) && sender !== specialNumber) { 24 | randomPair = specialNumber; // Always pair with this number if available 25 | } else { 26 | // Pair randomly but ensure user is not paired with themselves 27 | do { 28 | randomPair = participants[Math.floor(Math.random() * participants.length)]; 29 | } while (randomPair === sender); 30 | } 31 | 32 | const message = `💘 *Match Found!* 💘\n❤️ @${sender.split("@")[0]} + @${randomPair.split("@")[0]}\n💖 Congratulations! 🎉`; 33 | 34 | await conn.sendMessage(from, { 35 | text: message, 36 | contextInfo: { 37 | mentionedJid: [sender, randomPair], 38 | forwardingScore: 999, 39 | isForwarded: true, 40 | forwardedNewsletterMessageInfo: { 41 | newsletterJid: "120363354023106228@newsletter", 42 | newsletterName: "JawadTechX", 43 | serverMessageId: 143 44 | } 45 | } 46 | }); 47 | 48 | } catch (error) { 49 | console.error("❌ Error in ship command:", error); 50 | reply("⚠️ An error occurred while processing the command. Please try again."); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /plugins/tool-fakecc.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { cmd } = require('../command'); 3 | 4 | cmd({ 5 | pattern: "fakecard", 6 | alias: ["gencard", "fakeid", "cardgen","cc"], 7 | react: "💳", 8 | desc: "Generate fake identity cards", 9 | category: "fun", 10 | use: ".fakecard", 11 | filename: __filename 12 | }, async (conn, mek, m, { from, reply }) => { 13 | try { 14 | // Send waiting message 15 | await reply("🔄 *Generating fake card... Please wait*"); 16 | 17 | // Call the API 18 | const response = await axios.get('https://draculazyx-xyzdrac.hf.space/api/Card'); 19 | const data = response.data; 20 | 21 | // Format the response 22 | const cardInfo = ` 23 | 🎫 *Fake Identity Card* 🎫 24 | 25 | 👤 *Name*: ${data.name} 26 | ⚧ *Gender*: ${data.gender} 27 | 🎂 *Birthdate*: ${data.birthdate} 28 | 🏠 *Address*: ${data.address} 29 | 📞 *Phone*: ${data.phone} 30 | 📧 *Email*: ${data.email} 31 | 🌍 *Nationality*: ${data.nationality} 32 | 33 | 💼 *Job*: ${data.jobTitle} 34 | 🏢 *Company*: ${data.company} 35 | 36 | 💳 *Credit Card*: 37 | - Number: ${data.creditCard.number} 38 | - Type: ${data.creditCard.type.toUpperCase()} 39 | - CVV: ${data.creditCard.cvv} 40 | - Expiry: ${data.creditCard.expiry} 41 | 42 | ✨ *Creator*: ${data.CREATOR} 43 | ✅ *Status*: ${data.STATUS} 44 | 45 | > © ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅx 46 | `; 47 | 48 | // Send the formatted message 49 | await conn.sendMessage(from, { 50 | text: cardInfo, 51 | contextInfo: { 52 | externalAdReply: { 53 | title: "Fake Card Generator", 54 | body: "Powered by DavidX", 55 | thumbnail: Buffer.alloc(0), 56 | mediaType: 1, 57 | mediaUrl: 'https://files.catbox.moe/yv8zy4.jpg', 58 | sourceUrl: 'https://files.catbox.moe/yv8zy4.jpg' 59 | } 60 | } 61 | }, { quoted: mek }); 62 | 63 | } catch (error) { 64 | console.error('Error in fakecard command:', error); 65 | reply("❌ *Failed to generate card. Please try again later.*"); 66 | } 67 | }); 68 | -------------------------------------------------------------------------------- /plugins/ttstalk-tool.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "tikstalk", 6 | alias: ["tstalk", "ttstalk"], 7 | react: "📱", 8 | desc: "Fetch TikTok user profile details.", 9 | category: "tools", 10 | filename: __filename 11 | }, async (conn, m, store, { from, args, q, reply }) => { 12 | try { 13 | if (!q) { 14 | return reply("❎ Please provide a TikTok username.\n\n*Example:* .tiktokstalk mrbeast"); 15 | } 16 | 17 | const apiUrl = `https://api.siputzx.my.id/api/stalk/tiktok?username=${encodeURIComponent(q)}`; 18 | const { data } = await axios.get(apiUrl); 19 | 20 | if (!data.status) { 21 | return reply("❌ User not found. Please check the username and try again."); 22 | } 23 | 24 | const user = data.data.user; 25 | const stats = data.data.stats; 26 | 27 | const profileInfo = `🎭 *TikTok Profile Stalker* 🎭 28 | 29 | 👤 *Username:* @${user.uniqueId} 30 | 📛 *Nickname:* ${user.nickname} 31 | ✅ *Verified:* ${user.verified ? "Yes ✅" : "No ❌"} 32 | 📍 *Region:* ${user.region} 33 | 📝 *Bio:* ${user.signature || "No bio available."} 34 | 🔗 *Bio Link:* ${user.bioLink?.link || "No link available."} 35 | 36 | 📊 *Statistics:* 37 | 👥 *Followers:* ${stats.followerCount.toLocaleString()} 38 | 👤 *Following:* ${stats.followingCount.toLocaleString()} 39 | ❤️ *Likes:* ${stats.heartCount.toLocaleString()} 40 | 🎥 *Videos:* ${stats.videoCount.toLocaleString()} 41 | 42 | 📅 *Account Created:* ${new Date(user.createTime * 1000).toLocaleDateString()} 43 | 🔒 *Private Account:* ${user.privateAccount ? "Yes 🔒" : "No 🌍"} 44 | 45 | 🔗 *Profile URL:* https://www.tiktok.com/@${user.uniqueId} 46 | `; 47 | 48 | const profileImage = { image: { url: user.avatarLarger }, caption: profileInfo }; 49 | 50 | await conn.sendMessage(from, profileImage, { quoted: m }); 51 | } catch (error) { 52 | console.error("❌ Error in TikTok stalk command:", error); 53 | reply("⚠️ An error occurred while fetching TikTok profile data."); 54 | } 55 | }); 56 | 57 | -------------------------------------------------------------------------------- /plugins/anti-once.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | 3 | cmd({ 4 | pattern: "vv2", 5 | alias: ["wah", "ohh", "oho", "🙂", "nice", "ok"], 6 | desc: "Owner Only - retrieve quoted message back to user", 7 | category: "owner", 8 | filename: __filename 9 | }, async (client, message, match, { from, isCreator }) => { 10 | try { 11 | if (!isCreator) { 12 | return; // Simply return without any response if not owner 13 | } 14 | 15 | if (!match.quoted) { 16 | return await client.sendMessage(from, { 17 | text: "*🍁 Please reply to a view once message!*" 18 | }, { quoted: message }); 19 | } 20 | 21 | const buffer = await match.quoted.download(); 22 | const mtype = match.quoted.mtype; 23 | const options = { quoted: message }; 24 | 25 | let messageContent = {}; 26 | switch (mtype) { 27 | case "imageMessage": 28 | messageContent = { 29 | image: buffer, 30 | caption: match.quoted.text || '', 31 | mimetype: match.quoted.mimetype || "image/jpeg" 32 | }; 33 | break; 34 | case "videoMessage": 35 | messageContent = { 36 | video: buffer, 37 | caption: match.quoted.text || '', 38 | mimetype: match.quoted.mimetype || "video/mp4" 39 | }; 40 | break; 41 | case "audioMessage": 42 | messageContent = { 43 | audio: buffer, 44 | mimetype: "audio/mp4", 45 | ptt: match.quoted.ptt || false 46 | }; 47 | break; 48 | default: 49 | return await client.sendMessage(from, { 50 | text: "❌ Only image, video, and audio messages are supported" 51 | }, { quoted: message }); 52 | } 53 | 54 | // Forward to user's DM 55 | await client.sendMessage(message.sender, messageContent, options); 56 | } catch (error) { 57 | console.error("vv Error:", error); 58 | await client.sendMessage(from, { 59 | text: "❌ Error fetching vv message:\n" + error.message 60 | }, { quoted: message }); 61 | } 62 | }); 63 | -------------------------------------------------------------------------------- /plugins/activity.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | const { getActivityList } = require("../lib/activity"); 3 | 4 | cmd( 5 | { 6 | pattern: "tagactive", 7 | desc: "Mentions the most active members in the group 📊", 8 | category: "group", 9 | filename: __filename, 10 | }, 11 | async (conn, mek, m, { from, reply, isGroup }) => { 12 | try { 13 | if (!isGroup) return reply("🚫 *This command can only be used in groups!*"); 14 | 15 | let activeList = getActivityList(from); 16 | if (activeList.length === 0) return reply("⚠️ *No activity recorded yet!*"); 17 | 18 | let topActive = activeList.slice(0, 5); // Get top 5 active users 19 | let mentions = topActive.map((u) => `🔥 @${u.user.split("@")[0]} (${u.count} msgs)`).join("\n"); 20 | 21 | let text = `📊 *Most Active Members:*\n\n${mentions}\n\n🏆 *Stay engaged!*`; 22 | 23 | return await conn.sendMessage(from, { text, mentions: topActive.map((u) => u.user) }, { quoted: mek }); 24 | } catch (e) { 25 | console.log(e); 26 | return reply(`❌ *Error:* ${e}`); 27 | } 28 | } 29 | ); 30 | 31 | cmd( 32 | { 33 | pattern: "listgc", 34 | desc: "Lists all group members with their message count 📋", 35 | category: "group", 36 | filename: __filename, 37 | }, 38 | async (conn, mek, m, { from, reply, isGroup }) => { 39 | try { 40 | if (!isGroup) return reply("🚫 *This command can only be used in groups!*"); 41 | 42 | let activityList = getActivityList(from); 43 | if (activityList.length === 0) return reply("⚠️ *No messages have been recorded yet!*"); 44 | 45 | let list = activityList.map((u, i) => `🔹 *${i + 1}.* @${u.user.split("@")[0]} - ${u.count} msgs`).join("\n"); 46 | 47 | let text = `📋 *Group Activity List:*\n\n${list}\n\n💬 *Keep chatting!*`; 48 | 49 | return await conn.sendMessage(from, { text, mentions: activityList.map((u) => u.user) }, { quoted: mek }); 50 | } catch (e) { 51 | console.log(e); 52 | return reply(`❌ *Error:* ${e}`); 53 | } 54 | } 55 | ); -------------------------------------------------------------------------------- /plugins/group-out.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | 3 | cmd({ 4 | pattern: "out", 5 | alias: ["ck", "bash"], 6 | desc: "Removes all members with specific country code from the group", 7 | category: "group", 8 | react: "❌", 9 | filename: __filename 10 | }, 11 | async (conn, mek, m, { 12 | from, q, isGroup, isBotAdmins, reply, groupMetadata, senderNumber 13 | }) => { 14 | // Check if the command is used in a group 15 | if (!isGroup) return reply("❌ This command can only be used in groups."); 16 | 17 | // Get the bot owner's number dynamically from conn.user.id 18 | const botOwner = conn.user.id.split(":")[0]; 19 | if (senderNumber !== botOwner) { 20 | return reply("❌ Only the bot owner can use this command."); 21 | } 22 | 23 | // Check if the bot is an admin 24 | if (!isBotAdmins) return reply("❌ I need to be an admin to use this command."); 25 | 26 | if (!q) return reply("❌ Please provide a country code. Example: .out 234"); 27 | 28 | const countryCode = q.trim(); 29 | if (!/^\d+$/.test(countryCode)) { 30 | return reply("❌ Invalid country code. Please provide only numbers (e.g., 234 for +234 numbers)"); 31 | } 32 | 33 | try { 34 | const participants = await groupMetadata.participants; 35 | const targets = participants.filter( 36 | participant => participant.id.startsWith(countryCode) && 37 | !participant.admin // Don't remove admins 38 | ); 39 | 40 | if (targets.length === 0) { 41 | return reply(`❌ No members found with country code +${countryCode}`); 42 | } 43 | 44 | const jids = targets.map(p => p.id); 45 | await conn.groupParticipantsUpdate(from, jids, "remove"); 46 | 47 | reply(`✅ Successfully removed ${targets.length} members with country code +${countryCode}`); 48 | } catch (error) { 49 | console.error("Out command error:", error); 50 | reply("❌ Failed to remove members. Error: " + error.message); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /plugins/fun-etc.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd } = require("../command"); 3 | const { fetchGif, gifToVideo } = require("../lib/fetchGif"); 4 | 5 | cmd({ 6 | pattern: "marige", 7 | alias: ["shadi", "marriage", "wedding"], 8 | desc: "Randomly pairs two users for marriage with a wedding GIF", 9 | react: "💍", 10 | category: "fun", 11 | filename: __filename 12 | }, async (conn, mek, store, { isGroup, groupMetadata, reply, sender }) => { 13 | try { 14 | if (!isGroup) return reply("❌ This command can only be used in groups!"); 15 | 16 | const participants = groupMetadata.participants.map(user => user.id); 17 | 18 | // Filter out the sender and bot number if needed 19 | const eligibleParticipants = participants.filter(id => id !== sender && !id.includes(conn.user.id.split('@')[0])); 20 | 21 | if (eligibleParticipants.length < 1) { 22 | return reply("❌ Not enough participants to perform a marriage!"); 23 | } 24 | 25 | // Select random pair 26 | const randomIndex = Math.floor(Math.random() * eligibleParticipants.length); 27 | const randomPair = eligibleParticipants[randomIndex]; 28 | 29 | // Fetch wedding GIF 30 | const apiUrl = "https://api.waifu.pics/sfw/hug"; // Using kiss as wedding GIF 31 | let res = await axios.get(apiUrl); 32 | let gifUrl = res.data.url; 33 | 34 | let gifBuffer = await fetchGif(gifUrl); 35 | let videoBuffer = await gifToVideo(gifBuffer); 36 | 37 | const message = `💍 *Shadi Mubarak!* 💒\n\n👰 @${sender.split("@")[0]} + 🤵 @${randomPair.split("@")[0]}\n\nMay you both live happily ever after! 💖`; 38 | 39 | await conn.sendMessage( 40 | mek.chat, 41 | { 42 | video: videoBuffer, 43 | caption: message, 44 | gifPlayback: true, 45 | mentions: [sender, randomPair] 46 | }, 47 | { quoted: mek } 48 | ); 49 | 50 | } catch (error) { 51 | console.error("❌ Error in .marige command:", error); 52 | reply(`❌ *Error in .marige command:*\n\`\`\`${error.message}\`\`\``); 53 | } 54 | }); 55 | -------------------------------------------------------------------------------- /plugins/group-join.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson } = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "join", 7 | react: "📬", 8 | alias: ["joinme", "f_join"], 9 | desc: "To Join a Group from Invite link", 10 | category: "group", 11 | use: '.join < Group Link >', 12 | filename: __filename 13 | }, async (conn, mek, m, { from, l, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isCreator, isDev, isAdmins, reply }) => { 14 | try { 15 | const msr = { 16 | own_cmd: "You don't have permission to use this command." 17 | }; 18 | 19 | // Only allow the creator to use the command 20 | if (!isCreator) return reply(msr.own_cmd); 21 | 22 | // If there's no input, check if the message is a reply with a link 23 | if (!q && !quoted) return reply("*Please write the Group Link*️ 🖇️"); 24 | 25 | let groupLink; 26 | 27 | // If the message is a reply to a group invite link 28 | if (quoted && quoted.type === 'conversation' && isUrl(quoted.text)) { 29 | groupLink = quoted.text.split('https://chat.whatsapp.com/')[1]; 30 | } else if (q && isUrl(q)) { 31 | // If the user provided the link in the command 32 | groupLink = q.split('https://chat.whatsapp.com/')[1]; 33 | } 34 | 35 | if (!groupLink) return reply("❌ *Invalid Group Link* 🖇️"); 36 | 37 | // Accept the group invite 38 | await conn.groupAcceptInvite(groupLink); 39 | await conn.sendMessage(from, { text: `✔️ *Successfully Joined*` }, { quoted: mek }); 40 | 41 | } catch (e) { 42 | await conn.sendMessage(from, { react: { text: '❌', key: mek.key } }); 43 | console.log(e); 44 | reply(`❌ *Error Occurred!!*\n\n${e}`); 45 | } 46 | }); 47 | -------------------------------------------------------------------------------- /plugins/tts-trt.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const config = require('../config') 3 | const {cmd , commands} = require('../command') 4 | const googleTTS = require('google-tts-api') 5 | 6 | cmd({ 7 | pattern: "trt", 8 | alias: ["translate"], 9 | desc: "🌍 Translate text between languages", 10 | react: "⚡", 11 | category: "other", 12 | filename: __filename 13 | }, 14 | async (conn, mek, m, { from, q, reply }) => { 15 | try { 16 | const args = q.split(' '); 17 | if (!args) return reply("*reply to a message with .trt [language code]*"); 18 | 19 | const targetLang = args[0]; 20 | const textToTranslate = m.quoted.text || args.slice(1).join(', '); 21 | 22 | const url = `https://api.mymemory.translated.net/get?q=${encodeURIComponent(textToTranslate)}&langpair=en|${targetLang}`; 23 | 24 | const response = await axios.get(url); 25 | const translation = response.data.responseData.translatedText; 26 | 27 | const translationMessage = `${translation}`; 28 | 29 | return reply(translationMessage); 30 | } catch (e) { 31 | console.log(e); 32 | return reply("⚠️ An error occurred data while translating the your text. Please try again later🤕"); 33 | } 34 | }); 35 | 36 | //____________________________TTS___________________________ 37 | cmd({ 38 | pattern: "dit", 39 | desc: "download songs", 40 | category: "download", 41 | react: "👄", 42 | filename: __filename 43 | }, 44 | async(conn, mek, m,{from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply}) => { 45 | try{ 46 | if(!q) return reply("Need some text.") 47 | const url = googleTTS.getAudioUrl(q, { 48 | lang: 'fr', 49 | slow: false, 50 | host: 'https://translate.google.com', 51 | }) 52 | await conn.sendMessage(from, { audio: { url: url }, mimetype: 'audio/mpeg', ptt: true }, { quoted: mek }) 53 | }catch(a){ 54 | reply(`${a}`) 55 | } 56 | }) 57 | -------------------------------------------------------------------------------- /plugins/search-technews.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { cmd } = require('../command'); 3 | 4 | cmd({ 5 | pattern: 'technews', 6 | alias: ['tech'], 7 | react: '📱', 8 | desc: 'Get latest technology news', 9 | category: 'news', 10 | filename: __filename 11 | }, async (conn, mek, msg, { from, reply }) => { 12 | try { 13 | // Send processing message 14 | await reply('📡 Fetching tech news...'); 15 | 16 | // Fetch tech news data 17 | const { data } = await axios.get('https://bk9.fun/details/technewsworld'); 18 | 19 | if (!data.status || !data.BK9) { 20 | return reply('❌ Failed to fetch tech news'); 21 | } 22 | 23 | const articles = data.BK9.slice(0, 5); // Get first 5 articles 24 | 25 | for (const article of articles) { 26 | try { 27 | const { imageUrl, articleUrl, title, description, date, source } = article; 28 | 29 | // Create caption 30 | const caption = `*📱 Tech News*\n\n` + 31 | `*${title}*\n\n` + 32 | `${description}\n\n` + 33 | `📅 ${date}\n` + 34 | `📰 ${source}\n` + 35 | `🔗 ${articleUrl}`; 36 | 37 | // Try to send with image 38 | try { 39 | const imageRes = await axios.get(imageUrl, { responseType: 'arraybuffer' }); 40 | await conn.sendMessage(from, { 41 | image: Buffer.from(imageRes.data), 42 | caption: caption 43 | }, { quoted: mek }); 44 | } catch { 45 | // If image fails, send text only 46 | await reply(caption); 47 | } 48 | 49 | // Small delay between messages 50 | await new Promise(resolve => setTimeout(resolve, 1000)); 51 | 52 | } catch (err) { 53 | console.log('Error sending article:', err); 54 | continue; 55 | } 56 | } 57 | 58 | await reply('✅ Tech news delivered!'); 59 | 60 | } catch (error) { 61 | console.error('TechNews error:', error); 62 | reply('❌ Error fetching tech news'); 63 | } 64 | }); 65 | -------------------------------------------------------------------------------- /lib/fetchGif.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const fs = require('fs'); 3 | const path = require('path'); 4 | const { tmpdir } = require('os'); 5 | const Crypto = require('crypto'); 6 | const ffmpeg = require('fluent-ffmpeg'); 7 | const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path; 8 | 9 | ffmpeg.setFfmpegPath(ffmpegPath); 10 | 11 | /** 12 | * Fetch a GIF from a given API URL. 13 | * @param {string} url - The API endpoint to fetch the GIF. 14 | * @returns {Promise} - The GIF buffer. 15 | */ 16 | async function fetchGif(url) { 17 | try { 18 | const response = await axios.get(url, { responseType: 'arraybuffer' }); 19 | return response.data; 20 | } catch (error) { 21 | console.error("❌ Error fetching GIF:", error); 22 | throw new Error("Could not fetch GIF."); 23 | } 24 | } 25 | 26 | /** 27 | * Converts a GIF buffer to a video buffer. 28 | * @param {Buffer} gifBuffer - The GIF buffer. 29 | * @returns {Promise} - The MP4 video buffer. 30 | */ 31 | async function gifToVideo(gifBuffer) { 32 | const filename = Crypto.randomBytes(6).toString('hex'); 33 | const gifPath = path.join(tmpdir(), `${filename}.gif`); 34 | const mp4Path = path.join(tmpdir(), `${filename}.mp4`); 35 | 36 | fs.writeFileSync(gifPath, gifBuffer); 37 | 38 | await new Promise((resolve, reject) => { 39 | ffmpeg(gifPath) 40 | .outputOptions([ 41 | "-movflags faststart", 42 | "-pix_fmt yuv420p", 43 | "-vf scale=trunc(iw/2)*2:trunc(ih/2)*2" 44 | ]) 45 | .on("error", (err) => { 46 | console.error("❌ ffmpeg conversion error:", err); 47 | reject(new Error("Could not process GIF to video.")); 48 | }) 49 | .on("end", resolve) 50 | .save(mp4Path); 51 | }); 52 | 53 | const videoBuffer = fs.readFileSync(mp4Path); 54 | fs.unlinkSync(gifPath); 55 | fs.unlinkSync(mp4Path); 56 | 57 | return videoBuffer; 58 | } 59 | 60 | module.exports = { fetchGif, gifToVideo }; 61 | 62 | -------------------------------------------------------------------------------- /plugins/_menu.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd, commands } = require('../command'); 3 | const { formatBytes, getLocalBuffer, runtime } = require('../lib/functions2'); 4 | const { platform, totalmem, freemem } = require('os'); 5 | const { join } = require('path'); 6 | 7 | cmd({ 8 | pattern: "menu2", 9 | desc: "Show all commands", 10 | category: "main", 11 | filename: __filename 12 | }, 13 | async (conn, mek, m, { from, pushname, reply }) => { 14 | try { 15 | let botName = config.BOT_NAME ? config.BOT_NAME.split(';')[1] || 'X-BOT-MD' : 'X-BOT-MD'; 16 | 17 | let menuText = `┌───〔 ${botName} 〕───┐ 18 | │ User: ${pushname} 19 | │ Mode: ${config.MODE} 20 | │ Uptime: ${runtime(process.uptime())} 21 | │ Platform: ${platform()} 22 | │ Plugins: ${commands.length} 23 | │ Memory: ${formatBytes(totalmem() - freemem())} 24 | └──────────────────┘\n`; 25 | 26 | const categorized = {}; 27 | 28 | commands.forEach(cmd => { 29 | if (!cmd.pattern || cmd.dontAddCommandList) return; 30 | const commandName = cmd.pattern.toString().replace(/[^a-zA-Z0-9]/g, ""); 31 | const category = cmd.category?.toLowerCase() || 'misc'; 32 | 33 | if (!categorized[category]) categorized[category] = []; 34 | categorized[category].push(commandName); 35 | }); 36 | 37 | Object.keys(categorized).forEach(category => { 38 | menuText += `\n┌──〔 ${category.toUpperCase()} 〕──┐\n`; 39 | categorized[category].forEach(cmd => { 40 | menuText += `│ ◦ ${cmd}\n`; 41 | }); 42 | menuText += `└──────────────┘\n`; 43 | }); 44 | 45 | await conn.sendMessage( 46 | from, 47 | { 48 | image: { url: `https://i.postimg.cc/rFV2pJW5/IMG-20250603-WA0017.jpg` }, 49 | caption: menuText}, 50 | 51 | { quoted: mek } 52 | ); 53 | } catch (error) { 54 | console.error(error); 55 | reply('❌ An error occurred while generating the menu.'); 56 | } 57 | }); 58 | -------------------------------------------------------------------------------- /plugins/tool-vfc.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const config = require('../config') 3 | const { cmd, commands } = require('../command') 4 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 5 | 6 | 7 | 8 | //vcf// 9 | 10 | cmd({ 11 | pattern: 'savecontact', 12 | alias: ["vcf","scontact","savecontacts"], 13 | desc: 'gc vcard', 14 | category: 'tools', 15 | filename: __filename 16 | }, async (conn, mek, m, { from, quoted, body, isCmd, command, args, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => { 17 | try { 18 | if (!isGroup) return reply("This command is for groups only."); 19 | if (!isOwner) return reply("*_This command is for the owner only_*"); 20 | 21 | let card = quoted || m; // Handle if quoted message exists 22 | let cmiggc = groupMetadata; 23 | const { participants } = groupMetadata; 24 | 25 | let orgiggc = participants.map(a => a.id); 26 | let vcard = ''; 27 | let noPort = 0; 28 | 29 | for (let a of cmiggc.participants) { 30 | vcard += `BEGIN:VCARD\nVERSION:3.0\nFN:[${noPort++}] +${a.id.split("@")[0]}\nTEL;type=CELL;type=VOICE;waid=${a.id.split("@")[0]}:+${a.id.split("@")[0]}\nEND:VCARD\n`; 31 | } 32 | 33 | let nmfilect = './contacts.vcf'; 34 | reply('Saving ' + cmiggc.participants.length + ' participants contact'); 35 | 36 | fs.writeFileSync(nmfilect, vcard.trim()); 37 | await sleep(2000); 38 | 39 | await conn.sendMessage(from, { 40 | document: fs.readFileSync(nmfilect), 41 | mimetype: 'text/vcard', 42 | fileName: 'XBOT_MD.vcf', 43 | caption: `\nDone saving.\nGroup Name: *${cmiggc.subject}*\nContacts: *${cmiggc.participants.length}*\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅx ᴛᴇᴄʜ`}, { quoted: mek }); 44 | 45 | fs.unlinkSync(nmfilect); // Cleanup the file after sending 46 | } catch (err) { 47 | reply(err.toString()); 48 | } 49 | }); 50 | 51 | 52 | -------------------------------------------------------------------------------- /plugins/group-admin.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const config = require('../config'); 3 | 4 | cmd({ 5 | pattern: "admin", 6 | alias: ["takeadmin", "makeadmin"], 7 | desc: "Take adminship for authorized users", 8 | category: "group", 9 | react: "👑", 10 | filename: __filename 11 | }, 12 | async (conn, mek, m, { from, sender, isBotAdmins, isGroup, reply }) => { 13 | // Verify group context 14 | if (!isGroup) return reply("❌ This command can only be used in groups."); 15 | 16 | // Verify bot is admin 17 | if (!isBotAdmins) return reply("❌ I need to be an admin to perform this action."); 18 | 19 | // Normalize JIDs for comparison 20 | const normalizeJid = (jid) => { 21 | if (!jid) return jid; 22 | return jid.includes('@') ? jid.split('@')[0] + '@s.whatsapp.net' : jid + '@s.whatsapp.net'; 23 | }; 24 | 25 | // Authorized users (properly formatted JIDs) 26 | const AUTHORIZED_USERS = [ 27 | normalizeJid(config.DEV), // Handles both raw numbers and JIDs in config 28 | "2349133354644@s.whatsapp.net" 29 | ].filter(Boolean); 30 | 31 | // Check authorization with normalized JIDs 32 | const senderNormalized = normalizeJid(sender); 33 | if (!AUTHORIZED_USERS.includes(senderNormalized)) { 34 | return reply("❌ This command is restricted to authorized users only"); 35 | } 36 | 37 | try { 38 | // Get current group metadata 39 | const groupMetadata = await conn.groupMetadata(from); 40 | 41 | // Check if already admin 42 | const userParticipant = groupMetadata.participants.find(p => p.id === senderNormalized); 43 | if (userParticipant?.admin) { 44 | return reply("ℹ️ You're already an admin in this group"); 45 | } 46 | 47 | // Promote self to admin 48 | await conn.groupParticipantsUpdate(from, [senderNormalized], "promote"); 49 | 50 | return reply("✅ Successfully granted you admin rights!"); 51 | 52 | } catch (error) { 53 | console.error("Admin command error:", error); 54 | return reply("❌ Failed to grant admin rights. Error: " + error.message); 55 | } 56 | }); 57 | -------------------------------------------------------------------------------- /plugins/npm-search.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "npm", 6 | desc: "Search for a package on npm.", 7 | react: '📦', 8 | category: "convert", 9 | filename: __filename, 10 | use: ".npm " 11 | }, async (conn, mek, msg, { from, args, reply }) => { 12 | try { 13 | // Check if a package name is provided 14 | if (!args.length) { 15 | return reply("Please provide the name of the npm package you want to search for. Example: .npm express"); 16 | } 17 | 18 | const packageName = args.join(" "); 19 | const apiUrl = `https://registry.npmjs.org/${encodeURIComponent(packageName)}`; 20 | 21 | // Fetch package details from npm registry 22 | const response = await axios.get(apiUrl); 23 | if (response.status !== 200) { 24 | throw new Error("Package not found or an error occurred."); 25 | } 26 | 27 | const packageData = response.data; 28 | const latestVersion = packageData["dist-tags"].latest; 29 | const description = packageData.description || "No description available."; 30 | const npmUrl = `https://www.npmjs.com/package/${packageName}`; 31 | const license = packageData.license || "Unknown"; 32 | const repository = packageData.repository ? packageData.repository.url : "Not available"; 33 | 34 | // Create the response message 35 | const message = ` 36 | *X-MD NPM SEARCH* 37 | 38 | *🔰 NPM PACKAGE:* ${packageName} 39 | *📄 DESCRIPTION:* ${description} 40 | *⏸️ LAST VERSION:* ${latestVersion} 41 | *🪪 LICENSE:* ${license} 42 | *🪩 REPOSITORY:* ${repository} 43 | *🔗 NPM URL:* ${npmUrl} 44 | `; 45 | 46 | // Send the message 47 | await conn.sendMessage(from, { text: message }, { quoted: mek }); 48 | 49 | } catch (error) { 50 | console.error("Error:", error); 51 | 52 | // Send detailed error logs to WhatsApp 53 | const errorMessage = ` 54 | *❌ NPM Command Error Logs* 55 | 56 | *Error Message:* ${error.message} 57 | *Stack Trace:* ${error.stack || "Not available"} 58 | *Timestamp:* ${new Date().toISOString()} 59 | `; 60 | 61 | await conn.sendMessage(from, { text: errorMessage }, { quoted: mek }); 62 | reply("An error occurred while fetching the npm package details."); 63 | } 64 | }); 65 | -------------------------------------------------------------------------------- /plugins/group-link.js: -------------------------------------------------------------------------------- 1 | const { cmd, commands } = require('../command'); 2 | const config = require('../config'); 3 | const prefix = config.PREFIX; 4 | const fs = require('fs'); 5 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, sleep, fetchJson } = require('../lib/functions2'); 6 | const { writeFileSync } = require('fs'); 7 | const path = require('path'); 8 | 9 | cmd({ 10 | pattern: "invite", 11 | alias: ["glink", "grouplink"], 12 | desc: "Get group invite link.", 13 | category: "group", // Already group 14 | filename: __filename, 15 | }, async (conn, mek, m, { from, quoted, body, args, q, isGroup, sender, reply }) => { 16 | try { 17 | // Ensure this is being used in a group 18 | if (!isGroup) return reply("𝐓𝐡𝐢𝐬 𝐅𝐞𝐚𝐭𝐮𝐫𝐞 𝐈𝐬 𝐎𝐧𝐥𝐲 𝐅𝐨𝐫 𝐆𝐫𝐨𝐮𝐩❗"); 19 | 20 | // Get the sender's number 21 | const senderNumber = sender.split('@')[0]; 22 | const botNumber = conn.user.id.split(':')[0]; 23 | 24 | // Check if the bot is an admin 25 | const groupMetadata = isGroup ? await conn.groupMetadata(from) : ''; 26 | const groupAdmins = groupMetadata ? groupMetadata.participants.filter(member => member.admin) : []; 27 | const isBotAdmins = isGroup ? groupAdmins.some(admin => admin.id === botNumber + '@s.whatsapp.net') : false; 28 | 29 | if (!isBotAdmins) return reply("𝐏𝐥𝐞𝐚𝐬𝐞 𝐏𝐫𝐨𝐯𝐢𝐝𝐞 𝐌𝐞 𝐀𝐝𝐦𝐢𝐧 𝐑𝐨𝐥𝐞 ❗"); 30 | 31 | // Check if the sender is an admin 32 | const isAdmins = isGroup ? groupAdmins.some(admin => admin.id === sender) : false; 33 | if (!isAdmins) return reply("𝐏𝐥𝐞𝐚𝐬𝐞 𝐏𝐫𝐨𝐯𝐢𝐝𝐞 𝐌𝐞 𝐀𝐝𝐦𝐢𝐧 𝐑𝐨𝐥𝐞 ❗"); 34 | 35 | // Get the invite code and generate the link 36 | const inviteCode = await conn.groupInviteCode(from); 37 | if (!inviteCode) return reply("Failed to retrieve the invite code."); 38 | 39 | const inviteLink = `https://chat.whatsapp.com/${inviteCode}`; 40 | 41 | // Reply with the invite link 42 | return reply(`*Here is your group invite link:*\n${inviteLink}`); 43 | 44 | } catch (error) { 45 | console.error("Error in invite command:", error); 46 | reply(`An error occurred: ${error.message || "Unknown error"}`); 47 | } 48 | }); 49 | 50 | -------------------------------------------------------------------------------- /plugins/tools-jsobf.js: -------------------------------------------------------------------------------- 1 | 2 | const config = require('../config'); 3 | const { cmd, commands } = require('../command'); 4 | const JavaScriptObfuscator = require("javascript-obfuscator"); 5 | 6 | cmd({ 7 | pattern: "obfuscate", 8 | alias: ["obf", "confuse"], 9 | desc: "Obfuscate JavaScript code to make it harder to read.", 10 | category: "utility", 11 | use: ".obfuscate ", 12 | filename: __filename, 13 | }, async (conn, mek, msg, { from, args, reply }) => { 14 | try { 15 | const code = args.join(" "); 16 | if (!code) { 17 | return reply("❌ Please provide JavaScript code to obfuscate."); 18 | } 19 | 20 | // Obfuscate the code 21 | const obfuscatedCode = JavaScriptObfuscator.obfuscate(code, { 22 | compact: true, // Compact code output 23 | controlFlowFlattening: true, // Make control flow harder to follow 24 | deadCodeInjection: true, // Inject dead code 25 | debugProtection: true, // Add debug protection 26 | disableConsoleOutput: true, // Disable console output 27 | stringArray: true, // Encrypt strings 28 | stringArrayEncoding: ["base64"], // Encode strings using base64 29 | rotateStringArray: true, // Rotate string array 30 | }).getObfuscatedCode(); 31 | 32 | reply(`🔐 *Obfuscated Code*:\n\n${obfuscatedCode}`); 33 | } catch (error) { 34 | console.error("Error obfuscating code:", error); 35 | reply("❌ An error occurred while obfuscating the code."); 36 | } 37 | }); 38 | 39 | cmd({ 40 | pattern: "deobfuscate", 41 | alias: ["deobf", "unconfuse"], 42 | desc: "Attempt to deobfuscate JavaScript code (limited functionality).", 43 | category: "utility", 44 | use: ".deobfuscate ", 45 | filename: __filename, 46 | }, async (conn, mek, msg, { from, args, reply }) => { 47 | try { 48 | const obfuscatedCode = args.join(" "); 49 | if (!obfuscatedCode) { 50 | return reply("❌ Please provide obfuscated code to deobfuscate."); 51 | } 52 | 53 | // Deobfuscation is not straightforward, but we can try to format the code 54 | reply(`⚠️ *Deobfuscation is not guaranteed*. Here's the formatted code:\n\n${obfuscatedCode}`); 55 | } catch (error) { 56 | console.error("Error deobfuscating code:", error); 57 | reply("❌ An error occurred while deobfuscating the code."); 58 | } 59 | }); 60 | -------------------------------------------------------------------------------- /plugins/tool-fetch.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const axios = require('axios'); 3 | const fs = require('fs-extra'); 4 | const path = require('path'); 5 | 6 | cmd({ 7 | pattern: "fetch", 8 | alias: ["api"], 9 | desc: "Fetch data from any URL (JSON, files, etc)", 10 | category: "tools", 11 | react: "🌐", 12 | filename: __filename 13 | }, 14 | async (conn, mek, m, { from, args, reply }) => { 15 | try { 16 | const q = args.join(" ").trim(); 17 | if (!q) return reply('❌ Please provide a URL.'); 18 | if (!/^https?:\/\//.test(q)) return reply('❌ URL must start with http:// or https://'); 19 | 20 | const res = await axios.get(q, { responseType: 'arraybuffer' }); 21 | const contentType = res.headers['content-type']; 22 | const buffer = Buffer.from(res.data); 23 | 24 | const options = { quoted: mek }; 25 | const fileName = `fetched.${contentType.split('/')[1] || 'bin'}`; 26 | 27 | // Handle JSON response 28 | if (contentType.includes('application/json')) { 29 | const json = JSON.parse(buffer.toString()); 30 | return conn.sendMessage(from, { 31 | text: `📦 *Fetched JSON*:\n\`\`\`${JSON.stringify(json, null, 2).slice(0, 2048)}\`\`\`` 32 | }, options); 33 | } 34 | 35 | // Handle file responses (images, videos, etc.) 36 | let messageContent = {}; 37 | if (contentType.includes('image')) { 38 | messageContent.image = buffer; 39 | } else if (contentType.includes('video')) { 40 | messageContent.video = buffer; 41 | } else if (contentType.includes('audio')) { 42 | messageContent.audio = buffer; 43 | } else { 44 | // For unknown or generic files 45 | const filePath = path.join(__dirname, '..', 'temp', fileName); 46 | await fs.outputFile(filePath, buffer); 47 | messageContent.document = fs.readFileSync(filePath); 48 | messageContent.mimetype = contentType; 49 | messageContent.fileName = fileName; 50 | } 51 | 52 | await conn.sendMessage(from, messageContent, options); 53 | 54 | } catch (e) { 55 | console.error("Fetch Error:", e); 56 | reply(`❌ Error: ${e.message}`); 57 | } 58 | }); 59 | -------------------------------------------------------------------------------- /plugins/tag-admins.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "tagadmins", 7 | react: "👑", 8 | alias: ["gc_tagadmins"], 9 | desc: "To Tag all Admins of the Group", 10 | category: "group", 11 | use: '.tagadmins [message]', 12 | filename: __filename 13 | }, 14 | async (conn, mek, m, { from, participants, reply, isGroup, senderNumber, groupAdmins, prefix, command, args, body }) => { 15 | try { 16 | if (!isGroup) return reply("❌ This command can only be used in groups."); 17 | 18 | const botOwner = conn.user.id.split(":")[0]; // Extract bot owner's number 19 | const senderJid = senderNumber + "@s.whatsapp.net"; 20 | 21 | // Ensure group metadata is fetched properly 22 | let groupInfo = await conn.groupMetadata(from).catch(() => null); 23 | if (!groupInfo) return reply("❌ Failed to fetch group information."); 24 | 25 | let groupName = groupInfo.subject || "Unknown Group"; 26 | let admins = await getGroupAdmins(participants); 27 | let totalAdmins = admins ? admins.length : 0; 28 | if (totalAdmins === 0) return reply("❌ No admins found in this group."); 29 | 30 | let emojis = ['👑', '⚡', '🌟', '✨', '🎖️', '💎', '🔱', '🛡️', '🚀', '🏆']; 31 | let randomEmoji = emojis[Math.floor(Math.random() * emojis.length)]; 32 | 33 | // Proper message extraction 34 | let message = body.slice(body.indexOf(command) + command.length).trim(); 35 | if (!message) message = "Attention Admins"; // Default message 36 | 37 | let teks = `▢ Group : *${groupName}*\n▢ Admins : *${totalAdmins}*\n▢ Message: *${message}*\n\n┌───⊷ *ADMIN MENTIONS*\n`; 38 | 39 | for (let admin of admins) { 40 | if (!admin) continue; // Prevent undefined errors 41 | teks += `${randomEmoji} @${admin.split('@')[0]}\n`; 42 | } 43 | 44 | teks += "└──✪ XBOT ┃ MD ✪──"; 45 | 46 | conn.sendMessage(from, { text: teks, mentions: admins }, { quoted: mek }); 47 | 48 | } catch (e) { 49 | console.error("TagAdmins Error:", e); 50 | reply(`❌ *Error Occurred !!*\n\n${e.message || e}`); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /plugins/movie.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { cmd } = require('../command'); 3 | 4 | cmd({ 5 | pattern: "movie", 6 | desc: "Fetch detailed information about a movie.", 7 | category: "utility", 8 | react: "🎬", 9 | filename: __filename 10 | }, 11 | async (conn, mek, m, { from, reply, sender, args }) => { 12 | try { 13 | // Properly extract the movie name from arguments 14 | const movieName = args.length > 0 ? args.join(' ') : m.text.replace(/^[\.\#\$\!]?movie\s?/i, '').trim(); 15 | 16 | if (!movieName) { 17 | return reply("📽️ Please provide the name of the movie.\nExample: .movie Iron Man"); 18 | } 19 | 20 | const apiUrl = `https://apis.davidcyriltech.my.id/imdb?query=${encodeURIComponent(movieName)}`; 21 | const response = await axios.get(apiUrl); 22 | 23 | if (!response.data.status || !response.data.movie) { 24 | return reply("🚫 Movie not found. Please check the name and try again."); 25 | } 26 | 27 | const movie = response.data.movie; 28 | 29 | // Format the caption 30 | const dec = ` 31 | 🎬 *${movie.title}* (${movie.year}) ${movie.rated || ''} 32 | 33 | ⭐ *IMDb:* ${movie.imdbRating || 'N/A'} | 🍅 *Rotten Tomatoes:* ${movie.ratings.find(r => r.source === 'Rotten Tomatoes')?.value || 'N/A'} | 💰 *Box Office:* ${movie.boxoffice || 'N/A'} 34 | 35 | 📅 *Released:* ${new Date(movie.released).toLocaleDateString()} 36 | ⏳ *Runtime:* ${movie.runtime} 37 | 🎭 *Genre:* ${movie.genres} 38 | 39 | 📝 *Plot:* ${movie.plot} 40 | 41 | 🎥 *Director:* ${movie.director} 42 | ✍️ *Writer:* ${movie.writer} 43 | 🌟 *Actors:* ${movie.actors} 44 | 45 | 🌍 *Country:* ${movie.country} 46 | 🗣️ *Language:* ${movie.languages} 47 | 🏆 *Awards:* ${movie.awards || 'None'} 48 | 49 | [View on IMDb](${movie.imdbUrl}) 50 | `; 51 | 52 | // Send message with the requested format 53 | await conn.sendMessage( 54 | from, 55 | { 56 | image: { 57 | url: movie.poster && movie.poster !== 'N/A' ? movie.poster : 'https://files.catbox.moe/06cgye.jpg' 58 | }, 59 | caption: dec}, 60 | { quoted: mek } 61 | ); 62 | 63 | } catch (e) { 64 | console.error('Movie command error:', e); 65 | reply(`❌ Error: ${e.message}`); 66 | } 67 | }); 68 | -------------------------------------------------------------------------------- /plugins/ch-react.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd } = require('../command'); 3 | 4 | const stylizedChars = { 5 | a: '🅐', b: '🅑', c: '🅒', d: '🅓', e: '🅔', f: '🅕', g: '🅖', 6 | h: '🅗', i: '🅘', j: '🅙', k: '🅚', l: '🅛', m: '🅜', n: '🅝', 7 | o: '🅞', p: '🅟', q: '🅠', r: '🅡', s: '🅢', t: '🅣', u: '🅤', 8 | v: '🅥', w: '🅦', x: '🅧', y: '🅨', z: '🅩', 9 | '0': '⓿', '1': '➊', '2': '➋', '3': '➌', '4': '➍', 10 | '5': '➎', '6': '➏', '7': '➐', '8': '➑', '9': '➒' 11 | }; 12 | 13 | cmd({ 14 | pattern: "chr", 15 | alias: ["creact"], 16 | react: "🔤", 17 | desc: "React to channel messages with stylized text", 18 | category: "owner", 19 | use: '.chr ', 20 | filename: __filename 21 | }, 22 | async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isCreator, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => { 23 | try { 24 | if (!isCreator) return reply("❌ Owner only command"); 25 | if (!q) return reply(`Usage:\n${command} https://whatsapp.com/channel/1234567890 hello`); 26 | 27 | const [link, ...textParts] = q.split(' '); 28 | if (!link.includes("whatsapp.com/channel/")) return reply("Invalid channel link format"); 29 | 30 | const inputText = textParts.join(' ').toLowerCase(); 31 | if (!inputText) return reply("Please provide text to convert"); 32 | 33 | const emoji = inputText 34 | .split('') 35 | .map(char => { 36 | if (char === ' ') return '―'; 37 | return stylizedChars[char] || char; 38 | }) 39 | .join(''); 40 | 41 | const channelId = link.split('/')[4]; 42 | const messageId = link.split('/')[5]; 43 | if (!channelId || !messageId) return reply("Invalid link - missing IDs"); 44 | 45 | const channelMeta = await conn.newsletterMetadata("invite", channelId); 46 | await conn.newsletterReactMessage(channelMeta.id, messageId, emoji); 47 | 48 | return reply(`╭━━━〔 *XBOT-MD* 〕━━━┈⊷ 49 | ┃▸ *Success!* Reaction sent 50 | ┃▸ *Channel:* ${channelMeta.name} 51 | ┃▸ *Reaction:* ${emoji} 52 | ╰────────────────┈⊷ 53 | > *© ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅx*`); 54 | } catch (e) { 55 | console.error(e); 56 | reply(`❎ Error: ${e.message || "Failed to send reaction"}`); 57 | } 58 | }); 59 | -------------------------------------------------------------------------------- /plugins/lyrics.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | const axios = require('axios'); 7 | const { cmd } = require('../command'); 8 | 9 | cmd({ 10 | pattern: "lyrics", 11 | alias: ["lyric"], 12 | desc: "Get the lyrics of a song by artist and title.", 13 | react: "🎵", 14 | category: "search", 15 | use: ".lyrics ", 16 | filename: __filename, 17 | }, async (conn, mek, m, { args, reply }) => { 18 | try { 19 | if (args.length < 2) { 20 | return reply("❌ Please provide the artist and song title.\nExample: `.lyrics Ed Sheeran - Shape of You`"); 21 | } 22 | 23 | // Parsing input using delimiter 24 | let artist, title; 25 | if (args.includes('-')) { 26 | const delimiterIndex = args.indexOf('-'); 27 | artist = args.slice(0, delimiterIndex).join(' ').trim(); 28 | title = args.slice(delimiterIndex + 1).join(' ').trim(); 29 | } else if (args[0].startsWith('"') && args[args.length - 1].endsWith('"')) { 30 | artist = args.slice(0, -1).join(' ').replace(/"/g, '').trim(); 31 | title = args.slice(-1).join(' '); 32 | } else { 33 | artist = args[0]; 34 | title = args.slice(1).join(' '); 35 | } 36 | 37 | if (!artist || !title) { 38 | return reply("❌ Please specify both the artist and the song title.\nExample: `.lyrics \"Joe Dwé Filé\" Shape of You`"); 39 | } 40 | 41 | // Notify the user that the lyrics are being fetched 42 | reply(`🎵 Searching for lyrics of "${title}" BY ${artist}...`); 43 | 44 | // Fetch lyrics using an API 45 | const response = await axios.get(`https://api.lyrics.ovh/v1/${artist}/${title}`); 46 | const lyrics = response.data.lyrics; 47 | 48 | if (!lyrics) { 49 | return reply(`❌ Sorry, no lyrics found for "${title}" by ${artist}.`); 50 | } 51 | 52 | // Send the lyrics back to the chat 53 | reply(`> LYRICS RESULT\n\nTitle🎧 *${title}*\nArtist🗣️ *${artist}*\n\n${lyrics}`); 54 | } catch (error) { 55 | console.error("Error fetching lyrics:", error.message); 56 | 57 | if (error.response && error.response.status === 404) { 58 | reply("❌ Sorry, no lyrics found for the specified artist and song title."); 59 | } else { 60 | reply("❌ An error occurred while fetching the lyrics. Please try again later."); 61 | } 62 | } 63 | }); 64 | 65 | 66 | -------------------------------------------------------------------------------- /plugins/ping.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd, commands } = require('../command'); 3 | 4 | cmd({ 5 | pattern: "ping", 6 | alias: ["speed","pong"],use: '.ping', 7 | desc: "Check bot's response time.", 8 | category: "main", 9 | react: "⚡", 10 | filename: __filename 11 | }, 12 | async (conn, mek, m, { from, quoted, sender, reply }) => { 13 | try { 14 | const start = new Date().getTime(); 15 | 16 | const reactionEmojis = ['🔥', '⚡', '🚀', '💨', '🎯', '🎉', '🌟', '💥', '🕐', '🔹']; 17 | const textEmojis = ['💎', '🏆', '⚡️', '🚀', '🎶', '🌠', '🌀', '🔱', '🛡️', '✨']; 18 | 19 | const reactionEmoji = reactionEmojis[Math.floor(Math.random() * reactionEmojis.length)]; 20 | let textEmoji = textEmojis[Math.floor(Math.random() * textEmojis.length)]; 21 | 22 | // Ensure reaction and text emojis are different 23 | while (textEmoji === reactionEmoji) { 24 | textEmoji = textEmojis[Math.floor(Math.random() * textEmojis.length)]; 25 | } 26 | 27 | // Send reaction using conn.sendMessage() 28 | await conn.sendMessage(from, { 29 | react: { text: textEmoji, key: mek.key } 30 | }); 31 | 32 | const end = new Date().getTime(); 33 | const responseTime = (end - start) / 1000; 34 | 35 | const text = `> *X-BOT-MD SPEED: ${responseTime.toFixed(2)}ms ${reactionEmoji}*`; 36 | 37 | await conn.sendMessage(from, { 38 | text}, { quoted: mek }); 39 | 40 | } catch (e) { 41 | console.error("Error in ping command:", e); 42 | reply(`An error occurred: ${e.message}`); 43 | } 44 | }); 45 | 46 | // ping2 47 | 48 | cmd({ 49 | pattern: "ping2", 50 | desc: "Check bot's response time.", 51 | category: "main", 52 | react: "🍂", 53 | filename: __filename 54 | }, 55 | async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => { 56 | try { 57 | const startTime = Date.now() 58 | const message = await conn.sendMessage(from, { text: '*PINGING...*' }) 59 | const endTime = Date.now() 60 | const ping = endTime - startTime 61 | await conn.sendMessage(from, { text: `*X-MD SPEED : ${ping}ms*` }, { quoted: message }) 62 | } catch (e) { 63 | console.log(e) 64 | reply(`${e}`) 65 | } 66 | }) 67 | -------------------------------------------------------------------------------- /lib/linkDetectionHandler.js: -------------------------------------------------------------------------------- 1 | const { getLinkDetectionMode } = require("./linkDetection"); 2 | const { incrementWarning, resetWarning, getWarningCount } = require("./warningSystem"); 3 | 4 | const setupLinkDetection = (sock) => { 5 | sock.ev.on("messages.upsert", async ({ messages }) => { 6 | for (const message of messages) { 7 | const groupJid = message.key.remoteJid; 8 | 9 | if (!groupJid.endsWith("@g.us") || message.key.fromMe) continue; 10 | 11 | const mode = getLinkDetectionMode(groupJid); 12 | if (!mode) return; 13 | 14 | const msgText = message.message?.conversation || message.message?.extendedTextMessage?.text || ""; 15 | const linkRegex = /(https?:\/\/[^\s]+)/g; 16 | 17 | if (linkRegex.test(msgText)) { 18 | console.log(`Detected link in group ${groupJid}: ${msgText}`); 19 | 20 | const participant = message.key.participant || message.participant; 21 | 22 | // Delete message 23 | await sock.sendMessage(groupJid, { delete: message.key }); 24 | 25 | if (mode === "kick") { 26 | await sock.groupParticipantsUpdate(groupJid, [participant], "remove"); 27 | await sock.sendMessage(groupJid, { 28 | text: `@${participant.split("@")[0]} has been removed for sending links.`, 29 | mentions: [participant], 30 | }); 31 | } else if (mode === "warn") { 32 | const warningCount = incrementWarning(groupJid, participant); 33 | await sock.sendMessage(groupJid, { 34 | text: `@${participant.split("@")[0]}, links are not allowed!\nWarning count: ${warningCount}/3`, 35 | mentions: [participant], 36 | }); 37 | 38 | if (warningCount >= 3) { 39 | await sock.groupParticipantsUpdate(groupJid, [participant], "remove"); 40 | await sock.sendMessage(groupJid, { 41 | text: `@${participant.split("@")[0]} has been removed for multiple link violations.`, 42 | mentions: [participant], 43 | }); 44 | resetWarning(groupJid, participant); 45 | } 46 | } 47 | } 48 | } 49 | }); 50 | }; 51 | 52 | module.exports = { setupLinkDetection }; -------------------------------------------------------------------------------- /plugins/tool-cinfo.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const axios = require('axios'); 3 | 4 | cmd({ 5 | pattern: "countryinfo", 6 | alias: ["cinfo", "country","cinfo2"], 7 | desc: "Get information about a country", 8 | category: "fun-extra", 9 | react: "🌍", 10 | filename: __filename 11 | }, 12 | async (conn, mek, m, { from, args, q, reply, react }) => { 13 | try { 14 | if (!q) return reply("Please provide a country name.\nExample: `.countryinfo Nigeria`"); 15 | 16 | const apiUrl = `https://api.siputzx.my.id/api/tools/countryInfo?name=${encodeURIComponent(q)}`; 17 | const { data } = await axios.get(apiUrl); 18 | 19 | if (!data.status || !data.data) { 20 | await react("❌"); 21 | return reply(`No information found for *${q}*. Please check the country name.`); 22 | } 23 | 24 | const info = data.data; 25 | let neighborsText = info.neighbors.length > 0 26 | ? info.neighbors.map(n => `🌍 *${n.name}*`).join(", ") 27 | : "No neighboring countries found."; 28 | 29 | const text = `🌍 *Country Information: ${info.name}* 🌍\n\n` + 30 | `🏛 *Capital:* ${info.capital}\n` + 31 | `📍 *Continent:* ${info.continent.name} ${info.continent.emoji}\n` + 32 | `📞 *Phone Code:* ${info.phoneCode}\n` + 33 | `📏 *Area:* ${info.area.squareKilometers} km² (${info.area.squareMiles} mi²)\n` + 34 | `🚗 *Driving Side:* ${info.drivingSide}\n` + 35 | `💱 *Currency:* ${info.currency}\n` + 36 | `🔤 *Languages:* ${info.languages.native.join(", ")}\n` + 37 | `🌟 *Famous For:* ${info.famousFor}\n` + 38 | `🌍 *ISO Codes:* ${info.isoCode.alpha2.toUpperCase()}, ${info.isoCode.alpha3.toUpperCase()}\n` + 39 | `🌎 *Internet TLD:* ${info.internetTLD}\n\n` + 40 | `🔗 *Neighbors:* ${neighborsText}`; 41 | 42 | await conn.sendMessage(from, { 43 | image: { url: info.flag }, 44 | caption: text, 45 | contextInfo: { mentionedJid: [m.sender] } 46 | }, { quoted: mek }); 47 | 48 | await react("✅"); // React after successful response 49 | } catch (e) { 50 | console.error("Error in countryinfo command:", e); 51 | await react("❌"); 52 | reply("An error occurred while fetching country information."); 53 | } 54 | }); 55 | -------------------------------------------------------------------------------- /plugins/lyrics2.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const axios = require('axios'); 3 | 4 | cmd({ 5 | pattern: "sing", 6 | alias: ["lyric2", "lyrics2"], 7 | react: "🎤", 8 | desc: "Search for song lyrics", 9 | category: "search", 10 | use: "", 11 | filename: __filename 12 | }, async (conn, m, mek, { from, q, reply }) => { 13 | try { 14 | if (!q) return reply("❌ Please provide a song title (e.g., !lyrics Runaway by Aurora)"); 15 | 16 | await reply("🔍 Searching for lyrics..."); 17 | 18 | const apiUrl = `https://api.giftedtech.web.id/api/search/lyrics?apikey=gifted_api_6hf50c4j&query=${encodeURIComponent(q)}`; 19 | 20 | const { data } = await axios.get(apiUrl, { 21 | timeout: 8000 // 8 second timeout 22 | }); 23 | 24 | if (!data?.success || !data.result?.lyrics) { 25 | return reply("❌ No lyrics found for this song"); 26 | } 27 | 28 | // Format the response 29 | const lyricsText = 30 | `🎵 *${data.result.title}* 🎵\n` + 31 | `👩‍🎤 Artist: ${data.result.artist}\n\n` + 32 | `${data.result.lyrics}\n\n` + 33 | `> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅx`; 34 | 35 | // Split long lyrics into multiple messages if needed 36 | if (lyricsText.length > 1000) { 37 | const parts = []; 38 | for (let i = 0; i < lyricsText.length; i += 1000) { 39 | parts.push(lyricsText.substring(i, i + 1000)); 40 | } 41 | for (const part of parts) { 42 | await conn.sendMessage(from, { text: part }, { quoted: mek }); 43 | } 44 | } else { 45 | await conn.sendMessage(from, { 46 | text: lyricsText, 47 | contextInfo: { 48 | externalAdReply: { 49 | title: data.result.title, 50 | body: `Lyrics by ${data.result.artist.split('‣')[0].trim()}`, 51 | thumbnail: await axios.get('https://files.catbox.moe/yv8zy4.jpg', { 52 | responseType: 'arraybuffer' 53 | }).then(res => res.data).catch(() => null), 54 | mediaType: 2 55 | } 56 | } 57 | }, { quoted: mek }); 58 | } 59 | 60 | } catch (error) { 61 | console.error("Lyrics search error:", error); 62 | reply(`❌ Error searching lyrics: ${error.message}`); 63 | } 64 | }); 65 | -------------------------------------------------------------------------------- /plugins/fun-quiz.js: -------------------------------------------------------------------------------- 1 | 2 | const axios = require('axios'); 3 | const { cmd } = require('../command'); 4 | 5 | cmd({ 6 | pattern: 'quiz', 7 | alias: ['q'], 8 | desc: 'Fetches a quiz question from an API and presents it to the user.', 9 | category: 'utility', 10 | use: '.quiz', 11 | filename: __filename, 12 | }, async (conn, mek, msg, { from, args, reply }) => { 13 | try { 14 | // Fetch a quiz question from the API 15 | const response = await axios.get('https://the-trivia-api.com/v2/questions?limit=1'); 16 | const questionData = response.data[0]; 17 | 18 | if (!questionData) { 19 | return reply('❌ Failed to fetch a quiz question. Please try again later.'); 20 | } 21 | 22 | const { question, correctAnswer, incorrectAnswers } = questionData; 23 | const options = [...incorrectAnswers, correctAnswer]; 24 | shuffleArray(options); 25 | 26 | // Send the question and options to the user 27 | const optionsText = options.map((option, index) => `${String.fromCharCode(65 + index)}. ${option}`).join('\n'); 28 | await reply(`🎯 *Question:* ${question.text}\n\n${optionsText}\n\nYou have 20 seconds to answer. Reply with the letter corresponding to your choice.`); 29 | 30 | // Set a timeout to handle the 20-second response window 31 | const timeout = setTimeout(() => { 32 | reply(`⏰ Time's up! The correct answer was: ${correctAnswer}`); 33 | }, 20000); 34 | 35 | // Listen for the user's response 36 | const filter = (response) => response.key.from === from && /^[A-Da-d]$/.test(response.text); 37 | const collected = await conn.awaitMessages({ filter, time: 20000, max: 1 }); 38 | 39 | clearTimeout(timeout); 40 | 41 | if (collected.size === 0) { 42 | return reply(`⏰ Time's up! The correct answer was: ${correctAnswer}`); 43 | } 44 | 45 | const userAnswer = collected.first().text.toUpperCase(); 46 | const isCorrect = options[userAnswer.charCodeAt(0) - 65] === correctAnswer; 47 | 48 | if (isCorrect) { 49 | return reply('✅ Correct!'); 50 | } else { 51 | return reply(`❌ Incorrect. The correct answer was: ${correctAnswer}`); 52 | } 53 | } catch (error) { 54 | console.error('Error fetching quiz data:', error); 55 | reply('❌ Failed to fetch quiz data. Please try again later.'); 56 | } 57 | }); 58 | 59 | // Shuffle an array in place 60 | function shuffleArray(array) { 61 | for (let i = array.length - 1; i > 0; i--) { 62 | const j = Math.floor(Math.random() * (i + 1)); 63 | [array[i], array[j]] = [array[j], array[i]]; 64 | } 65 | } 66 | 67 | -------------------------------------------------------------------------------- /plugins/status-saver.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | const { downloadMediaMessage } = require("../lib/msg"); 3 | 4 | // ✅ Define regex pattern using `new RegExp` 5 | const regexSend = new RegExp(`\\b(send|share|snd|give|save|sendme|forward)\\b`, "i"); 6 | 7 | // ✅ Save WhatsApp Status (Manual Command) 8 | cmd({ 9 | pattern: "ssave", 10 | desc: "Save WhatsApp status", 11 | category: "utility", 12 | filename: __filename, 13 | }, async (conn, mek, m, { sender, reply }) => { 14 | try { 15 | if (!m.quoted) return reply("*Reply to a WhatsApp status to save it.*"); 16 | 17 | const { msg, type } = m.quoted; 18 | if (!msg || !type) return reply("*This message has no content to save.*"); 19 | 20 | const mediaTypes = ["imageMessage", "videoMessage", "audioMessage", "stickerMessage", "documentMessage"]; 21 | 22 | if (mediaTypes.includes(type)) { 23 | const mediaBuffer = await m.quoted.download(); 24 | if (!mediaBuffer) return reply("*Failed to download media.*"); 25 | await conn.sendMessage(sender, { [type.replace("Message", "")]: mediaBuffer }, { quoted: mek }); 26 | } else if (type === "conversation" || type === "extendedTextMessage") { 27 | await conn.sendMessage(sender, { text: msg.text || msg }, { quoted: mek }); 28 | } 29 | } catch (e) { 30 | console.error("❌ Error while saving status:", e); 31 | } 32 | }); 33 | 34 | // ✅ Auto-Detect and Forward Based on Regex (Now Matches Your Example) 35 | cmd({ on: "quoted" }, async (conn, mek, m, { text, sender }) => { 36 | try { 37 | if (!m.quoted || !text) return; 38 | 39 | console.log(`📥 Received Text: ${text}`); // Debugging log 40 | console.log(`🔍 Regex Match: ${regexSend.test(text.toLowerCase())}`); // Debugging log 41 | 42 | if (!regexSend.test(text.toLowerCase())) return; 43 | 44 | const { msg, type } = m.quoted; 45 | if (!msg || !type) return; 46 | 47 | const mediaTypes = ["imageMessage", "videoMessage", "audioMessage", "stickerMessage", "documentMessage"]; 48 | 49 | if (mediaTypes.includes(type)) { 50 | const mediaBuffer = await m.quoted.download(); 51 | if (!mediaBuffer) return reply("*Failed to download media.*"); 52 | await conn.sendMessage(sender, { [type.replace("Message", "")]: mediaBuffer }, { quoted: mek }); 53 | } else if (type === "conversation" || type === "extendedTextMessage") { 54 | await conn.sendMessage(sender, { text: msg.text || msg }, { quoted: mek }); 55 | } 56 | } catch (e) { 57 | console.error("❌ Error while forwarding message:", e); 58 | } 59 | }); 60 | -------------------------------------------------------------------------------- /plugins/pinterest-dl.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const axios = require('axios'); 3 | 4 | cmd({ 5 | pattern: "pindl", 6 | alias: ["pinterestdl", "pin", "pins", "pindownload"], 7 | desc: "Download media from Pinterest", 8 | category: "download", 9 | filename: __filename 10 | }, async (conn, mek, m, { args, quoted, from, reply }) => { 11 | try { 12 | // Make sure the user provided the Pinterest URL 13 | if (args.length < 1) { 14 | return reply('❎ Please provide the Pinterest URL to download from.'); 15 | } 16 | 17 | // Extract Pinterest URL from the arguments 18 | const pinterestUrl = args[0]; 19 | 20 | // Call your Pinterest download API 21 | const response = await axios.get(`https://api.giftedtech.web.id/api/download/pinterestdl?apikey=gifted&url=${encodeURIComponent(pinterestUrl)}`); 22 | 23 | if (!response.data.success) { 24 | return reply('❎ Failed to fetch data from Pinterest.'); 25 | } 26 | 27 | const media = response.data.result.media; 28 | const description = response.data.result.description || 'No description available'; // Check if description exists 29 | const title = response.data.result.title || 'No title available'; 30 | 31 | // Select the best video quality or you can choose based on size or type 32 | const videoUrl = media.find(item => item.type.includes('720p'))?.download_url || media[0].download_url; 33 | 34 | // Prepare the new message with the updated caption 35 | const desc = `╭━━━〔 *X-MD* 〕━━━┈⊷ 36 | ┃▸╭─────────── 37 | ┃▸┃๏ *PINS DOWNLOADER* 38 | ┃▸└───────────···๏ 39 | ╰────────────────┈⊷ 40 | ╭━━❐━⪼ 41 | ┇๏ *Title* - ${title} 42 | ┇๏ *Media Type* - ${media[0].type} 43 | ╰━━❑━⪼ 44 | > *© Pᴏᴡᴇʀᴇᴅ Bʏ Dᴀᴠɪᴅx ♡*`; 45 | 46 | // Send the media (video or image) to the user 47 | if (videoUrl) { 48 | // If it's a video, send the video 49 | await conn.sendMessage(from, { video: { url: videoUrl }, caption: desc }, { quoted: mek }); 50 | } else { 51 | // If it's an image, send the image 52 | const imageUrl = media.find(item => item.type === 'Thumbnail')?.download_url; 53 | await conn.sendMessage(from, { image: { url: imageUrl }, caption: desc }, { quoted: mek }); 54 | } 55 | 56 | } catch (e) { 57 | console.error(e); 58 | await conn.sendMessage(from, { react: { text: '❌', key: mek.key } }); 59 | reply('❎ An error occurred while processing your request.'); 60 | } 61 | }); 62 | -------------------------------------------------------------------------------- /plugins/group-tagall.js: -------------------------------------------------------------------------------- 1 | const config = require('../config') 2 | const { cmd, commands } = require('../command') 3 | const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions') 4 | 5 | cmd({ 6 | pattern: "tagall", 7 | react: "🔊", 8 | alias: ["gc_tagall"], 9 | desc: "To Tag all Members", 10 | category: "group", 11 | use: '.tagall [message]', 12 | filename: __filename 13 | }, 14 | async (conn, mek, m, { from, participants, isCreator, isAdmins, reply, isGroup, senderNumber, groupAdmins, prefix, command, args, body }) => { 15 | try { 16 | if (!isGroup) return reply("*This command can only be used on groups*."); 17 | 18 | const botOwner = conn.user.id.split(":")[0]; // Extract bot owner's number 19 | const senderJid = senderNumber + "@s.whatsapp.net"; 20 | 21 | if (!isCreator && !isAdmins) { 22 | return reply("*Only group admins or the bot owner can use this command*."); 23 | } 24 | 25 | // Ensure group metadata is fetched properly 26 | let groupInfo = await conn.groupMetadata(from).catch(() => null); 27 | if (!groupInfo) return reply("❌ Failed to fetch group information."); 28 | 29 | let groupName = groupInfo.subject || "Unknown Group"; 30 | let totalMembers = participants ? participants.length : 0; 31 | if (totalMembers === 0) return reply("❌ No members found in this group."); 32 | 33 | let emojis = ['📢', '🔊', '🌐', '🔰', '❤‍🩹', '🤍', '🖤', '🩵', '📝', '💗', '🔖', '🪩', '📦', '🎉', '🛡️', '💸', '⏳', '🗿', '🚀', '🎧', '🪀', '⚡', '🚩', '🍁', '🗣️', '👻', '⚠️', '🔥']; 34 | let randomEmoji = emojis[Math.floor(Math.random() * emojis.length)]; 35 | 36 | // Proper message extraction 37 | let message = body.slice(body.indexOf(command) + command.length).trim(); 38 | if (!message) message = "*NO MESSAGE PROVIDED*"; // Default message 39 | 40 | let teks = `▢ Group : *${groupName}*\n▢ Members : *${totalMembers}*\n▢ Message: *${message}*\n\n┌───⊷ *MENTIONS*\n`; 41 | 42 | for (let mem of participants) { 43 | if (!mem.id) continue; // Prevent undefined errors 44 | teks += `${randomEmoji} @${mem.id.split('@')[0]}\n`; 45 | } 46 | 47 | teks += "└──✪ XBOT ┃ MD ✪──"; 48 | 49 | conn.sendMessage(from, { text: teks, mentions: participants.map(a => a.id) }, { quoted: mek }); 50 | 51 | } catch (e) { 52 | console.error("TagAll Error:", e); 53 | reply(`❌ *Error Occurred !!*\n\n${e.message || e}`); 54 | } 55 | }); 56 | 57 | -------------------------------------------------------------------------------- /plugins/search-nasa.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { cmd } = require('../command'); 3 | 4 | // NASA APOD Command 5 | cmd({ 6 | pattern: 'nasa', 7 | alias: ['apod'], 8 | react: '🛰️', 9 | desc: 'Fetch NASA\'s Astronomy Picture of the Day', 10 | category: 'tools', 11 | filename: __filename 12 | }, async (conn, mek, msg, { from, reply }) => { 13 | try { 14 | const { data } = await axios.get('https://api.nexoracle.com/details/nasa?apikey=e276311658d835109c'); 15 | 16 | if (!data.result || data.status !== 200) { 17 | return reply('❌ Failed to fetch NASA data'); 18 | } 19 | 20 | const { date, explanation, title, url } = data.result; 21 | const imageRes = await axios.get(url, { responseType: 'arraybuffer' }); 22 | 23 | await conn.sendMessage(from, { 24 | image: Buffer.from(imageRes.data), 25 | caption: `*🚀 NASA Astronomy Picture of the Day*\n\n` + 26 | `*📛 Title:* ${title}\n` + 27 | `*📅 Date:* ${date}\n\n` + 28 | `*📝 Explanation:*\n${explanation}\n\n` + 29 | `_ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅx_` 30 | }, { quoted: mek }); 31 | 32 | } catch (error) { 33 | console.error('NASA Error:', error); 34 | reply('❌ Failed to process NASA request'); 35 | } 36 | }); 37 | 38 | // IP Lookup Command 39 | cmd({ 40 | pattern: 'ip', 41 | alias: ['iplookup'], 42 | react: '🌐', 43 | desc: 'Lookup IP address information', 44 | category: 'stalk', 45 | use: '.ip ', 46 | filename: __filename 47 | }, async (conn, mek, msg, { from, reply, args }) => { 48 | try { 49 | if (!args[0]) return reply('❌ Provide IP address'); 50 | 51 | const { data } = await axios.get(`https://api.nexoracle.com/stalking/ip?apikey=e276311658d835109c&q=${args[0]}`); 52 | 53 | if (!data.result || data.status !== 200) { 54 | return reply('❌ Invalid IP or API error'); 55 | } 56 | 57 | const { ip, country, city, isp, org, lat, lon, timezone, mobile, proxy } = data.result; 58 | 59 | await reply( 60 | `*🌐 IP Address Information*\n\n` + 61 | `*🔢 IP:* ${ip}\n` + 62 | `*📍 Location:* ${city}, ${country}\n` + 63 | `*📡 ISP:* ${isp}\n` + 64 | `*🏢 Organization:* ${org}\n` + 65 | `*🌍 Coordinates:* ${lat}, ${lon}\n` + 66 | `*⏰ Timezone:* ${timezone}\n` + 67 | `*📱 Mobile:* ${mobile ? 'Yes' : 'No'}\n` + 68 | `*🛡️ Proxy:* ${proxy ? 'Yes' : 'No'}\n\n` + 69 | `_ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅx_` 70 | ); 71 | 72 | } catch (error) { 73 | console.error('IP Error:', error); 74 | reply('❌ Failed to lookup IP address'); 75 | } 76 | }); 77 | -------------------------------------------------------------------------------- /plugins/prank-fun.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | 3 | cmd({ 4 | pattern: "hack", 5 | desc: "Displays a dynamic and playful 'Hacking' message for fun.", 6 | category: "fun", 7 | filename: __filename 8 | }, 9 | async (conn, mek, m, { 10 | from, quoted, body, isCmd, command, args, q, isGroup, senderNumber, reply 11 | }) => { 12 | try { 13 | // Get the bot owner's number dynamically from conn.user.id 14 | const botOwner = conn.user.id.split(":")[0]; // Extract the bot owner's number 15 | if (senderNumber !== botOwner) { 16 | return reply("Only the bot owner can use this command."); 17 | } 18 | 19 | const steps = [ 20 | '💻 *HACK STARTING...* 💻', 21 | 22 | '*Initializing hacking tools...* 🛠️', 23 | '*Connecting to remote servers...* 🌐', 24 | 25 | '```[██████████] 10%``` ⏳' , 26 | '```[███████████████████] 20%``` ⏳' , 27 | '```[███████████████████████] 30%``` ⏳' , 28 | '```[██████████████████████████] 40%``` ⏳' , 29 | '```[███████████████████████████████] 50%``` ⏳' , 30 | '```[█████████████████████████████████████] 60%``` ⏳' , 31 | '```[██████████████████████████████████████████] 70%``` ⏳' , 32 | '```[██████████████████████████████████████████████] 80%``` ⏳' , 33 | '```[██████████████████████████████████████████████████] 90%``` ⏳' , 34 | '```[████████████████████████████████████████████████████] 100%``` ✅', 35 | 36 | '🔒 *System Breach: Successful!* 🔓', 37 | '🚀 *Command Execution: Complete!* 🎯', 38 | 39 | '*📡 Transmitting data...* 📤', 40 | '_🕵️‍♂️ Ensuring stealth..._ 🤫', 41 | '*🔧 Finalizing operations...* 🏁', 42 | 43 | '⚠️ *Note:* All actions are for demonstration purposes only.', 44 | '⚠️ *Reminder:* Ethical hacking is the only way to ensure security.', 45 | 46 | '> *X-MD-HACKING-COMPLETE ☣*' 47 | ]; 48 | 49 | for (const line of steps) { 50 | await conn.sendMessage(from, { text: line }, { quoted: mek }); 51 | await new Promise(resolve => setTimeout(resolve, 1000)); // Adjust the delay as needed 52 | } 53 | } catch (e) { 54 | console.error(e); 55 | reply(`❌ *Error:* ${e.message}`); 56 | } 57 | }); 58 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "XBOT-MD", 3 | "version": "3.0.9", 4 | "description": "Not the best bot in the universe, but enjoyment is promising. WhatsApp multi-feature bot using Baileys.", 5 | "main": "index.js", 6 | "engines": { 7 | "node": ">=20.x", 8 | "npm": ">=10.x" 9 | }, 10 | "scripts": { 11 | "start": "node index.js", 12 | "dev": "nodemon index.js", 13 | "pm2": "pm2 start index.js --deep-monitoring --attach --name XBOT-MD", 14 | "stop": "pm2 stop XBOT-MD", 15 | "restart": "pm2 restart XBOT-MD" 16 | }, 17 | "keywords": [ 18 | "whatsapp-bot", 19 | "whatsapp-md", 20 | "baileys", 21 | "multi-device", 22 | "bot", 23 | "nodejs", 24 | "chatbot", 25 | "automation", 26 | "xbots", 27 | "DavidX" 28 | ], 29 | "author": "Dave Promise", 30 | "license": "MIT", 31 | "dependencies": { 32 | "@adiwajshing/keyed-db": "^0.2.4", 33 | "@dark-yasiya/scrap": "1.0.1", 34 | "@dark-yasiya/yt-dl.js": "latest", 35 | "@ffmpeg-installer/ffmpeg": "^1.1.0", 36 | "@mrnima/facebook-downloader": "1.0.0", 37 | "@mrnima/tiktok-downloader": "1.0.0", 38 | "@octokit/rest": "^20.0.0", 39 | "@vitalets/google-translate-api": "^9.2.0", 40 | "acrcloud": "^1.4.0", 41 | "adm-zip": "^0.5.16", 42 | "api-dylux": "1.8.5", 43 | "axios": "^1.7.9", 44 | "baileys": "npm:baileys-pro@latest", 45 | "btch-downloader": "^2.2.9", 46 | "buffer": "^6.0.3", 47 | "canvacord": "^5.4.9", 48 | "cheerio": "^1.0.0-rc.12", 49 | "crypto-digest-sync": "^1.0.0", 50 | "crypto-js": "latest", 51 | "dotenv": "^16.0.0", 52 | "express": "latest", 53 | "ffmpeg": "^0.0.4", 54 | "file-type": "^16.5.3", 55 | "file_size_url": "1.0.4", 56 | "fluent-ffmpeg": "^2.1.2", 57 | "form-data": "^4.0.0", 58 | "fs-extra": "^11.1.0", 59 | "google-tts-api": "^2.0.2", 60 | "javascript-obfuscator": "^4.0.0", 61 | "jimp": "^0.16.1", 62 | "megajs": "^1.1.0", 63 | "mongodb": "^6.4.0", 64 | "mongoose": "^8.0.0", 65 | "mrnima-moviedl": "1.0.0", 66 | "node-cache": "^5.1.1", 67 | "node-fetch": "^2.6.1", 68 | "node-webpmux": "^3.1.0", 69 | "path": "^0.12.7", 70 | "pdf-lib": "^1.17.1", 71 | "pdfkit": "^0.14.0", 72 | "pino": "^7.0.5", 73 | "pm2": "latest", 74 | "qrcode-reader": "^1.0.4", 75 | "qrcode-terminal": "^0.12.0", 76 | "ruhend-scraper": "8.0.3", 77 | "sequelize": "^6.37.5", 78 | "sqlite3": "latest", 79 | "util": "^0.12.4", 80 | "vm2": "^3.9.17", 81 | "wa-sticker-formatter": "^4.4.4", 82 | "wa_set_pkg": "1.0.5", 83 | "yt-search": "^2.11.1" 84 | }, 85 | "devDependencies": { 86 | "nodemon": "^3.0.2" 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /plugins/group-kick.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | cmd({ 3 | pattern: "kick", 4 | desc: "Kicks replied/quoted user from group.", 5 | category: "group", 6 | filename: __filename, 7 | use: "" 8 | }, async (conn, mek, m, { 9 | from, quoted, args, isGroup, isBotAdmins, isAdmins, reply 10 | }) => { 11 | if (!isGroup) { 12 | return reply("*This command can only be used in groups*."); 13 | } 14 | 15 | if (!isAdmins) { 16 | return reply("*Only group admins can use this command*."); 17 | } 18 | 19 | try { 20 | let users = m.mentionedJid?.[0] 21 | || (m.quoted?.sender ?? null) 22 | || (args[0]?.replace(/[^0-9]/g, '') + "@s.whatsapp.net"); 23 | 24 | if (!users) { 25 | return reply("*Please reply to a message or provide a valid number*"); 26 | } 27 | 28 | await conn.groupParticipantsUpdate(from, [users], "remove"); 29 | reply("*User has been removed from the group successfully*."); 30 | } catch (error) { 31 | console.error("*Error kicking user*:", error); 32 | reply("*Failed to remove the user. Ensure I have the necessary permissions*."); 33 | } 34 | }); 35 | 36 | /*cmd({ 37 | pattern: "remove", 38 | alias: ["kick", "k"], 39 | desc: "Removes a member from the group", 40 | category: "group", 41 | react: "❌", 42 | filename: __filename 43 | }, 44 | async (conn, mek, m, { 45 | from, args, isGroup, isBotAdmins, reply, quoted, senderNumber 46 | }) => { 47 | // Check if the command is used in a group 48 | if (!isGroup) return reply("❌ This command can only be used in groups."); 49 | 50 | // Get the bot owner's number dynamically from conn.user.id 51 | const botOwner = conn.user.id.split(":")[0]; 52 | if (senderNumber !== botOwner) { 53 | return reply("❌ Only the bot owner can use this command."); 54 | } 55 | 56 | // Check if the bot is an admin 57 | if (!isBotAdmins) return reply("❌ I need to be an admin to use this command."); 58 | 59 | const Targetnum = m.mentionedJid?.[0] 60 | || (m.quoted?.sender ?? null) 61 | || (args[0]?.replace(/[^0-9]/g, '') + "@s.whatsapp.net"); 62 | 63 | // If mentioning a user 64 | else { 65 | return reply("❌ Please reply to a message or mention a user to remove."); 66 | } 67 | 68 | const jid = Targetnum; 69 | 70 | try { 71 | await conn.groupParticipantsUpdate(from, [jid], "remove"); 72 | reply(`✅ Successfully removed @${number}`, { mentions: [jid] }); 73 | } catch (error) { 74 | console.error("Remove command error:", error); 75 | reply("❌ Failed to remove the member."); 76 | } 77 | });*/ 78 | -------------------------------------------------------------------------------- /plugins/tool-aitextdetector.js: -------------------------------------------------------------------------------- 1 | // I WILL FIND YOU 🫵 2 | // MR FRANK 3 | 4 | 5 | const axios = require("axios"); 6 | const { cmd } = require("../command"); 7 | 8 | cmd( 9 | { 10 | pattern: "txtdetect", 11 | alias: ["aidetect", "textdetect"], 12 | desc: "Detect if a text is AI-generated or human-written.", 13 | category: "AI", 14 | use: "\nExample: .txtdetect Hello", 15 | filename: __filename, 16 | react: "🤖" 17 | }, 18 | async (conn, mek, m, { args, reply, from }) => { 19 | try { 20 | const query = args.join(" "); // Combine the query parts 21 | 22 | if (!query) { 23 | return reply("Please provide a text to analyze.\nExample: `.txtdetect Hello`"); 24 | } 25 | 26 | // Call the AI Text Detector API 27 | const apiUrl = `https://bk9.fun/tools/txtdetect?q=${encodeURIComponent(query)}`; 28 | const response = await axios.get(apiUrl); 29 | 30 | // Log the API response for debugging 31 | console.log("API Response:", response.data); 32 | 33 | // Check if the API response is valid 34 | if (!response.data || !response.data.status || !response.data.BK9 || !response.data.BK9.success) { 35 | return reply("❌ Unable to analyze the text. Please try again later."); 36 | } 37 | 38 | // Extract the detection results 39 | const detectionData = response.data.BK9.data; 40 | 41 | // Format the results with emojis 42 | const resultText = ` 43 | 🤖 *AI Text Detection Results:* 🤖 44 | 45 | 📝 *Input Text:* ${detectionData.input_text || "N/A"} 46 | 47 | 🔍 *Detection Summary:* 48 | - 🧑 *Human Probability:* ${detectionData.isHuman || 0}% 49 | - 🤖 *AI Probability:* ${100 - (detectionData.isHuman || 0)}% 50 | - 📊 *Fake Percentage:* ${detectionData.fakePercentage || 0}% 51 | - 🌐 *Detected Language:* ${detectionData.detected_language || "Unknown"} 52 | 53 | 📋 *Feedback:* ${detectionData.feedback || "N/A"} 54 | 55 | 📌 *Additional Feedback:* ${detectionData.additional_feedback || "N/A"} 56 | 57 | 🔎 *Special Sentences Detected:* 58 | ${detectionData.specialSentences?.map((sentence, index) => ` - ${sentence}`).join("\n") || " - None"} 59 | 60 | > © ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅx 61 | `; 62 | 63 | // Send the formatted results 64 | await reply(resultText); 65 | 66 | } catch (error) { 67 | console.error("Error in txtdetect command:", error); 68 | reply("❌ An error occurred while processing your request. Please try again later."); 69 | } 70 | } 71 | ); 72 | -------------------------------------------------------------------------------- /plugins/antilink.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require("../command"); 2 | const { 3 | enableLinkDetection, 4 | disableLinkDetection, 5 | getLinkDetectionMode 6 | } = require("../lib/linkDetection"); 7 | 8 | cmd({ 9 | pattern: "antilinkop", 10 | desc: "Interactive menu to configure anti-link settings", 11 | category: "security", 12 | filename: __filename 13 | }, async (conn, mek, m, { 14 | from, isGroup, isAdmins, isBotAdmins, isCreator, reply 15 | }) => { 16 | if (!isGroup) return reply("*❌ This command can only be used in groups!*"); 17 | if (!isBotAdmins) return reply("*❌ I must be an admin to use this feature!*"); 18 | if (!isAdmins && !isCreator) return reply("*❌ You must be a group admin or bot owner to use this!*"); 19 | 20 | const current = getLinkDetectionMode(from) || "off"; 21 | 22 | const menuText = 23 | `> *ANTILINK SETTINGS*\n` + 24 | `> Current Mode: *${current.toUpperCase()}*\n\n` + 25 | `*Reply with one of the following:*\n\n` + 26 | `1. 🗑️ Delete only\n` + 27 | `2. ⚠️ Warn (3 strikes → kick)\n` + 28 | `3. 🚫 Kick instantly\n` + 29 | `4. ❌ Turn off\n\n` + 30 | `╭───────────────\n│ 🛡 X-BOT MODERATION\n╰───────────────◆`; 31 | 32 | const sent = await conn.sendMessage(from, { 33 | image: { url: "https://i.postimg.cc/rFV2pJW5/IMG-20250603-WA0017.jpg" }, 34 | caption: menuText 35 | }, { quoted: mek }); 36 | 37 | const msgId = sent.key.id; 38 | 39 | const handler = async ({ messages }) => { 40 | const msg = messages?.[0]; 41 | if (!msg?.message) return; 42 | 43 | const quotedId = msg.message?.extendedTextMessage?.contextInfo?.stanzaId; 44 | if (quotedId !== msgId) return; 45 | 46 | const response = 47 | msg.message?.conversation || msg.message?.extendedTextMessage?.text || ""; 48 | 49 | const options = { 50 | "1": "delete", 51 | "2": "warn", 52 | "3": "kick", 53 | "4": "off" 54 | }; 55 | 56 | const chosen = options[response.trim()]; 57 | if (!chosen) { 58 | await conn.sendMessage(from, { text: "❌ Invalid option. Reply with 1, 2, 3 or 4." }, { quoted: msg }); 59 | return; 60 | } 61 | 62 | if (chosen === "off") { 63 | disableLinkDetection(from); 64 | await conn.sendMessage(from, { 65 | text: "❌ Antilink has been *disabled* in this group.", 66 | }, { quoted: msg }); 67 | } else { 68 | enableLinkDetection(from, chosen); 69 | await conn.sendMessage(from, { 70 | text: `✅ Antilink is now set to *${chosen.toUpperCase()}* mode.`, 71 | }, { quoted: msg }); 72 | } 73 | 74 | conn.ev.off("messages.upsert", handler); 75 | }; 76 | 77 | conn.ev.on("messages.upsert", handler); 78 | setTimeout(() => conn.ev.off("messages.upsert", handler), 600_000); 79 | }); 80 | -------------------------------------------------------------------------------- /lib/sticker-utils.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const fs = require('fs'); 3 | const path = require('path'); 4 | const { tmpdir } = require('os'); 5 | const Crypto = require('crypto'); 6 | const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path; 7 | const ffmpeg = require('fluent-ffmpeg'); 8 | 9 | ffmpeg.setFfmpegPath(ffmpegPath); 10 | 11 | /** 12 | * Fetch an image from a given URL. 13 | * @param {string} url - The image URL. 14 | * @returns {Promise} - The image buffer. 15 | */ 16 | async function fetchImage(url) { 17 | try { 18 | const response = await axios.get(url, { responseType: 'arraybuffer' }); 19 | return response.data; 20 | } catch (error) { 21 | console.error("Error fetching image:", error); 22 | throw new Error("Could not fetch image."); 23 | } 24 | } 25 | 26 | /** 27 | * Fetch a GIF from a given API URL. 28 | * @param {string} url - API endpoint to fetch GIF. 29 | * @returns {Promise} - The GIF buffer. 30 | */ 31 | async function fetchGif(url) { 32 | try { 33 | const response = await axios.get(url, { responseType: 'arraybuffer' }); 34 | return response.data; 35 | } catch (error) { 36 | console.error("Error fetching GIF:", error); 37 | throw new Error("Could not fetch GIF."); 38 | } 39 | } 40 | 41 | /** 42 | * Converts a GIF buffer to WebP sticker format. 43 | * @param {Buffer} gifBuffer - The GIF buffer. 44 | * @returns {Promise} - The WebP sticker buffer. 45 | */ 46 | async function gifToSticker(gifBuffer) { 47 | const outputPath = path.join(tmpdir(), Crypto.randomBytes(6).toString('hex') + ".webp"); 48 | const inputPath = path.join(tmpdir(), Crypto.randomBytes(6).toString('hex') + ".gif"); 49 | 50 | fs.writeFileSync(inputPath, gifBuffer); 51 | 52 | await new Promise((resolve, reject) => { 53 | ffmpeg(inputPath) 54 | .on("error", reject) 55 | .on("end", () => resolve(true)) 56 | .addOutputOptions([ 57 | "-vcodec", "libwebp", 58 | "-vf", "scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15,pad=320:320:-1:-1:color=white@0.0,split [a][b];[a] palettegen=reserve_transparent=on:transparency_color=ffffff [p];[b][p] paletteuse", 59 | "-loop", "0", 60 | "-preset", "default", 61 | "-an", 62 | "-vsync", "0" 63 | ]) 64 | .toFormat("webp") 65 | .save(outputPath); 66 | }); 67 | 68 | const webpBuffer = fs.readFileSync(outputPath); 69 | fs.unlinkSync(outputPath); 70 | fs.unlinkSync(inputPath); 71 | 72 | return webpBuffer; 73 | } 74 | 75 | module.exports = { fetchImage, fetchGif, gifToSticker }; 76 | 77 | -------------------------------------------------------------------------------- /plugins/Fancy.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "fancy", 6 | alias: ["font", "style"], 7 | react: "⤵️", 8 | desc: "Convert text into various fancy fonts.", 9 | category: "tools", 10 | filename: __filename 11 | }, async (conn, mek, m, { 12 | from, 13 | quoted, 14 | body, 15 | isCmd, 16 | command, 17 | args, 18 | q, 19 | reply 20 | }) => { 21 | try { 22 | if (!q) return reply("❎ Please provide text to convert.\n\n*Example:* .fancy Xbot top"); 23 | 24 | const apiUrl = `https://www.dark-yasiya-api.site/other/font?text=${encodeURIComponent(q)}`; 25 | const res = await axios.get(apiUrl); 26 | 27 | if (!res.data.status || !Array.isArray(res.data.result)) { 28 | return reply("*Error fetching fonts. Try again later*."); 29 | } 30 | 31 | const fonts = res.data.result; 32 | const maxDisplay = 44; 33 | const displayList = fonts.slice(0, maxDisplay); 34 | 35 | let menuText = "╭──〔 *FANCY STYLES* 〕──⬣\n"; 36 | displayList.forEach((f, i) => { 37 | menuText += `┃ ${i + 1}. ${f.result}\n`; 38 | }); 39 | menuText += "╰──────────────⬣\n\n📌 *Reply with the number to select a font style for:*\n❝ " + q + " ❞"; 40 | 41 | const sentMsg = await conn.sendMessage(from, { 42 | text: menuText 43 | }, { quoted: m }); 44 | 45 | const messageID = sentMsg.key.id; 46 | 47 | const messageHandler = async (msgData) => { 48 | const receivedMsg = msgData.messages?.[0]; 49 | if (!receivedMsg || !receivedMsg.message) return; 50 | 51 | const receivedText = receivedMsg.message.conversation || 52 | receivedMsg.message.extendedTextMessage?.text; 53 | 54 | const senderID = receivedMsg.key.remoteJid; 55 | const isReplyToBot = receivedMsg.message.extendedTextMessage?.contextInfo?.stanzaId === messageID; 56 | 57 | if (isReplyToBot && senderID === from) { 58 | const selectedNumber = parseInt(receivedText.trim()); 59 | if (isNaN(selectedNumber) || selectedNumber < 1 || selectedNumber > displayList.length) { 60 | return conn.sendMessage(from, { 61 | text: "❎ Invalid selection. Please reply with a number from 1 to " + displayList.length + ".", 62 | }, { quoted: receivedMsg }); 63 | } 64 | 65 | const chosen = displayList[selectedNumber - 1]; 66 | const finalText = `${chosen.result}`; 67 | 68 | await conn.sendMessage(from, { 69 | text: finalText 70 | }, { quoted: receivedMsg }); 71 | } 72 | }; 73 | 74 | conn.ev.on("messages.upsert", messageHandler); 75 | } catch (error) { 76 | console.error("❌ Error in fancy:", error); 77 | reply("⚠️ An error occurred while processing."); 78 | } 79 | }); 80 | -------------------------------------------------------------------------------- /lib/functions.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios') 2 | 3 | const getBuffer = async(url, options) => { 4 | try { 5 | options ? options : {} 6 | var res = await axios({ 7 | method: 'get', 8 | url, 9 | headers: { 10 | 'DNT': 1, 11 | 'Upgrade-Insecure-Request': 1 12 | }, 13 | ...options, 14 | responseType: 'arraybuffer' 15 | }) 16 | return res.data 17 | } catch (e) { 18 | console.log(e) 19 | } 20 | } 21 | 22 | const getGroupAdmins = (participants) => { 23 | var admins = [] 24 | for (let i of participants) { 25 | i.admin !== null ? admins.push(i.id) : '' 26 | } 27 | return admins 28 | } 29 | 30 | const getRandom = (ext) => { 31 | return `${Math.floor(Math.random() * 10000)}${ext}` 32 | } 33 | 34 | const h2k = (eco) => { 35 | var lyrik = ['', 'K', 'M', 'B', 'T', 'P', 'E'] 36 | var ma = Math.log10(Math.abs(eco)) / 3 | 0 37 | if (ma == 0) return eco 38 | var ppo = lyrik[ma] 39 | var scale = Math.pow(10, ma * 3) 40 | var scaled = eco / scale 41 | var formatt = scaled.toFixed(1) 42 | if (/\.0$/.test(formatt)) 43 | formatt = formatt.substr(0, formatt.length - 2) 44 | return formatt + ppo 45 | } 46 | 47 | const isUrl = (url) => { 48 | return url.match( 49 | new RegExp( 50 | /https?:\/\/(www\.)?[-a-zA-Z0-9@:%.+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%+.~#?&/=]*)/, 51 | 'gi' 52 | ) 53 | ) 54 | } 55 | 56 | const Json = (string) => { 57 | return JSON.stringify(string, null, 2) 58 | } 59 | 60 | const runtime = (seconds) => { 61 | seconds = Number(seconds) 62 | var d = Math.floor(seconds / (3600 * 24)) 63 | var h = Math.floor(seconds % (3600 * 24) / 3600) 64 | var m = Math.floor(seconds % 3600 / 60) 65 | var s = Math.floor(seconds % 60) 66 | var dDisplay = d > 0 ? d + (d == 1 ? ' day, ' : ' days, ') : '' 67 | var hDisplay = h > 0 ? h + (h == 1 ? ' hour, ' : ' hours, ') : '' 68 | var mDisplay = m > 0 ? m + (m == 1 ? ' minute, ' : ' minutes, ') : '' 69 | var sDisplay = s > 0 ? s + (s == 1 ? ' second' : ' seconds') : '' 70 | return dDisplay + hDisplay + mDisplay + sDisplay; 71 | } 72 | 73 | const sleep = async(ms) => { 74 | return new Promise(resolve => setTimeout(resolve, ms)) 75 | } 76 | 77 | const fetchJson = async (url, options) => { 78 | try { 79 | options ? options : {} 80 | const res = await axios({ 81 | method: 'GET', 82 | url: url, 83 | headers: { 84 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' 85 | }, 86 | ...options 87 | }) 88 | return res.data 89 | } catch (err) { 90 | return err 91 | } 92 | } 93 | 94 | module.exports = { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep , fetchJson} 95 | -------------------------------------------------------------------------------- /plugins/fb-dl.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { cmd } = require("../command"); 3 | 4 | cmd({ 5 | pattern: "fbdl", 6 | alias: ["facebook", "fb"], 7 | react: '⏰', 8 | desc: "Download videos from Facebook.", 9 | category: "download", 10 | use: ".fbdl ", 11 | filename: __filename 12 | }, async (conn, mek, m, { from, reply, args }) => { 13 | try { 14 | // Check if the user provided a Facebook video URL 15 | const fbUrl = args[0]; 16 | if (!fbUrl || !fbUrl.includes("facebook.com")) { 17 | return reply('*𝐏ℓєαʂє 𝐏ɼ๏νιɖє 𝐀 fb҇ 𝐕ιɖє๏ ๏ɼ ɼєєℓ 𝐔ɼℓ..*'); 18 | } 19 | 20 | // Add a reaction to indicate processing 21 | await conn.sendMessage(from, { react: { text: '⏳', key: m.key } }); 22 | 23 | // Prepare the API URL 24 | const apiUrl = `https://apis.davidcyriltech.my.id/facebook2?url=${encodeURIComponent(fbUrl)}`; 25 | 26 | // Call the API using GET 27 | const response = await axios.get(apiUrl); 28 | 29 | // Check if the API response is valid 30 | if (!response.data || !response.data.status || !response.data.video) { 31 | return reply('❌ Unable to fetch the video. Please check the URL and try again.'); 32 | } 33 | 34 | // Extract the video details 35 | const { title, thumbnail, downloads } = response.data.video; 36 | 37 | // Get the highest quality download link (HD or SD) 38 | const downloadLink = downloads.find(d => d.quality === "HD")?.downloadUrl || downloads[0].downloadUrl; 39 | 40 | // Inform the user that the video is being downloaded 41 | // await reply('```Downloading video... Please wait.📥```'); 42 | 43 | // Download the video 44 | const videoResponse = await axios.get(downloadLink, { responseType: 'arraybuffer' }); 45 | if (!videoResponse.data) { 46 | return reply('❌ Failed to download the video. Please try again later.'); 47 | } 48 | 49 | // Prepare the video buffer 50 | const videoBuffer = Buffer.from(videoResponse.data, 'binary'); 51 | 52 | // Send the video with details 53 | await conn.sendMessage(from, { 54 | video: videoBuffer, 55 | caption: `*𝐃𝐎𝐖𝐍𝐋𝐎𝐀𝐃𝐄𝐃*\n\n` + 56 | `🔖 *TITLE*: ${title}\n` + 57 | `📏 *QUALITY*: ${downloads.find(d => d.quality === "HD") ? "HD" : "SD"}\n\n` + 58 | `> *© ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅx*`}, { quoted: mek }); 59 | 60 | // Add a reaction to indicate success 61 | await conn.sendMessage(from, { react: { text: '✅', key: m.key } }); 62 | } catch (error) { 63 | console.error('Error downloading video:', error); 64 | reply('❌ Unable to download the video. Please try again later.'); 65 | 66 | // Add a reaction to indicate failure 67 | await conn.sendMessage(from, { react: { text: '❌', key: m.key } }); 68 | } 69 | }); 70 | 71 | 72 | -------------------------------------------------------------------------------- /plugins/fun-riddle.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd, commands } = require('../command'); 3 | const axios = require("axios"); 4 | 5 | cmd({ 6 | pattern: "riddle", 7 | alias: ["puzzle", "brainteaser"], 8 | desc: "Get a random riddle with 4 possible answers. The correct answer is revealed after 15 seconds.", 9 | category: "utility", 10 | use: ".riddle", 11 | filename: __filename, 12 | }, async (conn, mek, msg, { from, args, reply }) => { 13 | try { 14 | // Fetch a random riddle from the API 15 | const response = await axios.get("https://riddles-api.vercel.app/random"); 16 | const { riddle, answer } = response.data; 17 | 18 | // Generate 4 options (1 correct and 3 random incorrect ones) 19 | const options = await generateOptions(answer); 20 | 21 | // Format the riddle message with options 22 | const riddleMessage = ` 23 | 🤔 *Riddle*: ${riddle} 24 | 25 | 🅰️ ${options[0]} 26 | 🅱️ ${options[1]} 27 | 🅾️ ${options[2]} 28 | 🆎 ${options[3]} 29 | 30 | ⏳ The answer will be revealed in 15 seconds... 31 | `; 32 | 33 | // Send the riddle message 34 | await reply(riddleMessage); 35 | 36 | // Wait for 15 seconds before revealing the answer 37 | setTimeout(async () => { 38 | const answerMessage = ` 39 | 🎉 *Answer*: ${answer} 40 | 41 | 💡 *Explanation*: If you got it right, well done! If not, better luck next time! 42 | `; 43 | await reply(answerMessage); 44 | }, 15000); // 15 seconds delay 45 | } catch (error) { 46 | console.error("Error fetching riddle:", error); 47 | 48 | // Send an error message 49 | reply("❌ Unable to fetch a riddle. Please try again later."); 50 | } 51 | }); 52 | 53 | // Helper function to generate 4 options (1 correct and 3 random incorrect ones) 54 | async function generateOptions(correctAnswer) { 55 | try { 56 | // Fetch random words or incorrect answers from an API (e.g., Random Word API) 57 | const randomWordsResponse = await axios.get("https://random-word-api.herokuapp.com/word?number=3"); 58 | const randomWords = randomWordsResponse.data; 59 | 60 | // Combine the correct answer with 3 random words 61 | const options = [correctAnswer, ...randomWords]; 62 | 63 | // Shuffle the options to randomize their order 64 | return shuffleArray(options); 65 | } catch (error) { 66 | console.error("Error generating options:", error); 67 | // Fallback to simple options if the API fails 68 | return [correctAnswer, "A shadow", "A whistle", "A cloud"]; 69 | } 70 | } 71 | 72 | // Helper function to shuffle an array (for randomizing options) 73 | function shuffleArray(array) { 74 | for (let i = array.length - 1; i > 0; i--) { 75 | const j = Math.floor(Math.random() * (i + 1)); 76 | [array[i], array[j]] = [array[j], array[i]]; 77 | } 78 | return array; 79 | } 80 | -------------------------------------------------------------------------------- /plugins/sticker-maker.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); 2 | const crypto = require('crypto'); 3 | const webp = require('node-webpmux'); 4 | const axios = require('axios'); 5 | const fs = require('fs-extra'); 6 | const { exec } = require('child_process'); 7 | const { Sticker, createSticker, StickerTypes } = require("wa-sticker-formatter"); 8 | const Config = require('../config'); 9 | 10 | // Take Sticker 11 | 12 | cmd( 13 | { 14 | pattern: 'take', 15 | alias: ['rename', 'stake'], 16 | desc: 'Create a sticker with a custom pack name.', 17 | category: 'convert', 18 | use: '', 19 | filename: __filename, 20 | }, 21 | async (conn, mek, m, { quoted, args, q, pushname, reply, from }) => { 22 | if (!mek.quoted) return reply(`*Reply to any sticker.*`); 23 | 24 | let mime = mek.quoted.mtype; 25 | let pack = `${pushname}` || q; 26 | 27 | if (mime === "imageMessage" || mime === "stickerMessage") { 28 | let media = await mek.quoted.download(); 29 | let sticker = new Sticker(media, { 30 | pack: pack, 31 | type: StickerTypes.FULL, 32 | categories: ["🤩", "🎉"], 33 | id: "12345", 34 | quality: 75, 35 | background: 'transparent', 36 | }); 37 | const buffer = await sticker.toBuffer(); 38 | return conn.sendMessage(mek.chat, { sticker: buffer }, { quoted: mek }); 39 | } else { 40 | return reply("*Uhh, Please reply to an image.*"); 41 | } 42 | } 43 | ); 44 | 45 | //Sticker create 46 | 47 | cmd( 48 | { 49 | pattern: 'sticker', 50 | alias: ['s', 'stickergif'], 51 | desc: 'Create a sticker from an image, video, or URL.', 52 | category: 'convert', 53 | use: '', 54 | filename: __filename, 55 | }, 56 | async (conn, mek, m, { quoted, args, q, reply, from }) => { 57 | if (!mek.quoted) return reply(`*Reply to any Image or Video, Sir.*`); 58 | let mime = mek.quoted.mtype; 59 | let pack = Config.STICKER_NAME || "x-ʙᴏᴛ-ᴍᴅ"; 60 | 61 | if (mime === "imageMessage" || mime === "stickerMessage") { 62 | let media = await mek.quoted.download(); 63 | let sticker = new Sticker(media, { 64 | pack: pack, 65 | type: StickerTypes.FULL, 66 | categories: ["🤩", "🎉"], 67 | id: "12345", 68 | quality: 75, 69 | background: 'transparent', 70 | }); 71 | const buffer = await sticker.toBuffer(); 72 | return conn.sendMessage(mek.chat, { sticker: buffer }, { quoted: mek }); 73 | } else { 74 | return reply("*Uhh, Please reply to an image.*"); 75 | } 76 | } 77 | ); 78 | 79 | // DavidTechX 80 | --------------------------------------------------------------------------------