Kembali ke Beranda
Gistify Snippet
Feb 16·1 file(s)
Public
Uploaded by Joy MD - Bot | 16/2/2026, 23.17.12
synced from github gist codesnap.js
#tools
codesnap.jsjavascript
39 baris| 1 | /* |
| 2 | * ─────────────────────────── |
| 3 | * 🟢 JOY MD - SOURCE CODE |
| 4 | * ─────────────────────────── |
| 5 | * 👤 Channel : https://shorturl.at/ce5eX |
| 6 | * 📅 Fetched : 16/2/2026, 23.14.04 |
| 7 | * 📂 File : codesnap.js |
| 8 | * ─────────────────────────── |
| 9 | */ |
| 10 | |
| 11 | /** |
| 12 | * @module plugins/tools/codesnap |
| 13 | * @description Generate CodeSnap image from text via FAA API |
| 14 | */ |
| 15 | |
| 16 | let handler = async (m, { conn, text, usedPrefix, command }) => { |
| 17 | if (!text) return m.reply(`Kirim teks code atau reply pesan code.\nContoh: *${usedPrefix + command}* console.log("Hello World")`) |
| 18 | |
| 19 | await m.reply('🎨 _Generating CodeSnap..._') |
| 20 | |
| 21 | try { |
| 22 | const url = `https://api-faa.my.id/faa/codesnap?text=${encodeURIComponent(text)}` |
| 23 | |
| 24 | await conn.sendMessage(m.chat, { |
| 25 | image: { url: url }, |
| 26 | caption: '🎨 *CodeSnap Generator*' |
| 27 | }, { quoted: m }) |
| 28 | |
| 29 | } catch (e) { |
| 30 | console.error('CodeSnap Error:', e) |
| 31 | m.reply('❌ Gagal membuat gambar code.') |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | handler.help = ['codesnap <code>', 'carbon <code>'] |
| 36 | handler.tags = ['tools'] |
| 37 | handler.command = ['codesnap', 'carbon'] |
| 38 | |
| 39 | export default handler |
Diskusi & Komentar0
Belum ada komentar — jadilah yang pertama memberikan masukan atau diskusi kode.
Masuk dengan akun GitHub untuk menulis komentar dan berdiskusi.