$ show NightStrang6r/FunPayVertex
FunPayVertex is a Telegram-controlled automation bot for the FunPay digital marketplace, written in Python. It scrapes FunPay's internal API to provide auto-delivery of digital goods, auto-reply to chat messages, auto-raise of listings, and inventory management (auto-restore/disable lots). The architecture is event-driven: the `FunPayAPI.Runner` polls FunPay's `/runner/` endpoint and emits typed events (new orders, messages, reviews) which are dispatched to registered handlers in `handlers.py` and through a plugin system. The Telegram bot (`tg_bot/`) serves as the primary user interface, offering menus for configuration, notifications, plugin management, and proxy settings. The codebase is modular with a separate `FunPayAPI` package that could be reused independently. It lacks tests and CI/CD, and relies on scraping HTML/CSS selectors that may break with site updates, contributing to a medium technical drift rating. The plugin system and localization framework are well-designed and potentially reusable.
The LLM identified 4 files worth highlighting for reuse:
A standalone Python package for interacting with the FunPay marketplace's internal API. Contains `Account` (auth, requests, retry logic), `Runner` (polling loop that diffs state and emits typed events), `types` (data classes for orders, lots, messages), and custom exceptions. Can be extracted and reused in any FunPay automation project with minimal modification. Demonstrates skill in building resilient scrapers with session management, error handling, and event emission.
The `Vertex` class implements a plugin system where modules are scanned for predefined lists like `BIND_TO_NEW_ORDER`, `BIND_TO_PRE_INIT`, etc. Handlers are registered by UUID and can be enabled/disabled/pinned. This pattern allows third-party plugins to hook into the event lifecycle without modifying core code. Could be extracted as a generic plugin loader for event-driven applications. Demonstrates a clean, convention-based extension mechanism.
A singleton `Localizer` class that loads translation modules (flat dictionaries) and provides a `translate(key, locale, *args)` method with fallback to the key name. Caches loaded locale modules and supports per-call language override. Simple, well-isolated, and can be reused in any Python application needing lightweight i18n without external dependencies.
A utility function that adds prev/next/first/last page buttons to any Telegram inline keyboard markup, based on current page, total pages, and a callback prefix. Generic and self-contained, it can be reused in any Telegram bot to add paginated navigation with minimal code. Demonstrates good abstraction and handling of edge cases (single page, first/last page).