Kembali ke katalog plugin
fun
cekpintar
Cek persen kepintaran versi iseng KANA, buat hiburan
Check your smartness percent the playful KANA way, just for fun
plugins/fun/cekpintar.js
Lokasi file di repo kana-md
1
Perintah termasuk alias
2.7 KB
Ukuran file sumber
4/11/2026
Update terakhir, commit 44f4010
Daftar perintah
Ketuk tombol salin untuk menyalin perintah, lalu tempel di chat WhatsApp bot KANA.
.cekpintarCara pakai
.cekpintar
Contoh
.cekpintar
Kode sumber plugin
Cara pasang: simpan file ini ke folder plugins/fun/ di bot KANA kamu, lalu restart bot. Pemilik source code lain bisa mengambil update plugin terbaru dari halaman ini kapan saja.
import { sendButtons } from '../../src/ui/buttons.js'
import { wibDateString } from '../../src/services/user-service.js'
export const config = {
name: 'cekpintar',
alias: [],
category: 'fun',
description: { id: 'Cek persen kepintaran versi iseng KANA, buat hiburan', en: 'Check your smartness percent the playful KANA way, just for fun' },
usage: '.cekpintar',
example: '.cekpintar',
cooldown: 3,
}
// Hash deterministik kecil jadi persen 0 sampai 100 (duplikasi disengaja,
// sama seperti di cekmood, supaya plugin tetap mandiri satu file).
export function hashPercent(seed) {
let h = 0
const s = String(seed ?? '')
for (let i = 0; i < s.length; i++) h = (h * 31 + s.charCodeAt(i)) >>> 0
return h % 101
}
export const i18n = {
id: {
cekpintar: {
title: 'Cek Pintar ๐ง ',
result: 'Kepintaran {name} versi KANA hari ini: {percent}%!\n{comment}\n\n{disclaimer}',
low: 'Otaknya lagi loading yaa... tidur cukup dulu, besok pasti lebih ngebut~ ๐ดโจ',
mid: 'Cukup pintar kok, apalagi kalau lagi fokus beneran~ ๐',
high: 'Pintar nih! Ide-ide kamu hari ini layak didengerin~ (โงโฝโฆ)',
max: 'Level jenius terdeteksi! KANA sampai kagum nih~ ๐๐',
disclaimer: 'Ini cuma hiburan yaa, persen iseng ini bukan tes IQ dan bukan ukuran pintar beneran~',
btnAgain: 'Cek Lagi',
btnMenu: 'Menu Fun',
},
},
en: {
cekpintar: {
title: 'Smart Check ๐ง ',
result: '{name} smartness, KANA version, today: {percent}%!\n{comment}\n\n{disclaimer}',
low: 'Your brain is still loading... get enough sleep first, tomorrow will be faster~ ๐ดโจ',
mid: 'Smart enough, especially when you truly focus~ ๐',
high: 'You are sharp! Your ideas today are worth hearing~ (โงโฝโฆ)',
max: 'Genius level detected! Even KANA is impressed~ ๐๐',
disclaimer: 'This is just for fun, this playful percent is not an IQ test and not a real measure of intelligence~',
btnAgain: 'Check Again',
btnMenu: 'Fun Menu',
},
},
}
export const test = { input: '.cekpintar', expect: /kepintaran/i }
export async function handler(ctx) {
const percent = hashPercent(`${ctx.senderDigits}:smart:${wibDateString()}`)
const band = percent < 30 ? 'low' : percent < 60 ? 'mid' : percent < 85 ? 'high' : 'max'
const body = ctx.t('cekpintar.result', {
name: ctx.pushName || ctx.senderDigits,
percent,
comment: ctx.t(`cekpintar.${band}`),
disclaimer: ctx.t('cekpintar.disclaimer'),
})
return sendButtons(ctx.sock, ctx.chat, {
title: ctx.t('cekpintar.title'),
body,
footer: ctx.t('menu.footer'),
replies: [
{ text: ctx.t('cekpintar.btnAgain'), id: '.cekpintar' },
],
textFallback: body,
})
}
