// code from goatstore // api: https://store.agi.bd module.exports = { config: { name: "prefix", version: "2.0", author: "โ€”อž๐ส€ษชแดแด‡ฬ", countDown: 3, role: 0, shortDescription: "Prefix info", category: "system", guide: "prefix\nprefix [new prefix]", }, onChat: async function ({ event, message, threadsData }) { const body = (event.body || "").trim().toLowerCase(); if (body!== "prefix" && body!== "pre") return; let p; try { const d = await threadsData.get(event.threadID); p = d?.data?.prefix || global.GoatBot.config.prefix; } catch { p = global.GoatBot.config.prefix; } const botName = global.GoatBot.config.nickNameBot || global.GoatBot.config.botName || "Bot"; return message.reply( `โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— โ•‘ ๐ŸŒŸ ๐๐‘๐„๐…๐ˆ๐— ๐ˆ๐๐…๐Ž ๐ŸŒŸ โ•‘ โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ โ•‘ โš™๏ธ ๐’๐ฒ๐ฌ๐ญ๐ž๐ฆ ยป ${global.GoatBot.config.prefix} โ•‘ ๐Ÿ’ฌ ๐†๐ซ๐จ๐ฎ๐ฉ ยป ${p} โ•‘ ๐Ÿ“š ๐”๐ฌ๐š๐ ๐ž ยป ${p}help โ•‘ ๐Ÿค– ๐๐จ๐ญ ยป ${botName} โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•` ); }, onStart: async function ({ api, event, args, threadsData, role }) { const { threadID, messageID } = event; const body = (event.body || "").trim(); if (!body.startsWith(global.GoatBot.config.prefix) && args.length === 0) return; const botName = global.GoatBot.config.nickNameBot || global.GoatBot.config.botName || "Bot"; if (args.length === 0) { let p; try { const d = await threadsData.get(threadID); p = d?.data?.prefix || global.GoatBot.config.prefix; } catch { p = global.GoatBot.config.prefix; } return api.sendMessage( `โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— โ•‘ ๐ŸŒŸ ๐๐‘๐„๐…๐ˆ๐— ๐ˆ๐๐…๐Ž ๐ŸŒŸ โ•‘ โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ โ•‘ โš™๏ธ ๐’๐ฒ๐ฌ๐ญ๐ž๐ฆ ยป ${global.GoatBot.config.prefix} โ•‘ ๐Ÿ’ฌ ๐†๐ซ๐จ๐ฎ๐ฉ ยป ${p} โ•‘ ๐Ÿ“š ๐”๐ฌ๐š๐ ๐ž ยป ${p}help โ•‘ ๐Ÿค– ๐๐จ๐ญ ยป ${botName} โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•`, threadID, messageID ); } if (role < 2) return api.sendMessage("โŒ ๐Ÿ‘‘ ๐Ž๐ง๐ฅ๐ฒ ๐›๐จ๐ญ ๐š๐๐ฆ๐ข๐ง ๐œ๐š๐ง ๐œ๐ก๐š๐ง๐ ๐ž", threadID, messageID); const newPrefix = args[0]; return api.sendMessage( `โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— โ•‘ โš ๏ธ ๐Ÿ”„ ๐‚๐‡๐€๐๐†๐„ ๐๐‘๐„๐…๐ˆ๐— ๐Ÿ”„ โš ๏ธ โ•‘ โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ โ•‘ ๐Ÿ“Œ ๐Ž๐ฅ๐ ยป ${global.GoatBot.config.prefix} โ•‘ โœจ ๐๐ž๐ฐ ยป ${newPrefix} โ•‘ ๐Ÿค– ๐๐จ๐ญ ยป ${botName} โ•‘ โ•‘ ๐Ÿ‘‰ ๐‘๐ž๐š๐œ๐ญ ๐Ÿ˜ ๐š๐ง๐ฒ ๐ž๐ฆ๐จ๐ฃ๐ข โ•‘ ๐Ÿ’– ๐ญ๐จ ๐œ๐จ๐ง๐Ÿ๐ข๐ซ๐ฆ ๐Ÿ’– โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•`, threadID, (err, info) => { global.GoatBot.onReaction.set(info.messageID, { commandName: "prefix", author: event.senderID, newPrefix, threadID }); }, messageID ); }, onReaction: async function ({ api, event, threadsData, Reaction }) { if (Reaction.author!== event.userID) return; const botName = global.GoatBot.config.nickNameBot || global.GoatBot.config.botName || "Bot"; await threadsData.set(Reaction.threadID, Reaction.newPrefix, "data.prefix"); return api.sendMessage( `โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— โ•‘ โœ… ๐ŸŽ‰ ๐‚๐‡๐€๐๐†๐„๐ƒ ๐ŸŽ‰ โœ… โ•‘ โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ โ•‘ ๐Ÿš€ ๐๐ž๐ฐ ๐๐ซ๐ž๐Ÿ๐ข๐ฑ ยป ${Reaction.newPrefix} โ•‘ ๐Ÿค– ๐๐จ๐ญ ยป ${botName} โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•`, Reaction.threadID ); } };