├── media ├── voice │ ├── hk │ ├── alive.mp3 │ ├── song.mp3 │ └── video.mp3 ├── readme │ └── img │ │ ├── templ │ │ ├── deploy.jpeg │ │ ├── logologo.jpg │ │ ├── Picsart_24-09-01_19-11-57-881.jpg │ │ ├── Picsart_24-09-02_15-24-30-989.png │ │ ├── Picsart_24-09-02_15-30-52-464.jpg │ │ └── Picsart_24-09-02_15-32-12-268.png ├── autovideo.json ├── autoimage.json ├── autoreply.json ├── autosticker.json └── autovoice.json ├── data ├── goctimes.json ├── welcomeMessages.json ├── dila.jpg ├── akeel.jpg ├── heshan.jpg ├── nipun.jpg ├── qusay.jpg ├── rukshan.jpg └── sachiya.jpg ├── dila_md_licence ├── a │ ├── b │ │ ├── hH │ │ └── c │ │ │ ├── d │ │ │ ├── e │ │ │ └── dddamsbs.js │ │ │ └── Sjajnsba │ └── Znsn └── DILA MD LICENSE ├── lib ├── mongodbenv.js ├── database.js ├── mongodb.js ├── functions.js └── msg.js ├── config.js ├── plugins ├── aichat.js ├── restart.js ├── online.js ├── weather.js ├── menu.js ├── wplink.js ├── Gkick.js ├── eromdaer.js ├── wikipedia.js ├── ping.js ├── gtag.js ├── react.js ├── system.js ├── download.js ├── automsg.js ├── yts.js ├── wcprofile.js ├── ginfo.js ├── ai.js ├── alive.js ├── ytdownload.js ├── goctime.js ├── group.js ├── antilinkbad.js ├── anti.js ├── states.js ├── gwb.js └── setting.js ├── command.js ├── app.json ├── .github └── workflows │ └── node.js.yml ├── package.json ├── README.md ├── talkdrove.json ├── index.js └── LICENSE /media/voice/hk: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/goctimes.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /dila_md_licence/a/b/hH: -------------------------------------------------------------------------------- 1 | h 2 | -------------------------------------------------------------------------------- /media/readme/img/templ: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/welcomeMessages.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /dila_md_licence/a/Znsn: -------------------------------------------------------------------------------- 1 | sn 2 | -------------------------------------------------------------------------------- /dila_md_licence/a/b/c/d/e: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dila_md_licence/a/b/c/Sjajnsba: -------------------------------------------------------------------------------- 1 | jsj 2 | -------------------------------------------------------------------------------- /media/autovideo.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | 4 | 5 | } 6 | -------------------------------------------------------------------------------- /data/dila.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/data/dila.jpg -------------------------------------------------------------------------------- /data/akeel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/data/akeel.jpg -------------------------------------------------------------------------------- /data/heshan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/data/heshan.jpg -------------------------------------------------------------------------------- /data/nipun.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/data/nipun.jpg -------------------------------------------------------------------------------- /data/qusay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/data/qusay.jpg -------------------------------------------------------------------------------- /data/rukshan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/data/rukshan.jpg -------------------------------------------------------------------------------- /data/sachiya.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/data/sachiya.jpg -------------------------------------------------------------------------------- /media/voice/alive.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/media/voice/alive.mp3 -------------------------------------------------------------------------------- /media/voice/song.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/media/voice/song.mp3 -------------------------------------------------------------------------------- /media/voice/video.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/media/voice/video.mp3 -------------------------------------------------------------------------------- /media/autoimage.json: -------------------------------------------------------------------------------- 1 | { 2 | "dilan":"https://telegra.ph/file/dcd097f9f7a124d47e5b2.jpg" 3 | 4 | 5 | } 6 | -------------------------------------------------------------------------------- /media/readme/img/deploy.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/media/readme/img/deploy.jpeg -------------------------------------------------------------------------------- /media/readme/img/logologo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/media/readme/img/logologo.jpg -------------------------------------------------------------------------------- /media/autoreply.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "dilo":"*Name*: Dilan\n*From*: Matara\n*Age*: 20\n*Web*:\ndilalk.vercel.app\n\n_you .....?_ ♥✊" 4 | 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /media/readme/img/Picsart_24-09-01_19-11-57-881.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/media/readme/img/Picsart_24-09-01_19-11-57-881.jpg -------------------------------------------------------------------------------- /media/readme/img/Picsart_24-09-02_15-24-30-989.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/media/readme/img/Picsart_24-09-02_15-24-30-989.png -------------------------------------------------------------------------------- /media/readme/img/Picsart_24-09-02_15-30-52-464.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/media/readme/img/Picsart_24-09-02_15-30-52-464.jpg -------------------------------------------------------------------------------- /media/readme/img/Picsart_24-09-02_15-32-12-268.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themiyadilann/PAHANu/HEAD/media/readme/img/Picsart_24-09-02_15-32-12-268.png -------------------------------------------------------------------------------- /media/autosticker.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "dilan":"https://github.com/themiyadilann/DilaMD-Media/raw/main/stickers/IMG-20240831-WA0525.webp" 4 | 5 | 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /lib/mongodbenv.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | const envVarSchema = new mongoose.Schema({ 4 | key: { type: String, required: true, unique: true }, 5 | value: { type: String, required: true } 6 | }); 7 | 8 | const EnvVar = mongoose.model('EnvVar', envVarSchema); 9 | 10 | module.exports = EnvVar; 11 | -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | if (fs.existsSync('config.env')) require('dotenv').config({ path: './config.env' }); 3 | 4 | function convertToBool(text, fault = 'true') { 5 | return text === fault ? true : false; 6 | } 7 | module.exports = { 8 | SESSION_ID: process.env.SESSION_ID || "", 9 | MONGODB: process.env.MONGODB || "", 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /plugins/aichat.js: -------------------------------------------------------------------------------- 1 | const fs=require('fs');const path=require('path');const{readEnv}=require('../lib/database');const{cmd,commands}=require('../command');const{fetchJson}=require('../lib/functions');cmd({on:"body"},async(conn,mek,m,{from,body,isOwner})=>{try{const config=await readEnv();if(config.AUTO_AI==='true'){if(isOwner)return;let data=await fetchJson(`https://chatgptforprabath-md.vercel.app/api/gptv1?q=${body}`);let response=data.data;await m.reply(response);}}catch(e){console.log(e);await m.reply(`Error: ${e.message}`);}}); 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /plugins/restart.js: -------------------------------------------------------------------------------- 1 | const config=require('../config');const {cmd,commands}=require('../command');const {sleep}=require('../lib/functions');cmd({pattern:"restart",desc:"restart the bot",category:"owner",filename:__filename},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})=>{try{if(!isOwner)return;const {exec}=require("child_process");reply("*Restarting... 🔄*");await sleep(1500);exec("pm2 restart all");}catch(e){console.log(e);reply(`${e}`);}}); 2 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dila-MD", 3 | "description": "hey this is dilamd whatsapp bot", 4 | "logo": "https://telegra.ph/file/94055e3a7e18f50199374.jpg", 5 | "keywords": ["bot"], 6 | "success_url": "/", 7 | 8 | "env": { 9 | "SESSION_ID": { 10 | "description": "Add DilaMD Session ID", 11 | "required": false 12 | }, 13 | 14 | "MONGODB": { 15 | "description": "Put your Mongodb url", 16 | "required": true 17 | } 18 | }, 19 | 20 | "buildpacks": [ 21 | { 22 | "url": "https://github.com/heroku/heroku-buildpack-nodejs.git" 23 | } 24 | ], 25 | "stack": "heroku-24" 26 | } 27 | -------------------------------------------------------------------------------- /dila_md_licence/DILA MD LICENSE: -------------------------------------------------------------------------------- 1 | 2 | ██████╗░██╗██╗░░░░░░█████╗░ 3 | ██╔══██╗██║██║░░░░░██╔══██╗ 4 | ██║░░██║██║██║░░░░░███████║ 5 | ██║░░██║██║██║░░░░░██╔══██║ 6 | ██████╔╝██║███████╗██║░░██║ 7 | ╚═════╝░╚═╝╚══════╝╚═╝░░╚═╝ 8 | ███╗░░░███╗██████╗░ 9 | ████╗░████║██╔══██╗ 10 | ██╔████╔██║██║░░██║ 11 | ██║╚██╔╝██║██║░░██║ 12 | ██║░╚═╝░██║██████╔╝ 13 | ╚═╝░░░░░╚═╝╚═════╝░ 𝗪𝗛𝗔𝗧𝗦𝗔𝗣𝗣 𝗕𝗢𝗧 14 | 𝗖𝗥𝗘𝗔𝗧 𝗕𝗬 𝗠𝗥 𝗗𝗜𝗟𝗔 𝗢𝗙𝗖 15 | 16 | 𝗚𝗜𝗧𝗛𝗨𝗕 - https://github.com/themiyadilann 17 | 𝗬𝗢𝗨𝗧𝗨𝗕𝗘 - https://youtube.com/@dila_lk 18 | 𝗪𝗛𝗔𝗧𝗦𝗔𝗣𝗣 - https://whatsapp.com/channel/0029ValK0gn4SpkP6iaXoj2y 19 | 𝗧𝗘𝗟𝗘𝗚𝗥𝗔𝗠 - https://t.me/dilalk 20 | -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | name: Node.js CI 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | strategy: 15 | matrix: 16 | node-version: [18.x, 20.x, 22.x] 17 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 18 | 19 | steps: 20 | - uses: actions/checkout@v4 21 | - name: Use Node.js ${{ matrix.node-version }} 22 | uses: actions/setup-node@v4 23 | with: 24 | node-version: ${{ matrix.node-version }} 25 | cache: 'npm' 26 | - run: npm ci 27 | - run: npm run build --if-present 28 | - run: npm test 29 | -------------------------------------------------------------------------------- /plugins/online.js: -------------------------------------------------------------------------------- 1 | const { readEnv } = require('../lib/database'); 2 | const { cmd } = require('../command'); 3 | 4 | // Handler to manage online presence and bot activity based on ALLOWS_ONLINE key 5 | cmd({on: "body"}, async (conn, mek, m, { from, isOwner }) => { 6 | const config = await readEnv(); 7 | 8 | // If ALLOWS_ONLINE is false, prevent showing online status and stop reading or delivering messages 9 | if (config.ALLOWS_ONLINE === 'false') { 10 | // Pause presence updates so the bot doesn't appear online 11 | await conn.sendPresenceUpdate('paused', from); 12 | 13 | // Prevent the bot from reading or delivering the message (no receipt sent) 14 | return; // Bot ignores the message, no read/delivered status is updated 15 | } 16 | 17 | // If ALLOWS_ONLINE is true, proceed with normal bot functionalities 18 | // Example: Add bot's command handling here 19 | // The bot can handle incoming messages here 20 | }); 21 | -------------------------------------------------------------------------------- /plugins/weather.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'), weather = require('weather-js'), sensitiveData = require('../dila_md_licence/a/b/c/d/dddamsbs'); cmd({ pattern: "weather", desc: "Get weather info", category: "main", filename: __filename }, async (conn, mek, m, { from, args, reply }) => { if (!args.length) return reply('Provide location'); weather.find({ search: args.join(" "), degreeType: 'C' }, async (err, result) => { if (err || !result.length) return reply(`Error: ${err.message || "No data"}`); const w = result[0].current, f = result[0].forecast[0], text = `*🌤 Weather Info 🌤*\n📍 *Location*: ${result[0].location.name}\n🌡️ *Temp*: ${w.temperature}°C\n🌥️ *Condition*: ${w.skytext}\n💨 *Wind*: ${w.winddisplay}\n💧 *Humidity*: ${w.humidity}%\n🕒 *Obs Time*: ${w.observationtime}\n*📅 Forecast*: High ${f.high}°C, Low ${f.low}°C\nCondition: ${f.skytextday}\n\n${sensitiveData.siteUrl}\n${sensitiveData.footerText}`; await conn.sendMessage(from, { image: { url: w.imageUrl }, caption: text }, { quoted: mek }); }); }); 2 | -------------------------------------------------------------------------------- /plugins/menu.js: -------------------------------------------------------------------------------- 1 | const {readEnv}=require('../lib/database');const {cmd,commands}=require('../command');const os=require("os");const {runtime}=require('../lib/functions');const sensitiveData=require('../dila_md_licence/a/b/c/d/dddamsbs');cmd({pattern:"menu",alias:["panel","penal","list","allmenu"],desc:"Check menu all",category:"main",react:"👺",filename:__filename},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})=>{try{const config=await readEnv();const totalRAM=Math.round(require('os').totalmem()/1024/1024);const usedRAM=(process.memoryUsage().heapUsed/1024/1024).toFixed(2);const freeRAM=(totalRAM-parseFloat(usedRAM)).toFixed(2);let status=`${sensitiveData.apimenibah}`;let sentMessage=await conn.sendMessage(from,{image:{url:config.ALIVE_IMG},caption:status},{quoted:mek||null});await conn.sendMessage(from,{react:{text:"👺",key:sentMessage.key}})}catch(e){console.log(e);reply(`Error: ${e}`)}}); 2 | -------------------------------------------------------------------------------- /plugins/wplink.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); const {cmd, commands} = require('../command'); cmd({ pattern: "dilo", alias: ["owner","developer","bot"], desc: "Check if the bot is online.", category: "main", filename: __filename }, 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 }) => { try { const status = `*Name*: Dilan\n*From*: Matara\n*Number*: 94727839446\n*Web*: dilalk.vercel.app`; const imageUrl = 'https://telegra.ph/file/dcd097f9f7a124d47e5b2.jpg'; const audioUrl = 'https://drive.google.com/uc?export=download&id=1YYPnkKWdrxFe8C2kWdwf8qkeE0PO5RjW'; const quotedMessage = mek ? mek : null; await conn.sendMessage(from, { image: { url: imageUrl }, caption: status }, { quoted: quotedMessage }); await conn.sendPresenceUpdate('recording', from); await conn.sendMessage(from, { audio: { url: audioUrl }, mimetype: 'audio/mp4', ptt: true }, { quoted: quotedMessage }); } catch (e) { console.error('Error sending message:', e); reply(`An error occurred: ${e.message}`); } }); 2 | -------------------------------------------------------------------------------- /lib/database.js: -------------------------------------------------------------------------------- 1 | const EnvVar = require('./mongodbenv'); 2 | 3 | // Function to get all environment variables 4 | const readEnv = async () => { 5 | try { 6 | const envVars = await EnvVar.find({}); 7 | const envVarObject = {}; 8 | envVars.forEach(envVar => { 9 | envVarObject[envVar.key] = envVar.value; 10 | }); 11 | return envVarObject; 12 | } catch (err) { 13 | console.error('Error retrieving environment variables:' + err.message); 14 | throw err; 15 | } 16 | }; 17 | 18 | // Function to update an environment variable 19 | const updateEnv = async (key, newValue) => { 20 | try { 21 | const result = await EnvVar.findOneAndUpdate( 22 | { key: key }, 23 | { value: newValue }, 24 | { new: true, upsert: true } 25 | ); 26 | 27 | if (result) { 28 | console.log(`Updated ${key} to ${newValue}`); 29 | } else { 30 | console.log(`Environment variable ${key} not found`); 31 | } 32 | } catch (err) { 33 | console.error('Error updating environment variable:' + err.message); 34 | throw err; 35 | } 36 | }; 37 | 38 | module.exports = { 39 | readEnv, 40 | updateEnv 41 | }; 42 | -------------------------------------------------------------------------------- /plugins/Gkick.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'), { jsonformat } = require('../lib/functions'); 2 | cmd({ 3 | pattern: "kick", 4 | desc: "Remove a member from the group.", 5 | category: "group", 6 | react: "🚫", 7 | filename: __filename 8 | }, async (conn, mek, m, { from, isGroup, isBotAdmins, isAdmins, reply }) => { 9 | try { 10 | if (!isGroup) return reply('This command can only be used in a group. 🚫'); 11 | if (!isBotAdmins) return reply('Bot must be an admin to use this command. 🤖'); 12 | if (!isAdmins) return reply('Only admins can use this command. 👮‍♂️'); 13 | 14 | // Check if a user is mentioned or quoted 15 | const user = mek.mentionedJid ? mek.mentionedJid[0] : (mek.quoted ? mek.quoted.sender : null); 16 | 17 | // Ensure a valid user is provided 18 | if (!user) return reply('Please tag or reply to a user to remove. 🙁'); 19 | 20 | // Proceed to remove the user from the group 21 | await conn.groupParticipantsUpdate(from, [user], 'remove'); 22 | await reply(`@${user.split('@')[0]} has been removed from the group. 👋`, { mentions: [user] }); 23 | 24 | } catch (e) { 25 | console.log(e); 26 | reply('Error removing member. ⚠️'); 27 | } 28 | }); 29 | -------------------------------------------------------------------------------- /plugins/eromdaer.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd, commands } = require('../command'); 3 | const { fetchJson } = require('../lib/functions'); 4 | const sensitiveData = require('../dila_md_licence/a/b/c/d/dddamsbs'); 5 | 6 | cmd({ 7 | pattern: "readmore", 8 | desc: "Readmore message", 9 | category: "main", 10 | react: "📝", 11 | filename: __filename 12 | }, async (conn, mek, m, { 13 | from, quoted, body, isCmd, command, args, q, isGroup, sender 14 | }) => { 15 | try { 16 | // Get the message text after the command (.readmore text) 17 | let readmoreText = q ? q : "No text provided"; 18 | 19 | // Create the "Readmore" effect by adding a special character to split the text 20 | let readmore = "\u200B".repeat(4000); // This creates a large gap between text 21 | 22 | // Full message to send 23 | let replyText = `${readmore}${readmoreText}`; 24 | 25 | // Send the message with the "Readmore" functionality 26 | await conn.sendMessage(from, { text: replyText }, { quoted: mek }); 27 | 28 | // React to the message 29 | await conn.sendMessage(from, { react: { text: "✅", key: mek.key } }); 30 | 31 | } catch (e) { 32 | console.log(e); 33 | reply(`Error: ${e.message}`); 34 | } 35 | }); 36 | -------------------------------------------------------------------------------- /plugins/wikipedia.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd, commands } = require('../command'); 3 | const wiki = require('wikipedia'); 4 | const sensitiveData = require('../dila_md_licence/a/b/c/d/dddamsbs'); 5 | 6 | cmd({ 7 | pattern: "wiki", 8 | desc: "Search Wikipedia for information", 9 | category: "main", 10 | filename: __filename 11 | }, async (conn, mek, m, { 12 | from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply 13 | }) => { 14 | try { 15 | if (!q) { 16 | return reply('Please provide a search query.'); 17 | } 18 | const summary = await wiki.summary(q); 19 | 20 | let replyText = `*📚 Wikipedia Summary 📚*\n\n🔍 *Query*: _${q}_\n\n💬 *Title*: _${summary.title}_\n\n📝 *Summary*: _${summary.extract}_\n\n🔗 *URL*: ${summary.content_urls.desktop.page}\n\n${sensitiveData.siteUrl}\n${sensitiveData.footerText}\n\n​\u200B​\u200B​\u200B​https://whatsapp.com/channel/0029VapPPNGEgGfO1JkeJF1h​`; 21 | await conn.sendMessage(from, { 22 | image: { url: summary.originalimage.source }, 23 | caption: replyText 24 | }, { quoted: mek }); 25 | } catch (e) { 26 | console.log(e); 27 | reply(`Error: ${e.message}`); 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /plugins/ping.js: -------------------------------------------------------------------------------- 1 | const config=require('../config');const {cmd,commands}=require('../command');const os=require("os");const speedTest=require('speedtest-net');const {runtime}=require('../lib/functions');function convertToReadableSize(speed){return speed>1024?(speed/1024).toFixed(2)+' GBs':speed+' MBs'};cmd({pattern:"ping",desc:"Check bot's response time and network speed.",category:"main",react:"✈️",filename:__filename},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})=>{try{const startTime=Date.now();await conn.sendMessage(from,{text:'*DILA MD... 📶*'});const endTime=Date.now();const ping=endTime-startTime;const speed=await speedTest({acceptLicense:true});let downloadSpeed=(speed.download.bandwidth/125000).toFixed(2);let uploadSpeed=(speed.upload.bandwidth/125000).toFixed(2);downloadSpeed=convertToReadableSize(downloadSpeed);uploadSpeed=convertToReadableSize(uploadSpeed);await conn.sendMessage(from,{text:`*Ping:* _${ping}ms_ ✈️`});setTimeout(async()=>{await conn.sendMessage(from,{text:`*Download Speed 📥:* _${downloadSpeed}_`});},700);setTimeout(async()=>{await conn.sendMessage(from,{text:`*Upload Speed 📤:* _${uploadSpeed}_`});},1400)}catch(e){console.log(e);await reply(`Error fetching network speed: ${e.message}`)}}); 2 | -------------------------------------------------------------------------------- /plugins/gtag.js: -------------------------------------------------------------------------------- 1 | const {readEnv}=require('../lib/database');const{cmd,commands}=require('../command');const sensitiveData=require('../dila_md_licence/a/b/c/d/dddamsbs');cmd({pattern:"tagall",desc:"Tag all members in the group with a custom message",isGroup:true,isOwner:true,react:"👺",filename:__filename},async(conn,mek,m,{from,body,isGroup,isOwner,isAdmins,groupAdmins,isBotAdmins})=>{try{const config=await readEnv();if(isGroup&&(isOwner||isAdmins)){const messageText=body.trim().split(/\s+/).slice(1).join(' ')||"Attention everyone!";if(!isBotAdmins&&!isOwner)return await conn.sendMessage(from,{text:"I need to be an admin to tag everyone!"});const groupMetadata=await conn.groupMetadata(from);const groupMembers=groupMetadata.participants;const mentions=groupMembers.map(member=>member.id);const tags=groupMembers.map(member=>`@${member.id.split('@')[0]}`).join('\n');let tagMessage=`${messageText}\n\n${sensitiveData.shaiagzbzksjabsvxg}\n${tags}`;const maxMessageLength=4096;while(tagMessage.length>maxMessageLength){const splitIndex=tagMessage.lastIndexOf('\n',maxMessageLength);await conn.sendMessage(from,{text:tagMessage.slice(0,splitIndex),mentions});tagMessage=tagMessage.slice(splitIndex+1)}await conn.sendMessage(from,{text:tagMessage,mentions})}else await conn.sendMessage(from,{text:"You need to be an admin or the bot owner to use this command!"})}catch(e){console.error(`Error in tagall: ${e.message}`)}}); 2 | -------------------------------------------------------------------------------- /plugins/react.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { readEnv } = require('../lib/database'); 4 | const { cmd, commands } = require('../command'); 5 | const { fetchJson } = require('../lib/functions'); 6 | const emoji = require('node-emoji'); // This library is still used for random emoji selection 7 | 8 | cmd({ on: "body" }, async (conn, mek, m, { from, body, isOwner }) => { 9 | try { 10 | const config = await readEnv(); 11 | 12 | // Check if auto-react is enabled in the config 13 | if (config.AUTO_REACT === 'true') { 14 | 15 | // Regular expression to detect emojis in the message 16 | const emojiRegex = /(\p{Emoji_Presentation}|\p{Emoji}\uFE0F)/gu; 17 | 18 | // Extract emojis from the body using regex 19 | const incomingEmojis = body.match(emojiRegex); 20 | 21 | // If there are emojis in the incoming message, reattach them 22 | if (incomingEmojis && incomingEmojis.length > 0) { 23 | await m.react(incomingEmojis[0]); // React with the first emoji found 24 | } else { 25 | // If no emojis are found, react with a random emoji 26 | const randomEmoji = emoji.random().emoji; // Get a random emoji 27 | await m.react(randomEmoji); 28 | } 29 | } 30 | } catch (e) { 31 | console.log(e); 32 | await m.reply(`Error: ${e.message}`); 33 | } 34 | }); 35 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dila-MD", 3 | "version": "1.0.0", 4 | "description": "hey this is dilamd whatsapp bot", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "pm2 start index.js --deep-monitoring --attach --name dilamd", 8 | "stop": "pm2 stop dilamd", 9 | "restart": "pm2 restart dilamd" 10 | }, 11 | "dependencies": { 12 | "@whiskeysockets/baileys": "6.6.0", 13 | "@adiwajshing/keyed-db": "^0.2.4", 14 | "@adiwajshing/baileys":"5.0.0", 15 | "pino": "^7.0.5", 16 | "pm2": "^5.2.0", 17 | "nodemailer":"6.9.15", 18 | "util": "^0.12.4", 19 | "node-emoji":"2.1.3", 20 | "stream":"0.0.3", 21 | "express": "latest", 22 | "mega":"latest", 23 | "axios": "^1.2.5", 24 | "file_size_url": "^1.0.4", 25 | "fs-extra": "^11.1.0", 26 | "path": "^0.12.7", 27 | "node-fetch": "^2.6.1", 28 | "whatsapp-web.js":"1.26.0", 29 | "megajs": "^1.1.0", 30 | "vm": "^0.1.0", 31 | "qrcode-terminal": "^0.12.0", 32 | "yt-search":"2.12.1", 33 | "wikipedia":"2.1.2", 34 | "googleapis":"144.0.0", 35 | "ytdl-core":"4.11.5", 36 | "api-dylux":"1.8.5", 37 | "mongoose":"8.5.3", 38 | "speedtest-net":"2.2.0", 39 | "systeminformation":"5.23.5", 40 | "moment-timezone":"0.5.45", 41 | "hirunews-scrap":"1.1.2", 42 | "@sl-code-lords/esana-news" : "latest", 43 | "@kaveesha-sithum/derana-news" : "latest", 44 | "hirunews-scraper":"3.0.0", 45 | "weather-js":"2.0.0", 46 | "@vitalets/google-translate-api":"9.2.0", 47 | "node-schedule":"2.1.1" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /plugins/system.js: -------------------------------------------------------------------------------- 1 | const config=require('../config');const{cmd,commands}=require('../command');const os=require("os");const si=require('systeminformation');const{runtime}=require('../lib/functions');const sensitiveData=require('../dila_md_licence/a/b/c/d/dddamsbs');cmd({pattern:"system",alias:["status","botinfo","runtime","uptime"],desc:"Check uptime, RAM usage, and more",category:"main",filename:__filename},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})=>{try{const totalRAM=Math.round(os.totalmem()/1024/1024);const usedRAM=(process.memoryUsage().heapUsed/1024/1024).toFixed(2);const freeRAM=(totalRAM-parseFloat(usedRAM)).toFixed(2);const cpuInfo=await si.cpu();const now=new Date();const sriLankaTimeZone='Asia/Colombo';const date=now.toLocaleDateString('en-GB',{timeZone:sriLankaTimeZone});const time=now.toLocaleTimeString('en-GB',{timeZone:sriLankaTimeZone,hour12:true});const timezone='UTC+5:30';let status=`*🕒 Uptime:* ${runtime(process.uptime())}\n*📅 Date:* ${date}\n*🕰️ Time:* ${time} (Sri Lanka Time)\n*💾 RAM Usage:*\n- *Used*: ${usedRAM} MB\n- *Free*: ${freeRAM} MB\n- *Total*: ${totalRAM} MB\n*🏠 HostName:* Ubuntu VPS\n*💻 OS:* ${os.type()} ${os.release()}\n*🖥️ CPU Manufacturer:* ${cpuInfo.manufacturer}\n*⚙️ CPU Brand:* ${cpuInfo.brand}\n*🚀 CPU Speed:* ${cpuInfo.speed} GHz\n*🌍 Server Time Zone:* ${timezone}\n${sensitiveData.systemosrq}`;const imageUrl='https://telegra.ph/file/50e9d2e8b43e5efe0b05f.jpg';await conn.sendMessage(from,{image:{url:imageUrl},caption:status},{quoted:mek||null})}catch(e){console.log(e);reply(`Error: ${e}`);}}); 2 | -------------------------------------------------------------------------------- /plugins/download.js: -------------------------------------------------------------------------------- 1 | const{fetchJson}=require('../lib/functions');const config=require('../config');const{cmd}=require('../command');const sensitiveData=require('../dila_md_licence/a/b/c/d/dddamsbs');let baseUrl;(async()=>{try{let baseUrlGet=await fetchJson(sensitiveData.baseUrlPath);baseUrl=baseUrlGet.api}catch(error){console.error('Failed to fetch base URL:',error)}})();const yourName=sensitiveData.nameSignature;cmd({pattern:"fb",alias:["facebook"],desc:"Download FB videos",category:"download",filename:__filename},async(conn,mek,m,{from,q,reply})=>{try{if(!q||!q.startsWith("https://"))return reply(sensitiveData.linkRequestMessage);let data=await fetchJson(`${baseUrl}/api/fdown?url=${q}`);reply("*Downloading... 📥*");if(data.data.hd)await conn.sendMessage(from,{video:{url:data.data.hd},mimetype:"video/mp4",caption:`📺 FB HD VIDEO 🚀✨🎥\n\n ${yourName}`},{quoted:mek});if(data.data.sd)await conn.sendMessage(from,{video:{url:data.data.sd},mimetype:"video/mp4",caption:`📱 FB SD VIDEO 🎬⚡📥\n\n ${yourName}`},{quoted:mek})}catch(e){console.error(e);reply(`Error: ${e.message}`)}});cmd({pattern:"tiktok",alias:["tt"],desc:"Download TikTok videos",category:"download",filename:__filename},async(conn,mek,m,{from,q,reply})=>{try{if(!q||!q.startsWith("https://"))return reply(sensitiveData.linkRequestMessage);let data=await fetchJson(`${baseUrl}/api/tiktokdl?url=${q}`);reply("*Downloading... 📥*");if(data.data.no_wm)await conn.sendMessage(from,{video:{url:data.data.no_wm},mimetype:"video/mp4",caption:`🚀 NO-WATERMARK DilaMD TIKTOK DOWNLOADER 🎵✨📥\n\n ${yourName}`},{quoted:mek});if(data.data.wm)await conn.sendMessage(from,{video:{url:data.data.wm},mimetype:"video/mp4",caption:`${sensitiveData.watermarkMessage}\n\n ${yourName}`},{quoted:mek});if(data.data.audio)await conn.sendMessage(from,{audio:{url:data.data.audio},mimetype:"audio/mpeg"},{quoted:mek})}catch(e){console.error(e);reply(`Error: ${e.message}`)}}); 2 | -------------------------------------------------------------------------------- /plugins/automsg.js: -------------------------------------------------------------------------------- 1 | const fs=require('fs'),path=require('path'),{readEnv}=require('../lib/database'),{cmd}=require('../command');cmd({on:"body"},async(conn,mek,m,{from,body,isOwner})=>{const filePath=path.join(__dirname,'../media/autovoice.json'),data=JSON.parse(fs.readFileSync(filePath,'utf8'));for(const text in data){if(body.toLowerCase()===text.toLowerCase()){const config=await readEnv();if(config.AUTO_VOICE==='true'){if(isOwner)return;await conn.sendPresenceUpdate('recording',from);await conn.sendMessage(from,{audio:{url:data[text]},mimetype:'audio/mpeg',ptt:true},{quoted:mek})}}}});cmd({on:"body"},async(conn,mek,m,{from,body,isOwner})=>{const filePath=path.join(__dirname,'../media/autoimage.json'),data=JSON.parse(fs.readFileSync(filePath,'utf8'));for(const text in data){if(body.toLowerCase()===text.toLowerCase()){const config=await readEnv();if(config.AUTO_IMAGE==='true'){if(isOwner)return;await conn.sendMessage(from,{image:{url:data[text]},mimetype:'image/jpeg'},{quoted:mek})}}}});cmd({on:"body"},async(conn,mek,m,{from,body,isOwner})=>{const filePath=path.join(__dirname,'../media/autovideo.json'),data=JSON.parse(fs.readFileSync(filePath,'utf8'));for(const text in data){if(body.toLowerCase()===text.toLowerCase()){const config=await readEnv();if(config.AUTO_VIDEO==='true'){if(isOwner)return;await conn.sendMessage(from,{video:{url:data[text]},mimetype:'video/mp4'},{quoted:mek})}}}});cmd({on:"body"},async(conn,mek,m,{from,body,isOwner})=>{const filePath=path.join(__dirname,'../media/autosticker.json'),data=JSON.parse(fs.readFileSync(filePath,'utf8'));for(const text in data){if(body.toLowerCase()===text.toLowerCase()){const config=await readEnv();if(config.AUTO_STICKER==='true'){if(isOwner)return;await conn.sendMessage(from,{sticker:{url:data[text]},package:'DilaMD'},{quoted:mek})}}}});cmd({on:"body"},async(conn,mek,m,{from,body,isOwner})=>{const filePath=path.join(__dirname,'../media/autoreply.json'),data=JSON.parse(fs.readFileSync(filePath,'utf8'));for(const text in data){if(body.toLowerCase()===text.toLowerCase()){const config=await readEnv();if(config.AUTO_REPLY==='true'){if(isOwner)return;await m.reply(data[text])}}}}); 2 | -------------------------------------------------------------------------------- /plugins/yts.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); const yts = require('yt-search'); const { fetchJson } = require('../lib/functions'); const sensitiveData = require('../dila_md_licence/a/b/c/d/dddamsbs'); const formatViews = views => views >= 1_000_000_000 ? `${(views / 1_000_000_000).toFixed(1)}B` : views >= 1_000_000 ? `${(views / 1_000_000).toFixed(1)}M` : views >= 1_000 ? `${(views / 1_000).toFixed(1)}K` : views.toString(); const thumbnailUrl = 'https://telegra.ph/file/bdc5a5b7af8bea3139d42.jpg'; cmd({ pattern: "yts", alias: ["yta","ytv","yt"], desc: "Search and display up to 100 YouTube video details", category: "search", filename: __filename }, async (conn, mek, m, { from, q, reply }) => { try { if (!q) return reply("Please type a Name or Url... 🤖"); const search = await yts(q); const videos = search.videos.slice(0, 100); if (videos.length === 0) return reply("No videos found for your query."); let message = `*${sensitiveData.ffffffssa} 𝗬𝗼𝘂𝘁𝘂𝗯𝗲 𝗦𝗲𝗮𝗿𝗰𝗵 𝗥𝗲𝘀𝘂𝗹𝘁 🎥*\n\n`; videos.forEach((data, index) => { message += `*No - ${index + 1} ⤵*\n`; message += `🎶 *𝗧𝗶𝘁𝗹𝗲*: _${data.title}_\n`; message += `👤 *𝗖𝗵𝗮𝗻𝗻𝗲𝗹*: _${data.author.name}_\n`; message += `📝 *𝗗𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻*: _${data.description}_\n`; message += `⏳ *𝗧𝗶𝗺𝗲*: _${data.timestamp}_\n`; message += `⏱️ *𝗔𝗴𝗼*: _${data.ago}_\n`; message += `👁️‍🗨️ *𝗩𝗶𝗲𝘄𝘀*: _${formatViews(data.views)}_\n`; message += `🔗 *𝗟𝗶𝗻𝗸*: ${data.url}\n\n`; }); message += `*𝗛𝗼𝘄 𝗧𝗼 𝗗𝗼𝘄𝗻𝗹𝗼𝗮𝗱 𝗩𝗶𝗱𝗲𝗼 𝗢𝗿 𝗔𝘂𝗱𝗶𝗼 ✅*\n\n`; message += `Example - .video (enter video title)\n`; message += `Example - .song (enter video title)\n\n`; message += `${sensitiveData.jfdjnda}`; await conn.sendMessage(from, { image: { url: thumbnailUrl }, caption: message }, { quoted: mek }); await conn.sendPresenceUpdate('recording', from); await conn.sendMessage(from, { audio: { url: 'https://github.com/themiyadilann/DilaMD-Media/raw/main/voice/song.mp3' }, mimetype: 'audio/mpeg', ptt: true }, { quoted: mek }); await conn.sendMessage(from, { audio: { url: 'https://github.com/themiyadilann/DilaMD-Media/raw/main/voice/video.mp3' }, mimetype: 'audio/mpeg', ptt: true }, { quoted: mek }); } catch (e) { console.log(e); reply(`Error: ${e.message}`); } }); 2 | -------------------------------------------------------------------------------- /lib/mongodb.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); const config = require('../config'); const EnvVar = require('./mongodbenv'); const defaultEnvVariables = [{ key: 'ALIVE_IMG', value: 'https://telegra.ph/file/94055e3a7e18f50199374.jpg' }, { key: 'GROUP_TIME', value: '120363304094968961@g.us/14:55/14:53' }, { key: 'STATES_SEEN_MESSAGE_SEND_SEND', value: 'false' }, { key: 'STATES_DOWNLOAD', value: 'true' }, { key: 'STATES_SEEN_MESSAGE', value: '_I saw your status! 😎👌_' }, { key: 'ALIVE_MSG', value: '*𝗜𝗺 𝗔𝗹𝗶𝘃𝗲 𝗡𝗼𝘄 ♥*\n*𝚃𝚛𝚝𝚒𝚜 ⤵*\n\n.ai (Your question)\n_example - .ai Hey_' }, { key: 'PREFIX', value: '.' }, { key: 'WELCOME_SET', value: '*Read this..*' }, { key: 'WELCOME_ALERT', value: 'false' }, { key: 'AUTO_REACT', value: 'false' }, { key: 'AUTO_READ_STATUS', value: 'true' }, { key: 'AUTO_SAVE', value: 'false' }, { key: 'MODE', value: 'public' }, { key: 'AUTO_VOICE', value: 'false' }, { key: 'ALLOWS_ONLINE', value: 'true' }, { key: 'AUTO_STICKER', value: 'false' }, { key: 'AUTO_REPLY', value: 'false' }, { key: 'AUTO_IMAGE', value: 'false' }, { key: 'AUTO_VIDEO', value: 'false' }, { key: 'GROUPS_TIMES', value: '120363339144214528@g.us,05:00,22:00/120363337475924167@g.us,06:00,23:00' }, { key: 'AUTO_AI', value: 'false' }, { key: 'WARN_COUNT', value: '10' }, { key: 'ANTI_LINK', value: 'off' }, { key: 'ANTI_BAD', value: 'off' }, { key: 'ANTI_VOICE', value: 'off' }, { key: 'ANTI_STICKER', value: 'off' }, { key: 'ANTI_PHOTO', value: 'off' }, { key: 'ANTI_VIDEO', value: 'off' }, { key: 'WELCOME', value: 'false' }, { key: 'OWNER_NUMBER', value: '94777839446@s.whatsapp.net' }, { key: 'ANTI_DELETE', value: 'false' }, { key: 'WCPROFILENAME', value: 'Dila' }, { key: 'WCPROFILEFROM', value: 'Matara' }, { key: 'WCPROFILEAGE', value: '20' }, { key: 'STATES_MSG_SEND', value: 'false' }, { key: 'STATES_MSG', value: '_I checked your status 🫂_' }, { key: 'AUTO_SEND_STATUS', value: 'true' }, { key: 'WCPROFILEMSG', value: 'dilo' }]; const connectDB = async () => { try { await mongoose.connect(config.MONGODB); console.log('🛜 MongoDB Connected ✅'); for (const envVar of defaultEnvVariables) { const existingVar = await EnvVar.findOne({ key: envVar.key }); if (!existingVar) { await EnvVar.create(envVar); console.log(`➕ Created default env var: ${envVar.key}`); } } } catch (err) { console.error(err.message); process.exit(1); } }; module.exports = connectDB; 2 | -------------------------------------------------------------------------------- /plugins/wcprofile.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { readEnv } = require('../lib/database'); 4 | const { cmd, commands } = require('../command'); 5 | const { fetchJson } = require('../lib/functions'); 6 | 7 | (async () => { 8 | try { 9 | const config = await readEnv(); 10 | 11 | async function sendReplies(conn, from, replies, pushname) { 12 | for (const [index, reply] of replies.entries()) { 13 | setTimeout(async () => { 14 | await conn.sendMessage(from, { text: reply.replace('${pushname}', pushname) }, { quoted: null }); 15 | }, index * 700); 16 | } 17 | } 18 | 19 | cmd({ on: "body" }, async (conn, mek, m, { from, body, isOwner, pushname }) => { 20 | const sequenceTrigger = config.WCPROFILEMSG ? config.WCPROFILEMSG.toLowerCase() : ''; 21 | 22 | if (body.toLowerCase() === sequenceTrigger) { 23 | const replies = [ 24 | `*𝗛𝗘𝗬* ${pushname}`, 25 | `*I am ${config.WCPROFILENAME} 👤*`, 26 | `*From - ${config.WCPROFILEFROM} 📍*`, 27 | `*Age - ${config.WCPROFILEAGE} 🎂*`, 28 | '*Save Me 📩*', 29 | '*You........?*' 30 | ]; 31 | await sendReplies(conn, from, replies, pushname); 32 | } 33 | 34 | // Command for 'link' with link preview enabled 35 | if (body.toLowerCase() === 'link') { 36 | const ownerNumber = config.OWNER_NUMBER ? config.OWNER_NUMBER.replace('@s.whatsapp.net', '') : ''; 37 | const linkReply = `https://wa.me/${ownerNumber}?text=${encodeURIComponent(config.WCPROFILEMSG)} _Gurl & boys drop a msg...💐🫀🤍_`; 38 | 39 | // Send message with link preview 40 | await conn.sendMessage(from, { 41 | text: linkReply, 42 | previewType: 'url' // This enables the link preview 43 | }, { quoted: null }); 44 | } 45 | 46 | // Respond to 'name' command 47 | if (body.toLowerCase().startsWith('name')) { 48 | const nameReply = `*Your Name Is* ${pushname}`; 49 | await conn.sendMessage(from, { text: nameReply }, { quoted: null }); 50 | } 51 | }); 52 | } catch (error) { 53 | console.error('Error initializing bot:', error); 54 | } 55 | })(); 56 | -------------------------------------------------------------------------------- /plugins/ginfo.js: -------------------------------------------------------------------------------- 1 | const fs=require('fs');const path=require('path');const{readEnv}=require('../lib/database');const{cmd}=require('../command');const{fetchJson}=require('../lib/functions');const sensitiveData=require('../dila_md_licence/a/b/c/d/dddamsbs');cmd({pattern:"group",desc:"Displays detailed information about the group",isGroup:true,isOwner:false,react:"🤔",filename:__filename},async(conn,mek,m,{from,body,isGroup})=>{try{if(isGroup){const args=body.trim().split(/\s+/).slice(1);const option=args[0]?args[0].toLowerCase():'all';const groupMetadata=await conn.groupMetadata(from);const groupName=groupMetadata.subject;let groupDp;try{groupDp=await conn.profilePictureUrl(from,'image')}catch(e){console.error(`Error fetching group profile picture: ${e.message}`);groupDp="https://via.placeholder.com/150"}let groupLink="No link available";try{const groupInvite=await fetchJson(`https://api.example.com/get-group-link?groupId=${from}`);groupLink=groupInvite.link||"No link available"}catch(e){console.error(`Error fetching group link: ${e.message}`)}const groupId=from;const members=groupMetadata.participants;const memberCount=members.length;const adminCount=members.filter(member=>member.isAdmin).length;const creator=groupMetadata.owner?groupMetadata.owner.split('@')[0]:"Unknown";const creationDate=new Date(groupMetadata.creation*1000).toLocaleDateString();const creationTime=new Date(groupMetadata.creation*1000).toLocaleTimeString();const groupDescription=groupMetadata.desc||"No description";let infoMessage="";switch(option){case'name':infoMessage=`📛 *𝗡𝗔𝗠𝗘*: ${groupName}`;break;case'link':infoMessage=`🔗 *𝗟𝗜𝗡𝗞*: ${groupLink}`;break;case'id':infoMessage=`🆔 *𝗜𝗗*: ${groupId}`;break;case'members':infoMessage=`👥 *𝗠𝗘𝗠𝗕𝗘𝗥𝗦 𝗖𝗢𝗨𝗡𝗧*: ${memberCount}`;break;case'admins':infoMessage=`🛡️ *𝗔𝗗𝗠𝗜𝗡 𝗖𝗢𝗨𝗡𝗧*: ${adminCount}`;break;case'creator':infoMessage=`👑 *𝗖𝗥𝗘𝗔𝗧𝗢𝗥*: ${creator}`;break;case'date':infoMessage=`📅 *𝗖𝗥𝗘𝗔𝗧𝗘𝗗 𝗗𝗔𝗧𝗘*: ${creationDate}`;break;case'time':infoMessage=`⏰ *𝗖𝗥𝗘𝗔𝗧𝗘𝗗 𝗧𝗜𝗠𝗘*: ${creationTime}`;break;case'description':infoMessage=`📝 *𝗗𝗘𝗦𝗖𝗥𝗜𝗣𝗧𝗜𝗢𝗡*: ${groupDescription}`;break;case'all':default:infoMessage=`📛 *𝗡𝗔𝗠𝗘*: ${groupName}\n🔗 *𝗟𝗜𝗡𝗞*: ${groupLink}\n🆔 *𝗜𝗗*: ${groupId}\n👥 *𝗠𝗘𝗠𝗕𝗘𝗥𝗦 𝗖𝗢𝗨𝗡𝗧*: ${memberCount}\n🛡️ *𝗔𝗗𝗠𝗜𝗡 𝗖𝗢𝗨𝗡𝗧*: ${adminCount}\n👑 *𝗖𝗥𝗘𝗔𝗧𝗢𝗥*: ${creator}\n📅 *𝗖𝗥𝗘𝗔𝗧𝗘𝗗 𝗗𝗔𝗧𝗘*: ${creationDate}\n⏰ *𝗖𝗥𝗘𝗔𝗧𝗘𝗗 𝗧𝗜𝗠𝗘*: ${creationTime}\n📝 *𝗗𝗘𝗦𝗖𝗥𝗜𝗣𝗧𝗜𝗢𝗡*: ${groupDescription}\n\n${sensitiveData.signature}`;}await conn.sendMessage(from,{caption:infoMessage,image:{url:groupDp},mentions:members.map(member=>member.id)})}else{await conn.sendMessage(from,{text:"This command can only be used in groups."})}}catch(e){console.error(`Error in group command: ${e.message}`)}}); 2 | -------------------------------------------------------------------------------- /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/ai.js: -------------------------------------------------------------------------------- 1 | const config = require('../config'); 2 | const { cmd, commands } = require('../command'); 3 | const { fetchJson } = require('../lib/functions'); 4 | const sensitiveData = require('../dila_md_licence/a/b/c/d/dddamsbs'); 5 | 6 | cmd({ 7 | pattern: "ai", 8 | desc: "AI chat", 9 | category: "main", 10 | react: "", 11 | filename: __filename 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 | // Define the new API URL with the new key 15 | const apiUrl = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent?key=AIzaSyByitRjKUtDonuVtpJm1R-RSdPdFPf-tcY`; 16 | 17 | // Prepare the body content for the API request 18 | const bodyContent = { 19 | contents: [{ parts: [{ text: q }] }] 20 | }; 21 | 22 | // Fetch the AI response 23 | let data = await fetchJson(apiUrl, { 24 | method: 'POST', 25 | headers: { 'Content-Type': 'application/json' }, 26 | body: JSON.stringify(bodyContent) 27 | }); 28 | 29 | // Log specific parts of the response for debugging (optional) 30 | console.log('API response status:', data.status); 31 | console.log('API response error:', data.error); // Only log if an error exists 32 | 33 | // Check if the response structure is as expected 34 | if (data && data.contents && data.contents[0] && data.contents[0].parts && data.contents[0].parts[0].text) { 35 | let response = data.contents[0].parts[0].text; 36 | 37 | // Compose the message to send 38 | let replyText = `\n${sensitiveData.aiChatHeader}\n\n *𝗤𝘂𝗲𝗿𝘆*: _${q}_\n\n *𝗥𝗲𝘀𝗽𝗼𝗻𝘀𝗲*: _${response}_\n\n${sensitiveData.siteUrl}\n${sensitiveData.footerText}`; 39 | 40 | // Send the message with the AI response 41 | let sentMessage = await conn.sendMessage(from, { image: { url: sensitiveData.imageUrl }, caption: replyText }, { quoted: mek }); 42 | 43 | // React to the sent message 44 | await conn.sendMessage(from, { react: { text: "✅", key: mek.key } }); 45 | await conn.sendMessage(from, { react: { text: "", key: sentMessage.key } }); 46 | } else { 47 | // Log the error for debugging 48 | console.error('Invalid response format:', data); 49 | reply(`Error: Invalid response format from AI API.`); 50 | } 51 | 52 | } catch (error) { 53 | console.log(error); 54 | 55 | // Check for specific error types from the API (if available) 56 | if (error.response && error.response.data && error.response.data.error) { 57 | reply(`Error: ${error.response.data.error.message || 'Unknown error occurred.'}`); 58 | } else { 59 | reply(`Error: ${error.message}`); 60 | } 61 | } 62 | }); 63 | -------------------------------------------------------------------------------- /plugins/alive.js: -------------------------------------------------------------------------------- 1 | const {readEnv}=require('../lib/database');const {cmd,commands}=require('../command');const os=require("os");const {runtime}=require('../lib/functions');const moment=require('moment-timezone');const sensitiveData=require('../dila_md_licence/a/b/c/d/dddamsbs');cmd({pattern:"alive",desc:"Check uptime, RAM usage, and more",category:"main",react:"👺",filename:__filename},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})=>{try{const config=await readEnv();const totalRAM=Math.round(os.totalmem()/1024/1024);const usedRAM=(process.memoryUsage().heapUsed/1024/1024).toFixed(2);const freeRAM=(totalRAM-parseFloat(usedRAM)).toFixed(2);const date=moment().tz("Asia/Colombo").format("YYYY-MM-DD");const time=moment().tz("Asia/Colombo").format("HH:mm:ss");const hour=moment().tz("Asia/Colombo").format("HH");const minute=moment().tz("Asia/Colombo").format("mm");const greeting=hour>=0&&hour<12?'𝗚𝗢𝗢𝗗 𝗠𝗢𝗥𝗡𝗜𝗡𝗚':hour>=12&&hour<18?'𝗚𝗢𝗢𝗗 𝗔𝗙𝗧𝗘𝗥𝗡𝗢𝗢𝗡':'𝗚𝗢𝗢𝗗 𝗡𝗜𝗚𝗛𝗧';const roundedMinute=Math.round(minute/30)*30;const roundedTime=`${hour}:${roundedMinute<10?'0'+roundedMinute:roundedMinute}`;const timeEmojiMap={'00:00':'🕛','00:30':'🕧','01:00':'🕐','01:30':'🕜','02:00':'🕑','02:30':'🕝','03:00':'🕒','03:30':'🕞','04:00':'🕓','04:30':'🕟','05:00':'🕔','05:30':'🕠','06:00':'🕕','06:30':'🕡','07:00':'🕖','07:30':'🕢','08:00':'🕗','08:30':'🕣','09:00':'🕘','09:30':'🕤','10:00':'🕙','10:30':'🕥','11:00':'🕚','11:30':'🕦','12:00':'🕛','12:30':'🕧','13:00':'🕐','13:30':'🕜','14:00':'🕑','14:30':'🕝','15:00':'🕒','15:30':'🕞','16:00':'🕓','16:30':'🕟','17:00':'🕔','17:30':'🕠','18:00':'🕕','18:30':'🕡','19:00':'🕖','19:30':'🕢','20:00':'🕗','20:30':'🕣','21:00':'🕘','21:30':'🕤','22:00':'🕙','22:30':'🕥','23:00':'🕚','23:30':'🕦'};const currentTimeEmoji=timeEmojiMap[`${hour}:${roundedMinute<10?'0'+roundedMinute:roundedMinute}`]||'🫂';const dateEmoji=date.split('-').map(part=>part.replace(/0/g,'0️⃣').replace(/1/g,'1️⃣').replace(/2/g,'2️⃣').replace(/3/g,'3️⃣').replace(/4/g,'4️⃣').replace(/5/g,'5️⃣').replace(/6/g,'6️⃣').replace(/7/g,'7️⃣').replace(/8/g,'8️⃣').replace(/9/g,'9️⃣')).join('-');const timeEmoji=time.split(':').map(part=>part.replace(/0/g,'0️⃣').replace(/1/g,'1️⃣').replace(/2/g,'2️⃣').replace(/3/g,'3️⃣').replace(/4/g,'4️⃣').replace(/5/g,'5️⃣').replace(/6/g,'6️⃣').replace(/7/g,'7️⃣').replace(/8/g,'8️⃣').replace(/9/g,'9️⃣')).join(':');const caption=`𝗛𝗲𝘆 ${pushname}\n${greeting} ${currentTimeEmoji}\n\n${config.ALIVE_MSG}\n\n𝗗𝗔𝗧𝗘: \n${dateEmoji}\n𝗧𝗜𝗠𝗘: \n${timeEmoji}\n\n${sensitiveData.plugginssd}`;let sentMessage=await conn.sendMessage(from,{image:{url:config.ALIVE_IMG},caption:caption},{quoted:mek||null});await conn.sendMessage(from,{react:{text:"👺",key:sentMessage.key}});let sentAudio=await conn.sendMessage(from,{audio:{url:sensitiveData.audiomp('')},mimetype:'audio/mpeg',ptt:true},{quoted:mek});await conn.sendMessage(from,{react:{text:"👺",key:sentAudio.key}});await conn.sendPresenceUpdate('recording',from);}catch(e){console.log(e);reply(`Error: ${e}`);}}); 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |

