Async service providing a Telegram Bot (@LoglanBot) and Web Dictionary for the Loglan constructed language.
Built with Python 3.12+, Quart, Hypercorn, SQLAlchemy 2.0 (AsyncIO), Loglan-Core, and pyTelegramBotAPI.
- Telegram Bot:
- Direct translation of Loglan words to English and vice-versa.
- Commands
/log(search by Loglan word) and/gle(search by English key). - Interactive inline keyboards for navigating word parents, complexes, and affixes (djifoa).
- Secure webhook handler with secret token validation.
- Loglan-Online Web Interface:
- Interactive dictionary search with case-sensitivity and edition/event filters.
- Proxy reader for Loglan texts, articles, and columns with automated caching.
- Clean HTML exports and responsive Bootstrap layout.
- Python 3.11+ (recommended: 3.12)
- PostgreSQL (e.g. Neon.tech) with Loglan LOD database schema.
Copy .env.example to .env and configure your settings:
cp .env.example .envKey environment variables:
TELEGRAM_BOT_TOKEN: Telegram bot token from @BotFather.TELEGRAM_ADMIN_ID: Admin user ID for notifications.LOD_DATABASE_URL: Async PostgreSQL URL (e.g.postgresql+asyncpg://user:pass@host/dbname).WEBHOOK_SECRET: Secret token for webhook verification.
pip install -r requirements-dev.txthypercorn -b 0.0.0.0:8080 main:apppython -m app.bot.local_runRun tests:
pytest tests/ -vCheck types:
mypy app testsCheck code style and linting:
ruff check .
ruff format --check .Build and run container:
docker build -t loglan-bot .
docker run -p 8080:8080 --env-file .env loglan-bot