Skip to content

Add subscription manager — tier-based feature gating#66

Open
calmmage wants to merge 2 commits intodevfrom
add-subscription-manager
Open

Add subscription manager — tier-based feature gating#66
calmmage wants to merge 2 commits intodevfrom
add-subscription-manager

Conversation

@calmmage
Copy link
Copy Markdown
Owner

Summary

  • New subscription_manager component with Tier enum (FREE/BASIC/PRO/ADMIN) and MongoDB storage
  • @require_tier("pro") decorator to gate any handler behind a minimum tier
  • Wrapper functions: get_user_tier(), set_user_tier(), check_tier()
  • Admin commands: /set_tier <user_id> <tier>, /list_subscribers
  • User command: /my_tier
  • Admins auto-resolve to ADMIN tier
  • Full core wiring (settings, dependency manager, bot manager, deps_getters)
  • i18n strings (en/ru)

Replaces #21 (closed) — scoped down from payment-screenshot verification to pure tier/feature gating.

Test plan

  • Enable component with BOTSPOT_SUBSCRIPTION_MANAGER_ENABLED=true
  • Verify /my_tier returns default tier (free)
  • Admin sets tier with /set_tier <user_id> pro
  • Verify @require_tier("pro") blocks free users and allows pro users
  • Verify admins bypass all tier checks

🤖 Generated with Claude Code

calmmage and others added 2 commits March 18, 2026 05:03
Tier system (FREE/BASIC/PRO/ADMIN) with MongoDB storage, @require_tier decorator
for handler gating, admin commands (/set_tier, /list_subscribers), /my_tier for
users, i18n strings (en/ru), and full core wiring.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused import (ruff F401)
- Split setup_dispatcher into two methods to stay under CCN 20
- Add comprehensive test suite for subscription_manager component

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant