{"id":47621874,"url":"https://github.com/devkoriel/dari","last_synced_at":"2026-04-06T10:01:00.998Z","repository":{"id":345232889,"uuid":"1184360280","full_name":"devkoriel/dari","owner":"devkoriel","description":"다리 (Dari) — Real-time Telegram translation bot powered by Claude Haiku","archived":false,"fork":false,"pushed_at":"2026-04-01T00:39:44.000Z","size":8457,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-02T06:23:48.263Z","etag":null,"topics":["anthropic","chinese","claude","korean","python","telegram-bot","translation","whisper"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devkoriel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-17T14:10:13.000Z","updated_at":"2026-04-01T00:39:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devkoriel/dari","commit_stats":null,"previous_names":["devkoriel/dari"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/devkoriel/dari","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkoriel%2Fdari","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkoriel%2Fdari/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkoriel%2Fdari/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkoriel%2Fdari/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devkoriel","download_url":"https://codeload.github.com/devkoriel/dari/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkoriel%2Fdari/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31467985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anthropic","chinese","claude","korean","python","telegram-bot","translation","whisper"],"created_at":"2026-04-01T22:19:14.026Z","updated_at":"2026-04-06T10:01:00.993Z","avatar_url":"https://github.com/devkoriel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/banner.png\" alt=\"Dari Bot — Welcome\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e다리 (Dari)\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eA bridge between languages — real-time Telegram translation bot powered by Claude Haiku\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/devkoriel/dari/actions/workflows/deploy.yml\"\u003e\u003cimg src=\"https://github.com/devkoriel/dari/actions/workflows/deploy.yml/badge.svg\" alt=\"CI/CD\" /\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-3.14-blue\" alt=\"Python 3.14\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/claude-haiku%204.5-blueviolet\" alt=\"Claude Haiku 4.5\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-green\" alt=\"MIT License\" /\u003e\n\u003c/p\u003e\n\n---\n\n**다리** means \"bridge\" in Korean. Dari sits in your Telegram group chat and seamlessly translates every message between participants — preserving context, tone, and nuance across Korean, Chinese, and English.\n\n## Features\n\n| Feature | Description |\n|---------|-------------|\n| **Context-aware** | Rolling buffer of last 20 messages for natural, coherent translations |\n| **Multi-format** | Text, photo captions, voice messages, video notes |\n| **Phrase table** | Instant lookup for common phrases — zero API latency |\n| **Learn mode** | `/learn on` adds pronunciation guides to every translation |\n| **Smart skip** | Detects same-language, emoji-only, and number-only messages |\n| **Long messages** | Up to 10,000 characters with auto-chunking for Telegram's limit |\n| **Flag prefixes** | 🇰🇷 🇹🇼 🇺🇸 flags show source language at a glance |\n| **Webhook mode** | Cloudflare Tunnel for rock-solid 24/7 uptime |\n| **Prompt caching** | Reduced API costs via Anthropic's ephemeral cache |\n| **Voice/Video** | Groq Whisper transcription → translation pipeline |\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `/learn on\\|off` | Toggle pronunciation in translations |\n| `/say \u003cphrase\u003e` | Ask how to say something in your target language |\n| `/teach \u003cword\u003e` | Get cultural context and usage for a word |\n| `/lang \u003ccode\u003e` | Override your target language |\n| `/dday [set DATE NAME]` | Track important dates |\n| `/stats` | Bot statistics (admin only) |\n\n## Quick Start\n\n```bash\ngit clone https://github.com/devkoriel/dari.git\ncd dari\nuv sync\ncp .env.example .env  # Fill in your tokens\nuv run python -m src\n```\n\n### Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `TELEGRAM_BOT_TOKEN` | Yes | From [@BotFather](https://t.me/BotFather) |\n| `ANTHROPIC_API_KEY` | Yes | [Anthropic Console](https://console.anthropic.com/) |\n| `ADMIN_USER_ID` | Yes | Your Telegram user ID |\n| `USER_MAP` | Yes | JSON: `{\"user_id\": \"target_lang\"}` |\n| `CLAUDE_MODEL` | No | Default: `claude-haiku-4-5-20251001` |\n| `GROQ_API_KEY` | No | For voice/video transcription |\n| `WEBHOOK_URL` | No | Webhook domain (e.g. `https://bot.example.com`) |\n| `WEBHOOK_PORT` | No | Default: `8443` |\n\n## Architecture\n\n```\nTelegram ──webhook──▶ Cloudflare Tunnel ──▶ Dari (localhost:8443)\n                                                │\n                                    ┌───────────┼───────────┐\n                                    ▼           ▼           ▼\n                              Claude Haiku  Groq Whisper  JsonStore\n                              (translate)   (transcribe)  (persist)\n```\n\n### Project Structure\n\n```\ndari/\n├── src/\n│   ├── __main__.py       # Entry point\n│   ├── bot.py            # Telegram handlers \u0026 webhook\n│   ├── translator.py     # Claude API, context buffer, phrase table\n│   ├── transcriber.py    # Groq Whisper voice/video transcription\n│   ├── storage.py        # JSON persistence (atomic writes)\n│   ├── config.py         # Environment config\n│   └── quotes.py         # Daily couple quotes\n├── tests/                # 93 tests\n├── deploy/\n│   └── com.koriel.dari.plist\n├── assets/\n│   ├── banner.png\n│   └── avatar.png\n├── .github/workflows/\n│   └── deploy.yml        # CI/CD: lint → test → deploy\n├── pyproject.toml\n└── renovate.json\n```\n\n## CI/CD\n\nFully automated pipeline on every push to `main`:\n\n```\nLint (ruff check + format) → Test (93 tests) → Deploy (Mac mini)\n```\n\nRuns on a self-hosted GitHub Actions runner on the deployment target itself — no external access needed.\n\n## Deployment (macOS)\n\nDari runs as a launchd service with Cloudflare Tunnel for webhook delivery.\n\n```bash\n# Install service\ncp deploy/com.koriel.dari.plist ~/Library/LaunchAgents/\nlaunchctl load ~/Library/LaunchAgents/com.koriel.dari.plist\n\n# Check status\nlaunchctl list | grep dari\ntail -f ~/Library/Logs/dari.log\n```\n\n## Testing\n\n```bash\nuv run python -m pytest tests/ -v\n```\n\n## Cost\n\n| Service | Cost |\n|---------|------|\n| Claude Haiku 4.5 (w/ prompt caching) | ~$1–3/month |\n| Groq Whisper | Free tier |\n| Cloudflare Tunnel | Free |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevkoriel%2Fdari","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevkoriel%2Fdari","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevkoriel%2Fdari/lists"}