Skip to content

feat(tickets): add temporary and lifetime ticket bans - #647

Merged
Sayrix merged 1 commit into
mainfrom
feat/ticketban
Oct 14, 2026
Merged

Sayrix merged 1 commit into
mainfrom
feat/ticketban

Conversation

@Sayrix

@Sayrix Sayrix commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

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.

Closes #607.

Summary by CodeRabbit

  • New Features

    • Added /ticketban and /ticketunban commands for managing lifetime or time-limited ticket bans.
    • Users with an active ticket ban are notified and prevented from opening tickets through panels and forms.
  • Documentation

    • Added guidance on ticket-ban permissions, duration formats, expiration, and setup.
  • Quality

    • Added automated checks for ban management and ticket-opening behavior.

@Sayrix

Sayrix commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

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.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Review in Change Stack →

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.

Changes: Ticket Ban Feature

Layer / File(s) Summary
Persist ticket bans
src/db/schema.ts, src/migrate-v3-db.ts
Adds the ticket_bans table with a composite key on guild and user to the Drizzle schema and v3-to-v4 migration.
Manage ticket bans
src/features/tickets/bans.ts, src/features/commands/ticketban/command.ts, src/features/commands/ticketunban/command.ts, i18n/i18n-types.ts, i18n/en/index.ts, i18n/fr/index.ts
Adds duration parsing, permission checks, ban storage helpers, and the /ticketban and /ticketunban commands. Adds command translations in English and French.
Block banned ticket opens
src/features/tickets/ticket-workflow.ts, i18n/i18n-types.ts, i18n/en/index.ts, i18n/fr/index.ts
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.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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 Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely summarizes the main change: adding temporary and lifetime ticket bans.
Linked Issues check Passed 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 Passed 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.

❤️ Share

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.

@Sayrix
Sayrix merged commit 01255ae into main Oct 14, 2026
5 checks passed
@Sayrix
Sayrix deleted the feat/ticketban branch October 14, 2026 08:51
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.

Add the ability to ban someone from opening tickets

1 participant