forked from Rockachopa/Timmy-time-dashboard
Bridges Telegram messages to Timmy via python-telegram-bot (optional dependency). The bot token can be supplied through the TELEGRAM_TOKEN env var or at runtime via the new POST /telegram/setup dashboard endpoint, which (re)starts the bot without a restart. Changes: - src/telegram_bot/bot.py — TelegramBot singleton: token persistence (telegram_state.json), lifecycle (start/stop), /start command and message handler that forwards to Timmy - src/dashboard/routes/telegram.py — /telegram/setup and /telegram/status FastAPI routes - src/dashboard/app.py — register telegram router; auto-start/stop bot in lifespan hook - src/config.py — TELEGRAM_TOKEN setting (pydantic-settings) - pyproject.toml — [telegram] optional extra (python-telegram-bot>=21), telegram_bot wheel include - .env.example — TELEGRAM_TOKEN section - .gitignore — exclude telegram_state.json (contains token) - tests/conftest.py — stub telegram/telegram.ext for offline test runs - tests/test_telegram_bot.py — 16 tests covering token helpers, lifecycle, and all dashboard routes (370 total, all passing) https://claude.ai/code/session_01CNBm3ZLobtx3Z1YogHq8ZS
39 lines
422 B
Plaintext
39 lines
422 B
Plaintext
# Python
|
|
__pycache__/
|
|
*.py[cod]
|
|
*.pyo
|
|
.Python
|
|
build/
|
|
dist/
|
|
*.egg-info/
|
|
.eggs/
|
|
|
|
# Virtual envs
|
|
.venv/
|
|
venv/
|
|
env/
|
|
|
|
# Secrets / local config — commit only .env.example (the template)
|
|
.env
|
|
.env.*
|
|
!.env.example
|
|
|
|
# SQLite memory — never commit agent memory
|
|
*.db
|
|
|
|
# Telegram bot state (contains bot token)
|
|
telegram_state.json
|
|
|
|
# Testing
|
|
.pytest_cache/
|
|
.coverage
|
|
htmlcov/
|
|
reports/
|
|
|
|
# IDE
|
|
.idea/
|
|
.vscode/
|
|
*.swp
|
|
*.swo
|
|
.DS_Store
|