Skip to content

Repository files navigation

LiteAuction Bot

MVP Telegram auction bot scaffold on aiogram + PostgreSQL + Redis with Docker Compose.

For agent-driven sessions and planning workflow, start with AGENTS.md and planning/STATUS.md.

This repository currently contains delivered scope through Sprint 56:

  • Dockerized runtime (bot, db, redis)
  • Alembic migrations and initial PostgreSQL schema
  • Async SQLAlchemy setup
  • Basic bot startup with /start
  • Startup and container health checks for DB/Redis
  • FSM lot creation via private chat (and optional channel DM topics) using /newauction
  • Inline auction publishing via auc_<id> and chosen_inline_result
  • Runtime-toggleable high-risk publish gate requiring assigned guarantor for risky sellers
  • Live post updates after bids (top-3, current price, ending time)
  • Buyout, anti-sniper (2m -> +3m, max 3) and anti-mistake protections
  • Background watcher for expired auctions
  • Telegram moderation commands with audit log and blacklist
  • In-post complaint flow to moderator queue with action buttons
  • Auto fraud-signal scoring with moderator action queue
  • Stateful moderator panel (/modpanel) and extended fraud heuristics
  • Moderator dashboard stats (/modstats) and baseline spike anomaly scoring
  • Historical cross-auction baseline heuristic and web admin panel
  • Telegram Login auth for web admin and dispute timeline pages
  • Web moderation actions with role-based permissions
  • Risk/trust indicators on admin user, auction, appeal, and signal views
  • Post-trade feedback foundation with bot intake and admin moderation view
  • Fine-grained web RBAC scopes (auction, bid, user-ban, role-manage)
  • Telegram moderation RBAC synced with scope model + /role commands
  • Web CSRF protection and confirm-step for dangerous moderation actions
  • Configurable soft-gate for bids/reports (strict/grace/off) with private /start
  • Soft-gate conversion and onboarding funnel KPIs in web dashboard
  • Regression tests and GitHub Actions CI for RBAC/CSRF/confirm-flow
  • Integration regression tests for callback scope mapping and web post-refresh actions
  • Role-management workflow tests (web + bot) and permission-downgrade edge-case coverage
  • DB-backed RBAC integration tests and dedicated CI Postgres job
  • End-to-end callback integration tests for complaint/risk moderation flows
  • Queue message edit and timeline consistency regression coverage for moderation callbacks
  • Timeline event sequence guards for callback flows (create -> moderation action -> resolve)
  • Stable per-entity timeline ordering on equal timestamps (created_at + primary-key tie-breakers)
  • Web timeline pagination with configurable page/limit and navigation links
  • CI anti-flaky integration re-run and PR quality checklist template
  • DB-aware timeline page assembly and source filters (auction, bid, complaint, fraud, moderation)
  • Bug triage foundation: policy, backlog template, and GitHub bug issue form
  • Bugfix wave 1 improvements for timeline navigation context and pagination safety
  • Bugfix wave 2 improvements for callback retry safety and denied-scope back navigation
  • Visual foundation refresh for admin web layout, controls, and responsive readability
  • Final visual polish and release-readiness checklist with consolidated QA evidence template
  • Section-based moderation topic routing and user feedback/guarantor intake commands (/bug, /suggest, /guarant, /boostfeedback, /boostguarant, /boostappeal)
  • Rewards ledger foundation with idempotent points accrual, advanced /points, moderator /modpoints + /modpoints_history, and admin user-page rewards widget
  • Outbox-driven automation for approved feedback -> GitHub issue creation with retry/backoff
  • Full private-chat topic routing for bot DM (Аукционы, Уведомления, Модерация) with topic-aware command enforcement and /topics
  • Channel DM lot intake foundation (Bot API 9.2) via direct_messages_topic_id for /newauction
  • Suggested post moderation pipeline for channel DM topics (approve/decline + persisted review audit)
  • Draft-stream progress hints (sendMessageDraft) for long-running bot actions like /modstats and auction finalize
  • Moderation checklists for complaints, guarantor requests, and appeals with audit-logged checklist toggles
  • Task-scoped checklist replies in moderation flows with actor/timestamp audit trail
  • Seller/chat verification workflow (verifyUser/verifyChat) with scope-gated operator commands and trust-aware risk integration
  • Sprint planning automation via TOML manifests + GitHub issue/draft-PR sync + PR policy gate (Closes #... + sprint:* label)

Sprint 0 Checklist

  • Project scaffold and dependency setup
  • PostgreSQL schema baseline (users, auctions, bids, moderation tables)
  • Redis connectivity foundation
  • Docker Compose for local/prod-like environment
  • Basic bot polling runtime and /start
  • Healthcheck command for bot container

Sprint 1 Checklist (Core)

  • Create auction wizard: photo, description, start price, buyout/skip, min step, duration, anti-sniper
  • Publish draft via inline flow (switch_inline_query -> inline card)
  • Activate auction on publish and store inline_message_id
  • Bid buttons with fast presets (+step, +3step, +5step) and buyout button
  • Live post refresh after each accepted action
  • Anti-mistake: no self-overbid, cooldown, duplicate guard, confirm for buyout
  • Bid callbacks return alert with exact accepted amount
  • Auction auto-finish watcher and winner/seller notifications

Sprint 2 Checklist (Moderation)

  • Moderator command set in Telegram private chat
  • Auction controls: freeze / unfreeze / force end
  • Fraud controls: remove bid by bid UUID
  • User controls: ban / unban by tg_user_id
  • Read tools: list recent bids and audit log feed
  • Blacklist enforcement for new auctions and bidding

Sprint 3 Checklist (Report Workflow)

  • Complaint button in auction post (Пожаловаться)
  • Complaint cooldown and double-confirmation to reduce spam
  • Complaint persistence in database (complaints table)
  • Moderator queue notifications with action buttons
  • Callback moderation workflow: freeze / remove top bid / ban+remove / dismiss
  • Open complaints counter in auction post

Sprint 4 Checklist (Anti-Fraud Core)

  • Fraud signal persistence in database (fraud_signals table)
  • Automatic risk scoring on accepted bids
  • Moderator queue notifications for fraud signals
  • Callback workflow for fraud signals: freeze / ban / ignore
  • Moderator command /risk [auction_uuid] for open signals

Sprint 5 Checklist (Moderator UX + Heuristics)

  • Stateful moderator panel with inline navigation (/modpanel)
  • Browse open complaints/signals with paging and detail view
  • Return-to-panel flow after moderation callback actions
  • Duopoly (pair-collusion) heuristic in fraud scoring
  • Alternating-bid chain heuristic in fraud scoring

Sprint 6 Checklist (Dashboard + Baseline Anomaly)

  • Moderator dashboard snapshot service
  • /modstats command and panel stats section
  • Baseline-spike heuristic in fraud scoring
  • Configurable anomaly tuning via env

Sprint 7 Checklist (Historical Baseline + Web Admin)

  • Historical baseline heuristic across completed auctions
  • Admin panel backend (FastAPI) with dashboard and list pages
  • Docker Compose admin service on port 8080
  • Token-protected admin access (ADMIN_PANEL_TOKEN)

Sprint 8 Checklist (Telegram Auth + Timeline)

  • Telegram Login auth callback with signature verification
  • Session-cookie auth for admin panel (la_admin_session)
  • Auction dispute timeline page with bids/complaints/signals/mod-actions
  • Timeline links from complaints/signals/auctions tables

Sprint 9 Checklist (Web Actions + RBAC)

  • Web actions: freeze/unfreeze/end auction
  • Web actions: remove bid, ban/unban user
  • Role-aware access in web admin (viewer/operator/owner)
  • Operator allowlist config (ADMIN_OPERATOR_USER_IDS)

Sprint 10 Checklist (RBAC Scope Split)

  • Scope-based permission checks per web action
  • Operator role limited to auction/bid actions (no ban/role management)
  • User-management UI now hides forbidden actions by scope

Sprint 11 Checklist (Telegram RBAC Sync)

  • Shared RBAC scope service used by web and Telegram
  • Scope checks for Telegram moderation commands and callbacks
  • Owner-scope bot command /role to grant/revoke/list moderator roles

Sprint 12 Checklist (Web Security Hardening)

  • CSRF token validation for all web moderation POST actions
  • Confirm-step page for dangerous actions (end auction, remove bid, ban/unban)
  • Basic reason normalization/validation on web action endpoints

Sprint 13 Checklist (Onboarding Analytics)

  • Soft-gate conversion metrics added to moderation dashboard service
  • Funnel KPIs exposed in web dashboard (users/private-start/hints/conversion)
  • /modstats extended with onboarding and conversion indicators

Sprint 14 Checklist (Regression + CI)

  • Regression tests for allowlist RBAC scope matrix
  • Regression tests for CSRF protection and confirm-step behavior
  • GitHub Actions CI workflow to run test suite on push/PR

Sprint 15 Checklist (Integration Regression)

  • Callback action -> required-scope mapping extracted to testable helpers
  • Regression tests for complaint/fraud callback scope mapping
  • Regression tests for web moderation actions refreshing auction posts

Sprint 16 Checklist (Role Flow Regression)

  • Bot /role workflow tests (list/grant/validation branches)
  • Web role-management action tests (grant/revoke success/failure paths)
  • Permission-downgrade edge-case test for cookie auth after allowlist change

Sprint 17 Checklist (DB Integration)

  • DB-backed integration tests for dynamic user_roles scope resolution
  • Grant/revoke propagation tests with real Postgres session
  • Dedicated GitHub Actions Postgres job for integration tests

Sprint 18 Checklist (Callback E2E Integration)

  • Shared integration test fixtures moved to tests/integration/conftest.py
  • E2E tests for modrep callback flow (freeze + scope-denied path)
  • E2E tests for modrisk callback flow (ban -> DB updates + refresh + notify)

Sprint 19 Checklist (Queue + Timeline Consistency)

  • Scenario checks for complaint/fraud queue message edit behavior after callback actions
  • Timeline consistency checks for complaint/fraud lifecycle after moderation callbacks
  • Regression guard for repeated callback clicks (idempotent behavior)
  • BAN_USER callback logs linked to auction timeline (auction_id in moderation log)

Sprint 20 Checklist (Timeline Sequence Guards)

  • Integration helper to assert ordered timeline subsequences in callback scenarios
  • Sequence checks for complaint freeze and fraud ban callback paths
  • Sequence checks for repeated callback idempotency path
  • Manual QA expected order synced with callback event ordering

Sprint 21 Checklist (Same-Timestamp Ordering)

  • Deterministic tie-break rules for timeline events sharing the same timestamp
  • Integration regressions for complaint/fraud ordering with same happened_at

Sprint 22 Checklist (Per-Entity Stable Order)

  • Added primary-key tie-breakers to timeline source queries (created_at, then id)
  • Removed fragile string-based final tie-breakers from timeline sorting
  • Added regressions for multiple complaints/signals with identical timestamps to enforce numeric id ordering

Sprint 23 Checklist (Timeline Pagination)

  • Added page and limit query parameters to auction timeline admin endpoint
  • Added timeline page navigation links and visible page coverage counters
  • Added validation for pagination bounds (page >= 0, 1 <= limit <= 500)
  • Added regression tests for page boundaries and event ordering preservation

Sprint 24 Checklist (Quality Gates)

  • Added PR template with validation/self-review/risk/manual-QA checklist
  • Added CI anti-flaky re-run for integration DB suite on pull requests
  • Standardized reviewer focus section in PR metadata

Sprint 25 Checklist (Timeline Source Filters)

  • Added source filter support to timeline endpoint (source=auction,bid,...)
  • Moved timeline pagination closer to DB layer via per-source bounded fetch ((page+1)*limit)
  • Added regression tests for source filtering and page boundaries in web/controller and integration layers

Sprint 26 Checklist (Debug/Triage Foundation)

  • Added bug triage policy and bugfix Definition of Done checklist
  • Added prioritized bug backlog template for Sprint 27 candidate fixes
  • Added GitHub bug report issue template with required reproduction fields

Sprint 27 Checklist (Bugfix Wave 1)

  • Fixed timeline context retention across timeline/manage navigation (page, limit, source)
  • Fixed timeline page builder to cap fetch volume and return early for out-of-range pages
  • Normalized and deduplicated source filter input; blank source now consistently maps to all
  • Added regression tests for navigation context and pagination boundary behavior

Sprint 28 Checklist (Bugfix Wave 2)

  • Added idempotency regression for repeated modrisk:ban callback actions
  • Fixed denied-scope web pages to preserve safe return navigation context
  • Added unit and integration regressions for scope-denied back links and callback retry side effects

Sprint 29 Checklist (Visual Foundation)

  • Refreshed global admin web style system with CSS variables and consistent spacing/typography
  • Improved readability of tables/cards/forms/buttons without changing backend behavior
  • Added responsive layout handling for mobile viewports in core admin pages
  • Updated timeline source quick-links to chip-style controls for clearer filtering affordance

Sprint 30 Checklist (Final Polish + Release Readiness)

  • Added focus-visible keyboard affordances for interactive controls in admin web
  • Unified visual treatment for empty/error/warning states across key pages
  • Added release-readiness checklist at docs/release/sprint-30-readiness.md
  • Kept backend behavior unchanged while polishing UX and recovery paths

Sprint 50 Checklist (Admin UX Refresh)

  • Reworked admin dashboard into sectioned priority panels with quick-action tiles
  • Unified moderation list pages with shared header, filter toolbar, and table wrappers
  • Refreshed manage-user and manage-users pages with workflow-oriented sections and denser KPI grids
  • Preserved existing routes, filters, and moderation actions while reducing visual overload

Quick Start

  1. Copy env template:
cp .env.example .env

Optional: use .env.full.example as reference for all advanced tuning keys.

  1. Set real BOT_TOKEN in .env.

2.1 Set BOT_USERNAME (without @) to enable Telegram Login in web admin.

2.2 Set access/auth bootstrap values:

  • ADMIN_USER_IDS (first ID is owner)
  • ADMIN_PANEL_TOKEN
  • ADMIN_WEB_SESSION_SECRET
  1. Ensure timezone is set (default: Asia/Tashkent).

  2. Tune non-secret behavior defaults in config/defaults.toml.

  • You can keep .env small (tokens, IDs, URLs) and move policy/tuning values into TOML.
  • Optional: set APP_CONFIG_FILE in .env to use an alternate TOML file path.
  1. Run services:
docker compose up -d --build

Admin panel will be available at http://localhost:8080.

  1. Check logs:
docker compose logs -f bot

Useful Commands

  • Run migrations manually:
docker compose run --rm bot alembic upgrade head
  • Create a new migration:
docker compose run --rm bot alembic revision --autogenerate -m "message"
  • Run tests locally (same suite as CI):
python -m venv .venv
.venv/bin/pip install ".[dev]"
.venv/bin/python -m pytest -q tests
  • Run lint locally (same command as CI):
.venv/bin/python -m ruff check app tests
  • Run DB integration tests (use a dedicated test database):
docker compose exec -T db psql -U auction -d postgres -c "CREATE DATABASE auction_test OWNER auction;" || true
DB_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' liteauction-db)
RUN_INTEGRATION_TESTS=1 \
TEST_DATABASE_URL="postgresql+asyncpg://auction:auction@${DB_IP}:5432/auction_test" \
.venv/bin/python -m pytest -q tests/integration

Integration tests refuse to run unless TEST_DATABASE_URL is set and points to a database name containing test.

  • Sync sprint plan to GitHub issues/milestone:
cp planning/sprints/sprint-template.toml planning/sprints/sprint-<number>.toml
python scripts/sprint_sync.py --manifest planning/sprints/sprint-<number>.toml
  • Create draft PR scaffolds for each sprint task:
python scripts/sprint_sync.py --manifest planning/sprints/sprint-<number>.toml --create-draft-prs

This sync also updates planning/STATUS.md so recovery after context loss stays deterministic.

  • Open moderation command list in bot private chat:
/mod
  • Manage moderator role from bot (requires role:manage scope):
/role list <tg_user_id>
/role grant <tg_user_id> moderator
/role revoke <tg_user_id> moderator
  • View or adjust user reward balance from bot (requires role:manage scope):
/modpoints <tg_user_id>
/modpoints <tg_user_id> <limit>
/modpoints <tg_user_id> <amount> <reason>
/modpoints_history <tg_user_id> [page] [all|feedback|manual|boost|gboost|aboost]
  • Adjust user reward balance from admin web (requires role:manage scope):
/manage/users -> open user -> Rewards / points -> amount (+/-), reason -> Применить

The web action uses an idempotent key per form submit (action_id) to prevent duplicate ledger writes on repeated submit.

  • Open stateful moderation panel:
/modpanel
/botphoto list
/botphoto set <preset>
/botphoto reset
  • Extract custom emoji IDs for Bot API 9.4 button icons:
/emojiid
/effectid

Use it as a reply to a message that contains premium/custom emoji.

/effectid is best used as a reply to a message with a visual effect; it returns ready-to-paste env snippet for auction effect settings. If reply message has no effect metadata, command falls back to the last observed effect message for that user in current bot process.

  • Quick moderation stats:
/modstats
/notifstats
/funnelstats
  • Send user feedback from private chat:
/bug <описание>
/suggest <предложение>
/guarant <запрос на гаранта>
/boostfeedback <feedback_id>
/boostguarant <request_id>
/boostappeal <appeal_id>
/tradefeedback <auction_id> <1..5> [комментарий]
/points
/points <1..20>
/points detailed [1..20]
/topics

When PUBLISH_HIGH_RISK_REQUIRES_GUARANTOR=true, high-risk sellers cannot publish drafts until a guarantor request is assigned by moderation.

Trade feedback moderation list is available in admin web: /trade-feedback (status/rating/actor filters).

Owner-only runtime overrides are available in admin web: /settings.

  • Overrides are persisted in DB and keep updated_by / updated_at audit fields.
  • Only allowlisted operational keys are mutable in runtime layer.
  • Invalid values are rejected with validation errors; removing override rolls back to static config.

Current points redemption guardrails:

  • Global kill-switch for all redemptions.
  • Global cooldown between redemptions.
  • Global redemption count caps: daily, weekly.
  • Global redemption spend caps: daily, weekly, monthly.
  • Global account gates: minimum retained balance, minimum account age, minimum earned points.
  • Policy visibility in /points, /modstats, dashboard, and /manage/user/{id}.

Additional operational runtime keys:

  • Outbid anti-noise tuning: OUTBID_NOTIFICATION_DEBOUNCE_SECONDS, OUTBID_NOTIFICATION_DIGEST_WINDOW_SECONDS.

  • Publish gate tuning: PUBLISH_HIGH_RISK_REQUIRES_GUARANTOR, PUBLISH_GUARANTOR_ASSIGNMENT_MAX_AGE_DAYS.

  • Appeals SLA/escalation: APPEAL_SLA_OPEN_HOURS, APPEAL_SLA_IN_REVIEW_HOURS, APPEAL_ESCALATION_ENABLED, APPEAL_ESCALATION_INTERVAL_SECONDS, APPEAL_ESCALATION_BATCH_SIZE, APPEAL_ESCALATION_ACTOR_TG_USER_ID.

  • Include moderation queue destination in env (recommended):

MODERATION_CHAT_ID=-100xxxxxxxxxx
MODERATION_THREAD_ID=12345
MODERATION_TOPIC_COMPLAINTS_ID=12345
MODERATION_TOPIC_BUGS_ID=12346
MODERATION_TOPIC_FRAUD_ID=12353
MODERATION_TOPIC_CHANNEL_DM_GUARD_ID=12354
MODERATION_TOPIC_SUGGESTIONS_ID=12347
MODERATION_TOPIC_GUARANTORS_ID=12348
MODERATION_TOPIC_APPEALS_ID=12349
MODERATION_TOPIC_AUCTIONS_ACTIVE_ID=12350
MODERATION_TOPIC_AUCTIONS_FROZEN_ID=12351
MODERATION_TOPIC_AUCTIONS_CLOSED_ID=12352
ADMIN_PANEL_TOKEN=change_me
ADMIN_WEB_SESSION_SECRET=change_me_session_secret
ADMIN_WEB_CSRF_TTL_SECONDS=7200
ADMIN_OPERATOR_USER_IDS=324897201,123456789
GITHUB_AUTOMATION_ENABLED=true
GITHUB_TOKEN=ghp_xxx
GITHUB_REPO_OWNER=Nombah501
GITHUB_REPO_NAME=LiteAuction
OUTBOX_WATCHER_INTERVAL_SECONDS=20
OUTBOX_BATCH_SIZE=20
OUTBOX_MAX_ATTEMPTS=5
OUTBOX_RETRY_BASE_SECONDS=30
OUTBOX_RETRY_MAX_SECONDS=1800
FEEDBACK_GITHUB_ACTOR_TG_USER_ID=-998

For full non-secret tuning keys (fraud thresholds, points limits, boosts, private topic policy, feature flags, UI emojis), use .env.full.example.

Topic-specific IDs are optional; when unset the bot falls back to MODERATION_THREAD_ID. For backward compatibility, fraud and channel-DM guard routing fall back to MODERATION_TOPIC_BUGS_ID when dedicated topic IDs are not set.

Configuration precedence (high -> low): init kwargs -> environment -> .env -> config/defaults.toml -> hardcoded fallback defaults.

SOFT_GATE_MODE behavior:

  • strict - block bid/buy/report until user opens bot private chat and presses /start
  • grace - allow actions, but show onboarding prompt to open private chat (/start)
  • off - disable gate logic entirely

SOFT_GATE_HINT_INTERVAL_HOURS controls how often the onboarding hint can be shown in grace mode (per user).

Private DM topics (Bot API 9.3/9.4):

  • PRIVATE_TOPICS_ENABLED - enables personal topic routing in bot private chat.
  • PRIVATE_TOPICS_STRICT_ROUTING - when enabled, topic-scoped commands are processed only in their assigned topic.
  • PRIVATE_TOPICS_AUTOCREATE_ON_START - bootstrap all personal topics on /start.
  • PRIVATE_TOPICS_USER_TOPIC_POLICY - controls topic mutation mode: auto (BotFather policy), allow, or block.
  • PRIVATE_TOPIC_TITLE_* - topic names for auctions/support/points/trades/moderation (support is canonical for notifications, points, and trades).
  • When Telegram reports has_topics_enabled=false for a user, bot falls back to regular private-chat flow.

Examples:

PRIVATE_TOPICS_ENABLED=true
PRIVATE_TOPICS_STRICT_ROUTING=true
PRIVATE_TOPICS_AUTOCREATE_ON_START=true
PRIVATE_TOPICS_USER_TOPIC_POLICY=auto
PRIVATE_TOPIC_TITLE_AUCTIONS=Аукционы
PRIVATE_TOPIC_TITLE_SUPPORT=Уведомления
PRIVATE_TOPIC_TITLE_POINTS=Баллы
PRIVATE_TOPIC_TITLE_TRADES=Сделки
PRIVATE_TOPIC_TITLE_MODERATION=Модерация
BOT_PROFILE_PHOTO_PRESETS=default=AgACAgIAAxk...,campaign=AgACAgIAAxk...
BOT_PROFILE_PHOTO_DEFAULT_PRESET=default
AUCTION_MESSAGE_EFFECTS_ENABLED=false
AUCTION_EFFECT_DEFAULT_ID=
AUCTION_EFFECT_OUTBID_ID=
AUCTION_EFFECT_BUYOUT_SELLER_ID=
AUCTION_EFFECT_BUYOUT_WINNER_ID=
AUCTION_EFFECT_ENDED_SELLER_ID=
AUCTION_EFFECT_ENDED_WINNER_ID=

Bot profile photo presets (/botphoto command for operators with auction:manage):

  • BOT_PROFILE_PHOTO_PRESETS - comma-separated preset=file_id map used by /botphoto set <preset>.
  • BOT_PROFILE_PHOTO_DEFAULT_PRESET - preset name used by /botphoto reset; if missing, reset falls back to removeMyProfilePhoto.
  • Successful set/reset actions are written to moderation audit log.

Auction message effects for critical auction notifications:

  • AUCTION_MESSAGE_EFFECTS_ENABLED - global kill-switch for all auction effect usage.
  • AUCTION_EFFECT_DEFAULT_ID - one default effect for all auction events.
  • AUCTION_EFFECT_*_ID - optional per-event overrides (outbid, buyout seller/winner, ended seller/winner).
  • To simplify setup, reply with /effectid to any message that already has a visual effect and paste produced snippet.
  • If effect delivery is rejected by Telegram (unsupported effect/client/chat), bot retries the same text notification without message_effect_id.

Channel DM lot intake (Bot API 9.2):

  • CHANNEL_DM_INTAKE_ENABLED - enables /newauction intake in channel DM topics.
  • CHANNEL_DM_INTAKE_CHAT_ID - optional chat allowlist; 0 allows any direct-messages chat.
  • Incoming suggested_post_info events from enabled channel DM chats are routed to moderation with approve/decline actions.
  • chat_owner_changed / chat_owner_left service events from monitored channel DM chats are saved to audit and pause auto-processing until operator confirmation (/confirmowner <chat_id>).

Examples:

CHANNEL_DM_INTAKE_ENABLED=true
CHANNEL_DM_INTAKE_CHAT_ID=-1001234567890

Message drafts (Bot API 9.3):

  • MESSAGE_DRAFTS_ENABLED - enables draft progress hints in long-running command paths.

Example:

MESSAGE_DRAFTS_ENABLED=true

Private topics model:

  • Regular users: Аукционы, Уведомления.
  • Owner/moderators: + Модерация.
  • /start routes onboarding to the Аукционы topic when private topics are enabled.

Verification workflow (Bot API verify/remove verification):

  • Scope trust:manage can run moderation commands:

    • /verifyuser <tg_user_id> [description]
    • /unverifyuser <tg_user_id>
    • /verifychat <chat_id> [description]
    • /unverifychat <chat_id>
  • User verification state is shown in web /manage/users and /manage/user/<id> surfaces.

  • Risk/trust scoring consumes verification in a conservative way (bonus applies only when there is no active blacklist and no open fraud signals).

  • Optional Bot API 9.4 button icons (custom emoji IDs):

UI_EMOJI_CREATE_AUCTION_ID=5368324170671202286
UI_EMOJI_PUBLISH_ID=5368324170671202286
UI_EMOJI_BID_ID=5368324170671202286
UI_EMOJI_BID_X1_ID=5368324170671202286
UI_EMOJI_BID_X3_ID=5368324170671202286
UI_EMOJI_BID_X5_ID=5368324170671202286
UI_EMOJI_BUYOUT_ID=5368324170671202286
UI_EMOJI_REPORT_ID=5368324170671202286
UI_EMOJI_COPY_PUBLISH_ID=5368324170671202286
UI_EMOJI_GALLERY_ID=5368324170671202286
UI_EMOJI_NEW_LOT_ID=5368324170671202286
UI_EMOJI_PHOTOS_DONE_ID=5368324170671202286
UI_EMOJI_MOD_PANEL_ID=5368324170671202286
UI_EMOJI_MOD_COMPLAINTS_ID=5368324170671202286
UI_EMOJI_MOD_SIGNALS_ID=5368324170671202286
UI_EMOJI_MOD_FROZEN_ID=5368324170671202286
UI_EMOJI_MOD_APPEALS_ID=5368324170671202286
UI_EMOJI_MOD_STATS_ID=5368324170671202286
UI_EMOJI_MOD_REFRESH_ID=5368324170671202286
UI_EMOJI_MOD_FREEZE_ID=5368324170671202286
UI_EMOJI_MOD_UNFREEZE_ID=5368324170671202286
UI_EMOJI_MOD_REMOVE_TOP_ID=5368324170671202286
UI_EMOJI_MOD_BAN_ID=5368324170671202286
UI_EMOJI_MOD_IGNORE_ID=5368324170671202286
UI_EMOJI_MOD_TAKE_ID=5368324170671202286
UI_EMOJI_MOD_APPROVE_ID=5368324170671202286
UI_EMOJI_MOD_REJECT_ID=5368324170671202286
UI_EMOJI_MOD_ASSIGN_GUARANTOR_ID=5368324170671202286
UI_EMOJI_MOD_BACK_ID=5368324170671202286
UI_EMOJI_MOD_MENU_ID=5368324170671202286
UI_EMOJI_MOD_PREV_ID=5368324170671202286
UI_EMOJI_MOD_NEXT_ID=5368324170671202286

Granular keys are optional: when they are empty, the bot falls back to base keys (UI_EMOJI_BID_ID, UI_EMOJI_PUBLISH_ID, UI_EMOJI_CREATE_AUCTION_ID, UI_EMOJI_MOD_PANEL_ID).

Custom emoji on buttons require Bot API 9.4 support in Telegram client and the bot owner's Premium-enabled custom emoji access.

  • Fraud tuning (optional):
FRAUD_DUOPOLY_WINDOW_SECONDS=300
FRAUD_DUOPOLY_MIN_TOTAL_BIDS=10
FRAUD_DUOPOLY_PAIR_RATIO=0.85
FRAUD_ALTERNATING_RECENT_BIDS=8
FRAUD_ALTERNATING_MIN_SWITCHES=6
FRAUD_BASELINE_WINDOW_SECONDS=3600
FRAUD_BASELINE_MIN_BIDS=6
FRAUD_BASELINE_SPIKE_FACTOR=4.0
FRAUD_BASELINE_MIN_INCREMENT=50
FRAUD_BASELINE_SPIKE_SCORE=25
FRAUD_HISTORICAL_COMPLETED_AUCTIONS=30
FRAUD_HISTORICAL_MIN_POINTS=25
FRAUD_HISTORICAL_SPIKE_FACTOR=3.0
FRAUD_HISTORICAL_MIN_INCREMENT=40
FRAUD_HISTORICAL_SPIKE_SCORE=20
FRAUD_HISTORICAL_START_RATIO_LOW=0.5
FRAUD_HISTORICAL_START_RATIO_HIGH=2.0

Telegram Smoke Checklist (Auction UX)

  • Publish a draft auction and verify caption shows expressive status block, timer, and Топ-3 with medals.
  • In an active lot, verify bid buttons are green and display only amounts (+$N, +$3N, +$5N).
  • Tap any bid button once and verify a Telegram alert appears with exact accepted amount ($N).
  • Verify compact secondary actions are shown as short buttons (Фото N, Жалоба, Бот).
  • Verify buyout and complaint still require confirmation and keep existing anti-spam cooldown behavior.

Next (Post-Sprint)

  • Continue point improvements from bug triage backlog in small scoped PRs
  • Run consolidated manual QA using docs/manual-qa/sprint-19.md + docs/release/sprint-30-readiness.md
  • Use docs/release/rc-1-notes.md as release-candidate baseline notes
  • Fill docs/release/rc-1-manual-qa-matrix.md during final interactive QA run
  • Prepare release candidate notes and known limitations

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages