badge.js
badge pada pesan WhatsApp
JSJavaScriptPublicPluginsTanpa lisensiBaileys2 file · 108 baris · 28.3 KBDiperbarui 29 Okt 2026104 views
https://codeku.itsuki-nakano.my.id/repo/joootzyh/badge-jscurl -s https://codeku.itsuki-nakano.my.id/raw/joootzyh/badge-jsINFO BOT
- Nama bot
- Lulli Bot
- Platform
- Baileys
FILES
badge.js · javascript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import {
downloadContentFromMessage as e
} from "@whiskeysockets/baileys";
function t(e) {
return String(e || "").split(":")[0].split("@")[0].replace(/\D/g, "")
}
export default {
run: async (a, s) => {
const n = a.chat,
o = String(a.text || "").trim().toLowerCase();
if (/^(on|off|status)$/.test(o)) {
const e = function(e) {
global.db.setting = global.db.setting || {};
const a = e?.user?.jid || e?.user?.id || "",
s = t(a),
n = Object.keys(global.db.setting).find(e => t(e) === s) || a;
return global.db.setting[n] = global.db.setting[n] || {}, global.db.setting[n]
}(s);
"on" === o ? e.autobadge = !0 : "off" === o && (e.autobadge = !1);
const d = !1 === e.autobadge ? "OFF" : "ON",
g = "status" === o ? `ℹ️ *Auto Badge:* ${d}` : `✅ *Auto Badge ${d}*\nPengaturan hanya berlaku untuk bot ini.`;
return s.sendMessage(n, {
text: g
}, {
quoted: a
})
}
let d = !1,
g = null;
if (!a.quoted || "stickerMessage" !== a.quoted.mtype && "stickerMessage" !== a.quoted.type ? a.quoted?.message?.stickerMessage && (d = !0, g = a.quoted.message.stickerMessage) : (d = !0, g = a.quoted.msg || a.quoted.message?.stickerMessage || a.quoted), !d && a.message?.extendedTextMessage?.contextInfo?.quotedMessage?.stickerMessage && (d = !0, g = a.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage), !d) return s.sendMessage(n, {
text: "❌ Reply sebuah stiker untuk mengganti badge.\n\nPengaturan: .badge on / off / status"
}, {
quoted: a
});
await s.sendReact(n, "⏱️", a.key).catch(() => {});
try {
let t;
if (a.quoted && "function" == typeof a.quoted.download) t = await a.quoted.download();
else {
const a = await e(g, "sticker"),
s = [];
for await (const e of a) s.push(e);
t = Buffer.concat(s)
}
if (!t?.length) throw new Error("Gagal mengunduh file stiker.");
const o = g?.isAnimated || a.quoted?.isAnimated || !1;
global.db.badge = {
buffer: t.toString("base64"),
isAnimated: o,
updatedAt: Date.now()
}, await s.sendReact(n, "✅", a.key).catch(() => {}), await s.sendMessage(n, {
text: `✅ *Badge berhasil diganti!*\n\n*Tipe:* ${o?"Animasi 🎞️":"Statis 🖼️"}\n*Ukuran:* ${(t.length/1024).toFixed(1)} KB\n\nPengaturan Auto Badge: .badge on / off / status`
}, {
quoted: a
})
} catch (e) {
console.error("[badge] Error:", e), await s.sendReact(n, "❌", a.key).catch(() => {}), await s.sendMessage(n, {
text: `❌ Gagal menyimpan badge: ${e.message}`
}, {
quoted: a
})
}
},
cmd: "badge",
use: "(reply stiker) / on / off / status",
type: "owner",
owner: !0,
location: "plugins/owner/badge.js"
};
}PLAYGROUND
Siap
Klik Jalankan untuk melihat output.
Kode berjalan di kotak terisolasi di browser kamu. Tidak punya akses ke cookie, akun, atau server NAKANO CODE, dan tidak bisa membuka koneksi internet. Batas waktu 4 detik. Kode bot yang memanggil library WhatsApp (seperti Baileys) tidak bisa jalan di sini.