Skip to content

Repository files navigation

🤖 Loglan Dictionary Telegram Bot & Web Service

CI GitHub license Ruff Checked with mypy

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.


🚀 Features

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

🛠️ Quick Start

1. Requirements

  • Python 3.11+ (recommended: 3.12)
  • PostgreSQL (e.g. Neon.tech) with Loglan LOD database schema.

2. Environment Configuration

Copy .env.example to .env and configure your settings:

cp .env.example .env

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

3. Installation

pip install -r requirements-dev.txt

4. Running the Web App & Webhook Server

hypercorn -b 0.0.0.0:8080 main:app

5. Running Bot Locally in Polling Mode (for development)

python -m app.bot.local_run

🧪 Testing & Code Quality

Run tests:

pytest tests/ -v

Check types:

mypy app tests

Check code style and linting:

ruff check .
ruff format --check .

🐳 Docker Deployment

Build and run container:

docker build -t loglan-bot .
docker run -p 8080:8080 --env-file .env loglan-bot

About

Loglan Dictionary Telegram Bot

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages