Skip to content

Instantly share code, notes, and snippets.

@ONLym22
Created January 1, 2026 06:23
Show Gist options
  • Select an option

  • Save ONLym22/1bae974ecda1c998e7aebfc07bda594d to your computer and use it in GitHub Desktop.

Select an option

Save ONLym22/1bae974ecda1c998e7aebfc07bda594d to your computer and use it in GitHub Desktop.
Uploaded via ONLym Bot
// 📂 Source: JavaScript
case "gemini":
case "gemini-flash":
{
if (!text && !quoted) return xreply(`Contoh:\n${p_c}${command} Tanggal berapa hari ini?\n\nAtau kirim/reply file dengan caption ${p_c}${command} analisis file ini`);
let q = quoted ? quoted : m;
let mime = (q.msg || q).mimetype || "";
let catBoxUrl = "";
if (mime) {
xreact();
let media = await vellia.downloadAndSaveMediaMessage(q);
catBoxUrl = await uploadCatBox(media);
}
let apiUrl = `https://onlym.my.id/ai/gemini-flash?text=${Enc(text || "analisis file ini")}&apikey=${global.onlym}`;
if (catBoxUrl) {
apiUrl += `&url=${Enc(catBoxUrl)}`;
}
apiUrl += `&gemini_key=${global.geminiToken}`;
let res = await fetchJson(apiUrl);
if (!res.status) return xreply("Gagal mendapatkan respon AI");
xreply(res.result);
}
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment