Logo OmniDevvKANA Web
Masuk
Kembali ke katalog plugin

fun

bola8

Tanya bola ajaib 8 untuk jawaban acak seru

Ask the magic 8 ball for a fun random answer

plugins/fun/bola8.js

Lokasi file di repo kana-md

2

Perintah termasuk alias

3.2 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.

.bola8.8ball

Cara pakai

.bola8 <pertanyaan>

Contoh

.bola8 apakah hari ini beruntung?

Kode sumber plugin

Unduh .js

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'

export const config = {
  name: 'bola8',
  alias: ['8ball'],
  category: 'fun',
  description: { id: 'Tanya bola ajaib 8 untuk jawaban acak seru', en: 'Ask the magic 8 ball for a fun random answer' },
  usage: '.bola8 <pertanyaan>',
  example: '.bola8 apakah hari ini beruntung?',
  cooldown: 3,
}

export const i18n = {
  id: {
    bola8: {
      usage: 'Tulis pertanyaannya dulu yaa, contoh: .bola8 apakah hari ini beruntung?~ ๐Ÿ”ฎ',
      title: 'Bola Ajaib KANA ๐Ÿ”ฎ',
      answer: 'Pertanyaan: {question}\nJawaban bola ajaib: {answer} โœจ\n\n{disclaimer}',
      disclaimer: 'Catatan kecil: ini cuma hiburan yaa, jangan dijadiin keputusan hidup~ (โ‰งโ–ฝโ‰ฆ)',
      btnAgain: 'Tanya Lagi',
      btnMenu: 'Menu Fun',
      answers: [
        'Iyaa, pasti itu~ โœจ',
        'Kayaknya sih iya, bintang-bintang setuju~ ๐ŸŒŸ',
        'Hmm, tanda-tandanya bagus, lanjut aja~ ๐Ÿ’–',
        'Bola ajaib bilang: gas, jangan ragu~ (โ€ขฬ€แด—โ€ขฬ)ูˆ',
        'Bisa jadi... tapi tanya hatimu juga ya~ ๐ŸŒธ',
        'Kaboel, eh maksudnya kabur jawabannya, coba tanya lagi nanti~ ๐Ÿ’ญ',
        'Sstt, bola ajaib lagi ngantuk, jawabannya belum jelas~ ๐Ÿ˜ด',
        'Kayaknya belum waktunya deh~ โณ',
        'Hmm, peluangnya tipis nih... (โ•ฅ๏นโ•ฅ)',
        'Bola ajaib geleng-geleng: nggak dulu yaa~ ๐Ÿ™ˆ',
        'Jangan deh, kata bola ajaib mending cari jalan lain~ โœจ',
        'Ehh, jawabannya: ntar dulu, pikir lagi baik-baik~ ๐Ÿค”',
      ],
    },
  },
  en: {
    bola8: {
      usage: 'Write your question first, example: .bola8 will today be lucky?~ ๐Ÿ”ฎ',
      title: 'KANA Magic Ball ๐Ÿ”ฎ',
      answer: 'Question: {question}\nMagic ball says: {answer} โœจ\n\n{disclaimer}',
      disclaimer: 'Small note: this is just for fun, do not make life decisions from it~ (โ‰งโ–ฝโ‰ฆ)',
      btnAgain: 'Ask Again',
      btnMenu: 'Fun Menu',
      answers: [
        'Yes, definitely~ โœจ',
        'Looks like yes, the stars agree~ ๐ŸŒŸ',
        'Hmm, signs are good, go for it~ ๐Ÿ’–',
        'The magic ball says: go, do not hesitate~ (โ€ขฬ€แด—โ€ขฬ)ูˆ',
        'Could be... but ask your heart too~ ๐ŸŒธ',
        'The answer is hiding in fog, ask again later~ ๐Ÿ’ญ',
        'Shh, the ball is sleepy, the answer is unclear~ ๐Ÿ˜ด',
        'Seems like not the right time yet~ โณ',
        'Hmm, the chances look thin... (โ•ฅ๏นโ•ฅ)',
        'The ball shakes its head: not this time~ ๐Ÿ™ˆ',
        'Better not, the ball suggests another path~ โœจ',
        'Eh, the answer is: wait, think it over first~ ๐Ÿค”',
      ],
    },
  },
}

export const test = { input: '.bola8 apakah hari ini cerah?', expect: /bola ajaib/i }

export async function handler(ctx) {
  const question = ctx.text.trim()
  if (!question) return ctx.reply(ctx.t('bola8.usage'))
  const pool = i18n[ctx.lang]?.bola8?.answers ?? i18n.id.bola8.answers
  const answer = pool[Math.floor(Math.random() * pool.length)]
  const body = ctx.t('bola8.answer', { question, answer, disclaimer: ctx.t('bola8.disclaimer') })
  return sendButtons(ctx.sock, ctx.chat, {
    title: ctx.t('bola8.title'),
    body,
    footer: ctx.t('menu.footer'),
    replies: [
      { text: ctx.t('bola8.btnAgain'), id: `.bola8 ${question.slice(0, 60)}` },
    ],
    textFallback: body,
  })
}