// code from goatstore // api: https://store.agi.bd const fs = require("fs-extra"); const moment = require("moment-timezone"); const getStreamFromURL = global.utils.getStreamFromURL; // ==================== VIDEO LIST ==================== const gifList = [ "https://files.catbox.moe/tjhylq.mp4", "https://files.catbox.moe/qo2asu.mp4", "https://files.catbox.moe/jqjp2r.mp4", "https://files.catbox.moe/nm10q6.mp4", "https://files.catbox.moe/okfub6.mp4", "https://files.catbox.moe/pwe8d2.mp4", "https://files.catbox.moe/7hdws4.mp4", "https://files.catbox.moe/yzpag9.mp4" ]; const getRandomGif = () => gifList[Math.floor(Math.random() * gifList.length)]; module.exports = { config: { name: "prefix", version: "2.3", author: "Farhan-Khan", countDown: 5, role: 0, description: "Change & show bot prefix", category: "config" }, langs: { en: { usage: "โŒ ๐”๐ฌ๐š๐ ๐ž:\n" + "โžค ๐ฉ๐ซ๐ž๐Ÿ๐ข๐ฑ โ€” Show prefix\n" + "โžค ๐ฉ๐ซ๐ž๐Ÿ๐ข๐ฑ <๐ง๐ž๐ฐ๐๐ซ๐ž๐Ÿ๐ข๐ฑ> โ€” Change group prefix\n" + "โžค ๐ฉ๐ซ๐ž๐Ÿ๐ข๐ฑ <๐ง๐ž๐ฐ๐๐ซ๐ž๐Ÿ๐ข๐ฑ> -๐  โ€” Change global prefix\n" + "โžค ๐ฉ๐ซ๐ž๐Ÿ๐ข๐ฑ ๐ซ๐ž๐ฌ๐ž๐ญ โ€” Reset group prefix", reset: "โœ… ๐๐ซ๐ž๐Ÿ๐ข๐ฑ ๐ซ๐ž๐ฌ๐ž๐ญ ๐ฌ๐ฎ๐œ๐œ๐ž๐ฌ๐ฌ๐Ÿ๐ฎ๐ฅ!\n" + "๐Ÿ”ฐ ๐’๐ฒ๐ฌ๐ญ๐ž๐ฆ ๐ฉ๐ซ๐ž๐Ÿ๐ข๐ฑ: %1", onlyAdmin: "โ›” ๐Ž๐ง๐ฅ๐ฒ ๐›๐จ๐ญ ๐š๐๐ฆ๐ข๐ง ๐œ๐š๐ง ๐œ๐ก๐š๐ง๐ ๐ž ๐ ๐ฅ๐จ๐›๐š๐ฅ ๐ฉ๐ซ๐ž๐Ÿ๐ข๐ฑ.", confirmGlobal: "__________________________________\n" + "๐Ÿ—จ๏ธ = ๐†๐ฅ๐จ๐›๐š๐ฅ ๐๐ซ๐ž๐Ÿ๐ข๐ฑ ๐‚๐ก๐š๐ง๐ ๐ž ๐‘๐ž๐ช๐ฎ๐ž๐ฌ๐ญ๐ž๐.\n" + "๐Ÿ‘‰ = ๐‘๐ž๐š๐œ๐ญ ๐ฐ๐ข๐ญ๐ก ๐ž๐ฆ๐จ๐ฃ๐ข ๐ญ๐จ ๐œ๐จ๐ง๐Ÿ๐ข๐ซ๐ฆ. โœ…\n" + "__________________________________", confirmThisThread: "__________________________________\n" + "๐Ÿ—จ๏ธ = ๐†๐ซ๐จ๐ฎ๐ฉ ๐๐ซ๐ž๐Ÿ๐ข๐ฑ ๐‚๐ก๐š๐ง๐ ๐ž ๐‘๐ž๐ช๐ฎ๐ž๐ฌ๐ญ๐ž๐.\n" + "๐Ÿ‘‰ = ๐‘๐ž๐š๐œ๐ญ ๐ฐ๐ข๐ญ๐ก ๐ž๐ฆ๐จ๐ฃ๐ข ๐ญ๐จ ๐œ๐จ๐ง๐Ÿ๐ข๐ซ๐ฆ. โœ…\n" + "__________________________________", successGlobal: "โœ… ๐†๐‘๐Ž๐”๐ ๐๐‘๐„๐…๐ˆ๐— ๐‚๐‡๐€๐๐†๐„๐ƒ!\n" + "๐Ÿ†• ๐๐„๐– ๐๐‘๐„๐…๐ˆ๐—: %1", successThisThread: "โœ… ๐†๐‘๐Ž๐”๐ ๐๐‘๐„๐…๐ˆ๐— ๐‚๐‡๐€๐๐†๐„๐ƒ!\n" + "๐Ÿ†• ๐๐„๐– ๐๐‘๐„๐…๐ˆ๐—: %1" } }, // ==================== ON START ==================== onStart: async function ({ message, role, args, commandName, event, threadsData, getLang }) { // ==================== SHOW PREFIX ==================== if (!args[0]) { const gif = getRandomGif(); const systemPrefix = global.GoatBot.config.prefix; const groupPrefix = global.utils.getPrefix(event.threadID); const threadInfo = await threadsData.get(event.threadID); const groupName = threadInfo?.threadName || "Unknown Group"; const time = moment() .tz("Asia/Dhaka") .format("hh:mm A"); const date = moment() .tz("Asia/Dhaka") .format("DD MMM YYYY"); const owner = "๐Œ๐™ดสœ๐„แด…๐ˆ"; return message.reply({ body: ` โ•ญโ”โ”โ”ใ€”ใ€Š๐“†ฉ๐๐‘๐„๐…๐ˆ๐—๐“†ชใ€‹ใ€•โ”โ”โ”โ•ฎ โ”ƒ โ”ƒ ๐Ÿท๏ธใ€Ž๐†๐‘๐Ž๐”๐ใ€: โ†“ โ”ƒ โœฆโ‹†โŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโ‹†โœฆ โ”ƒ ใ€Š ${groupName} ใ€‹ โœฆโ‹†โŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโŽฏโ‹†โœฆ โ”ƒ โ”ƒ๐Ÿ”ฐใ€Ž๐’๐˜๐’๐“๐„๐Œใ€: ใ€Š ${systemPrefix} ใ€‹ โ”ƒ โ”ƒ๐Ÿ’ฌใ€Ž๐†๐‘๐Ž๐”๐ใ€: ใ€Š ${groupPrefix} ใ€‹ โ”ƒ โ”ƒโฐใ€Ž๐“๐ˆ๐Œ๐„ใ€: ใ€Š ${time} ใ€‹ โ”ƒ โ”ƒ๐Ÿ“…ใ€Ž๐ƒ๐€๐“๐„ใ€: ใ€Š ${date} ใ€‹ โ”ƒ โ”ƒ๐Ÿ‘‘ใ€Ž๐Ž๐–๐๐„๐‘ใ€: ใ€Š ${owner} ใ€‹ โ”ƒ โ”ƒโšกใ€Ž๐’๐“๐€๐“๐”๐’ใ€: ใ€Š ๐Ž๐๐‹๐ˆ๐๐„ ใ€‹ โ”ƒ โ•ฐโ”โ”โ”ใ€”ใ€Š๐“†ฉ๐Œ๐™ดสœ๐„แด…๐ˆ๐“†ชใ€‹ใ€•โ”โ”โ”โ•ฏ`, attachment: await getStreamFromURL(gif) }); } // ==================== RESET PREFIX ==================== if (args[0].toLowerCase() === "reset") { await threadsData.set( event.threadID, null, "data.prefix" ); return message.reply( getLang( "reset", global.GoatBot.config.prefix ) ); } // ==================== NEW PREFIX ==================== const newPrefix = args[0]; // -g เฆฆเฆฟเฆฒเง‡ Global Prefix const setGlobal = args[1] === "-g"; // ==================== ADMIN CHECK ==================== if (setGlobal && role < 2) { return message.reply( getLang("onlyAdmin") ); } // ==================== CONFIRM MESSAGE ==================== const confirmMsg = setGlobal ? getLang("confirmGlobal") : getLang("confirmThisThread"); const gif = getRandomGif(); return message.reply( { body: confirmMsg, attachment: await getStreamFromURL(gif) }, (err, info) => { if (err) return; global.GoatBot.onReaction.set( info.messageID, { commandName, author: event.senderID, newPrefix, setGlobal } ); } ); }, // ==================== ON REACTION ==================== onReaction: async function ({ event, message, threadsData, Reaction, getLang }) { // เฆถเงเฆงเง เฆฏเง‡ Prefix change เฆ•เฆฐเง‡เฆ›เง‡ เฆคเฆพเฆฐ reaction เฆ•เฆพเฆœ เฆ•เฆฐเฆฌเง‡ if (event.userID !== Reaction.author) return; global.GoatBot.onReaction.delete( event.messageID ); // ==================== GLOBAL PREFIX ==================== if (Reaction.setGlobal) { global.GoatBot.config.prefix = Reaction.newPrefix; fs.writeFileSync( global.client.dirConfig, JSON.stringify( global.GoatBot.config, null, 2 ) ); return message.reply( getLang( "successGlobal", Reaction.newPrefix ) ); } // ==================== GROUP PREFIX ==================== await threadsData.set( event.threadID, Reaction.newPrefix, "data.prefix" ); return message.reply( getLang( "successThisThread", Reaction.newPrefix ) ); } };