bot/stickfix.pycreates the TelegramUpdater, binds the job queue, and registers the handler modules so every incoming command (helper, user, sticker, inline) is routed through the dispatcher.- Handler modules (
bot/handlers/common.py,utility.py,stickers.py,inline.py) implement command parsing, context helpers, and inline scoring logic, keeping UI concerns separated from persistence. - Persistence relies on
bot/database/storage.py, a YAML-backedStickfixDB, withStickfixUsernow defined inbot/domain/user.pyand re-exported frombot/database/users.pyfor compatibility while persisting sticker tags plus user preferences such asshuffleandprivate_mode. - Logging comes from
bot/utils/logger.py, ensuring consistent formatting for lifecycle events (startup, DB saves, request handling). - The lightweight
tests/directory exercises this stack, so a stable uv/Ruff workflow will indirectly guarantee handler/storage invariants remain covered.
/startreturns a sticker and creates the user record viaHelperHandler, ensuring every user has aStickfixUserentry before saving tags./helpopensbot.handlers.common.HELP_PATHand sends the shared instructions text so helpers stay consistent./deleteMeremoves the caller fromStickfixDB;/setMode <private|public>flipsprivate_mode, and/shuffle <on|off>toggles the shuffle flag, all handled insideUserHandler./add <tag...>expects a reply-to sticker, validates it, and saves tag-to-sticker mappings either inSF_PUBLICor the caller’s private store depending on privacy (seeStickerHandler.__link_tags)./get <tag...>(private chats only) looks up stickers in the user’s private map but falls back toSF_PUBLICbefore sending cached stickers./deleteFrom <tag...>removes the sticker’s tags from the appropriate collection.- Inline queries split the text into tags, dedupe results via
_get_sticker_list, optionally shuffle them, and return cached inline stickers;__on_resultclears thecached_stickersbuffer after a selection.
- The project now targets Python 3.14 (see
pyproject.toml), enabling modern typing and interpreter ergonomics. uvis the single source of truth for dependency resolution:uv syncboots the env,uv lockregeneratesuv.lock, anduv run <cmd>executes commands within that env.Ruffreplaces the legacy lint stack and also powers formatting (uv run ruff format). The config lives inruff.toml.- Tests should run via
uv run pytestto ensure they execute in the locked environment. - Optional extras (
db,graph,dev) allow contributors to install Postgres/Neo4j tooling or dev helpers as needed.
- Expand the rediscovery report with architecture notes once the code paths are mapped.
- Draft migration scripts/docs (see issue #12) tied to the new workflow.
- Update CI (
.github/workflows) to runuv sync,uv run ruff check, anduv run pytest.