docs: add admin user ban/unban/blocked command documentation - #3223
Conversation
Reviewer's GuideAdds documentation for new admin-only user management commands (/ban, /unban, /blocked) and updates the feature summary to reflect user blocking behavior and layered enforcement (ENV + DB). Sequence diagram for user request handling with ENV + DB blockingsequenceDiagram
actor User
participant Bot
participant EnvBlockedUsers
participant DbBlockedUsers
participant Handler
User->>Bot: update
Bot->>EnvBlockedUsers: BLOCKED_USER_IDS
alt [user_id in BLOCKED_USER_IDS]
Bot-->>User: blocked (ENV layer)
else [user_id not in BLOCKED_USER_IDS]
Bot->>DbBlockedUsers: blocked
alt [user_id blocked in DB]
Bot-->>User: blocked (DB layer)
else [user_id not blocked in DB]
Bot->>Handler: handle_update
Handler-->>User: normal response
end
end
Flow diagram for admin /ban, /unban, /blocked commandsflowchart LR
Admin["Admin"]
Bot["Bot"]
EnvBlockedUsers[("BLOCKED_USER_IDS (ENV)")]
DbBlockedUsers[("blocked users (DB)")]
Admin -->|"/ban <user_id> [reason]"| Bot
Bot -->|"add user_id"| DbBlockedUsers
Admin -->|"/unban <user_id>"| Bot
Bot -->|"check user_id in BLOCKED_USER_IDS"| EnvBlockedUsers
EnvBlockedUsers -->|"user_id in BLOCKED_USER_IDS"| Bot
Bot -->|"cannot unban"| Admin
EnvBlockedUsers -->|"user_id not in BLOCKED_USER_IDS"| Bot
Bot -->|"remove user_id"| DbBlockedUsers
Admin -->|"/blocked"| Bot
Bot --> EnvBlockedUsers
Bot --> DbBlockedUsers
EnvBlockedUsers -->|"ENV-blocked list"| Admin
DbBlockedUsers -->|"DB-blocked list (date, reason)"| Admin
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
🧯 Dangerous deletes guard reportPolicy: see .cursorrules — dangerous deletions are blocked unless wrapped safely. Summary:
Flagged findings (file:line:snippet): Excluded matches (by path pattern) |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider briefly documenting how admins are expected to obtain the numeric
user_id(e.g., via an existing command or UI) to make the/banand/unbanusage clearer and reduce confusion around the non-support for@username.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments- Consider briefly documenting how admins are expected to obtain the numeric `user_id` (e.g., via an existing command or UI) to make the `/ban` and `/unban` usage clearer and reduce confusion around the non-support for `@username`.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
⏱️ Performance report(No performance test durations collected. Mark tests with |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📖 Documentation PreviewThe documentation has been built successfully!
To view locally:
|
התיעוד הציג את ההודעה כאילו היא אומרת דבר אחד. הקוד מחזיר אותה
בשני מצבים שונים לגמרי:
ℹ️ {target} לא היה חסום (או שבסיס הנתונים לא זמין).
זה משנה בפועל. אדמין שרואה את ההודעה ומסיק שהמשתמש כבר משוחרר
עלול לפספס תקלת DB שבה השחרור לא קרה כלל. נוספה הנחיה לאמת
עם /blocked כשהשחרור חשוב.
התיעוד עצמו מדויק בשאר הפרטים — נבדק מול ההודעות בקוד אחת-אחת.d82271a to
6fbb72eCompare@dosubot |
Uh oh!
There was an error while loading. Please reload this page.
Update documentation for #3222
The commands documentation now includes new admin-only entries for
/ban,/unban, and/blocked, detailing required numericuser_id, optionalreason, expected success/failure messages, and restrictions around blocking admins andBLOCKED_USER_IDS. The FEATURES_SUMMARY was updated to list these new user-management commands and to note that user blocking is enforced at entry with two layers (ENV + DB).Generated by Dosu
Summary by Sourcery
Document new admin-only user management commands for banning, unbanning, and listing blocked users, and describe the enforced blocking layers.
Enhancements:
Documentation:
/ban,/unban, and/blockedcommands, including parameters, behaviors, and restrictions.