audit
This commit is contained in:
@@ -38,7 +38,7 @@ These are the files that give someone the fastest path to understanding the repo
|
||||
|
||||
### 8. [**services/tickets.js**](../services/tickets.js)
|
||||
- **Why:** Core ticket lifecycle and Discord channel/thread creation.
|
||||
- **What you get:** Ticket numbers (`getNextTicketNumber`), channel naming and Discord rate limit handling (2 renames per 10 min), ticket limits and overflow category selection, rate limit for ticket creation per user, `createEmailTicketAsThread` / `createDiscordTicketAsThread`, auto-close/reminder/auto-unclaim jobs, and helpers like `updateTicketActivity`, `canRename`, `makeTicketName`.
|
||||
- **What you get:** Ticket numbers (`getNextTicketNumber`), channel naming, ticket limits and overflow category selection, rate limit for ticket creation per user, `createEmailTicketAsThread` / `createDiscordTicketAsThread`, auto-close/reminder/auto-unclaim jobs, and helpers like `updateTicketActivity`, `canRename` (retained as an always-ok shim — see `utils/renamer.js` and `services/channelQueue.js` for actual rename handling and primary-bot fallback), `makeTicketName`.
|
||||
|
||||
### 9. [**handlers/buttons.js**](../handlers/buttons.js)
|
||||
- **Why:** Every button and ticket modal goes through here.
|
||||
@@ -167,7 +167,7 @@ Broccolini Bot is a **Node.js support-ticket bot** that connects **Gmail**, **Di
|
||||
### Claim / Unclaim / Close
|
||||
|
||||
- **Claim** (button or `/claim`)
|
||||
Ticket is updated with `claimedBy` (user id or name). Channel may be renamed (respecting Discord’s 2 renames per 10 min). Claimed message is posted (template from CONFIG).
|
||||
Ticket is updated with `claimedBy` (user id or name). Channel may be renamed via the secondary-bot path (`utils/renamer.js`), falling back to the primary bot on 401/403/429. Claimed message is posted (template from CONFIG).
|
||||
|
||||
- **Unclaim** (button or `/unclaim`)
|
||||
`claimedBy` is cleared; channel rename and message as above.
|
||||
|
||||
@@ -200,7 +200,7 @@ THREAD_PARENT_CHANNEL=
|
||||
- Optimized background job queries
|
||||
|
||||
### Rate Limit Handling
|
||||
- Channel rename: 2 per 10 minutes per channel (Discord limit). When limit is reached, message: *Channel renamed too quickly. Try again \<t:unlock:R\>.*
|
||||
- Channel rename: Discord enforces 2 per 10 minutes per channel **per bot**. Renames route through `utils/renamer.js` (RENAMER_BOT secondary token); on 401/403/429 from the secondary, `services/channelQueue.js` falls back to the primary bot via `channel.setName`.
|
||||
- Modal submission handling
|
||||
- Autocomplete debouncing
|
||||
- Batch command registration
|
||||
|
||||
@@ -447,7 +447,7 @@ THREAD_PARENT_CHANNEL=
|
||||
|
||||
### Rate Limits
|
||||
- Channel creation: 50/day per guild
|
||||
- Channel rename: 2 per 10 minutes per channel ([Discord docs](https://discord.com/developers/docs/topics/rate-limits)). When the limit is reached, the bot skips the rename and posts: *Channel renamed too quickly. Try again \<t:unlock:R\>.*
|
||||
- Channel rename: Discord enforces 2 per 10 minutes per channel **per bot** ([Discord docs](https://discord.com/developers/docs/topics/rate-limits)). Renames route through `utils/renamer.js` (RENAMER_BOT secondary token); on 401/403/429 from the secondary, `services/channelQueue.js` falls back to the primary bot via `channel.setName`.
|
||||
- Message edits: Be cautious with bulk operations
|
||||
|
||||
---
|
||||
|
||||
@@ -66,8 +66,8 @@ const Transcript = mongoose.model('Transcript');
|
||||
claimed_by: String (Discord user ID),
|
||||
escalated: Boolean (default: false),
|
||||
ticket_number: Number,
|
||||
rename_count: Number (default: 0),
|
||||
rename_window_start: Date
|
||||
rename_count: Number (default: 0), // orphan: no longer read/written (see CLAUDE.md)
|
||||
rename_window_start: Date // orphan: no longer read/written
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user