/**
* SSWeb - Screenshot Website Tool
* ©YouzApi by Yuzz Offc
*/
import axios from "axios";
const handler = async (m, { sock, text, reply, usedPrefix }) => {
if (!text) return reply(`*Contoh:* ${usedPrefix}ssweb https://github.com\n*Mode normal:* ${usedPrefix}ssweb https://google.com --no-full`);
let url = text;
let fullPage = true;
if (text.includes('--no-full')) {
fullPage = false;
url = text.replace('--no-full', '').trim();
}
if (!url.startsWith('http')) {
url = 'https://' + url;
}
try {
const response = await axios.get(`https://youzapi.vercel.app/api/tools/ssweb`, {
params: {
url: url,
width: 1280,
height: 720,
fullPage: fullPage,
waitFor: 5000
},
timeout: 30000
});
const data = response.data;
if (!data?.status || !data?.result_url) {
throw new Error(data?.error || "Gagal mengambil screenshot");
}
const caption = `📸 *Screenshot Website*
🌐 *URL:* ${data.input}
📏 *Ukuran:* 1280x720
📄 *Full Page:* ${fullPage ? 'Ya' : 'Tidak'}
⏱️ *Waktu:* ${new Date().toLocaleString('id-ID')}`;
await sock.sendMessage(m.chat, {
image: { url: data.result_url },
caption: caption
}, { quoted: m });
} catch (error) {
console.error(error);
await reply(`❌ *Error:* ${error.response?.data?.error || error.message}`);
}
};
handler.command = ['ssweb', 'screenshot', 'ss'];
handler.help = ['ssweb <url> [--no-full]'];
handler.tags = ['tools'];
handler.limit = true;
export default handler;
// ©YouzApi by Yuzz Offc