Kembali ke katalog plugin
fun
truth
Ambil pertanyaan truth acak untuk permainan truth or dare
Draw a random truth question for truth or dare
plugins/fun/truth.js
Lokasi file di repo kana-md
1
Perintah termasuk alias
1.4 KB
Ukuran file sumber
4/11/2026
Update terakhir, commit 5d6f23b
Daftar perintah
Ketuk tombol salin untuk menyalin perintah, lalu tempel di chat WhatsApp bot KANA.
.truthCara pakai
.truth
Contoh
.truth
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 { TRUTHS } from '../../src/data/fun.js'
import { sendButtons } from '../../src/ui/buttons.js'
export const config = {
name: 'truth',
alias: [],
category: 'fun',
description: { id: 'Ambil pertanyaan truth acak untuk permainan truth or dare', en: 'Draw a random truth question for truth or dare' },
usage: '.truth',
example: '.truth',
cooldown: 3,
}
export const i18n = {
id: {
truth: {
title: 'Truth',
body: 'Waktunya TRUTH! Jujur-jujuran yuk~\n\nā {question}\n\nJawab sejujurnya yaa, tidak boleh ngeles~ {mood}',
dareBtn: 'š Berani Dare?',
truthBtn: 'š¬ Truth Lagi',
footer: 'Truth or Dare KANA',
},
},
en: {
truth: {
title: 'Truth',
body: 'Time for TRUTH!\n\nā {question}\n\nAnswer honestly, no dodging~ {mood}',
dareBtn: 'š Dare Instead?',
truthBtn: 'š¬ Another Truth',
footer: 'KANA Truth or Dare',
},
},
}
export const test = { input: '.truth', expect: /truth/i }
export async function handler(ctx) {
const item = TRUTHS[Math.floor(Math.random() * TRUTHS.length)]
const body = ctx.t('truth.body', { question: item[ctx.lang] ?? item.id, mood: ctx.say('senang') })
return sendButtons(ctx.sock, ctx.chat, {
title: ctx.t('truth.title'),
body,
footer: ctx.t('truth.footer'),
replies: [
{ text: ctx.t('truth.dareBtn'), id: '.dare' },
{ text: ctx.t('truth.truthBtn'), id: '.truth' },
],
textFallback: body,
})
}
