Telegram bot that helps English-speaking Bali expats practice Bahasa Indonesia through scenario-driven role-play with text + voice, Claude-powered conversation partners, and Haiku-powered grammar/pronunciation corrections.
- Node 20 + TypeScript (ESM, NodeNext)
- grammY (Telegram), Mongoose + Typegoose (MongoDB)
- Anthropic Claude Sonnet 4.6 (character) + Haiku 4.5 (corrections)
- Deepgram nova-3 (STT) + Google Cloud TTS (id-ID-Wavenet-A)
- Telegram Stars for monetization
- Copy
.env.example→.envand fill values. - Place Google Cloud service-account JSON at
./secrets/gcp-tts.json. docker compose up -d.- Talk to the bot.
TELEGRAM_BOT_TOKENANTHROPIC_API_KEYDEEPGRAM_API_KEYMONGODB_URIGOOGLE_APPLICATION_CREDENTIALS(path)ADMIN_TELEGRAM_IDS(comma-separated)
npm install
npm run dev # tsx watch
npm test # node:test + mongodb-memory-server
npm run typecheck/start— welcome/menu— main menu (inline)/scenarios— pick a scenario/quiz— vocabulary quiz (audio + native quiz polls), free & unlimited/end— end current scenario/subscribe— Stars subscription/lang— switch interface language (en/ru)/stats— admin only
Quiz content is generated offline from The Indonesian Way Anki decks.
- Install ffmpeg (
brew install ffmpeg). - Put the 8
.apkgfiles in.cache/anki/module-1.apkg…module-8.apkg(or setdeckIds inscripts/anki-decks.config.tsto attempt auto-download). npm run prep:anki→ writescontent/quiz/*.yaml+content/quiz/audio/*.ogg.- Commit
content/quiz/. The bot loads it at startup; audiofile_ids are cached in Mongo on first send.