// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const fs = require("fs"); const path = require("path"); module.exports = { config: { name: "pastebin", aliases: ["bin"], version: "1.0.1", author: "ā€”ĶžšŹ€ÉŖį“į“‡Ģ", role: 0, category: "tool", guide: "{pn} " }, onStart: async function ({ api, event, args }) { const { threadID, messageID } = event; const name = args[0]; if (!name) { return api.sendMessage( "šŸŒøšŸ’« š‘¶š’‘š’”! š‘­š’Šš’š’† š‘µš’‚š’Žš’† š‘µš’†š’†š’…š’†š’… šŸ’«šŸŒø\n" + "šŸ“ š‘¼š’”š’† : pastebin ", threadID, messageID ); } const filePath = path.join(__dirname, `${name}.js`); if (!fs.existsSync(filePath)) { return api.sendMessage( "āŒ š‘­š’Šš’š’† š‘µš’š’• š‘­š’š’–š’š’…\n" + `šŸ“ š‘­š’Šš’š’† : ${name}.js`, threadID, messageID ); } try { const code = fs.readFileSync(filePath, "utf8"); const response = await axios.post( "https://api.pastes.dev/post", code, { headers: { "Content-Type": "text/javascript", "User-Agent": "GoatBot-Pastebin-Command" }, maxBodyLength: Infinity, maxContentLength: Infinity, validateStatus: status => status >= 200 && status < 300 } ); let pasteKey; if (typeof response.data === "string") { try { const json = JSON.parse(response.data); pasteKey = json?.key; } catch { pasteKey = response.data.trim(); } } else { pasteKey = response.data?.key; } if (!pasteKey) { const location = response.headers?.location || response.headers?.Location; if (location) { pasteKey = location.split("/").pop(); } } if (!pasteKey) { return api.sendMessage( "āŒ š‘¼š’‘š’š’š’‚š’… š‘­š’‚š’Šš’š’†š’…!", threadID, messageID ); } const rawURL = `https://api.pastes.dev/${pasteKey}`; const msg = "╭━━━〔 šŸ’Ž š‘·š‘Øš‘ŗš‘»š‘¬ š‘©š‘°š‘µ šŸ’Ž 〕━━━╮\n" + "ā”ƒ\n" + `ā”ƒ šŸ“ š‘­š’Šš’š’† : ${name}.js\n` + "ā”ƒ ✨ š‘ŗš’•š’‚š’•š’–š’” : š‘¼š’‘š’š’š’‚š’…š’†š’…\n" + "ā”ƒ\n" + `ā”ƒ šŸ”— š‘¹š’‚š’˜ : ${rawURL}\n` + "ā”ƒ\n" + "╰━━━━━━━━━━━━━━━━━━━━━━╯"; return api.sendMessage( msg, threadID, messageID ); } catch (error) { const status = error?.response?.status; return api.sendMessage( status ? `āŒ š‘¼š’‘š’š’š’‚š’… š‘­š’‚š’Šš’š’†š’…!\nāš ļø š‘Æš‘»š‘»š‘· : ${status}` : "āŒ š‘·š’‚š’”š’•š’† š‘Øš‘·š‘° š‘¬š’“š’“š’š’“!", threadID, messageID ); } } };