Skip to content

feat: remove voting system from banall#94

Merged
toto04 merged 3 commits intomainfrom
remove-voting-banall
Apr 11, 2026
Merged

feat: remove voting system from banall#94
toto04 merged 3 commits intomainfrom
remove-voting-banall

Conversation

@lorenzocorallo
Copy link
Copy Markdown
Member

  • poor me

@lorenzocorallo lorenzocorallo requested a review from toto04 April 11, 2026 18:46
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Warning

Rate limit exceeded

@lorenzocorallo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 53 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 53 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c2790bf2-691e-4c72-ba4c-ba585b02382d

📥 Commits

Reviewing files that changed from the base of the PR and between 4cd9f56 and 93c8e60.

📒 Files selected for processing (3)
  • src/modules/moderation/ban-all.ts
  • src/modules/tg-logger/ban-all.ts
  • src/modules/tg-logger/index.ts

Walkthrough

This PR removes the voting and approval mechanism from the BanAll command. The refactored flow no longer queries Direttivo permissions or embeds voter data; instead, it sends the ban request to Telegram, verifies message delivery, and delegates initiation to a dedicated BanAll module.

Changes

Cohort / File(s) Summary
BanAll Voting Flow Removal
src/modules/tg-logger/ban-all.ts, src/modules/tg-logger/index.ts
Removed voting interaction components (outcome, voters fields, VOTE_EMOJI, OUTCOME_STR constants, vote handler, banAllMenu export). Simplified getBanAllText rendering to exclude outcome status and per-voter listings. Refactored TgLogger.banAll to eliminate Direttivo permission validation, instead verifying Telegram message delivery and delegating to banAll.initiateBanAll().

Sequence Diagram

sequenceDiagram
    participant User
    participant TgLogger
    participant Telegram API
    participant BanAll Module

    User->>TgLogger: Trigger banAll command
    TgLogger->>TgLogger: Log banAll request text
    TgLogger->>Telegram API: Send ban notification message
    Telegram API-->>TgLogger: Return message with message_id
    
    rect rgba(76, 175, 80, 0.5)
    TgLogger->>TgLogger: Verify message_id exists
    end
    
    TgLogger->>BanAll Module: initiateBanAll(banAll, message_id)
    BanAll Module-->>TgLogger: Acknowledgment
    TgLogger-->>User: Return "started" status text
Loading

Possibly Related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: remove voting system from banall' directly and accurately summarizes the main change: removing the voting interaction flow from the BanAll feature by deleting vote-related fields, constants, handlers, and menu exports.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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/tg-logger/index.ts`:
- Line 193: The posted code calls modules.get("banAll").initiateBanAll(banAll,
msg.message_id) but the new BanAll payload lacks outcome, causing
src/modules/moderation/ban-all.ts (initiateBanAll) to throw when it expects
banAll.outcome === "approved"; either update initiateBanAll to accept the new
no-vote flow (remove/guard the outcome check and proceed on missing outcome) or,
as a transitional fix here, set banAll.outcome = "approved" before calling
initiateBanAll so the existing approval check passes (reference
modules.get("banAll").initiateBanAll and the outcome check inside initiateBanAll
in ban-all.ts).
- Around line 177-179: The code still calls banAllMenu and passes reply_markup
when sending the BanAll message even though the BanAll voting UI was removed;
remove the stale wiring by eliminating the await banAllMenu(banAll) call and
remove the reply_markup option from the this.log call that sends
getBanAllText(banAll). Update the block that currently calls banAllMenu,
getBanAllText, and this.log(this.topics.banAll, ..., { reply_markup: menu }) to
simply log the separator and then log getBanAllText(banAll) without any menu or
reply_markup usage; ensure no remaining references to banAllMenu so compilation
succeeds.
🪄 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: 61b981f0-aff0-4bf3-a21c-f83c0657eee8

📥 Commits

Reviewing files that changed from the base of the PR and between cb4f2dc and 4cd9f56.

📒 Files selected for processing (2)
  • src/modules/tg-logger/ban-all.ts
  • src/modules/tg-logger/index.ts

Comment thread src/modules/tg-logger/index.ts Outdated
Comment thread src/modules/tg-logger/index.ts
@toto04 toto04 merged commit ce3cd7d into main Apr 11, 2026
2 checks passed
@toto04 toto04 deleted the remove-voting-banall branch April 11, 2026 19:07
@coderabbitai coderabbitai Bot mentioned this pull request Apr 11, 2026
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.

2 participants