feat(tickets): open tickets from a panel button in any channel
CI / quality (push) Has been cancelled
CI / quality (push) Has been cancelled
Members had to know `/ticket create` and its category list to reach support, so the entry point is now a panel: `/ticket setup` publishes it in the current channel, the button opens a menu of the categories the member is allowed to open, and the choice creates the ticket. The panel channel and message are stored in `ticket_panels`, so a reinstall replaces the previous message instead of leaving the server two entry points, and the panel survives a restart.
This commit is contained in:
9 files changed
+492
-29
No files matched your search
+5
-1
@@ -236,12 +236,16 @@ Resolved from the roles configured in `.env` (highest to lowest):
|
||||
|
||||
Tickets are private channels created under `CATEGORY_TICKETS_ID`. One open ticket per member and per category (SQL constraint).
|
||||
|
||||
`/ticket setup` publishes a panel with an **Open a ticket** button in the current channel: the member presses the button, picks a category in a menu, and the private channel opens. The panel channel is stored (`ticket_panels`), so the panel survives a restart and a reinstall replaces the previous message instead of stacking a second one.
|
||||
|
||||
| Command | Options | Access | State | Description |
|
||||
| ---------------- | ------------------------------ | -------------------------------- | ----- | ------------------------------------------------------------------------------------ |
|
||||
| `/ticket create` | `category` (required) | User (depending on the category) | ✅ | Creates a private channel under `CATEGORY_TICKETS_ID` |
|
||||
| `/ticket close` | `reason` (optional, 500 chars) | Author, Staff | ✅ | Closes, logs and then deletes the channel (10 s) — also through the **Close** button |
|
||||
| `/ticket claim` | — | **Staff** | ✅ | Takes the ticket over (**Claim** button) |
|
||||
| `/ticket add` | `user` | **Staff** | ✅ | Adds a participant to the private channel |
|
||||
| `/ticket setup` | — | **Staff** | ✅ | Publishes and pins the opening panel in this channel (replaces the previous one) |
|
||||
| `/ticket setup-remove` | — | **Staff** | ✅ | Removes the panel from this channel |
|
||||
|
||||
Available categories and who can use them:
|
||||
|
||||
@@ -429,7 +433,7 @@ Every text shown in Discord follows the same rules, listed at the top of `src/ui
|
||||
|
||||
- Engine: `node:sqlite` (`DatabaseSync`), **WAL** mode, foreign keys enabled.
|
||||
- Migrations: numbered SQL files in `src/database/migrations/`, applied in a transaction and tracked in `schema_migrations` (`npm run db:init`).
|
||||
- Tables: `guild_settings` (per-guild settings), `notification_channels`, `ticket_categories`, `tickets` (one open ticket per author and category), `moderation_actions`, `polls`, `poll_votes`, `voice_triggers` (voice triggers and their category), `voice_channels` (owner, lock, limit), `bot_statuses` (bot statuses, global — unique text), `event_logs`, `webhook_deliveries`, `web_sessions` (dashboard sessions, cookie fingerprint only), `web_api_tokens`, `deploy_targets` (deploy targets), `deployments` (history and log of every run).
|
||||
- Tables: `guild_settings` (per-guild settings), `notification_channels`, `ticket_categories`, `tickets` (one open ticket per author and category), `ticket_panels` (channel and message of the `/ticket setup` panel), `moderation_actions`, `polls`, `poll_votes`, `voice_triggers` (voice triggers and their category), `voice_channels` (owner, lock, limit), `bot_statuses` (bot statuses, global — unique text), `event_logs`, `webhook_deliveries`, `web_sessions` (dashboard sessions, cookie fingerprint only), `web_api_tokens`, `deploy_targets` (deploy targets), `deployments` (history and log of every run).
|
||||
- Data access: one repository per domain (`settings-`, `event-log-`, `ticket-`, `moderation-`, `poll-`, `notification-`, `voice-`, `voice-trigger-`, `bot-status-`, `web-session-`, `deploy-repository.js`) — SQL queries never leave that layer.
|
||||
- Migrations `002-ticket-and-poll-details.sql` (claim tracking `claimed_at` and closing `close_reason`), `003-voice-channels.sql` (temporary voice channels), `004-voice-triggers.sql` (several voice triggers per server) `005-bot-statuses.sql` (bot statuses edited from a command) and `006-web-dashboard.sql` (sessions, API tokens, deploy targets and history) complete the initial schema.
|
||||
- The database holds real data: it is **excluded from git** (`.gitignore`) and must be backed up (`BACKUP_DIR`).
|
||||
|
||||
Reference in new issue
Block a user