← back to browse
goat command

hentai

Send safe cute anime illustration

0
views
0
likes
0
installs
raw source
const fs = require("fs-extra");
const path = require("path");
const https = require("https");
const axios = require("axios");

module.exports = {
  config: {
    name: "hentai",
    version: "1.0",
    author: "ARIYAN ",
    countDown: 5,
    role: 0,
    shortDescription: { en: "Send safe cute anime illustration" },
    longDescription: { en: "Fetches safe (non-R18) anime images from lolicon API" },
    category: "fun",
    guide: { en: "+hentai" }
  },

  onStart: async function ({ api, event, args, message, usersData }) {
    // ==========================================
    // 👑 VIP CHECK LOGIC
    // ==========================================
    const uid = event.senderID;
const userData = await usersData.get(uid);

const vipExpires = Number(userData?.data?.vip?.expires || 0);

// Permanent VIP হলে expires = 0
const isPermanentVIP = userData?.data?.vip?.expires === 0;

// Temporary VIP হলে expiry এখনো শেষ হয়নি
const isTempVIP = vipExpires > Date.now();

if (!isPermanentVIP && !isTempVIP) {
      return message.reply(
        "তুই গরিব 🦆 " +
        "গরিব মানুষ এগুলো ব্যবহার করতে পারে না" +
        " ধনের মালিক হতে চাইলে টাইপ /VIP"
      );
    }
    // ==========================================
    try {
      const res = await axios.post("https://api.lolicon.app/setu/v2", {
        r18: 0,
        num: 1
      });

      if (!res.data || !res.data.data || res.data.data.length === 0) {
        return message.reply("❌ কোনো ছবি পাওয়া যায়নি।");
      }

      const imageUrl = res.data.data[0].urls.original || res.data.data[0].urls.regular;
      const filePath = path.join(__dirname, "cache/hentai.jpg");

      const file = fs.createWriteStream(filePath);
      https.get(imageUrl, resImg => {
        resImg.pipe(file);
        file.on("finish", () => {
          const caption = `
✨ 𝓒𝓾𝓽𝓮 𝓗𝓮𝓷𝓽𝓪𝓲 𝓑𝓪𝓫𝔂 ✨
          `;
          message.reply({
            body: caption.trim(),
            attachment: fs.createReadStream(filePath)
          });
        });
      }).on("error", () => {
        message.reply("❌ ছবি ডাউনলোডে সমস্যা হয়েছে।");
      });

    } catch {
      message.reply("❌ ছবি আনতে সমস্যা হয়েছে।");
    }
  }
};

View raw file