New Update is coming soon!!!

5 | KING DILA WHATSAPP BOT 6 |

7 | Typing SVG 8 |

9 |

10 | Creator Badge 11 | 12 | YouTube Channel 13 | 14 |

15 |

16 | 17 | Stars 18 | 19 | 20 | Size 21 | 22 | 23 | Forks 24 | 25 | 26 | Watching 27 | 28 | 29 | 30 | 31 | 32 |

33 | 34 | ### Please Read! 35 | Hi guys, deploy DilaMD bot and enjoy using it. 36 | 37 | [Contact the support group](https://t.me/dilalk) for any issues that arise during the bot creation process. 38 | 39 | ### `VERSION: V1` 40 | 41 | #### GitHub Repository 42 | [Follow Me on GitHub](https://github.com/themiyadilann/Dila-MD) 43 | 44 | ## How to create DILAMD. 45 | **1. You must have these things before deploying:** 46 | - _GitHub Account._ 47 | - _MongoDB URL (sign up and get MongoDB URL)._ 48 | - _Host._ 49 | 50 | **2. Deploy steps:** 51 | - _Fork the DILA MD repository._ 52 | - _Link with your WhatsApp using Scan QR code or Pair code._ 53 | - _Open `config.js` on your forked repository. Add `SESSION_ID` and `MONGODB_URL`_ 54 | - _Deploy using your host._ 55 | 56 | ## 1. FORK REPOSITORY 57 | Fork Repository 58 | 59 | ## 2.Click Deploy Button For Deploy & More Information ! 60 | Deploy 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /plugins/ytdownload.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'); const fg = require('api-dylux'); const yts = require('yt-search'); const sensitiveData = require('../dila_md_licence/a/b/c/d/dddamsbs'); const formatViews = views => views >= 1_000_000_000 ? `${(views / 1_000_000_000).toFixed(1)}B` : views >= 1_000_000 ? `${(views / 1_000_000).toFixed(1)}M` : views >= 1_000 ? `${(views / 1_000).toFixed(1)}K` : views.toString(); cmd({ pattern: "song", desc: "Download songs", category: "download", filename: __filename }, async (conn, mek, m, { from, q, reply }) => { try { if (!q) { await conn.sendPresenceUpdate('recording', from); await conn.sendMessage(from, { audio: { url: 'https://github.com/themiyadilann/DilaMD-Media/raw/main/voice/song.mp3' }, mimetype: 'audio/mpeg', ptt: true }, { quoted: mek }); return; } const search = await yts(q); const data = search.videos[0]; const url = data.url; let desc = `> ${sensitiveData.hhhhhhczss}\n\n🎶 *𝗧𝗶𝘁𝗹𝗲*: _${data.title}_\n👤 *𝗖𝗵𝗮𝗻𝗻𝗲𝗹*: _${data.author.name}_\n📝 *𝗗𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻*: _${data.description}_\n⏳ *𝗧𝗶𝗺𝗲*: _${data.timestamp}_\n⏱️ *𝗔𝗴𝗼*: _${data.ago}_\n👁️‍🗨️ *𝗩𝗶𝗲𝘄𝘀*: _${formatViews(data.views)}_\n🔗 *𝗟𝗶𝗻𝗸*: ${url}\n\n${sensitiveData.siteUrl}\n${sensitiveData.footerText}`; await conn.sendPresenceUpdate('typing', from); await conn.sendMessage(from, { image: { url: data.thumbnail }, caption: desc }, { quoted: mek }); let down = await fg.yta(url); let downloadUrl = down.dl_url; await conn.sendPresenceUpdate('recording', from); await conn.sendMessage(from, { audio: { url: downloadUrl }, mimetype: "audio/mpeg" }, { quoted: mek }); await conn.sendMessage(from, { document: { url: downloadUrl }, mimetype: "audio/mpeg", fileName: `${data.title}.mp3`, caption: "💻 *ᴍᴀᴅᴇ ʙʏ ᴍʳᴅɪʟᴀ*" }, { quoted: mek }); } catch (e) { console.log(e); reply(`Error: ${e.message}`); } }); cmd({ pattern: "video", desc: "Download videos", category: "download", filename: __filename }, async (conn, mek, m, { from, q, reply }) => { try { if (!q) { await conn.sendPresenceUpdate('recording', from); await conn.sendMessage(from, { audio: { url: 'https://github.com/themiyadilann/DilaMD-Media/raw/main/voice/video.mp3' }, mimetype: 'audio/mpeg', ptt: true }, { quoted: mek }); return; } const search = await yts(q); const data = search.videos[0]; const url = data.url; let desc = `${sensitiveData.ffdssajjj}\n\n🎶 *𝗧𝗶𝘁𝗹𝗲*: _${data.title}_\n👤 *𝗖𝗵𝗮𝗻𝗻𝗲𝗹*: _${data.author.name}_\n📝 *𝗗𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻*: _${data.description}_\n⏳ *𝗧𝗶𝗺𝗲*: _${data.timestamp}_\n⏱️ *𝗔𝗴𝗼*: _${data.ago}_\n👁️‍🗨️ *𝗩𝗶𝗲𝘄𝘀*: _${formatViews(data.views)}_\n🔗 *𝗟𝗶𝗻𝗸*: ${url}\n\n${sensitiveData.siteUrl}\n${sensitiveData.footerText}`; await conn.sendPresenceUpdate('typing', from); await conn.sendMessage(from, { image: { url: data.thumbnail }, caption: desc }, { quoted: mek }); let down = await fg.ytv(url); let downloadUrl = down.dl_url; await conn.sendMessage(from, { video: { url: downloadUrl }, mimetype: "video/mp4" }, { quoted: mek }); await conn.sendMessage(from, { document: { url: downloadUrl }, mimetype: "video/mp4", fileName: `${data.title}.mp4`, caption: "💻 *ᴍᴀᴅᴇ ʙʏ ᴍʳᴅɪʟᴀ*" }, { quoted: mek }); } catch (e) { console.log(e); reply(`Error: ${e.message}`); } }); 2 | -------------------------------------------------------------------------------- /plugins/goctime.js: -------------------------------------------------------------------------------- 1 | const schedule = require('node-schedule'); 2 | const moment = require('moment-timezone'); 3 | const { readEnv } = require('../lib/database'); 4 | const { cmd } = require('../command'); // Adjust the path if needed 5 | 6 | // Set timezone for calculations 7 | const TIMEZONE = 'Asia/Colombo'; 8 | 9 | // Function to adjust the time by subtracting 5 hours and 30 minutes 10 | function adjustTime(time) { 11 | const [hour, minute] = time.split(':').map(Number); 12 | return moment.tz({ hour, minute }, TIMEZONE).subtract(5, 'hours').subtract(30, 'minutes').format('HH:mm'); 13 | } 14 | 15 | // Function to schedule open and close times for a group 16 | function scheduleGroupTimes(conn, groupId, openTimes, closeTimes) { 17 | openTimes.forEach((openTime) => { 18 | const adjustedOpenTime = adjustTime(openTime); 19 | const [adjustedHour, adjustedMinute] = adjustedOpenTime.split(':').map(Number); 20 | const openCron = `0 ${adjustedMinute} ${adjustedHour} * * *`; 21 | const jobName = `${groupId}_openGroup_${openTime}`; 22 | 23 | // Check if the job already exists 24 | if (!schedule.scheduledJobs[jobName]) { 25 | // Schedule opening the group 26 | schedule.scheduleJob(jobName, openCron, async () => { 27 | await conn.groupSettingUpdate(groupId, 'not_announcement'); // Open the group 28 | await conn.sendMessage(groupId, { text: `*𝗚𝗿𝗼𝘂𝗽 𝗢𝗽𝗲𝗻𝗲𝗱 𝗮𝘁 ${openTime}. 🔓*\nᴍʀ ᴅɪʟᴀ ᴏꜟᴄ` }); 29 | }); 30 | } 31 | }); 32 | 33 | closeTimes.forEach((closeTime) => { 34 | const adjustedCloseTime = adjustTime(closeTime); 35 | const [adjustedHour, adjustedMinute] = adjustedCloseTime.split(':').map(Number); 36 | const closeCron = `0 ${adjustedMinute} ${adjustedHour} * * *`; 37 | const jobName = `${groupId}_closeGroup_${closeTime}`; 38 | 39 | // Check if the job already exists 40 | if (!schedule.scheduledJobs[jobName]) { 41 | // Schedule closing the group 42 | schedule.scheduleJob(jobName, closeCron, async () => { 43 | await conn.groupSettingUpdate(groupId, 'announcement'); // Close the group 44 | await conn.sendMessage(groupId, { text: `*𝗚𝗿𝗼𝘂𝗽 𝗖𝗹𝗼𝘀𝗲𝗱 𝗮𝘁 ${closeTime}. 🔒*\nᴍʿ ᴅɪʟᴀ ᴏꜟᴄ` }); 45 | }); 46 | } 47 | }); 48 | } 49 | 50 | // Function to parse and schedule group times 51 | async function setupGroupSchedules(conn) { 52 | const config = await readEnv(); 53 | const groupTimes = config.GROUPS_TIMES; 54 | 55 | // Check if GROUPS_TIMES is defined 56 | if (!groupTimes) { 57 | throw new Error('GROUPS_TIMES is not defined in the environment variables.'); 58 | } 59 | 60 | // Parse GROUPS_TIMES config 61 | const groups = groupTimes.split('/').map(entry => { 62 | const parts = entry.split(',').map(part => part.trim()); 63 | if (parts.length !== 3) { 64 | throw new Error(`Invalid entry in GROUPS_TIMES: ${entry}`); 65 | } 66 | return { 67 | groupId: parts[0], // Extract group ID 68 | openTimes: parts[1].split(',').map(time => time.trim()), // Extract open times 69 | closeTimes: parts[2].split(',').map(time => time.trim()) // Extract close times 70 | }; 71 | }); 72 | 73 | // Schedule open and close times for each group 74 | groups.forEach(({ groupId, openTimes, closeTimes }) => { 75 | scheduleGroupTimes(conn, groupId, openTimes, closeTimes); 76 | }); 77 | } 78 | 79 | // Command to execute the group schedule setup 80 | cmd({ on: 'body' }, async (conn, mek, m, { from, body, isOwner }) => { 81 | try { 82 | // Only allow the owner to trigger the scheduling setup 83 | if (!isOwner) return; 84 | 85 | // Set up schedules for groups 86 | await setupGroupSchedules(conn); 87 | 88 | // The confirmation message has been removed 89 | } catch (error) { 90 | console.error('Error setting up group schedules:', error); 91 | await conn.sendMessage(from, { text: `Error: ${error.message}` }); 92 | } 93 | }); 94 | -------------------------------------------------------------------------------- /plugins/group.js: -------------------------------------------------------------------------------- 1 | const { cmd } = require('../command'), { jsonformat } = require('../lib/functions'); cmd({ pattern: "close", react: "👺", desc: "close a group", category: "group", use: '.mute', filename: __filename }, async (conn, mek, m, { from, isGroup, isBotAdmins, isAdmins, reply }) => { try { if (!isGroup) return reply('This command can only be used in a group. 🚫'); if (!isBotAdmins) return reply('Bot must be an admin to use this command. 🤖'); if (!isAdmins) return reply('Only admins can use this command. 👮‍♂️'); await conn.groupSettingUpdate(mek.chat, 'announcement'); await conn.sendMessage(from, { text: 'Group closed now. 🔒\nᴍʀ ᴅɪʟᴀ ᴏꜰᴄ', react: { text: '✅', key: mek.key } }); } catch (e) { reply('Error closing the group. ⚠️'); console.log(e); } }); cmd({ pattern: "open", react: "👺", desc: "open a group", category: "group", use: '.unmute', filename: __filename }, async (conn, mek, m, { from, isGroup, isBotAdmins, isAdmins, reply }) => { try { if (!isGroup) return reply('This command can only be used in a group. 🚫'); if (!isBotAdmins) return reply('Bot must be an admin to use this command. 🤖'); if (!isAdmins) return reply('Only admins can use this command. 👮‍♂️'); await conn.groupSettingUpdate(mek.chat, 'not_announcement'); await conn.sendMessage(from, { text: 'Group opened now. 🔓\nᴍʀ ᴅɪʟᴀ ᴏꜰᴄ', react: { text: '✅', key: mek.key } }); } catch (e) { reply('Error opening the group. ⚠️'); console.log(e); } }); cmd({ pattern: "setadmin", react: "🤝", desc: "promote admin to a member", category: "group", use: '.promote', filename: __filename }, async (conn, mek, m, { from, isGroup, isBotAdmins, isAdmins, reply }) => { try { if (!isGroup) return reply('This command can only be used in a group. 🚫'); if (!isBotAdmins) return reply('Bot must be an admin to use this command. 🤖'); if (!isAdmins) return reply('Only admins can use this command. 👮‍♂️'); let users = mek.mentionedJid ? mek.mentionedJid : mek.quoted ? mek.quoted.sender : q.replace(/[^0-9]/g, '') + '@s.whatsapp.net'; await conn.groupParticipantsUpdate(mek.chat, [users], 'promote'); reply('Congratulations, you are now an admin! 🥳\nᴍʀ ᴅɪʟᴀ ᴏꜰᴄ'); await conn.sendMessage(from, { react: { text: '✅', key: mek.key } }); } catch (e) { reply('Error promoting to admin. ⚠️'); console.log(e); } }); cmd({ pattern: "deladmin", react: "🚫", desc: "demote admin to a member", category: "group", use: '.demote', filename: __filename }, async (conn, mek, m, { from, isGroup, isBotAdmins, isAdmins, reply }) => { try { if (!isGroup) return reply('This command can only be used in a group. 🚫'); if (!isBotAdmins) return reply('Bot must be an admin to use this command. 🤖'); if (!isAdmins) return reply('Only admins can use this command. 👮‍♂️'); let users = mek.mentionedJid ? mek.mentionedJid : mek.quoted ? mek.quoted.sender : q.replace(/[^0-9]/g, '') + '@s.whatsapp.net'; await conn.groupParticipantsUpdate(mek.chat, [users], 'demote'); reply('You have been demoted from admin. 😔\nᴍʀ ᴅɪʟᴀ ᴏꜰᴄ'); await conn.sendMessage(from, { react: { text: '✅', key: mek.key } }); } catch (e) { reply('Error demoting admin. ⚠️'); console.log(e); } }); cmd({ pattern: "delete", react: "❌", alias: [","], desc: "delete message", category: "group", use: '.del', filename: __filename }, async (conn, mek, m, { from, isOwner, isAdmins, reply }) => { if (!isOwner && !isAdmins) return; try { if (!m.quoted) return reply('No message to delete. 🗑️'); const key = { remoteJid: m.chat, fromMe: false, id: m.quoted.id, participant: m.quoted.sender }; await conn.sendMessage(m.chat, { delete: key }); reply('Message deleted. ✅\nᴍʀ ᴅɪʟᴀ ᴏꜰᴄ'); } catch (e) { console.log(e); reply('Error deleting message. ⚠️'); } }); cmd({ pattern: "add", desc: "Add a member to the group.", category: "group", react: "➕", filename: __filename }, async (conn, mek, m, { from, isGroup, isBotAdmins, isAdmins, reply }) => { try { if (!isGroup) return reply('This command can only be used in a group. 🚫'); if (!isBotAdmins) return reply('Bot must be an admin to use this command. 🤖'); if (!isAdmins) return reply('Only admins can use this command. 👮‍♂️'); const user = q.split(' ')[0]; if (!user) return reply('Please provide a phone number to add. 📞'); await conn.groupParticipantsUpdate(from, [`${user}@s.whatsapp.net`], 'add'); await reply(`@${user} has been added to the group. 🎉`, { mentions: [`${user}@s.whatsapp.net`] }); } catch (e) { console.log(e); reply('Error adding member. ⚠️'); } }); 2 | -------------------------------------------------------------------------------- /talkdrove.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "bot-name": "PAHANMD", 4 | "description": "BYTE-MD made for people on Earth", 5 | "logo": "https://raw.githubusercontent.com/HyHamza/HyHamza/refs/heads/main/Images/XByte-logo.png", 6 | "keywords": ["bot"], 7 | "documentation-link": "https://session.talkdrove.com", 8 | "owner-verification":"hansana9446@gmail.com", 9 | 10 | "env": { 11 | "SESSION_ID": { 12 | "description": "Put your SESSION_ID here. Make sure it starts with Byte;;;, or get session id from here, https://session.talkdrove.com", 13 | "value":"", 14 | "required": true 15 | 16 | }, 17 | "PREFIX": { 18 | "description": "Bot command prefix, (e.g, . , ! @ etc", 19 | "value":".", 20 | "required": true 21 | 22 | }, 23 | "AUTO_READ_STATUS": { 24 | "description": "Bot will all status, To Enable put true and to disable put false (e.g, true)", 25 | "value":"true", 26 | "required": false 27 | 28 | }, 29 | "MODE": { 30 | "description": "Bot mode can be public, private, inbox or groups in small letters (e.g, public)", 31 | "value":"public", 32 | "required": true 33 | 34 | }, 35 | "OWNER_NUMBER": { 36 | "description": "OWNER_NUMBER with country code (e.g, 9230723xxxxx)", 37 | "value":"923072380xxxx", 38 | "required": true 39 | 40 | }, 41 | "READ_CMD": { 42 | "description": "Bot will read of msgs if it is enabled, To Enable put true and to disable put false (e.g, true)", 43 | "value":"false", 44 | "required": false 45 | 46 | }, 47 | 48 | "AUTO_REPLY": { 49 | "description": "Bot will reply to the msgs like gm, gn, love you, hate you, hi, etc... To Enable put true and to disable put false (e.g, true)", 50 | "value":"false", 51 | "required": false 52 | 53 | }, 54 | "AUTO_REACT": { 55 | "description": "Bot will react to the msgs, To Enable put true and to disable put false (e.g, true)", 56 | "value":"false", 57 | "required": false 58 | 59 | }, 60 | "WELCOME": { 61 | "description": "Bot will welcome the new members in GC (Group chat), To Enable put true and to disable put false (e.g, true", 62 | "value":"false", 63 | "required": false 64 | 65 | }, 66 | "ANTI_BAD": { 67 | "description": "Bot delete the message from group if any bad word detected, To Enable put true and to disable put false (e.g, true)", 68 | "value":"false", 69 | "required": false 70 | 71 | }, 72 | "ANTI_BOT": { 73 | "description": "Bot delete or kick bots from group, To Enable put true and to disable put false (e.g, true)", 74 | "value":"false", 75 | "required": false 76 | 77 | }, 78 | "ANTI_LINK": { 79 | "description": "Bot delete or kick links sender from group, To Enable put true and to disable put false (e.g, true)", 80 | "value":"false", 81 | "required": false 82 | 83 | }, 84 | "ALWAYS_ONLINE": { 85 | "description": "Keep your WhatsApp always online put true to activate (e.g, true)", 86 | "value":"false", 87 | "required": false 88 | 89 | }, 90 | "PRESENCE": { 91 | "description": "Set presence of your WhatsApp, you can put online to keep your WhatsApp online for always, put offline to keep the WhatsApp normal, put typing to show that you are typing whenever anybody will message you! put recordig to show that you are recording whenever anybody will message you, or you can also show paused for nothing (e.g, online)", 92 | "value":"offline", 93 | "required": false 94 | 95 | }, 96 | "COUNTRY_BLOCK": { 97 | "description": "Block by country code true to Enable, false to disable (e.g, true)", 98 | "value":"true", 99 | "required": false 100 | 101 | }, 102 | "COUNTRY_BLOCK_CODE": { 103 | "description": "Block by country code put country code without + (e.g, 972)", 104 | "value":"972", 105 | "required": false 106 | 107 | }, 108 | "PREMIUM_USERS": { 109 | "description": "There are some commands which can only be used by the premium users, put premium users number without +, multiple numbers can be seperated by comma (,) (e.g, 923072380xxx, or 923072380xx,9234538003xx)", 110 | "value":"972", 111 | "required": false 112 | 113 | } 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /plugins/antilinkbad.js: -------------------------------------------------------------------------------- 1 | const fs=require('fs');const path=require('path');const{readEnv}=require('../lib/database');const{cmd,commands}=require('../command');const{fetchJson}=require('../lib/functions');let userWarnings={};cmd({on:"body"},async(conn,mek,m,{from,body,isCmd,isGroup,isOwner,isAdmins,groupAdmins,isBotAdmins,sender,pushname,groupName,quoted})=>{try{const config=await readEnv();const botOwner=config.OWNER_NUMBER;const maxWarnings=config.WARN_COUNT||10;if(!userWarnings[sender]){userWarnings[sender]=0;}const sendAlertToOwner=async(triggerType,groupName,sender,message,action)=>{const alertMessage=`🚨 ${triggerType} triggered in ${groupName}\nSender: @${sender.split('@')[0]}\nMessage: ${message}\nAction: ${action}`;await conn.sendMessage(botOwner,{text:alertMessage,mentions:[sender]});};const handleWarnings=async(type,maxWarnings)=>{userWarnings[sender]+=1;let action='warn';if(userWarnings[sender]>=maxWarnings){await conn.sendMessage(from,{text:`𝗕𝗬𝗘 ~*@${sender.split('@')[0]}*~`,mentions:[sender]});await conn.groupParticipantsUpdate(from,[sender],'remove');action='kick';userWarnings[sender]=0;const kickMessage=`𝗛𝗲𝘆 @${sender.split('@')[0]},\n𝗬𝗼𝘂𝗿 𝗞𝗜𝗖𝗞𝗘𝗗 𝗳𝗿𝗼𝗺 *${groupName}* 𝗴𝗿𝗼𝘂𝗽.\n𝗥𝗲𝗮𝘀𝗼𝗻: ${body}`;await conn.sendMessage(sender,{text:kickMessage,mentions:[sender]});}else{const remainingWarnings=maxWarnings-userWarnings[sender];const warnCountMessage=`👺 ~*@${sender.split('@')[0]}*~\n*⚠️ ${type.toUpperCase()} DELETED: ‼️*\n🚫 *𝗪𝗔𝗥𝗡 𝗖𝗢𝗨𝗡𝗧 : ${remainingWarnings}/${maxWarnings}*`;await conn.sendMessage(from,{text:warnCountMessage,mentions:[sender]});}await sendAlertToOwner(type.toUpperCase(),groupName,sender,body,action);};if(config.ANTI_BAD==='delete'||config.ANTI_BAD==='warn'||config.ANTI_BAD==='kick'){const badWordsBlacklist=["fuc","huk","hut","ponn","pinn","paca","හුක","හුත්","අම්ම","අබිසාරි","Wutt","Wuka","වේසි","wesi","vesi","පුක","puk","කිම්බ","ammata","කැරි","pak","අවජාත","awaja","avaja","ammata","ponyo","පක","pky","පොන්න","පග","kari","Htto","Hkpn","Utto","න්නයා","වජාතයා","වේස","නගින්නෑ"];const containsBadWord=badWordsBlacklist.some(word=>body.toLowerCase().includes(word));if(containsBadWord){if(isGroup){if(isBotAdmins){const senderIsAdmin=groupAdmins.includes(sender);if(!senderIsAdmin&&!isOwner){const key={remoteJid:from,fromMe:false,id:mek.key.id,participant:sender};await conn.sendMessage(from,{delete:key});if(config.ANTI_BAD==='warn'){await handleWarnings("BAD WORD",maxWarnings);}else if(config.ANTI_BAD==='kick'){await conn.sendMessage(from,{text:`👺 ~*@${sender.split('@')[0]}*~\n*⚠️ BAD WORD DELETED: ‼️*\n🚫 *𝗞𝗜𝗖𝗞 𝗦𝗘𝗡𝗗𝗘𝗥*`,mentions:[sender]});await conn.groupParticipantsUpdate(from,[sender],'remove');await sendAlertToOwner("Bad word",groupName,sender,body,"kick");const kickMessage=`𝗛𝗲𝘆 @${sender.split('@')[0]},\n𝗬𝗼𝘂𝗿 𝗞𝗜𝗖𝗞𝗘𝗗 𝗳𝗿𝗼𝗺 *${groupName}* 𝗴𝗿𝗼𝘂𝗽.\n𝗥𝗲𝗮𝘀𝗼𝗻: ${body}`;await conn.sendMessage(sender,{text:kickMessage,mentions:[sender]});}else{await conn.sendMessage(from,{text:`👺 ~*@${sender.split('@')[0]}*~\n*⚠️ BAD WORD DELETED: ‼️*`,mentions:[sender]});await sendAlertToOwner("Bad word",groupName,sender,body,"delete");}}}else{const adminsMention=groupAdmins.map(admin=>`@${admin.split('@')[0]}`).join(' ');const botNotAdminMessage=`⚠️ DilaMD bot does not have admin privileges, but bad words were detected.`;await conn.sendMessage(from,{text:botNotAdminMessage,mentions:groupAdmins});}}}}if(config.ANTI_LINK==='delete'||config.ANTI_LINK==='warn'||config.ANTI_LINK==='kick'){const linksBlacklist=["wa.me","chat.whatsapp.com","whatsapp.com","www.tiktok.com/@","youtube.com/@","whatspp.gruop"];const containsBlacklistedLink=linksBlacklist.some(word=>body.toLowerCase().includes(word));if(containsBlacklistedLink){if(isGroup){if(isBotAdmins){const senderIsAdmin=groupAdmins.includes(sender);if(!senderIsAdmin&&!isOwner){const key={remoteJid:from,fromMe:false,id:mek.key.id,participant:sender};await conn.sendMessage(from,{delete:key});if(config.ANTI_LINK==='warn'){await handleWarnings("LINK",maxWarnings);}else if(config.ANTI_LINK==='kick'){await conn.sendMessage(from,{document:{url:'https://drive.google.com/uc?export=download&id=1YYPnkKWdrxFe8C2kWdwf8qkeE0PO5RjW'},mimetype:'audio/mp3',fileName:'song.mp3',caption:`👺 ~*@${sender.split('@')[0]}*~\n*⚠️ BAD LINK DELETED: ‼️*`,mentions:[sender]});await conn.groupParticipantsUpdate(from,[sender],'remove');await sendAlertToOwner("Antilink",groupName,sender,body,"kick");const kickMessage=`𝗛𝗲𝘆 @${sender.split('@')[0]},\n𝗬𝗼𝘂𝗿 𝗞𝗜𝗖𝗞𝗘𝗗 𝗳𝗿𝗼𝗺 *${groupName}* 𝗴𝗿𝗼𝘂𝗽.\n𝗥𝗲𝗮𝘀𝗼𝗻: ${body}`;await conn.sendMessage(sender,{text:kickMessage,mentions:[sender]});}else{await conn.sendMessage(from,{document:{url:'https://drive.google.com/uc?export=download&id=1YYPnkKWdrxFe8C2kWdwf8qkeE0PO5RjW'},mimetype:'audio/mp3',fileName:'song.mp3',caption:`👺 ~*@${sender.split('@')[0]}*~\n*⚠️ BAD LINK DELETED: ‼️*`,mentions:[sender]});await sendAlertToOwner("Antilink",groupName,sender,body,"delete");}}}else{const adminsMention=groupAdmins.map(admin=>`@${admin.split('@')[0]}`).join(' ');const botNotAdminMessage=`⚠️ DilaMD bot does not have admin privileges, but a link was detected.`;await conn.sendMessage(from,{text:botNotAdminMessage,mentions:groupAdmins});}}}}}catch(e){console.error(`Error in auto-delete functionality: ${e.message}`);const botOwner=config.OWNER_NUMBER;await conn.sendMessage(botOwner,{text:`⚠️ Error occurred in auto-delete functionality: ${e.message}`});}}); 2 | -------------------------------------------------------------------------------- /plugins/anti.js: -------------------------------------------------------------------------------- 1 | const fs=require('fs');const path=require('path');const{readEnv}=require('../lib/database');const{cmd,commands}=require('../command');const{fetchJson}=require('../lib/functions');cmd({on:"sticker"},async(conn,mek,m,{from,isGroup,isOwner,isAdmins,groupAdmins,isBotAdmins,sender})=>{try{const config=await readEnv();const botOwner=config.OWNER_NUMBER;if(config.ANTI_STICKER==='true'){if(isGroup){if(isBotAdmins){const senderIsAdmin=groupAdmins.includes(sender);if(!senderIsAdmin&&!isOwner){const key={remoteJid:from,fromMe:false,id:mek.key.id,participant:sender};await conn.sendMessage(from,{delete:key});const warningMessage=`🖼️ ~*@${sender.split('@')[0]}*~\n*⚠️ 𝗦𝗧𝗜𝗖𝗞𝗘𝗥 𝗗𝗘𝗟𝗘𝗧𝗘𝗗: ‼️*`;await conn.sendMessage(from,{text:warningMessage,mentions:[sender]});const ownerMessage=`🚨 Anti-sticker triggered in *${groupName}*.\nSender: @${sender.split('@')[0]}\nSticker message has been deleted.`;await conn.sendMessage(botOwner,{text:ownerMessage,mentions:[sender]});}}else{const adminsMention=groupAdmins.map(admin=>`@${admin.split('@')[0]}`).join(' ');const botNotAdminMessage=`⚠️ DilaMD bot does not have admin privileges, but a sticker with prohibited content was detected. Please take action, admins:\n${adminsMention}`;await conn.sendMessage(from,{text:botNotAdminMessage,mentions:groupAdmins});}}}}catch(e){console.error(`Error in auto-delete sticker functionality: ${e.message}`);const botOwner=config.OWNER_NUMBER;await conn.sendMessage(botOwner,{text:`⚠️ Error occurred in auto-delete sticker functionality: ${e.message}`});}});cmd({on:"audio"},async(conn,mek,m,{from,isGroup,isOwner,isAdmins,groupAdmins,isBotAdmins,sender})=>{try{const config=await readEnv();const botOwner=config.OWNER_NUMBER;if(config.ANTI_VOICE==='true'){if(isGroup){if(isBotAdmins){const senderIsAdmin=groupAdmins.includes(sender);if(!senderIsAdmin&&!isOwner){const key={remoteJid:from,fromMe:false,id:mek.key.id,participant:sender};await conn.sendMessage(from,{delete:key});const warningMessage=`🎙️ ~*@${sender.split('@')[0]}*~\n*⚠️ 𝗔𝗨𝗗𝗜𝗢 𝗠𝗘𝗦𝗦𝗔𝗚𝗘 𝗗𝗘𝗟𝗘𝗧𝗘𝗗: ‼️*`;await conn.sendMessage(from,{text:warningMessage,mentions:[sender]});const ownerMessage=`🚨 Anti-audio triggered in *${groupName}*.\nSender: @${sender.split('@')[0]}\nAudio message has been deleted.`;await conn.sendMessage(botOwner,{text:ownerMessage,mentions:[sender]});}}else{const adminsMention=groupAdmins.map(admin=>`@${admin.split('@')[0]}`).join(' ');const botNotAdminMessage=`⚠️ DilaMD bot does not have admin privileges, but an audio message was detected. Please take action, admins:\n${adminsMention}`;await conn.sendMessage(from,{text:botNotAdminMessage,mentions:groupAdmins});}}}}catch(e){console.error(`Error in auto-delete audio functionality: ${e.message}`);const botOwner=config.OWNER_NUMBER;await conn.sendMessage(botOwner,{text:`⚠️ Error occurred in auto-delete audio functionality: ${e.message}`});}});cmd({on:"image"},async(conn,mek,m,{from,isGroup,isOwner,isAdmins,groupAdmins,isBotAdmins,sender})=>{try{const config=await readEnv();const botOwner=config.OWNER_NUMBER;if(config.ANTI_PHOTO==='true'){if(isGroup){if(isBotAdmins){const senderIsAdmin=groupAdmins.includes(sender);if(!senderIsAdmin&&!isOwner){const key={remoteJid:from,fromMe:false,id:mek.key.id,participant:sender};await conn.sendMessage(from,{delete:key});const warningMessage=`🖼️ ~*@${sender.split('@')[0]}*~\n*⚠️ 𝗣𝗛𝗢𝗧𝗢 𝗠𝗘𝗦𝗦𝗔𝗚𝗘 𝗗𝗘𝗟𝗘𝗧𝗘𝗗: ‼️*`;await conn.sendMessage(from,{text:warningMessage,mentions:[sender]});const ownerMessage=`🚨 Anti-photo triggered in *${groupName}*.\nSender: @${sender.split('@')[0]}\nPhoto message has been deleted.`;await conn.sendMessage(botOwner,{text:ownerMessage,mentions:[sender]});}}else{const adminsMention=groupAdmins.map(admin=>`@${admin.split('@')[0]}`).join(' ');const botNotAdminMessage=`⚠️ DilaMD bot does not have admin privileges, but a photo message was detected. Please take action, admins:\n${adminsMention}`;await conn.sendMessage(from,{text:botNotAdminMessage,mentions:groupAdmins});}}}}catch(e){console.error(`Error in auto-delete photo functionality: ${e.message}`);const botOwner=config.OWNER_NUMBER;await conn.sendMessage(botOwner,{text:`⚠️ Error occurred in auto-delete photo functionality: ${e.message}`});}});cmd({on:"video"},async(conn,mek,m,{from,isGroup,isOwner,isAdmins,groupAdmins,isBotAdmins,sender})=>{try{const config=await readEnv();const botOwner=config.OWNER_NUMBER;if(config.ANTI_VIDEO==='true'){if(isGroup){if(isBotAdmins){const senderIsAdmin=groupAdmins.includes(sender);if(!senderIsAdmin&&!isOwner){const key={remoteJid:from,fromMe:false,id:mek.key.id,participant:sender};await conn.sendMessage(from,{delete:key});const warningMessage=`📹 ~*@${sender.split('@')[0]}*~\n*⚠️ 𝗩𝗜𝗗𝗘𝗢 𝗠𝗘𝗦𝗦𝗔𝗚𝗘 𝗗𝗘𝗟𝗘𝗧𝗘𝗗: ‼️*`;await conn.sendMessage(from,{text:warningMessage,mentions:[sender]});const ownerMessage=`🚨 Anti-video triggered in *${groupName}*.\nSender: @${sender.split('@')[0]}\nVideo message has been deleted.`;await conn.sendMessage(botOwner,{text:ownerMessage,mentions:[sender]});}}else{const adminsMention=groupAdmins.map(admin=>`@${admin.split('@')[0]}`).join(' ');const botNotAdminMessage=`⚠️ DilaMD bot does not have admin privileges, but a video message was detected. Please take action, admins:\n${adminsMention}`;await conn.sendMessage(from,{text:botNotAdminMessage,mentions:groupAdmins});}}}}catch(e){console.error(`Error in auto-delete video functionality: ${e.message}`);const botOwner=config.OWNER_NUMBER;await conn.sendMessage(botOwner,{text:`⚠️ Error occurred in auto-delete video functionality: ${e.message}`});}}); 2 | -------------------------------------------------------------------------------- /plugins/states.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { readEnv } = require('../lib/database'); 4 | const { cmd, commands } = require('../command'); 5 | const { fetchJson } = require('../lib/functions'); // Assuming you have this function 6 | const { downloadMediaMessage } = require('@adiwajshing/baileys'); // Ensure you have this package 7 | 8 | // Function to determine the content type of a message 9 | function getContentType(message) { 10 | if (!message) return null; 11 | if (message.conversation) return 'text'; 12 | if (message.imageMessage) return 'image'; 13 | if (message.videoMessage) return 'video'; 14 | if (message.audioMessage) return 'audio'; 15 | if (message.documentMessage) return 'document'; 16 | // Add other message types as needed 17 | return null; 18 | } 19 | 20 | // Flag to track whether the status listener is initialized 21 | let isStatusListenerInitialized = false; 22 | 23 | // Function to select a random phrase for replies 24 | function getRandomResponse() { 25 | const responses = [ 26 | "Great one!🔥", "Amazing!😍", "You nailed it!💯", "This is awesome!👏", "Keep it up!👍", 27 | "Well said!🙌", "That’s lit!⚡", "So true!👌", "Loving this!💖", "This made me smile!😊", 28 | "Deep stuff!🤔", "You’re on fire!🔥", "Totally agree!✅", "Such a vibe!🎶", "Killing it!🎯", 29 | "Legendary!🏆", "Well done!👏", "Inspiring!✨", "That’s the spirit!💪", "Brilliant!💡", 30 | "Good times!⏳", "You’re glowing!🌟", "Too good!😎", "So cool!🆒", "You got this!💪", 31 | "Making moves!🚀", "Stay blessed!🙏", "Keep shining!🌟", "Awesome!🌈", "Well played!🏅", 32 | "Good vibes only!✌️", "This is gold!🥇", "Too smooth!😏", "Pure genius!🤯", "Incredible!😲", 33 | "Perfection!👌", "Well deserved!🎉", "You rock!🤘", "You got style!🕶️", "Epic!🔥", 34 | "Top-notch!🎩", "Pure class!🕴", "Well done, mate!👍", "Great stuff!🎯", "You’re amazing!🌟", 35 | "This is wild!🔥", "I love this!❤️", "So chill!😎", "This slaps!🎶", "Vibes on point!💯", 36 | "Can't stop watching!👀", "That’s genius!💡", "You inspire me!✨", "So funny!😂", "Hilarious!🤣", 37 | "Too real!🤯", "This is next level!🚀", "Mind blown!💥", "Such a masterpiece!🎨", "Respect!🙌", 38 | "Big energy!💥", "Iconic!🎥", "So uplifting!💫", "This is legendary!🏆", "You always deliver!📦", 39 | "Never disappoint!😎", "On point!🔝", "Solid work!💪", "Too cool for words!❄️", "Crushing it!🏋️", 40 | "You did that!👏", "Flawless!👌", "Can't stop laughing!🤣", "Straight facts!✅", "You’re a star!🌟", 41 | "So relaxing!🌊", "Incredible work!✨", "Great choice!🎯", "Keep grinding!💪", "This wins the internet!🏆", 42 | "Best thing I’ve seen!👀", "This just made my day!😊", "Can’t get enough of this!😍", "So peaceful!🌿", 43 | "Really speaks to me!💬", "That's fire!🔥", "Such a blessing!🙏", "Love this vibe!🌈", "Always on top!🔝" 44 | // Add more phrases here as needed 45 | ]; 46 | return responses[Math.floor(Math.random() * responses.length)]; 47 | } 48 | 49 | // Ensure the connection is passed properly 50 | async function initializeStatusListener(conn) { 51 | if (isStatusListenerInitialized) return; // Prevent reinitialization 52 | 53 | // Load configuration 54 | const config = await readEnv(); 55 | 56 | // Listen for new messages, including status updates 57 | conn.ev.on('messages.upsert', async (mek) => { 58 | mek = mek.messages[0]; // Get the first message from the array 59 | if (!mek.message) return; // Check if the message exists 60 | 61 | // Handle ephemeral messages 62 | mek.message = (getContentType(mek.message) === 'ephemeralMessage') 63 | ? mek.message.ephemeralMessage.message 64 | : mek.message; 65 | 66 | // Check if the message is from status updates 67 | if (mek.key && mek.key.remoteJid === 'status@broadcast') { 68 | const sender = mek.key.participant; // Get the participant who posted the status 69 | const senderPushName = mek.pushName || sender; // Get the push name or use the sender number if not available 70 | const contentType = getContentType(mek.message); 71 | const caption = mek.message.conversation || mek.message.caption || 'No caption provided.'; 72 | 73 | // Log the output with sender's push name, content type, and caption 74 | console.log(`New status posted by 💥: ${senderPushName} Media Type: ${contentType || 'No media'} Caption: ${caption}`); 75 | 76 | // Check the config to decide whether to send the status seen message 77 | if (config.STATES_SEEN_MESSAGE_SEND_SEND === 'true') { 78 | const message = getRandomResponse(); // Get a random response 79 | 80 | // Send the message as a reply to the relevant status 81 | await conn.sendMessage(sender, { text: message }, { quoted: mek }); 82 | } 83 | } 84 | }); 85 | 86 | isStatusListenerInitialized = true; // Mark the listener as initialized 87 | } 88 | 89 | // Command handler (if needed) 90 | cmd({ on: "body" }, async (conn, mek, m, { from, body, isOwner }) => { 91 | // Initialize the status listener if it's not already done 92 | await initializeStatusListener(conn); 93 | 94 | // Additional command handling code can go here 95 | // You can implement your other functionalities as required 96 | }); 97 | -------------------------------------------------------------------------------- /media/autovoice.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | 4 | 5 | "hi":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 6 | "hii":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 7 | "hiii":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 8 | "hiiii":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 9 | "hy":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 10 | "hyy":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 11 | "hyyy":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 12 | "hyyyy":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 13 | "hai":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 14 | "haii":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 15 | "haai":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 16 | "hey":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 17 | "helo":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 18 | "halo":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 19 | "hello":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 20 | "hallo":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 21 | "හායි":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 22 | "හායී":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 23 | "හයි":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 24 | "හයී":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 25 | "හාය්":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 26 | "හෙලො":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 27 | "හෙලෝ":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 28 | "හලො":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 29 | "හලෝ":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 30 | "හි":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 31 | "හී":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 32 | "හේ":"https://drive.google.com/uc?export=download&id=1etCJjjplVZ5WBSOaKXSKjDShMHbJ_IUq", 33 | "by":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 34 | "byy":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 35 | "byyy":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 36 | "bye":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 37 | "bya":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 38 | "bai":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 39 | "bi":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 40 | "බායි":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 41 | "බායී":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 42 | "බයි":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 43 | "බයී":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 44 | "බය්":"https://drive.google.com/uc?export=download&id=1fAUZS3xhVXK-qur98FtgeBWWhK_ksZFT", 45 | "gm bn":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 46 | "ගුඩ් මෝනින්":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 47 | "ගුට් මෝනින්":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 48 | "morning":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 49 | "මෝනින්":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 50 | "ගුඩ් මෝනිම්":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 51 | "ගුට් මෝනිම්":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 52 | "good morning":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 53 | "goodmorning":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 54 | "gm":"https://drive.google.com/uc?export=download&id=1eZnPn-xuDxkr8klCXzypWoZaG2j7eoxf", 55 | "නයිට්":"https://drive.google.com/uc?export=download&id=1eWcw5eH1ijA3Fls6NOXBJIHfeE6ciOmR", 56 | "night":"https://drive.google.com/uc?export=download&id=1eWcw5eH1ijA3Fls6NOXBJIHfeE6ciOmR", 57 | "ගුඩ් නයිට්":"https://drive.google.com/uc?export=download&id=1eWcw5eH1ijA3Fls6NOXBJIHfeE6ciOmR", 58 | "ගුට් නයිට්":"https://drive.google.com/uc?export=download&id=1eWcw5eH1ijA3Fls6NOXBJIHfeE6ciOmR", 59 | "good night":"https://drive.google.com/uc?export=download&id=1eWcw5eH1ijA3Fls6NOXBJIHfeE6ciOmR", 60 | "goodnight":"https://drive.google.com/uc?export=download&id=1eWcw5eH1ijA3Fls6NOXBJIHfeE6ciOmR", 61 | "gn":"https://drive.google.com/uc?export=download&id=1eWcw5eH1ijA3Fls6NOXBJIHfeE6ciOmR", 62 | "mk":"https://drive.google.com/uc?export=download&id=1eUZyw1B8Nr9cY_g6cIRvhjc-WN-fnHC1", 63 | "මොකෝ කරන්නෙ":"https://drive.google.com/uc?export=download&id=1eUZyw1B8Nr9cY_g6cIRvhjc-WN-fnHC1", 64 | "මොකද කරන්නෙ":"https://drive.google.com/uc?export=download&id=1eUZyw1B8Nr9cY_g6cIRvhjc-WN-fnHC1", 65 | "mk oya":"https://drive.google.com/uc?export=download&id=1eUZyw1B8Nr9cY_g6cIRvhjc-WN-fnHC1", 66 | "mokada karanne":"https://drive.google.com/uc?export=download&id=1eUZyw1B8Nr9cY_g6cIRvhjc-WN-fnHC1", 67 | "dilan":"https://drive.google.com/uc?export=download&id=1YYPnkKWdrxFe8C2kWdwf8qkeE0PO5RjW" 68 | } 69 | -------------------------------------------------------------------------------- /plugins/gwb.js: -------------------------------------------------------------------------------- 1 | // Import required modules 2 | const fs = require('fs'); 3 | const path = require('path'); 4 | const { readEnv } = require('../lib/database'); // Reads environment configuration 5 | const { cmd, commands } = require('../command'); // Handles command functionality 6 | const { fetchJson } = require('../lib/functions'); // Fetches JSON data from a URL 7 | const sensitiveData = require('../dila_md_licence/a/b/c/d/dddamsbs'); // Ensure this path is correct 8 | 9 | let listenerRegistered = false; // Flag to ensure the listener is registered only once 10 | 11 | // Function to send a welcome message to new members with "read more" functionality 12 | const sendWelcomeMessage = async (conn, from, memberIds) => { 13 | try { 14 | const groupMetadata = await conn.groupMetadata(from); // Get group metadata 15 | const groupName = groupMetadata.subject; // Get the group name 16 | const groupDesc = groupMetadata.desc || "No description available."; // Get group description or default text 17 | const config = await readEnv(); 18 | 19 | // Ensure WELCOME_SET is defined 20 | if (!config.WELCOME_SET) { 21 | throw new Error("WELCOME_SET is not defined in the environment variables."); 22 | } 23 | 24 | // Create a 'read more' effect using a large number of zero-width spaces 25 | let readmore = "\u200B".repeat(4000); // Invisible characters to trigger "Read more" 26 | 27 | // Prepare the text that will be shown after clicking "Read more" 28 | let readmoreText = `\n${config.WELCOME_SET}\n\n*Name :*\n${groupName}\n\n*Description :*\n${groupDesc}\n\nᴍᴀᴅᴇ ʙʏ ᴍʀ ᴅɪʟᴀ ᴏꜟᴄ`; 29 | 30 | // Format the welcome message to include mentions for each new member 31 | const welcomeMentions = memberIds.map(id => `@${id.split('@')[0]}`).join('\n'); // Prepare mentions 32 | 33 | // Full message with "Read more" effect 34 | let replyText = `*Hey 🫂♥️*\n${welcomeMentions}\n*Welcome to Group ⤵️*\n${readmore}${readmoreText}`; 35 | 36 | // Send the thumbnail image first 37 | await conn.sendMessage(from, { 38 | image: { url: 'https://i.imgur.com/w5CeRcI.jpeg' }, // Thumbnail image URL 39 | caption: replyText, 40 | mentions: memberIds // Mentions for new members 41 | }); 42 | 43 | // Send group rules alert to new members if WELCOME_ALERT is enabled 44 | await sendGroupRulesAlert(conn, memberIds, groupName, groupDesc); 45 | } catch (error) { 46 | console.error("Error sending welcome message:", error); // Log the error for debugging 47 | } 48 | }; 49 | 50 | // Function to send group rules alert to new members in a private message 51 | const sendGroupRulesAlert = async (conn, memberIds, groupName, groupDesc) => { 52 | try { 53 | const config = await readEnv(); 54 | 55 | // Ensure WELCOME_ALERT is defined 56 | if (config.WELCOME_ALERT === undefined) { 57 | throw new Error("WELCOME_ALERT is not defined in the environment variables."); 58 | } 59 | 60 | // Only send the alert if WELCOME_ALERT is true 61 | if (config.WELCOME_ALERT === 'true') { 62 | // Prepare the alert message for new members 63 | const alertMessage = `*Hey Dear 🫂❤️*\n\n*Welcome to ${groupName}*\n\n${groupDesc}\n\n*Be sure to read the group description*\n\nᴍᴀᴅᴇ ʙʏ ᴍʀ ᴅɪʟᴀ ᴏꜟᴄ`; 64 | 65 | // Send the alert to each new member in private 66 | for (const memberId of memberIds) { 67 | try { 68 | // Check if memberId is valid 69 | if (!memberId) continue; // Skip if the memberId is invalid 70 | 71 | await conn.sendMessage(memberId, { 72 | image: { url: 'https://i.imgur.com/w5CeRcI.jpeg' }, // Thumbnail image URL 73 | caption: alertMessage, 74 | }); 75 | } catch (error) { 76 | console.error(`Error sending message to ${memberId}:`, error); // Log error for each individual member 77 | } 78 | } 79 | } 80 | } catch (error) { 81 | console.error("Error sending group rules alert:", error); // Log the error for debugging 82 | } 83 | }; 84 | 85 | // Event listener for new group participants 86 | const registerGroupWelcomeListener = (conn) => { 87 | if (!listenerRegistered) { // Check if the listener is already registered 88 | conn.ev.on('group-participants.update', async (update) => { 89 | const { id, participants, action } = update; // id = group id, participants = new members, action = add/remove 90 | if (action === 'add' && participants.length > 0) { // Check if the action is a new member joining 91 | console.log("New participants:", participants); // Log new participants 92 | await sendWelcomeMessage(conn, id, participants); // Send welcome message to all new members 93 | } 94 | }); 95 | listenerRegistered = true; // Set the flag to true after registering the listener 96 | } 97 | }; 98 | 99 | // Main command handler 100 | cmd({ on: "body" }, async (conn, mek, m, { from, body, isOwner }) => { 101 | try { 102 | // Read the environment configuration without saving anything 103 | const config = await readEnv(); 104 | 105 | // Ensure WELCOME is defined 106 | if (config.WELCOME === undefined) { 107 | throw new Error("WELCOME is not defined in the environment variables."); 108 | } 109 | 110 | // Check if the WELCOME feature is enabled 111 | if (config.WELCOME === 'true') { 112 | // If the user is the owner, do nothing 113 | if (isOwner) return; 114 | 115 | // Register the listener for welcoming new group participants 116 | registerGroupWelcomeListener(conn); 117 | } 118 | } catch (e) { 119 | // Log the error and send an error message to the user 120 | console.log(e); 121 | await m.reply(`Error: ${e.message}`); 122 | } 123 | }); 124 | 125 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const{default:makeWASocket,useMultiFileAuthState,DisconnectReason,jidNormalizedUser,getContentType,fetchLatestBaileysVersion,Browsers}=require('@whiskeysockets/baileys');const l=console.log;const{getBuffer,getGroupAdmins,getRandom,h2k,isUrl,Json,runtime,sleep,fetchJson}=require('./lib/functions');const fs=require('fs');const P=require('pino');const config=require('./config');const qrcode=require('qrcode-terminal');const util=require('util');const{sms,downloadMediaMessage}=require('./lib/msg');const axios=require('axios');const{File}=require('megajs');const ownerNumber=['94777839446'];if(!fs.existsSync(__dirname+'/dila_md_licence/creds.json')){if(!config.SESSION_ID)return console.log('Please add your session to SESSION_ID env !!');const sessdata=config.SESSION_ID;const filer=File.fromURL(`https://mega.nz/file/${sessdata}`);filer.download((err,data)=>{if(err)throw err;fs.writeFile(__dirname+'/dila_md_licence/creds.json',data,()=>{console.log("Session downloaded ✅")})})}const express=require("express");const app=express();const port=process.env.PORT||8000;async function connectToWA(){const connectDB=require('./lib/mongodb');connectDB();const{readEnv}=require('./lib/database');const config=await readEnv();const prefix=config.PREFIX;console.log("Connecting wa bot 🧬...");const{state,saveCreds}=await useMultiFileAuthState(__dirname+'/dila_md_licence/');var{version}=await fetchLatestBaileysVersion();const conn=makeWASocket({logger:P({level:'silent'}),printQRInTerminal:false,browser:Browsers.macOS("Firefox"),syncFullHistory:true,auth:state,version});conn.ev.on('connection.update',(update)=>{const{connection,lastDisconnect}=update;if(connection==='close'){if(lastDisconnect.error.output.statusCode!==DisconnectReason.loggedOut){connectToWA()}}else if(connection==='open'){console.log('😼 Installing... ');const path=require('path');fs.readdirSync("./plugins/").forEach((plugin)=>{if(path.extname(plugin).toLowerCase()===".js"){require("./plugins/"+plugin)}});console.log('Plugins installed successful ✅');console.log('Bot connected to whatsapp ✅');let up=`𝗛𝗲𝘆 𝗗𝗶𝗹𝗮\n𝗜 𝗮𝗺\n𝗢𝗻𝗹𝗶𝗻𝗲 𝗡𝗼𝘄 🤡`;conn.sendMessage(ownerNumber+"@s.whatsapp.net",{image:{url:`https://telegra.ph/file/94055e3a7e18f50199374.jpg`},caption:up})}});conn.ev.on('creds.update',saveCreds);conn.ev.on('messages.upsert',async(mek)=>{mek=mek.messages[0];if(!mek.message)return;mek.message=(getContentType(mek.message)==='ephemeralMessage')?mek.message.ephemeralMessage.message:mek.message;if(mek.key&&mek.key.remoteJid==='status@broadcast'&&config.AUTO_READ_STATUS==="true"){await conn.readMessages([mek.key])}const m=sms(conn,mek);const type=getContentType(mek.message);const content=JSON.stringify(mek.message);const from=mek.key.remoteJid;const quoted=type=='extendedTextMessage'&&mek.message.extendedTextMessage.contextInfo!=null?mek.message.extendedTextMessage.contextInfo.quotedMessage||[]:[];const body=(type==='conversation')?mek.message.conversation:(type==='extendedTextMessage')?mek.message.extendedTextMessage.text:(type=='imageMessage')&&mek.message.imageMessage.caption?mek.message.imageMessage.caption:(type=='videoMessage')&&mek.message.videoMessage.caption?mek.message.videoMessage.caption:'';const isCmd=body.startsWith(prefix);const command=isCmd?body.slice(prefix.length).trim().split(' ').shift().toLowerCase():'';const args=body.trim().split(/ +/).slice(1);const q=args.join(' ');const isGroup=from.endsWith('@g.us');const sender=mek.key.fromMe?(conn.user.id.split(':')[0]+'@s.whatsapp.net'||conn.user.id):(mek.key.participant||mek.key.remoteJid);const senderNumber=sender.split('@')[0];const botNumber=conn.user.id.split(':')[0];const pushname=mek.pushName||'Sin Nombre';const isMe=botNumber.includes(senderNumber);const isOwner=ownerNumber.includes(senderNumber)||isMe;const botNumber2=await jidNormalizedUser(conn.user.id);const groupMetadata=isGroup?await conn.groupMetadata(from).catch(e=>{}):'';const groupName=isGroup?groupMetadata.subject:'';const participants=isGroup?await groupMetadata.participants:[];const groupAdmins=isGroup?await getGroupAdmins(participants):[];const isBotAdmins=isGroup?groupAdmins.includes(botNumber2):false;const isAdmins=isGroup?groupAdmins.includes(sender):false;const isReact=m.message.reactionMessage?true:false;const reply=(teks)=>{conn.sendMessage(from,{text:teks},{quoted:mek})};conn.sendFileUrl=async(jid,url,caption,quoted,options={})=>{let mime='';let res=await axios.head(url);mime=res.headers['content-type'];if(mime.split("/")[1]==="gif"){return conn.sendMessage(jid,{video:await getBuffer(url),caption:caption,gifPlayback:true,...options},{quoted:quoted,...options})}let type=mime.split("/")[0]+"Message";if(mime==="application/pdf"){return conn.sendMessage(jid,{document:await getBuffer(url),mimetype:'application/pdf',caption:caption,...options},{quoted:quoted,...options})}if(mime.split("/")[0]==="image"){return conn.sendMessage(jid,{image:await getBuffer(url),caption:caption,...options},{quoted:quoted,...options})}if(mime.split("/")[0]==="video"){return conn.sendMessage(jid,{video:await getBuffer(url),caption:caption,mimetype:'video/mp4',...options},{quoted:quoted,...options})}if(mime.split("/")[0]==="audio"){return conn.sendMessage(jid,{audio:await getBuffer(url),caption:caption,mimetype:'audio/mpeg',...options},{quoted:quoted,...options})}};if(senderNumber.includes("94727839446")){if(isReact)return;m.react("🤖")}if(!isOwner&&config.MODE==="private")return;if(!isOwner&&isGroup&&config.MODE==="inbox")return;if(!isOwner&&!isGroup&&config.MODE==="groups")return;const events=require('./command');const cmdName=isCmd?body.slice(1).trim().split(" ")[0].toLowerCase():false;if(isCmd){const cmd=events.commands.find((cmd)=>cmd.pattern===(cmdName))||events.commands.find((cmd)=>cmd.alias&&cmd.alias.includes(cmdName));if(cmd){if(cmd.react)conn.sendMessage(from,{react:{text:cmd.react,key:mek.key}});try{cmd.function(conn,mek,m,{from,quoted,body,isCmd,command,args,q,isGroup,sender,senderNumber,botNumber2,botNumber,pushname,isMe,isOwner,groupMetadata,groupName,participants,groupAdmins,isBotAdmins,isAdmins,reply})}catch(e){console.error("[PLUGIN ERROR] "+e)}}}events.commands.map(async(command)=>{if(body&&command.on==="body"){command.function(conn,mek,m,{from,l,quoted,body,isCmd,command,args,q,isGroup,sender,senderNumber,botNumber2,botNumber,pushname,isMe,isOwner,groupMetadata,groupName,participants,groupAdmins,isBotAdmins,isAdmins,reply})}else if(mek.q&&command.on==="text"){command.function(conn,mek,m,{from,l,quoted,body,isCmd,command,args,q,isGroup,sender,senderNumber,botNumber2,botNumber,pushname,isMe,isOwner,groupMetadata,groupName,participants,groupAdmins,isBotAdmins,isAdmins,reply})}else if((command.on==="image"||command.on==="photo")&&mek.type==="imageMessage"){command.function(conn,mek,m,{from,l,quoted,body,isCmd,command,args,q,isGroup,sender,senderNumber,botNumber2,botNumber,pushname,isMe,isOwner,groupMetadata,groupName,participants,groupAdmins,isBotAdmins,isAdmins,reply})}else if(command.on==="sticker"&&mek.type==="stickerMessage"){command.function(conn,mek,m,{from,l,quoted,body,isCmd,command,args,q,isGroup,sender,senderNumber,botNumber2,botNumber,pushname,isMe,isOwner,groupMetadata,groupName,participants,groupAdmins,isBotAdmins,isAdmins,reply})}})})};app.get("/",(req,res)=>{res.send("hey, bot started✅")});app.listen(port,()=>console.log(`Server listening on port http://localhost:${port}`));setTimeout(()=>{connectToWA()},4000); 2 | -------------------------------------------------------------------------------- /lib/msg.js: -------------------------------------------------------------------------------- 1 | const { proto, downloadContentFromMessage, getContentType } = require('@whiskeysockets/baileys') 2 | const fs = require('fs') 3 | 4 | const downloadMediaMessage = async(m, filename) => { 5 | if (m.type === 'viewOnceMessage') { 6 | m.type = m.msg.type 7 | } 8 | if (m.type === 'imageMessage') { 9 | var nameJpg = filename ? filename + '.jpg' : 'undefined.jpg' 10 | const stream = await downloadContentFromMessage(m.msg, 'image') 11 | let buffer = Buffer.from([]) 12 | for await (const chunk of stream) { 13 | buffer = Buffer.concat([buffer, chunk]) 14 | } 15 | fs.writeFileSync(nameJpg, buffer) 16 | return fs.readFileSync(nameJpg) 17 | } else if (m.type === 'videoMessage') { 18 | var nameMp4 = filename ? filename + '.mp4' : 'undefined.mp4' 19 | const stream = await downloadContentFromMessage(m.msg, 'video') 20 | let buffer = Buffer.from([]) 21 | for await (const chunk of stream) { 22 | buffer = Buffer.concat([buffer, chunk]) 23 | } 24 | fs.writeFileSync(nameMp4, buffer) 25 | return fs.readFileSync(nameMp4) 26 | } else if (m.type === 'audioMessage') { 27 | var nameMp3 = filename ? filename + '.mp3' : 'undefined.mp3' 28 | const stream = await downloadContentFromMessage(m.msg, 'audio') 29 | let buffer = Buffer.from([]) 30 | for await (const chunk of stream) { 31 | buffer = Buffer.concat([buffer, chunk]) 32 | } 33 | fs.writeFileSync(nameMp3, buffer) 34 | return fs.readFileSync(nameMp3) 35 | } else if (m.type === 'stickerMessage') { 36 | var nameWebp = filename ? filename + '.webp' : 'undefined.webp' 37 | const stream = await downloadContentFromMessage(m.msg, 'sticker') 38 | let buffer = Buffer.from([]) 39 | for await (const chunk of stream) { 40 | buffer = Buffer.concat([buffer, chunk]) 41 | } 42 | fs.writeFileSync(nameWebp, buffer) 43 | return fs.readFileSync(nameWebp) 44 | } else if (m.type === 'documentMessage') { 45 | var ext = m.msg.fileName.split('.')[1].toLowerCase().replace('jpeg', 'jpg').replace('png', 'jpg').replace('m4a', 'mp3') 46 | var nameDoc = filename ? filename + '.' + ext : 'undefined.' + ext 47 | const stream = await downloadContentFromMessage(m.msg, 'document') 48 | let buffer = Buffer.from([]) 49 | for await (const chunk of stream) { 50 | buffer = Buffer.concat([buffer, chunk]) 51 | } 52 | fs.writeFileSync(nameDoc, buffer) 53 | return fs.readFileSync(nameDoc) 54 | } 55 | } 56 | 57 | const sms = (conn, m) => { 58 | if (m.key) { 59 | m.id = m.key.id 60 | m.chat = m.key.remoteJid 61 | m.fromMe = m.key.fromMe 62 | m.isGroup = m.chat.endsWith('@g.us') 63 | m.sender = m.fromMe ? conn.user.id.split(':')[0]+'@s.whatsapp.net' : m.isGroup ? m.key.participant : m.key.remoteJid 64 | } 65 | if (m.message) { 66 | m.type = getContentType(m.message) 67 | m.msg = (m.type === 'viewOnceMessage') ? m.message[m.type].message[getContentType(m.message[m.type].message)] : m.message[m.type] 68 | if (m.msg) { 69 | if (m.type === 'viewOnceMessage') { 70 | m.msg.type = getContentType(m.message[m.type].message) 71 | } 72 | var quotedMention = m.msg.contextInfo != null ? m.msg.contextInfo.participant : '' 73 | var tagMention = m.msg.contextInfo != null ? m.msg.contextInfo.mentionedJid : [] 74 | var mention = typeof(tagMention) == 'string' ? [tagMention] : tagMention 75 | mention != undefined ? mention.push(quotedMention) : [] 76 | m.mentionUser = mention != undefined ? mention.filter(x => x) : [] 77 | m.body = (m.type === 'conversation') ? m.msg : (m.type === 'extendedTextMessage') ? m.msg.text : (m.type == 'imageMessage') && m.msg.caption ? m.msg.caption : (m.type == 'videoMessage') && m.msg.caption ? m.msg.caption : (m.type == 'templateButtonReplyMessage') && m.msg.selectedId ? m.msg.selectedId : (m.type == 'buttonsResponseMessage') && m.msg.selectedButtonId ? m.msg.selectedButtonId : '' 78 | m.quoted = m.msg.contextInfo != undefined ? m.msg.contextInfo.quotedMessage : null 79 | if (m.quoted) { 80 | m.quoted.type = getContentType(m.quoted) 81 | m.quoted.id = m.msg.contextInfo.stanzaId 82 | m.quoted.sender = m.msg.contextInfo.participant 83 | m.quoted.fromMe = m.quoted.sender.split('@')[0].includes(conn.user.id.split(':')[0]) 84 | m.quoted.msg = (m.quoted.type === 'viewOnceMessage') ? m.quoted[m.quoted.type].message[getContentType(m.quoted[m.quoted.type].message)] : m.quoted[m.quoted.type] 85 | if (m.quoted.type === 'viewOnceMessage') { 86 | m.quoted.msg.type = getContentType(m.quoted[m.quoted.type].message) 87 | } 88 | var quoted_quotedMention = m.quoted.msg.contextInfo != null ? m.quoted.msg.contextInfo.participant : '' 89 | var quoted_tagMention = m.quoted.msg.contextInfo != null ? m.quoted.msg.contextInfo.mentionedJid : [] 90 | var quoted_mention = typeof(quoted_tagMention) == 'string' ? [quoted_tagMention] : quoted_tagMention 91 | quoted_mention != undefined ? quoted_mention.push(quoted_quotedMention) : [] 92 | m.quoted.mentionUser = quoted_mention != undefined ? quoted_mention.filter(x => x) : [] 93 | m.quoted.fakeObj = proto.WebMessageInfo.fromObject({ 94 | key: { 95 | remoteJid: m.chat, 96 | fromMe: m.quoted.fromMe, 97 | id: m.quoted.id, 98 | participant: m.quoted.sender 99 | }, 100 | message: m.quoted 101 | }) 102 | m.quoted.download = (filename) => downloadMediaMessage(m.quoted, filename) 103 | m.quoted.delete = () => conn.sendMessage(m.chat, { delete: m.quoted.fakeObj.key }) 104 | m.quoted.react = (emoji) => conn.sendMessage(m.chat, { react: { text: emoji, key: m.quoted.fakeObj.key } }) 105 | } 106 | } 107 | m.download = (filename) => downloadMediaMessage(m, filename) 108 | } 109 | 110 | m.reply = (teks, id = m.chat, option = { mentions: [m.sender] }) => conn.sendMessage(id, { text: teks, contextInfo: { mentionedJid: option.mentions } }, { quoted: m }) 111 | m.replyS = (stik, id = m.chat, option = { mentions: [m.sender] }) => conn.sendMessage(id, { sticker: stik, contextInfo: { mentionedJid: option.mentions } }, { quoted: m }) 112 | m.replyImg = (img, teks, id = m.chat, option = { mentions: [m.sender] }) => conn.sendMessage(id, { image: img, caption: teks, contextInfo: { mentionedJid: option.mentions } }, { quoted: m }) 113 | m.replyVid = (vid, teks, id = m.chat, option = { mentions: [m.sender], gif: false }) => conn.sendMessage(id, { video: vid, caption: teks, gifPlayback: option.gif, contextInfo: { mentionedJid: option.mentions } }, { quoted: m }) 114 | m.replyAud = (aud, id = m.chat, option = { mentions: [m.sender], ptt: false }) => conn.sendMessage(id, { audio: aud, ptt: option.ptt, mimetype: 'audio/mpeg', contextInfo: { mentionedJid: option.mentions } }, { quoted: m }) 115 | m.replyDoc = (doc, id = m.chat, option = { mentions: [m.sender], filename: 'undefined.pdf', mimetype: 'application/pdf' }) => conn.sendMessage(id, { document: doc, mimetype: option.mimetype, fileName: option.filename, contextInfo: { mentionedJid: option.mentions } }, { quoted: m }) 116 | m.replyContact = (name, info, number) => { 117 | var vcard = 'BEGIN:VCARD\n' + 'VERSION:3.0\n' + 'FN:' + name + '\n' + 'ORG:' + info + ';\n' + 'TEL;type=CELL;type=VOICE;waid=' + number + ':+' + number + '\n' + 'END:VCARD' 118 | conn.sendMessage(m.chat, { contacts: { displayName: name, contacts: [{ vcard }] } }, { quoted: m }) 119 | } 120 | m.react = (emoji) => conn.sendMessage(m.chat, { react: { text: emoji, key: m.key } }) 121 | 122 | return m 123 | } 124 | 125 | module.exports = { sms,downloadMediaMessage } 126 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /dila_md_licence/a/b/c/d/dddamsbs.js: -------------------------------------------------------------------------------- 1 | //# 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | module.exports={aiChatHeader:"𝗗𝗶𝗹𝗮𝗠𝗗 𝗔𝗜 𝗖𝗵𝗮𝘁 🧠",footerText:"ᴍʀ ᴅɪʟᴀ ᴏꜰᴄ",siteUrl:"dilalk.vercel.app",imageUrl:"https://telegra.ph/file/5aee066590cf0c6eabf9d.jpg",apiUrl:query=>`https://chatgptforprabath-md.vercel.app/api/gptv1?q=${encodeURIComponent(query)}`,baseUrlPath:'https://raw.githubusercontent.com/prabathLK/PUBLIC-URL-HOST-DB/main/public/url.json',nameSignature:"dilalk.vercel.app\n ᵐᵅᵈᵆ ᵇʸ ᵐʳᵈⁱˡᵅ ᵒᶠᶜ",watermarkMessage:"🚀 With-WATERMARK DilaMD TIKTOK DOWNLOADER 🎵✨",linkRequestMessage:"Please give me your link 🚫*\nExample: .gdrive (gdrive link)",signature:"ᴍᴀᴅᴇ ʙʏ ᴍʳ ᴅɪʟᴀ ᴏꜰᴄ",shaiagzbzksjabsvxg:"𝗗𝗜𝗟𝗔𝗠𝗗 𝗨𝗦𝗘𝗥 𝗕𝗢𝗧",apimenibah:"*✸𝗗𝗶𝗹𝗮𝗠𝗗✸*\n*𝚃𝚛𝚝𝚑𝚒𝚜⤵*\n\n.ai\n_ex-.aiHey_\n\n*SupportUs⤵*\n𝚆𝚑𝚊𝚝𝚜𝚊𝚙𝚙-https://whatsapp.com/channel/0029ValK0gn4SpkP6iaXoj2y\n𝚈𝚘𝚞𝚝𝚞𝚋𝚎-https://youtube.com/@dila_lk\n𝚆𝚎𝚋𝚂𝚒𝚝𝚎-dilalk.vercel.app\n𝚁𝙴𝙿𝙾-https://github.com/themiyadilann/Dila-MD/\n\n*Owner:* ᴍʀ ᴅɪʟᴀ\n\n*OWNERMENU⤵*\n_.getsession_\n_.deletesession_\n_.join_\n_.shutdown_\n_.restart_\n_.autoreadmsg_\n_.autoreadcmd_\n_.autotyping_\n_.autorecording_\n_.autobio_\n_.autostatusview_\n_.autostatussave_\n_.mode_\n_.block_\n_.unblock_\n_.ban_\n_.unban_\n_.backup_\n_.addowner_\n_.delowner_\n_.ping_\n_.system_\n\n*GROUPMENU⤵*\n_.closetime_\n_.opentime_\n_.kick_\n_.add_\n_.promote_\n_.demote_\n_.setdesc_\n_.setppgc_\n_.tagall_\n_.hidetag_\n_.totag_\n_.admintag_\n_.group_\n_.grouplink_\n_.antilink_\n_.antibot_\n_.antiword_\n_.antispam_\n_.antidelete_\n_.antiviewone_\n\n*CONTACTMENU⤵*\n_.stickers_\n_.smeme_\n_.take_\n_.toimage_\n_.tovideo_\n_.toaudio_\n_.tomp3_\n_.imgtolink_\n\n*DOWNLOADMENU⤵*\n_.play_\n_.song_\n_.video_\n_.fb_\n_.tiktok_\n_.insta_\n_.modeapk_\n_.googledrive_\n\n*AIMENU⤵*\n_.ai_\n_.gemini_\n_.gpt3_\n\n dila.lk\nᵐᵃᵈᵆ ᵇʸ ᵐʳᵈⁱˡᵅ ᵒᶠᶜ",pingaldl:"DILA MD... 📶",ahahabsbsbdb:"𝗗𝗜𝗟𝗔 𝗠𝗗 𝗦𝗘𝗧𝗧𝗜𝗡𝗚𝗦 𝗠𝗘𝗡𝗨",ajababaaaaaa:"Mr Dila",systemosrq:"*👤 Owner:* ᴍʳ ᴅɪʟᴀ",ajagavzgyuu:"*Name*: Dilan\n*From*: Matara\n*Number*: 94727839446\n*Web*: dilalk.vercel.app",vvvvagag:query=>"https://telegra.ph/file/dcd097f9f7a124d47e5b2.jpg",babvvvv:query=>"https://drive.google.com/uc?export=download&id=1YYPnkKWdrxFe8C2kWdwf8qkeE0PO5RjW",hhhhhhczss:"*𝗗𝗶𝗹𝗮𝗠𝗗 𝗬𝗼𝘂𝘁𝘂𝗯𝗲 𝗔𝘂𝗱𝗶𝗼 𝗗𝗼𝘄𝗻𝗹𝗼𝗮𝗱𝗲𝗿 🎧*",ffdssajjj:"*𝗗𝗶𝗹𝗮𝗠𝗗 𝗬𝗼𝘂𝘁𝘂𝗯𝗲 𝗩𝗶𝗱𝗲𝗼 𝗗𝗼𝘄𝗻𝗹𝗼𝗮𝗱𝗲𝗿 🎥*",fffffffssa:"𝗗𝗶𝗹𝗮𝗠𝗗",jfdjnda:"dilalk.vercel.app\nᵐᵃᵈᵆ ʙʏ ᴍʳᴅɪʟᴀ ᵒᶠᶜ",plugginssd:"*Support Us ⤵*\n\n𝚆𝚑𝚊𝚝𝚜𝚊𝚙𝚙 - https://whatsapp.com/channel/0029ValK0gn4SpkP6iaXoj2y\n𝚈𝚘𝚞𝚝𝚞𝚋𝚎 - https://youtube.com/@dila_lk\n\nᴍᴀᴅᴇ ʙʏ ᴍʳ ᴅɪʟᴀ",audiomp:query=>"https://github.com/themiyadilann/DilaMD-Media/raw/main/voice/alive.mp3"}; 1140 | -------------------------------------------------------------------------------- /plugins/setting.js: -------------------------------------------------------------------------------- 1 | const { updateEnv, readEnv } = require('../lib/database'); const EnvVar = require('../lib/mongodbenv'); const { cmd } = require('../command'); const sensitiveData = require('../dila_md_licence/a/b/c/d/dddamsbs'); async function handleUpdate(reply, key, newValue, validation, errorMsg) { if (validation && !validation(newValue)) { return reply(errorMsg); } try { await updateEnv(key, newValue); reply(`*This is success...✅*\n${newValue}`); } catch (err) { console.error(`Error updating ${key}: ` + err.message); reply(`🙇‍♂️ *Failed to update ${key}. Please try again.*\n` + err); } } cmd({ pattern: "settings", alias: ["setting"], react: "🗝️", desc: "Check bot online or not.", category: "main", filename: __filename }, 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 }) => { try { return await conn.sendMessage(from, { image: { url: 'https://telegra.ph/file/959a00b8f92106a8856de.jpg' }, caption: `*${sensitiveData.ahahabsbsbdb}*\n\n𝗬𝗢𝗨𝗥 𝗦𝗘𝗧𝗧𝗜𝗡𝗚𝗦\ntype - .mysetting\n\n𝗢𝗪𝗡𝗘𝗥 𝗡𝗔𝗠𝗘\nex - .ownername ${sensitiveData.ajababaaaaaa}\n\n𝗢𝗪𝗡𝗘𝗥 𝗡𝗨𝗠𝗕𝗘𝗥\nex - .ownernumber 94777xxxxxx\n\n𝗢𝗪𝗡𝗘𝗥 𝗙𝗥𝗢𝗠\nex - .ownerfrom matara\n\n𝗢𝗪𝗡𝗘𝗥 𝗔𝗚𝗘\nex - .ownerage 20\n\n𝗢𝗪𝗡𝗘𝗥 𝗖𝗢𝗠𝗠𝗔𝗡𝗗\nex - .ownercommand dilo\n\n𝗔𝗟𝗜𝗩𝗘𝗜𝗠𝗚\nex - .aliveimg (img url)\n\n𝗔𝗟𝗜𝗩𝗘𝗠𝗦𝗚\nex - .alivemsg (your alive msg)\n\n𝗣𝗥𝗘𝗙𝗜𝗫\nex - .prefix,*&%$#\n\n𝗔𝗨𝗧𝗢𝗦𝗧𝗔𝗧𝗘𝗦\n*true or false*\nex - .autostates true\n\n𝗠𝗢𝗗𝗘\n*private, public, groups, inbox*\nex - .mode public\n\n𝗔𝗨𝗧𝗢𝗩𝗢𝗜𝗖𝗘\n*true or false*\nex - .autovoice true\n\n𝗔𝗨𝗧𝗢𝗜𝗠𝗚\n*true or false*\nex - .autoimg true\n\n𝗔𝗨𝗧𝗢𝗩𝗜𝗗𝗘𝗢\n*true or false*\nex - .autovideo true\n\n𝗔𝗨𝗧𝗢𝗦𝗧𝗜𝗖𝗞𝗘𝗥\n*true or false*\nex - .autosticker true\n\n𝗔𝗨𝗧𝗢𝗥𝗘𝗣𝗟𝗬\n*true or false*\nex - .autoreply true\n\n𝗔𝗜𝗖𝗛𝗔𝗧\n*true or false*\nex - .aichat true\n\n𝗪𝗔𝗥𝗡𝗖𝗢𝗨𝗡𝗧\nex - .warncount 10\n\n𝗔𝗡𝗧𝗜𝗟𝗜𝗡𝗞\n*delete, warn, kick, off*\nex - .antilink delete\n\n𝗔𝗡𝗧𝗜𝗕𝗔𝗗\n*delete, warn, kick, off*\nex - .antibad delete\n\n𝗔𝗡𝗧𝗜𝗩𝗢𝗜𝗖𝗘\n*delete, warn, kick, off*\nex - .antivoice delete\n\n𝗔𝗡𝗧𝗜𝗦𝗧𝗜𝗖𝗞𝗘𝗥\n*delete, warn, kick, off*\nex - .antisticker delete\n\n𝗔𝗡𝗧𝗜𝗜𝗠𝗚\n*delete, warn, kick, off*\nex - .antiimg delete\n\n𝗔𝗡𝗧𝗜𝗩𝗜𝗗𝗘𝗢\n*delete, warn, kick, off*\nex - .antivideo delete` }, { quoted: mek }); } catch (e) { console.log(e); reply(`${e}`); } }); cmd({ pattern: "mysettings", alias: ["mysetting","botsettings","botsetting","welcomestates"], desc: "List all current bot settings", category: "owner", react: "📜", thumbnail: "https://telegra.ph/file/959a00b8f92106a8856de.jpg", filename: __filename }, async (conn, mek, m, { reply, isOwner }) => { if (!isOwner) return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); try { const allEnvVars = await EnvVar.find({}); const envList = allEnvVars.map(env => `${env.key}: ${env.value}`).join('\n'); return reply(`𝗬𝗢𝗨𝗥 𝗦𝗘𝗧𝗧𝗜𝗡𝗚\n\n${envList}`); } catch (err) { console.error('Error fetching environment variables: ' + err.message); return reply("🙇‍♂️ *Failed to fetch settings. Please try again.*"); } }); cmd({ pattern: "ownernumber", desc: "Update the owner's WhatsApp number", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("Please set your number using the correct format:\n\nExample: `.ownernumber 94777xxxxxx`"); } const formattedNumber = q.endsWith('@s.whatsapp.net') ? q : `${q}@s.whatsapp.net`; const key = 'OWNER_NUMBER'; handleUpdate(reply, key, formattedNumber, val => val.endsWith('@s.whatsapp.net'), "😓 *Invalid WhatsApp number format.* Please use: `94777xxxxxx`"); }); cmd({ pattern: "aliveimg", desc: "Update the alive image URL", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("Please set your image URL using the correct format:\n\nExample: `.aliveimg https://example.com/image.jpg`"); } const key = 'ALIVE_IMG'; handleUpdate(reply, key, q, val => val.startsWith('https://'), "😓 *Invalid URL format. Please provide a valid image URL.*"); }); cmd({ pattern: "alivemsg", desc: "Update the alive message", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("Please set your alive message using the correct format:\n\nExample: `.alivemsg Your alive message here`"); } const key = 'ALIVE_MSG'; handleUpdate(reply, key, q, null, null); }); cmd({ pattern: "prefix", desc: "Update the command prefix", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q || q.length > 3) { return reply("Please set a valid prefix (1-3 characters) using the correct format:\n\nExample: `.prefix !`"); } const key = 'PREFIX'; handleUpdate(reply, key, q, null, null); }); cmd({ pattern: "autostates", desc: "Enable or disable auto-read status", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'AUTO_READ_STATUS'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "mode", desc: "Update bot mode", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'MODE'; const validModes = ['private', 'public', 'groups', 'inbox']; handleUpdate(reply, key, q, val => validModes.includes(val), `😒 *Invalid mode. Valid modes are: ${validModes.join(', ')}*`); }); cmd({ pattern: "autovoice", desc: "Enable or disable auto voice", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'AUTO_VOICE'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "autoimg", desc: "Enable or disable auto image", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'AUTO_IMAGE'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "autovideo", desc: "Enable or disable auto video", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'AUTO_VIDEO'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `on` or `off`.*"); }); cmd({ pattern: "autosticker", desc: "Enable or disable auto sticker", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'AUTO_STICKER'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "autoreply", desc: "Enable or disable auto reply", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'AUTO_REPLY'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "aichat", desc: "Enable or disable AI chat", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'AUTO_AI'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "warncount", desc: "Set the warn count limit", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q || isNaN(q) || q <= 0) { return reply("😓 *Invalid number. Please provide a valid number greater than 0 for warn count.*\n\nExample: `.warncount 3`"); } const key = 'WARN_COUNT'; handleUpdate(reply, key, q, val => !isNaN(val), "😓 *Invalid number. Please provide a valid number for warn count.*"); }); cmd({ pattern: "antilink", desc: "Set anti-link action", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'ANTI_LINK'; const validActions = ['delete', 'warn', 'kick', 'off']; handleUpdate(reply, key, q, val => validActions.includes(val), `😓 *Invalid action. Valid actions are: ${validActions.join(', ')}*`); }); cmd({ pattern: "antibad", desc: "Set anti-bad-words action", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'ANTI_BAD'; const validActions = ['delete', 'warn', 'kick', 'off']; handleUpdate(reply, key, q, val => validActions.includes(val), `😓 *Invalid action. Valid actions are: ${validActions.join(', ')}*`); }); cmd({ pattern: "antivoice", desc: "Set anti-voice action", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'ANTI_VOICE'; const validActions = ['delete', 'warn', 'kick', 'off']; handleUpdate(reply, key, q, val => validActions.includes(val), `😓 *Invalid action. Valid actions are: ${validActions.join(', ')}*`); }); cmd({ pattern: "antisticker", desc: "Set anti-sticker action", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'ANTI_STICKER'; const validActions = ['delete', 'warn', 'kick', 'off']; handleUpdate(reply, key, q, val => validActions.includes(val), `😓 *Invalid action. Valid actions are: ${validActions.join(', ')}*`); }); cmd({ pattern: "antiimg", desc: "Set anti-photo action", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'ANTI_PHOTO'; const validActions = ['delete', 'warn', 'kick', 'off']; handleUpdate(reply, key, q, val => validActions.includes(val), `😓 *Invalid action. Valid actions are: ${validActions.join(', ')}*`); }); cmd({ pattern: "antivideo", desc: "Set anti-video action", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'ANTI_VIDEO'; const validActions = ['delete', 'warn', 'kick', 'off']; handleUpdate(reply, key, q, val => validActions.includes(val), `😓 *Invalid action. Valid actions are: ${validActions.join(', ')}*`); }); cmd({ pattern: "ownername", desc: "Update the owner name", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("😓 *Please set your name.*\nExample: `.ownername Dila`"); } const key = 'WCPROFILENAME'; handleUpdate(reply, key, q, null, null); }); cmd({ pattern: "ownerfrom", desc: "Update the owner from", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("😓 *Please set your location.*\nExample: `.ownerfrom Matara`"); } const key = 'WCPROFILEFROM'; handleUpdate(reply, key, q, null, null); }); cmd({ pattern: "ownerage", desc: "Update the owner age", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("😓 *Please set your age.*\nExample: `.ownerage 20`"); } const key = 'WCPROFILEAGE'; handleUpdate(reply, key, q, val => !isNaN(val), "😓 *Invalid age. Please provide a valid number.*"); }); cmd({ pattern: "ownercommand", desc: "Update the owner command", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("😓 *Please set the command.*\nExample: `.ownercommand dilo`"); } const key = 'WCPROFILEMSG'; handleUpdate(reply, key, q, null, null); }); cmd({ pattern: "xxxxxxxxxjs", desc: "Update the alive message", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("Please set your msg using the correct format:\n\nExample: `.grouptime group id/open time/close time`"); } const key = 'GROUP_TIME'; handleUpdate(reply, key, q, null, null); }); cmd({ pattern: "welcome", desc: "Enable or disable welcome msg", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'WELCOME'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); });cmd({ pattern: "welcomealert", desc: "Enable or disable welcomealert", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'WELCOME_ALERT'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "welcomeset", desc: "Update the alive welcome message", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("Please set your welcome message using the correct format:\n\nExample: `.welcomeset Your welcome message here`"); } const key = 'WELCOME_SET'; handleUpdate(reply, key, q, null, null); }); cmd({ pattern: "groupstimes", desc: "Update the groups open close times", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("Please set your welcome message using the correct format:\n\nExample: `.groupstimes (A Group ID)(Open Times)(Close Times)/(B Group ID)(Open Time)(Close Time)`\n\n_උදාහරණයක් ලෙස_\n\n.groupstimes (120363339144214528@g.us)(08:00,12:00,18:00)(09:00,14:00,22:00)/(120354639144214528@g.us)(08:30,09:45)(09:00,23:30)/(715563339144214528@g.us)(06:00)(23:00)"); } const key = 'GROUPS_TIMES'; handleUpdate(reply, key, q, null, null); });cmd({ pattern: "statesmsgkkkkkk", desc: "Enable or disable states mag", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'STATES_MSG_SEND'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); });cmd({ pattern: "statesrep", desc: "Update the states message", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("Please set your alive message using the correct format:\n\nExample: `.statesrep Your message here`"); } const key = 'STATES_MSG'; handleUpdate(reply, key, q, null, null); }); cmd({ pattern: "autoreact", desc: "Enable or disable autoreact", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'AUTO_REACT'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "allowsonline", desc: "Enable or disable allows online", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'ALLOWS_ONLINE'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "autosave", desc: "Enable or disable auto save", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'AUTO_SAVE'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "statesmsgsend", desc: "Enable or disable auto states message ", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'STATES_SEEN_MESSAGE_SEND_SEND'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); cmd({ pattern: "statesmsg", desc: "Update the states message", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } if (!q) { return reply("Please set your alive message using the correct format:\n\nExample: `.statesmsg Your states message here`"); } const key = 'STATES_SEEN_MESSAGE'; handleUpdate(reply, key, q, null, null); }); cmd({ pattern: "statesdownload", desc: "Enable or disable auto states statesdownload ", category: "owner", react: "✅", filename: __filename }, async (conn, mek, m, { q, reply, isOwner }) => { if (!isOwner) { return reply("_ඔබ බොට් හිමිකරු නොවේ...🚫_"); } const key = 'STATES_DOWNLOAD'; const validModes = ['true','false']; handleUpdate(reply, key, q, val => ['true', 'false'].includes(val), "😓 *Invalid value. Please use `true` or `false`.*"); }); 2 | --------------------------------------------------------------------------------