Phase 5: groups

Group wallets, group passes, spending rules and admin-only settings.

- Groups recorded from my_chat_member; admin rights verified with
  getChatMember and cached for five minutes
- Group context in entitlement resolution: group pass, group credits under
  the spending rule (anyone, admins only, capped per person per day) and
  the group's daily cap; refunds go back to the wallet that paid
- Group gate before any lookup: bot on or off, who may use it, allowed
  and blocked sites, plus the owner's maintenance mode
- /settings with inline toggles checked on every press, /grouplang,
  /autodetect, /allow, /block, /spending, /groupwallet, /grouppass,
  /groupstats
- Deep links with the target pre-selected: paying for a group happens in
  the private chat; a refused download in a group offers "Buy for me" and
  "Add group credits"
- Optional link detection, tidy mode, default quality and language per
  group; per-member usage
- /quality, /language, /app, /privacy, /terms, /support
- Remaining owner tools: /stats, /queue all, /user, /group, /ban, /unban,
  /grant (passes and gift codes), /credit, /refund, /blocklist,
  /broadcast with confirmation, /maint, /reload i18n

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Michilis
2026-11-18 09:46:32 +00:00
co-authored by Claude Fable 5.2
parent 7d4893bc3f
commit 51371da0e0
23 changed files with 3231 additions and 81 deletions
+12
View File
@@ -158,6 +158,18 @@ Only in a private chat, only for the user IDs in `OWNER_IDS`.
| `/ytdlp update` | Update yt-dlp on every worker now |
| `/cache` | Cache size, hit rate, volume saved |
| `/purge <link>` | Take a video down: delete its files and block it for good |
| `/blocklist add site <host>` | Refuse a whole site. Also `add key <extractor:id>`, `remove`, and no argument to list. |
| `/stats` | Users, jobs, queue, cache, payments, and whether the ledger and balances agree |
| `/queue all` | Every queued and running job with its worker and tags |
| `/user <id>`, `/group <chat id>` | Look one up |
| `/ban <id>`, `/unban <id>` | A banned user gets no answers |
| `/grant <id> day\|week\|month` | Give a pass to a user, or to a group (negative ID) |
| `/grant code credits <sats> [uses]` | Create a gift code. Also `code day\|week\|month`. |
| `/credit <id> <sats>` | Add credits |
| `/refund <id> <sats>`, `/refund <id> pass <duration>` | Give sats back, or extend a pass |
| `/broadcast <text>` | Preview, then send to everyone on confirmation |
| `/maint on\|off` | Refuse new downloads for everyone but owners |
| `/reload i18n` | Reload translations from `LOCALES_DIR` |
## Backups