You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(tickets): add temporary and lifetime ticket bans - #647
Adds /ticketban to prevent users from opening tickets without banning them from the server.
/ticketban user:@user duration:7d applies a temporary ban.
/ticketban user:@user applies a lifetime ban.
/ticketunban user:@user lifts an existing ban.
Durations support s, m, h, d, and w, including combinations such as 1d12h. Bans persist across restarts, expire automatically, and apply to all ticket types, including forms opened before the ban. Existing tickets remain accessible.
Both commands require Ban Members or Administrator permissions. Includes English and French translations.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 1ce298d9-72fb-48a5-9a52-94c45bf30b6e
📥 Commits
Reviewing files that changed from the base of the PR and between b593122 and f852d89.
📒 Files selected for processing: 14
.github/workflows/builder.yml
README.md
i18n/en/index.ts
i18n/fr/index.ts
i18n/i18n-types.ts
package.json
scripts/verify-migrate-v3.mjs
scripts/verify-ticketban.mjs
src/db/schema.ts
src/features/commands/ticketban/command.ts
src/features/commands/ticketunban/command.ts
src/features/tickets/bans.ts
src/features/tickets/ticket-workflow.ts
src/migrate-v3-db.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Adds persistent, guild-scoped ticket bans with timed or lifetime durations, /ticketban and /ticketunban commands, and checks that block banned users from opening tickets. Adds English and French messages, migration support, verification tests, README instructions, and a CI test step.
Adds duration parsing, permission checks, ban storage helpers, and the /ticketban and /ticketunban commands. Adds command translations in English and French.
Checks for active bans before opening and creating tickets. Adds English and French messages for lifetime and timed bans.
Verify and document ticket bans scripts/verify-ticketban.mjs, scripts/verify-migrate-v3.mjs, package.json, .github/workflows/builder.yml, README.md
Adds integration checks for duration parsing, permissions, persistence, expiry, unbanning, and ticket-opening paths. Adds a migration assertion, CI test step, and README instructions.
sequenceDiagram
participant TicketInteraction
participant continueTicketOpen
participant getTicketBanMessage
participant ticket_bans
TicketInteraction->>continueTicketOpen: request to open a ticket
continueTicketOpen->>getTicketBanMessage: check the user's active ban
getTicketBanMessage->>ticket_bans: query by guild and user
ticket_bans-->>getTicketBanMessage: active ban or no matching row
getTicketBanMessage-->>continueTicketOpen: ban message or null
continueTicketOpen-->>TicketInteraction: reply with ban message when active
Loading
Merge Risk:⚪ Minimal · up to f852d
The ticket-ban changes are mergeable after normal checks; no concrete issue remains identified.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 11 files. (3 skipped:…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely summarizes the main change: adding temporary and lifetime ticket bans.
Linked Issues check
Issue #607 requests temporary or permanent prevention of ticket opening. The PR adds /ticketban with timed and lifetime bans, /ticketunban, persistent ticket_bans storage, expiry handling, and c…
Out of Scope Changes check
The changes remain connected to issue #607. The schema and migration add ban storage. Commands, translations, README content, workflow integration, and verification support the ticket-ban feature. The…
Full details: Docstring Coverage
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 11 files. (3 skipped: 3 unsupported.)
Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit taps a ban command with care, A timed or lasting rule now waits there. The ticket gate checks before paths unfold, French and English tell what bans hold. And tests watch expiry, storage, and flow.
Comment @coderabbitai help to get the list of available commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
/ticketbanto prevent users from opening tickets without banning them from the server./ticketban user:@user duration:7dapplies a temporary ban./ticketban user:@userapplies a lifetime ban./ticketunban user:@userlifts an existing ban.Durations support
s,m,h,d, andw, including combinations such as1d12h. Bans persist across restarts, expire automatically, and apply to all ticket types, including forms opened before the ban. Existing tickets remain accessible.Both commands require Ban Members or Administrator permissions. Includes English and French translations.
Closes #607.
Summary by CodeRabbit
New Features
/ticketbanand/ticketunbancommands for managing lifetime or time-limited ticket bans.Documentation
Quality