Skip to content

chore(rewrite-v2): Ground-up rewrite of Python Italy Telegram Bot ("Electus")#41

Closed
Copilot wants to merge 1 commit intorewrite-v2from
copilot/sub-pr-39-again
Closed

chore(rewrite-v2): Ground-up rewrite of Python Italy Telegram Bot ("Electus")#41
Copilot wants to merge 1 commit intorewrite-v2from
copilot/sub-pr-39-again

Conversation

Copy link

Copilot AI commented Feb 22, 2026

Complete replacement of the legacy fork-based codebase with a clean Python 3.14/uv rewrite. Named Electus (Matrix × Python theme), Italian-first UX.

Core architecture

  • src/python_italy_bot/ — single installable package via pyproject.toml
  • Repository pattern — dual Repository (sync) / AsyncRepository (async) abstract interfaces in db/base.py; in-memory default, asyncpg PostgreSQL when DATABASE_URL is set
  • Handler → Service → Repository layering; handlers are thin wires, business logic lives in services/

Features

  • Captcha flow — new member restricted on join → DMs bot the secret command found in assets/regolamento.md → bot unrestricts; globally-verified users skip captcha in subsequent chats
  • Moderation/ban, /unban, /mute, /unmute, /report, @admin mention; global ban propagated across all registered chats
  • Spam detection — per-user rate window + message-hash deduplication with auto-delete
  • Group settings — per-chat custom welcome message via /setwelcome / /resetwelcome
  • Owner tools/announce broadcast to all registered chats, /ping health check
  • /id — returns chat ID + caller user ID

Persistence

8 PostgreSQL tables (schema.sql): pending_verifications, verified_users, bans, mutes, reports, group_settings, globally_verified_users, bot_chats, global_bans. Zero-config in-memory backend requires no schema.

Configuration

All settings via env vars; .env.example provided. Key vars: TELEGRAM_BOT_TOKEN, DATABASE_URL, CAPTCHA_SECRET_COMMAND, BOT_OWNER_ID, MAIN_GROUP_ID, LOCAL_GROUP_IDS, RULES_URL.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Remove existing Telegram bot codebase for rewrite chore(rewrite-v2): Ground-up rewrite of Python Italy Telegram Bot ("Electus") Feb 22, 2026
Copilot AI requested a review from MattiaFailla February 22, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants