Kembali ke Beranda
Gistify Snippet
fakebca.jsjavascript
130 baris| 1 | /** |
| 2 | ✧ Name : fake bca |
| 3 | ✧ Creator : Rin imup lucu🤤 |
| 4 | ✧ Category : Canvas |
| 5 | ✧ Link sumber : https://whatsapp.com/channel/0029Vb6EHtR5Ui2gHMW9zX2x |
| 6 | ✧ *Note* : Jangan hapus wm ya hargai dari sumber share nya,gak mudah buat canvas jangan seenak nya copy terus hapus credit ketauan hapus ? liat aja mata" gw banyak nanti viral😂 |
| 7 | **/ |
| 8 | |
| 9 | |
| 10 | import fetch from 'node-fetch'; |
| 11 | import { createCanvas, loadImage, GlobalFonts } from '@napi-rs/canvas'; |
| 12 | import { writeFile, mkdir, unlink } from 'node:fs/promises'; |
| 13 | import { existsSync } from 'node:fs'; |
| 14 | import { join } from 'node:path'; |
| 15 | |
| 16 | let handler = async (m, { conn, text, command }) => { |
| 17 | if (!text) { |
| 18 | return m.reply( |
| 19 | `*Format salah!*\n\nContoh penggunaan:\n.${command} RIN IMUP|111 - 222 - 3333|1,000,000` |
| 20 | ); |
| 21 | } |
| 22 | |
| 23 | const [namaPayload, rekPayload, saldoPayload] = text.split('|'); |
| 24 | if (!namaPayload || !rekPayload || !saldoPayload) { |
| 25 | return m.reply( |
| 26 | `*Format salah!*\n\nPastikan menggunakan pemisah tanda garis (|)\nContoh:\n.${command} RIN IMUP|111 - 222 - 3333|1,000,000` |
| 27 | ); |
| 28 | } |
| 29 | |
| 30 | const txtNama = namaPayload.trim().toUpperCase(); |
| 31 | const txtRek = rekPayload.trim(); |
| 32 | const txtSaldo = saldoPayload.trim(); |
| 33 | |
| 34 | try { |
| 35 | await m.reply("⏳ Memproses gambar Fake bca..."); |
| 36 | |
| 37 | const BG_URL = 'https://raw.githubusercontent.com/ryyntwx/allimagerin/refs/heads/main/F1.png'; |
| 38 | const ASSETS_DIR = join(process.cwd(), 'assets', 'bcadash'); |
| 39 | const FONTS_DIR = join(ASSETS_DIR, 'fonts'); |
| 40 | const BG_LOCAL = join(ASSETS_DIR, 'template_f1.png'); |
| 41 | const TMP_DIR = join(process.cwd(), 'tmp'); |
| 42 | |
| 43 | await mkdir(FONTS_DIR, { recursive: true }); |
| 44 | await mkdir(TMP_DIR, { recursive: true }); |
| 45 | |
| 46 | const fontConfigs = [ |
| 47 | { url: 'https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLEj6Z1xlFQ.woff2', name: 'Poppins-SemiBold.ttf', family: 'PoppinsBca' }, |
| 48 | { url: 'https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI6fAZ9hiJ-Ek-_EeA.woff2', name: 'Inter-Medium.ttf', family: 'InterMediumBca' }, |
| 49 | { url: 'https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYAZ9hiJ-Ek-_EeA.woff2', name: 'Inter-Bold.ttf', family: 'InterBoldBca' } |
| 50 | ]; |
| 51 | |
| 52 | for (const f of fontConfigs) { |
| 53 | const fPath = join(FONTS_DIR, f.name); |
| 54 | if (!existsSync(fPath)) { |
| 55 | const fRes = await fetch(f.url); |
| 56 | const arrayBuffer = await fRes.arrayBuffer(); |
| 57 | await writeFile(fPath, Buffer.from(arrayBuffer)); |
| 58 | } |
| 59 | GlobalFonts.registerFromPath(fPath, f.family); |
| 60 | } |
| 61 | |
| 62 | if (!existsSync(BG_LOCAL)) { |
| 63 | const res = await fetch(BG_URL); |
| 64 | const arrayBuffer = await res.arrayBuffer(); |
| 65 | await writeFile(BG_LOCAL, Buffer.from(arrayBuffer)); |
| 66 | } |
| 67 | |
| 68 | const bgImg = await loadImage(BG_LOCAL); |
| 69 | const canvas = createCanvas(bgImg.width, bgImg.height); |
| 70 | const ctx = canvas.getContext('2d'); |
| 71 | ctx.drawImage(bgImg, 0, 0, canvas.width, canvas.height); |
| 72 | |
| 73 | ctx.save(); |
| 74 | ctx.globalAlpha = 0.003; |
| 75 | ctx.fillStyle = "#FFFFFF"; |
| 76 | ctx.font = "700 24px InterBoldBca"; |
| 77 | ctx.rotate(-25 * Math.PI / 180); |
| 78 | for (let y = -200; y < 1200; y += 280) { |
| 79 | for (let x = -300; x < 1200; x += 400) { |
| 80 | ctx.fillText( |
| 81 | Buffer.from(["Unlubk1k"].join(""), "base64").toString(), |
| 82 | x, |
| 83 | y |
| 84 | ); |
| 85 | } |
| 86 | } |
| 87 | ctx.restore(); |
| 88 | |
| 89 | ctx.textAlign = 'left'; |
| 90 | ctx.textBaseline = 'top'; |
| 91 | |
| 92 | // nama user di becea💦 |
| 93 | ctx.fillStyle = '#FFFFFF'; |
| 94 | ctx.font = `600 27px PoppinsBca`; |
| 95 | ctx.fillText(txtNama, 127, 56); |
| 96 | |
| 97 | // Nomor Rekening 💦 |
| 98 | ctx.fillStyle = '#FFFFFF'; |
| 99 | ctx.font = `500 28px InterMediumBca`; |
| 100 | ctx.fillText(txtRek, 211, 219); |
| 101 | |
| 102 | // Ukuran Saldo🤤 |
| 103 | ctx.fillStyle = '#4F4F4F'; |
| 104 | ctx.font = `700 43px InterBoldBca`; |
| 105 | ctx.fillText(txtSaldo, 156, 361); |
| 106 | |
| 107 | const outPath = join(TMP_DIR, `bca-${Date.now()}.png`); |
| 108 | await writeFile(outPath, await canvas.encode('png')); |
| 109 | |
| 110 | await conn.sendFile( |
| 111 | m.chat, |
| 112 | outPath, |
| 113 | 'bca.png', |
| 114 | `✅ *FAKE BCA BERHASIL*\n\n👤 *Nama:* ${txtNama}\n💳 *No. Rek:* ${txtRek}\n💰 *Saldo:* Rp ${txtSaldo}`, |
| 115 | m |
| 116 | ); |
| 117 | |
| 118 | if (existsSync(outPath)) await unlink(outPath); |
| 119 | |
| 120 | } catch (err) { |
| 121 | console.error(err); |
| 122 | m.reply("❌ Gagal membuat gambar fake BCA\n\n" + err.message); |
| 123 | } |
| 124 | }; |
| 125 | |
| 126 | handler.help = ['fakebca <nama>|<norek>|<saldo>']; |
| 127 | handler.tags = ['maker']; |
| 128 | handler.command = ['fakebca']; |
| 129 | export default handler; |
| 130 | |
Diskusi & Komentar0
Belum ada komentar — jadilah yang pertama memberikan masukan atau diskusi kode.
Masuk dengan akun GitHub untuk menulis komentar dan berdiskusi.