bot.onText(/^(\.|\#|\/)buathtml(?:\s+(.+))?$/, async (msg, match) => {
const chatId = msg.chat.id;
const userId = msg.from.id.toString();
const reply = msg.reply_to_message; // pesan yang direply
const targetMessageId = reply ? reply.message_id : msg.message_id;
// โ
Cek apakah user adalah Owner
if (userId !== owner) {
return bot.sendMessage(chatId, "โ Akses ditolak! Hanya owner yang dapat menggunakan perintah ini.", {
reply_to_message_id: targetMessageId,
reply_markup: {
inline_keyboard: [
[{ text: "HUBUNGI ADMIN", url: "https://t.me/GyzenOfficial" }]
]
}
});
}
// โ
Ambil input dari user
const inputText = (match[2] || '').trim() || (reply && reply.text);
if (!inputText) {
return bot.sendMessage(chatId, `Contoh:\n/buathtml halaman login dengan form username dan password\n/buathtml halaman landing page produk VPS`, {
reply_to_message_id: targetMessageId
});
}
if (!googleApiKey || googleApiKey === "ISI_TOKEN_GEMINI_LU") {
return bot.sendMessage(chatId, "โ API Key untuk Google AI belum diatur.", {
reply_to_message_id: targetMessageId
});
}
await bot.sendMessage(chatId, `โณ Sedang membuat HTML sesuai permintaan:\n"${inputText}"`, {
reply_to_message_id: targetMessageId
});
try {
const ai = new genAI.GoogleGenerativeAI(googleApiKey);
const model = ai.getGenerativeModel({ model: "gemini-2.0-flash" });
const prompt = `
Kamu adalah AI khusus pembuat kode untuk website.
Buat kode HTML lengkap (boleh termasuk CSS dan JS inline jika diperlukan) sesuai permintaan user:
"${inputText}"
Aturan:
- Hanya tampilkan kode HTML/CSS/JS tanpa tanda kutip tambahan.
- Jangan berikan penjelasan.
- Pastikan hasil dapat langsung digunakan di file .html.
`;
const result = await model.generateContent(prompt);
const response = await result.response;
let textResult = response.text();
const cleanResult = textResult.replace(/[\w]*\n?/g, '').replace(/
await bot.sendMessage(chatId, `โ
*Kode HTML berhasil dibuat!*\n\n\`\`\`html\n${cleanResult}\n\`\`\`\nแดสแดแดแดแดแด
สส สแดแดแดsแดสแดษดษขสแดสss`, {
reply_to_message_id: targetMessageId,
parse_mode: "MarkdownV2"
});
} catch (err) {
console.error('BuatHTML AI Error:', err);
await bot.sendMessage(chatId, `โ Gagal membuat HTML: ${err.message}`, {
reply_to_message_id: targetMessageId
});
}
});Feature: Buat Html Via Ai/Bot
Source Code: kecubung
ยฉ 2025 แ Kecubung โฐ
๐ฅ2๐ฅฐ1๐1
NEED CH YG SUKA SHARE SHARE SC, FUNC, HTML DLL? MASUK CH DI BAWAH BOY ๐
https://t.me/ALFA_CUMUNITY
ยป mau base join sini
ยป mau function new join sini
ยป all gw share disini
ยป out? Rugi banget lek
โค2๐ฅ1๐คฉ1
This media is not supported in your browser
VIEW IN TELEGRAM
Colab sama pelenger @strom_primrose
โก1
This media is not supported in your browser
VIEW IN TELEGRAM
FORCLOSE NEW
FUNCTION EXOTICS
storan patner func
join patner func pv: @TopFlory
