Logo OmniDevvKANA Web
Kembali ke katalog plugin

fun

family100

Kuis Family 100: tebak jawaban paling populer, poin per jawaban

Family 100 quiz: guess the most popular answers, points per answer

plugins/fun/family100.js

Lokasi file di repo kana-md

3

Perintah termasuk alias

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

.family100.family.f100

Cara pakai

.family100 lalu balas pesan pertanyaannya dengan jawabanmu

Contoh

.family100

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 { getSession, startQuiz, bindQuestionMessage } from '../../src/quiz/engine.js'
import { sendButtons } from '../../src/ui/buttons.js'

export const config = {
  name: 'family100',
  alias: ['family', 'f100'],
  category: 'fun',
  description: { id: 'Kuis Family 100: tebak jawaban paling populer, poin per jawaban', en: 'Family 100 quiz: guess the most popular answers, points per answer' },
  usage: '.family100 lalu balas pesan pertanyaannya dengan jawabanmu',
  example: '.family100',
  cooldown: 5,
}

export const i18n = {
  id: {
    family100: {
      title: 'Kuis Family 100',
      intro: '🎉 KUIS FAMILY 100\n\n{question}\n\nAda {count} jawaban populer, total {points} poin. Balas (reply) pesan ini dengan jawabanmu satu-satu. Waktunya {seconds} detik, menyerah pakai .nyerah yaa~ {mood}',
      already: 'Ehh, masih ada kuis {type} yang jalan di chat ini. Selesaikan dulu atau pencet tombol menyerah di bawah yaa~',
      giveUpBtn: '🏳️ Menyerah (.nyerah)',
      menuBtn: '🎲 Menu Fun',
      footer: 'Kuis KANA',
    },
  },
  en: {
    family100: {
      title: 'Family 100 Quiz',
      intro: '🎉 FAMILY 100 QUIZ\n\n{question}\n\nThere are {count} popular answers worth {points} points in total. Reply to this message with your answers one by one. You have {seconds} seconds, give up with .nyerah~ {mood}',
      already: 'Eh, a {type} quiz is still running in this chat. Finish it first or tap the give up button below~',
      giveUpBtn: '🏳️ Give Up (.nyerah)',
      menuBtn: '🎲 Fun Menu',
      footer: 'KANA Quiz',
    },
  },
}

export const test = { input: '.family100', expect: /family 100|kuis/i }

export async function handler(ctx) {
  const existing = await getSession(ctx.storage, ctx.chat)
  if (existing) {
    const body = ctx.t('family100.already', { type: existing.type })
    return sendButtons(ctx.sock, ctx.chat, {
      title: ctx.t('family100.title'),
      body,
      footer: ctx.t('family100.footer'),
      replies: [
        { text: ctx.t('family100.giveUpBtn'), id: '.nyerah' },
      ],
      textFallback: body,
    })
  }
  const { question } = await startQuiz(ctx.storage, ctx.chat, 'family100', {
    lang: ctx.lang,
    startedBy: ctx.senderDigits,
  })
  const body = ctx.t('family100.intro', {
    question: question.text,
    count: question.answersCount,
    points: question.points,
    seconds: 300,
    mood: ctx.say('senang'),
  })
  const sentQuestion = await sendButtons(ctx.sock, ctx.chat, {
    title: ctx.t('family100.title'),
    body,
    footer: ctx.t('family100.footer'),
    replies: [
      { text: ctx.t('family100.giveUpBtn'), id: '.nyerah' },
    ],
    textFallback: body,
  })
  await bindQuestionMessage(ctx.storage, ctx.chat, sentQuestion?.key?.id)
  return sentQuestion
}