const axios = require("axios"); const fs = require("fs"); const path = require("path"); module.exports = { config: { name: "hotvideo", aliases: ["hotvideo"], version: "1.0", author: "badhon-bbz", countDown: 5, role: 0, category: "media", guide: { en: "{pn}" }, description: "Send hotvideo image" }, onStart: async function ({ message }) { const imageUrl = "https://i.imgur.com/AnA5Hrg.jpeg"; const cacheDir = path.resolve(process.cwd(), "cache"); if (!fs.existsSync(cacheDir)) { fs.mkdirSync(cacheDir, { recursive: true }); } const filePath = path.resolve( cacheDir, "hotvideo.jpg" ); try { const response = await axios.get(imageUrl, { responseType: "arraybuffer", timeout: 30000, headers: { "User-Agent": "Mozilla/5.0" } }); fs.writeFileSync(filePath, response.data); if (!fs.existsSync(filePath)) { throw new Error("Image file not found"); } await message.reply({ attachment: fs.createReadStream(filePath) }); setTimeout(function () { try { if (fs.existsSync(filePath)) { fs.unlinkSync(filePath); } } catch (e) { console.log("Cleanup error:", e.message); } }, 10000); } catch (error) { console.error("HOTVIDEO ERROR:", error); try { if (fs.existsSync(filePath)) { fs.unlinkSync(filePath); } } catch (e) {} return message.reply("❌ ছবি পাঠানো যায়নি।"); } } };