// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const fs = require("fs-extra"); const path = require("path"); // ๐Ÿ”’ LOCKED FOR RAYHAN-SABBIR const a1 = "๐† แ"; const a2 = "๐‘๐€๐˜"; const a3 = "๐‡๐€๐-"; const a4 = "๐’๐€๐"; const a5 = "๐๐ˆ๐‘"; const hiddenOwner = [a1, a2, a3, a4, a5].join(""); if (hiddenOwner!== "๐† แ๐‘๐€๐˜๐‡๐€๐-๐’๐€๐๐๐ˆ๐‘") { process.exit(0); } module.exports = { config: { name: "emoji_voice", version: "2.0.3", author: hiddenOwner, countDown: 5, role: 0, shortDescription: "Sends a cute girl's voice when an emoji is used ๐Ÿ˜ - ON/OFF Added", longDescription: "One emoji triggers multiple voices, sent randomly + ON/OFF system ๐Ÿ˜˜", category: "system" }, onStart: async function () { const cacheDir = path.join(__dirname, "cache"); await fs.ensureDir(cacheDir); const statusPath = path.join(cacheDir, "emoji_voice_status.json"); if (!fs.existsSync(statusPath)) { await fs.writeJson(statusPath, { enabled: true }); } }, onChat: async function ({ event, message }) { const { body, threadID } = event; if (!body) return; const cacheDir = path.join(__dirname, "cache"); const statusPath = path.join(cacheDir, "emoji_voice_status.json"); await fs.ensureDir(cacheDir); let status = { enabled: true }; try { if (fs.existsSync(statusPath)) { status = await fs.readJson(statusPath); } else { await fs.writeJson(statusPath, status); } } catch { status = { enabled: true }; } const lowerBody = body.toLowerCase().trim(); // --- ON / OFF COMMAND --- const onCommands = ["emoji on", "emoji_voice on", "emoji voice on", "emoji_voice_on"]; const offCommands = ["emoji off", "emoji_voice off", "emoji voice off", "emoji_voice_off"]; if (onCommands.includes(lowerBody)) { status.enabled = true; await fs.writeJson(statusPath, status); return message.reply("โœ… ๐„๐ฆ๐จ๐ฃ๐ข ๐•๐จ๐ข๐œ๐ž ๐Ž๐ เฆ•เฆฐเง‡ เฆฆเฆฟเฆฒเฆพเฆฎ ๐Ÿซถ๐Ÿ˜\nเฆเฆ–เฆจ เฆ‡เฆฎเง‹เฆœเฆฟ เฆฆเฆฟเฆฒเง‡ เฆญเฆฏเฆผเง‡เฆธ เฆ†เฆธเฆฌเง‡เฅค"); } if (offCommands.includes(lowerBody)) { status.enabled = false; await fs.writeJson(statusPath, status); return message.reply("โŒ ๐„๐ฆ๐จ๐ฃ๐ข ๐•๐จ๐ข๐œ๐ž ๐Ž๐…๐… เฆ•เฆฐเง‡ เฆฆเฆฟเฆฒเฆพเฆฎ ๐Ÿฅบ\nเฆเฆ–เฆจ เฆ†เฆฐ เฆญเฆฏเฆผเง‡เฆธ เฆ†เฆธเฆฌเง‡ เฆจเฆพเฅค"); } // --- CHECK STATUS --- if (!status.enabled) return; // --- ONLY EMOJI (length check) --- if (body.length > 4) return; // 2 char er beshi hole voice na const emojiAudioMap = { "๐Ÿฅฑ": ["https://files.catbox.moe/9pou40.mp3","https://files.catbox.moe/60cwcg.mp3"], "๐Ÿ˜": ["https://files.catbox.moe/60cwcg.mp3"], "๐Ÿ˜Œ": ["https://files.catbox.moe/epqwbx.mp3"], "๐Ÿฅบ": ["https://files.catbox.moe/wc17iq.mp3","https://files.catbox.moe/dv9why.mp3"], "๐Ÿคญ": ["https://files.catbox.moe/cu0mpy.mp3"], "๐Ÿ˜…": ["https://files.catbox.moe/jl3pzb.mp3"], "๐Ÿ˜": ["https://files.catbox.moe/z9e52r.mp3"], "๐Ÿ˜ž": ["https://files.catbox.moe/tdimtx.mp3"], "๐Ÿคซ": ["https://files.catbox.moe/0uii99.mp3"], "๐Ÿผ": ["https://files.catbox.moe/p6ht91.mp3"], "๐Ÿค”": ["https://files.catbox.moe/hy6m6w.mp3"], "๐Ÿฅฐ": ["https://files.catbox.moe/dv9why.mp3"], "๐Ÿคฆ": ["https://files.catbox.moe/ivlvoq.mp3"], "๐Ÿ˜˜": ["https://files.catbox.moe/ma2jlz.mp4","https://files.catbox.moe/37dqpx.mp3"], "๐Ÿ˜‘": ["https://files.catbox.moe/p78xfw.mp3"], "๐Ÿ˜ข": ["https://files.catbox.moe/shxwj1.mp3"], "๐Ÿ™Š": ["https://files.catbox.moe/3bejxv.mp3"], "๐Ÿคจ": ["https://files.catbox.moe/4aci0r.mp3"], "๐Ÿ˜ก": ["https://files.catbox.moe/shxwj1.mp3","https://files.catbox.moe/h9ekli.mp3"], "๐Ÿคฌ": ["https://files.catbox.moe/shxwj1.mp3","https://files.catbox.moe/h9ekli.mp3"], "๐Ÿ™ˆ": ["https://files.catbox.moe/3qc90y.mp3"], "๐Ÿ˜": ["https://files.catbox.moe/qjfk1b.mp3"], "๐Ÿ˜ญ": ["https://files.catbox.moe/itm4g0.mp3"], "๐Ÿ˜ฑ": ["https://files.catbox.moe/mu0kka.mp3"], "๐Ÿ˜ป": ["https://files.catbox.moe/y8ul2j.mp3"], "๐Ÿ˜ฟ": ["https://files.catbox.moe/tqxemm.mp3"], "๐Ÿ’”": ["https://files.catbox.moe/6yanv3.mp3"], "๐Ÿคฃ": ["https://files.catbox.moe/2sweut.mp3","https://files.catbox.moe/jl3pzb.mp3"], "๐Ÿฅน": ["https://files.catbox.moe/jf85xe.mp3"], "เฆฌเฆŸ": ["https://files.catbox.moe/3u6shs.mp3"], "๐Ÿซฃ": ["https://files.catbox.moe/ttb6hi.mp3"], "๐Ÿธ": ["https://files.catbox.moe/utl83s.mp3","https://files.catbox.moe/sg6ugl.mp3"], "๐Ÿ’‹": ["https://files.catbox.moe/37dqpx.mp3"], "๐Ÿซฆ": ["https://files.catbox.moe/61w3i0.mp3"], "๐Ÿ˜ด": ["https://files.catbox.moe/rm5ozj.mp3"], "๐Ÿ™": ["https://files.catbox.moe/7avi7u.mp3"], "๐Ÿ˜ผ": ["https://files.catbox.moe/4oz916.mp3"], "๐Ÿ–•": ["https://files.catbox.moe/593u3j.mp3","https://files.catbox.moe/dtua60.mp3"], "๐Ÿฅต": ["https://files.catbox.moe/l90704.mp3"], "๐Ÿ™‚": ["https://files.catbox.moe/4oks08.mp3"], "๐Ÿ˜’": ["https://files.catbox.moe/mt5il0.mp3"], "๐Ÿ˜“": ["https://files.catbox.moe/zh3mdg.mp3"], "๐Ÿคง": ["https://files.catbox.moe/zh3mdg.mp3"], "๐Ÿ™„": ["https://files.catbox.moe/vgzkeu.mp3"] }; const emoji = body.trim(); const audioList = emojiAudioMap[emoji]; if (!audioList) return; const audioUrl = audioList[Math.floor(Math.random() * audioList.length)]; const filePath = path.join(cacheDir, `${encodeURIComponent(emoji)}_${Date.now()}_${Math.floor(Math.random() * 1000)}.mp3`); try { const response = await axios.get(audioUrl, { responseType: "arraybuffer" }); fs.writeFileSync(filePath, Buffer.from(response.data)); await message.reply({ attachment: fs.createReadStream(filePath) }); fs.unlink(filePath, (err) => { if (err) console.error("Failed to delete cache file:", err); }); } catch (error) { console.error(error); } } };