feat: revamp points/reward system for inclusive engagement

- /city /deb now free, capped at 10/day each (was 2 pts cost)
- Welcome bonus +20 pts on first-ever valid message
- First-message-of-day bonus +2 pts
- Weekly winner point bonuses reduced (500→200, 300→100, 150→50)
- Weekly participation rewards for all active users (+5 base, +15 for ≥20 pts)
- Pro-day rewards for top 3 unchanged

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
AmandaloveYang
2026-05-11 13:35:52 +08:00
parent 81e9aeb98f
commit 787d04619b
8 changed files with 215 additions and 27 deletions
+18
View File
@@ -79,6 +79,24 @@ class CommandGuard:
self._reply_group_required(message)
return False
def check_daily_query_limit(self, message: Any, query_type: str, limit: int) -> bool:
user = message.from_user
result = self.io_layer.db.track_query_usage(user.id, query_type)
if result.get("allowed"):
return True
if result.get("reason") == "user_missing":
self.io_layer.bot.reply_to(message, "⚠️ 用户未注册,请先在群内发言。")
return False
if result.get("reason") == "daily_limit":
used = int(result.get("used") or 0)
self.io_layer.send_query_message(
message,
f"❌ 今日 <b>/{query_type}</b> 免费次数已用完 ({used}/{limit})\n请明天再来,或通过群内发言赚取积分。",
parse_mode="HTML",
)
return False
return True
def ensure_access_and_points(self, message: Any, cost: int, command_label: str) -> bool:
if not self.ensure_group_member(message, command_label):
return False