Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughUpdated Changes
Sequence DiagramsequenceDiagram
actor Admin
participant Mod as Moderation Module
participant MStorage as MessageUserStorage
participant TG as Telegram API
participant Shared as Shared API
Admin->>Mod: request BAN(target, chat, duration)
Mod->>MStorage: sync() (best-effort)
alt sync OK / error ignored
MStorage-->>Mod: sync complete
end
Mod->>TG: getLastByUser(target, chat, limit=100) (errors -> [])
TG-->>Mod: messages[]
Mod->>Shared: deleteMessages(messages[]) (best-effort)
Shared-->>Mod: deletion result (or error ignored)
par
Mod->>TG: banChatMember(target, { revoke_messages: true, until_date })
TG-->>Mod: ban result (true/false)
and
Mod->>Mod: deleteLastMessages(...) runs concurrently
end
Mod-->>Admin: return ban result
Possibly related PRs
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/modules/moderation/index.ts`:
- Around line 157-184: Move the immediate ban to the front of the "BAN" case by
calling modules.shared.api.banChatMember(p.chat.id, p.target.id, {...}) first
(await its result or handle failure) and then kickoff the
MessageUserStorage.getInstance().sync(),
api.tg.messages.getLastByUser.query(...), and
modules.shared.api.deleteMessages(...) as best-effort asynchronous work (do not
block the ban); replace the empty .catch(() => {}) handlers with logging of
errors (use the existing logger) so failures are recorded rather than silently
swallowed, and ensure deleteMessages uses the messages map as currently
implemented but runs after the ban without delaying it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9d6f12e1-0d4b-457a-bba0-c8ce930fe37a
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
package.jsonsrc/modules/moderation/index.ts
No description provided.