Created
December 6, 2025 05:01
-
-
Save mifyow/0378b138de462bc116f383e7ea2014cd to your computer and use it in GitHub Desktop.
gada deskripsi ygy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fetch from 'node-fetch'; | |
| import FormData from 'form-data'; | |
| async function uploadUguu(buffer) { | |
| const form = new FormData(); | |
| form.append('files[]', buffer, `${Date.now()}.jpg`); | |
| const res = await fetch("https://uguu.se/upload.php", { method: "POST", body: form }); | |
| const json = await res.json(); | |
| if (!json.success) throw new Error("Upload gagal"); | |
| return json.files[0].url; | |
| } | |
| let handler = async (m, { conn, args, usedPrefix, command }) => { | |
| try { | |
| if (args.length < 2) | |
| return m.reply(`Contoh:\n${usedPrefix + command} mif haloo`); | |
| await conn.sendMessage(m.chat, { react: { text: "⏳", key: m.key } }); | |
| let q = m.quoted ? m.quoted : m; | |
| let mime = q.mimetype || ""; | |
| if (!/image/.test(mime)) { | |
| await conn.sendMessage(m.chat, { react: { text: "❌", key: m.key } }); | |
| return m.reply("Reply gambar nya"); | |
| } | |
| let buffer = await q.download(); | |
| let ppurl = await uploadUguu(buffer); | |
| let username = args.shift(); | |
| let caption = args.join(" "); | |
| let api = `https://api.zenzxz.my.id/api/maker/fakestory?username=${encodeURIComponent(username)}&caption=${encodeURIComponent(caption)}&ppurl=${encodeURIComponent(ppurl)}`; | |
| let r = await fetch(api); | |
| let img = Buffer.from(await r.arrayBuffer()); | |
| await conn.sendMessage(m.chat, { image: img }, { quoted: m }); | |
| await conn.sendMessage(m.chat, { react: { text: "✔️", key: m.key } }); | |
| } catch (e) { | |
| await conn.sendMessage(m.chat, { react: { text: "❌", key: m.key } }); | |
| m.reply(String(e)); | |
| } | |
| }; | |
| handler.help = ['fakestory <username> <caption>']; | |
| handler.command = ['fakestory']; | |
| handler.tags = ['maker']; | |
| export default handler; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment