Lynxdecode / HD FOTO - TOOLS HD
Base Code : Plugin Esm Author : Lynx decode - ren Note : credit jangan di hapus hargai pembuat !!, kalau tidak sesuai dengan base kalian, sesuaikan sendiri ya!!
OtherJavaScript
3 views
Base Code : Plugin Esm Author : Lynx decode - ren Note : credit jangan di hapus hargai pembuat !!, kalau tidak sesuai dengan base kalian, sesuaikan sendiri ya!!
/**
* ───「 FEATURE AUTHOR 」───
* 👤 Author : Lynx Decode
* 📞 Contact : +62 882-5804-1396
* 📢 Channel Ofc : https://whatsapp.com/channel/0029VbAnuii6GcGCu73oep1i
* ⚠️ Note : Keep credit to respect the creator!
* ─────────────────────────
* @credit scrape : ren-offc
* @noted²: don't delete the credit !!
* 📝 Plugin: Image Enhancer (HD)
*/
let handler = async (m, { conn, usedPrefix, command }) => {
let q = m.quoted ? m.quoted : m;
let mime = (q.msg || q).mimetype || '';
if (!mime.includes('image')) {
return m.reply(`┌˚₊ ๑│ ᴇ ɴ ʜ ᴀ ɴ ᴄ ᴇ ʀ │๑˚₊ ⚠️\n┇ \n│ ❌ *Format salah!*\n│ \n│ 📌 *Cara pakai:*\n│ Kirim/Reply gambar dengan caption ${usedPrefix + command}\n┇ \n└˚₊ ๑ ────────────── ๑˚₊\n> © ERINE-AI`);
}
await m.react('⏳');
try {
let media = await q.download();
if (!media) throw new Error("Gagal mendownload gambar dari WhatsApp.");
const blob = new Blob([media], { type: 'image/jpeg' });
const form = new FormData();
form.set('method', '1');
form.set('is_pro_version', 'true');
form.set('is_enhancing_more', 'false');
form.set('max_image_size', 'high');
form.set('file', blob, 'image.jpg');
const res = await fetch('https://ihancer.com/api/enhance', {
method: 'POST',
headers: {
'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36',
'Referer': 'https://ihancer.com/app/',
},
body: form,
});
if (!res.ok) {
throw new Error(`Server API Error: ${res.status} ${res.statusText}`);
}
let resultBuffer = Buffer.from(await res.arrayBuffer());
let caption = `┌˚₊ ๑│ ᴇ ɴ ʜ ᴀ ɴ ᴄ ᴇ ʀ │๑˚₊ ✨\n┇ \n│ 📸 *Gambar berhasil diperjelas!*\n┇ \n└˚₊ ๑ ────────────── ๑˚₊\n> © ERINE-AI`;
await conn.sendMessage(m.chat, {
image: resultBuffer,
caption: caption,
contextInfo: {
isForwarded: true,
forwardingScore: 9999,
forwardedNewsletterMessageInfo: {
newsletterJid: "120363400612665352@newsletter",
newsletterName: "🔥 𝙴𝚁𝙸𝙽𝙴-𝙰𝙸 𝙸𝙽𝙵𝙾𝚁𝙼𝙰𝚃𝙸𝙾𝙽",
serverMessageId: -1
}
}
}, { quoted: m });
await m.react('✅');
} catch (error) {
console.error('📍 Error', error);
await m.react('❌');
m.reply(`┌˚₊ ๑│ s ʏ s ᴛ ᴇ ᴍ ᴇ ʀ ʀ ᴏ ʀ │๑˚₊ ❌\n┇ Gagal memproses gambar.\n┇ *Detail:* ${error.message || String(error)}\n└˚₊ ๑ ────────────── ๑˚₊\n> © ERINE-AI`);
}
};
handler.help = ['hd'];
handler.tags = ['tools'];
handler.command = /^hd$/i;
export default handler;