const axios = require("axios"); const fs = require("fs"); const path = require("path"); const baseApiUrl = async () => { const base = await axios.get("https://raw.githubusercontent.com/mahmudx7/HINATA/main/baseApiUrl.json"); return base.data.mahmud; }; /** * @author Aizen * @author: do not delete it */ module.exports = { config: { name: "stonk", version: "1.7", author: "ajmaul", role: 0, category: "fun", cooldown: 10, guide: "stonk [mention-reply-UID]", }, onStart: async function ({ api, event, args }) { let id2 = messageReply?.senderID || Object.keys(mentions)[0] || args[0]; if (!id2) return api.sendMessage("Mention, reply, or provide UID of the target.", threadID, messageID); try { const url = `${await baseApiUrl()}/api/dig?type=stonk&user=${id2}`; const img = await axios.get(url, { responseType: "arraybuffer" }); const file = path.join(__dirname, `stonk_${id2}.png`); fs.writeFileSync(file, img.data); api.sendMessage({ body: "Effect stonk successful 📈", attachment: fs.createReadStream(file) }, threadID, () => fs.unlinkSync(file), messageID); } catch { api.sendMessage("🥹 Error, contact Aizen.", threadID, messageID); } } };