Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
865b3b1
Update bot.js
Vyxz1s3 Jun 13, 2026
1333be3
Change bot footer text from 'Titan Bot' to 'Celestial Bot'
Vyxz1s3 Jun 13, 2026
dbb1eae
Update bot.js
Vyxz1s3 Jun 13, 2026
1a92b09
Update bot primary and secondary color values
Vyxz1s3 Jun 13, 2026
ac4e031
Fix owner IDs parsing in bot configuration
Vyxz1s3 Jun 13, 2026
c1138ef
Update bot owner IDs in configuration
Vyxz1s3 Jun 13, 2026
5cb9dc9
Update support server URL in support.js
Vyxz1s3 Jun 13, 2026
54442ac
Update support server URL in support.js
Vyxz1s3 Jun 13, 2026
0713681
Update support and touchpoint button URLs
Vyxz1s3 Jun 13, 2026
53418b2
Update bug report button label and URL
Vyxz1s3 Jun 13, 2026
b59f09c
Add ticket system documentation
Vyxz1s3 Jun 14, 2026
a19df90
Add ticket system database schema
Vyxz1s3 Jun 14, 2026
9f42885
Update help.js
Vyxz1s3 Jun 14, 2026
232c909
Create Promote
Vyxz1s3 Jun 15, 2026
08cd4cb
Delete src/commands/Promote
Vyxz1s3 Jun 15, 2026
1a0988a
Create Promote
Vyxz1s3 Jun 15, 2026
8a81d37
Delete src/commands/Promote
Vyxz1s3 Jun 15, 2026
f358b9e
Create Promotions
Vyxz1s3 Jun 15, 2026
0c7280a
Update Promotions
Vyxz1s3 Jun 15, 2026
2f4749d
Update Promotions
Vyxz1s3 Jun 15, 2026
64077a3
Delete src/commands/Promotions
Vyxz1s3 Jun 15, 2026
a3fa25c
Create promote.js
Vyxz1s3 Jun 15, 2026
6ecd71d
Update promote.js
Vyxz1s3 Jun 15, 2026
e3e7bec
Update promote.js
Vyxz1s3 Jun 15, 2026
a8cbe84
Update promote.js
Vyxz1s3 Jun 15, 2026
ddcdfca
Update promote.js
Vyxz1s3 Jun 15, 2026
1ad1b6a
Create test.js
Vyxz1s3 Jun 15, 2026
bc54a9f
Delete src/commands/Moderation/promote.js
Vyxz1s3 Jun 15, 2026
a16fa1b
Add files via upload
Vyxz1s3 Jun 15, 2026
383043b
Delete src/commands/Moderation/commands.zip
Vyxz1s3 Jun 15, 2026
1aef9d1
fix: parse GUILD_IDS env var as array for slash command registration
railway-app[bot] Jun 15, 2026
22bbced
Merge pull request #2 from Vyxz1s3/railway/code-change-N6GNEi
Vyxz1s3 Jun 15, 2026
e95aa26
feat: add /promotion and /infraction staff management commands
railway-app[bot] Jun 15, 2026
965821f
Merge pull request #3 from Vyxz1s3/railway/code-change-3xS5S2
Vyxz1s3 Jun 15, 2026
f43fbb0
feat: add shift management system for staff with role-based access
railway-app[bot] Jun 15, 2026
36fd3af
Merge pull request #4 from Vyxz1s3/railway/code-change-ugbkfy
Vyxz1s3 Jun 15, 2026
cb57bfc
fix: cast break_time and total_duration to BIGINT in stopShift query
railway-app[bot] Jun 15, 2026
a7d2120
Merge pull request #5 from Vyxz1s3/railway/code-change-Q-i_LB
Vyxz1s3 Jun 15, 2026
6faa56d
fix(shiftwipe): replace ManageGuild check with ModerateMembers
railway-app[bot] Jun 15, 2026
9604198
Merge pull request #6 from Vyxz1s3/railway/code-change-wn5IsA
Vyxz1s3 Jun 15, 2026
d642bea
feat: replace shift subcommands with /shift manage button panel
railway-app[bot] Jun 15, 2026
b268a4b
Merge pull request #7 from Vyxz1s3/railway/code-change-cbCdm9
Vyxz1s3 Jun 15, 2026
d3c4621
fix: disable Search commands to free slots for /shift registration
railway-app[bot] Jun 15, 2026
4353005
Merge pull request #8 from Vyxz1s3/railway/code-change-CW_E9f
Vyxz1s3 Jun 15, 2026
9099690
feat: add per-action role config for shift start/break/stop
railway-app[bot] Jun 15, 2026
514c3d5
Merge pull request #9 from Vyxz1s3/railway/code-change-zYXYcd
Vyxz1s3 Jun 15, 2026
4c0073b
fix: require Administrator instead of ManageGuild for /shiftconfig
railway-app[bot] Jun 15, 2026
22818b7
Merge pull request #10 from Vyxz1s3/railway/code-change-gqyvLB
Vyxz1s3 Jun 15, 2026
beb0cb4
fix: drop NOT NULL on shift_role_id in shift_config migration
railway-app[bot] Jun 15, 2026
babf719
Merge pull request #11 from Vyxz1s3/railway/code-change-iSS34p
Vyxz1s3 Jun 15, 2026
f67a22c
fix: explicitly set shift_role_id=NULL in setShiftStart/Break/StopRol…
railway-app[bot] Jun 15, 2026
17b1446
Merge pull request #12 from Vyxz1s3/railway/code-change-oApvLD
Vyxz1s3 Jun 15, 2026
8fb5656
fix: allow multiple ticket panels and fix silent button handler failures
railway-app[bot] Jun 15, 2026
b9cb072
Merge pull request #13 from Vyxz1s3/railway/code-change-MXQGGC
Vyxz1s3 Jun 15, 2026
b383c42
feat: remove activity command and Voice category
railway-app[bot] Jun 15, 2026
c8fad7f
Merge pull request #14 from Vyxz1s3/railway/code-change-gQPqU3
Vyxz1s3 Jun 15, 2026
c41bb30
feat: remove Application command system entirely
railway-app[bot] Jun 15, 2026
1acfeac
Merge pull request #15 from Vyxz1s3/railway/code-change-Vjb-_R
Vyxz1s3 Jun 15, 2026
b05804c
fix(help): remove applications mention from Community category descri…
railway-app[bot] Jun 15, 2026
9583f16
Merge pull request #16 from Vyxz1s3/railway/code-change-Bfdgno
Vyxz1s3 Jun 15, 2026
ebbf2c3
feat: remove Search command category (define, google, movie, urban)
railway-app[bot] Jun 15, 2026
6d96c1c
Merge pull request #17 from Vyxz1s3/railway/code-change-yjWtP8
Vyxz1s3 Jun 15, 2026
e44804d
fix(help): remove Search category icon from CATEGORY_ICONS
railway-app[bot] Jun 15, 2026
b3a3a0f
Merge pull request #18 from Vyxz1s3/railway/code-change-9bXp7t
Vyxz1s3 Jun 15, 2026
7ce4b00
fix: replace "Made with ❤️" with "Made with Community Bot Dashboard"
railway-app[bot] Jun 15, 2026
2ab0e00
Merge pull request #19 from Vyxz1s3/railway/code-change-5Ajph7
Vyxz1s3 Jun 15, 2026
67e2d9e
feat: add anti-raid system with /antiraid command and service
railway-app[bot] Jun 15, 2026
9914268
Merge pull request #22 from Vyxz1s3/railway/code-change-fz4NJZ
Vyxz1s3 Jun 15, 2026
3d88c0d
Update support.js
Vyxz1s3 Jun 15, 2026
be0d559
feat: add /say command to Utility category
railway-app[bot] Jun 15, 2026
2c57185
Merge pull request #23 from Vyxz1s3/railway/code-change-AB_hR1
Vyxz1s3 Jun 15, 2026
2dba7cb
fix: convert test.js to ESM and remove duplicate channelName declaration
railway-app[bot] Jun 15, 2026
048560c
Merge pull request #24 from Vyxz1s3/railway/code-change-gvSSjq
Vyxz1s3 Jun 15, 2026
63add52
feat: add /retirement command and embed images to promotion/infraction
railway-app[bot] Jun 15, 2026
8a781fc
Merge pull request #25 from Vyxz1s3/railway/code-change-qWOGdH
Vyxz1s3 Jun 15, 2026
5c28d16
fix: add top banner and bottom thumbnail to staff embed commands
railway-app[bot] Jun 15, 2026
dfdd010
Merge pull request #26 from Vyxz1s3/railway/code-change-a0LYsr
Vyxz1s3 Jun 15, 2026
ebbc8ad
feat: update promotion and infraction embeds to divider format
railway-app[bot] Jun 15, 2026
35c99b9
Merge pull request #27 from Vyxz1s3/railway/code-change-5WVcMJ
Vyxz1s3 Jun 15, 2026
9c1c080
fix: replace :divider: with custom arrow emoji in promotion and infra…
railway-app[bot] Jun 15, 2026
056ae41
Merge pull request #30 from Vyxz1s3/railway/code-change-JPPFv6
Vyxz1s3 Jun 15, 2026
151b367
feat: consolidate staff command embeds into single embed with image a…
railway-app[bot] Jun 15, 2026
6cd898c
Merge pull request #31 from Vyxz1s3/railway/code-change-CwnrFH
Vyxz1s3 Jun 15, 2026
dbdf6d2
fix: replace arrow emoji dividers with ━ line dividers in embeds
railway-app[bot] Jun 15, 2026
2b6cbd8
Merge pull request #32 from Vyxz1s3/railway/code-change-jGJvyK
Vyxz1s3 Jun 15, 2026
6ace0d2
feat: update staff embed descriptions to bold arrow format
railway-app[bot] Jun 15, 2026
d256fe1
Merge pull request #34 from Vyxz1s3/railway/code-change-rmiBqK
Vyxz1s3 Jun 15, 2026
8274e2b
fix: remove embed colors and add > prefix to staff embed field lines
railway-app[bot] Jun 16, 2026
99110e1
Merge pull request #35 from Vyxz1s3/railway/code-change-UIp7Q7
Vyxz1s3 Jun 16, 2026
0da57a7
fix: remove thumbnail from promotion, infraction, and retirement embeds
railway-app[bot] Jun 16, 2026
a23aa9c
Merge pull request #36 from Vyxz1s3/railway/code-change-tMWIQt
Vyxz1s3 Jun 16, 2026
0dd1628
Update infraction.js
Vyxz1s3 Jun 16, 2026
0506b68
Update retirement.js
Vyxz1s3 Jun 16, 2026
98ae78c
feat: add 0x2C2F33 embed color to promotion, infraction, retirement
railway-app[bot] Jun 16, 2026
8e2d175
Merge pull request #37 from Vyxz1s3/railway/code-change-Esmtii
Vyxz1s3 Jun 16, 2026
da19457
Update infraction.js
Vyxz1s3 Jun 16, 2026
6ba4b78
fix: add missing comma for footer text in infraction embed
railway-app[bot] Jun 16, 2026
6de6456
Merge pull request #38 from Vyxz1s3/railway/code-change-XwAUvv
Vyxz1s3 Jun 16, 2026
f44e94e
feat: convert rank/supervisor options to role and user pickers
railway-app[bot] Jun 16, 2026
509defc
Merge pull request #39 from Vyxz1s3/railway/code-change-y45P_Q
Vyxz1s3 Jun 16, 2026
eaa75fa
feat(infraction): auto-assign infraction role to staff member on issue
railway-app[bot] Jun 16, 2026
5cee71d
Merge pull request #40 from Vyxz1s3/railway/code-change-JpzJIS
Vyxz1s3 Jun 16, 2026
2b6f29a
feat(promotion): remove old rank and add new rank on promotion
railway-app[bot] Jun 16, 2026
032c935
Merge pull request #41 from Vyxz1s3/railway/code-change-nrAthZ
Vyxz1s3 Jun 16, 2026
d90e0e7
feat: redesign promotion embed with professional visual hierarchy
railway-app[bot] Jun 16, 2026
76519c0
Merge pull request #43 from Vyxz1s3/railway/code-change-9zfj8O
Vyxz1s3 Jun 16, 2026
b62257a
style: darken embed color from 0x2C2F33 to 0x0f0f0f in staff commands
railway-app[bot] Jun 16, 2026
5662950
Merge pull request #44 from Vyxz1s3/railway/code-change-O3N9iX
Vyxz1s3 Jun 16, 2026
be4bf86
fix: update embed color from 0x0f0f0f to 0x1a1a1a in staff commands
railway-app[bot] Jun 16, 2026
5913bf7
Merge pull request #45 from Vyxz1s3/railway/code-change--eHSO9
Vyxz1s3 Jun 16, 2026
66cc38b
feat: redesign staff command embeds with consistent layout structure
railway-app[bot] Jun 16, 2026
3b11582
Merge pull request #46 from Vyxz1s3/railway/code-change-nfiFW8
Vyxz1s3 Jun 16, 2026
3b76d0a
Update bot.js
Vyxz1s3 Jun 17, 2026
73c53fb
Update bot.js
Vyxz1s3 Jun 17, 2026
4b13911
Update bot.js
Vyxz1s3 Jun 17, 2026
7b37ef1
Update bot.js
Vyxz1s3 Jun 17, 2026
856fa0b
Update bot.js
Vyxz1s3 Jun 17, 2026
65b2465
Add Roblox join request handler with Discord notifications
Jun 23, 2026
6b68cce
Change Roblox join request check to every minute (real-time)
Jun 23, 2026
abd1cc5
Fix button handler and add detailed Roblox logging
Jun 23, 2026
0845018
Fix button handler structure to match existing pattern
Jun 23, 2026
2e7a2da
Simplify and fix Roblox join request handler
Jun 23, 2026
6351f93
Fix button export format
Jun 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
DISCORD_TOKEN=your_discord_bot_token_here
CLIENT_ID=your_discord_client_id_here
GUILD_ID=your_discord_guild_id_here
GUILD_IDS=id1,id2,id3
OWNER_IDS=your_discord_id_here (optional)

# Bot Runtime Configuration
Expand Down
388 changes: 388 additions & 0 deletions README_TICKET_SYSTEM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,388 @@
# 🎫 Verity Ticket System

A comprehensive, production-ready Discord ticket system for your server. Manage support requests efficiently with automatic channel creation, staff assignment, and detailed logging.

## Features

✨ **Core Features:**
- 🎫 One-click ticket creation via modal
- 📋 Automatic ticket channel creation
- 👤 User permission management
- 🔐 Secure channel isolation
- 📊 Comprehensive dashboard
- 🎯 Staff assignment & claiming
- 📝 Internal notes system
- 🔴 Priority levels (Low, Normal, High, Urgent)
- 📜 Transcript generation
- 📈 Audit logging
- 💾 Full PostgreSQL integration
- 🏷️ Customizable categories
- ⚙️ Per-server configuration

## Installation

### 1. Run Database Migration

```bash
npm run migrate
```

This creates all necessary tables:
- `tickets` - Main ticket data
- `ticket_messages` - Message logging
- `ticket_settings` - Server configuration
- `ticket_categories` - Custom categories
- `ticket_notes` - Staff notes
- `ticket_audit_log` - Action logging

### 2. Load Commands

Copy these files to your commands directory:
- `src/commands/tickets/ticket.js` - User ticket commands
- `src/commands/admin/ticketsetup.js` - Setup commands
- `src/commands/admin/ticketadmin.js` - Admin dashboard
- `src/models/Ticket.js` - Database model
- `src/events/ticketInteractions.js` - Event handlers

### 3. Register Event Handlers

Add the `ticketInteractions.js` event handler to your bot's event loader.

## Setup Instructions

### Step 1: Initialize Ticket System

```
/ticketsetup create-channels
```

This automatically creates:
- 🎫 Support Tickets (category)
- 📋 ticket-logs (channel)
- 🎟️ create-ticket (panel channel)

### Step 2: Configure Settings

```
/ticketsetup configure ticket-category: [Category] log-channel: [Channel] support-role: [Role] max-tickets: [Number]
```

**Options:**
- `ticket-category` - Where ticket channels are created
- `log-channel` - Where ticket actions are logged
- `support-role` - Role for support staff
- `max-tickets` - Max open tickets per user (default: 5)

### Step 3: Create Ticket Panel (Optional)

```
/ticketsetup panel channel: [Channel]
```

Creates a dedicated ticket creation panel in any channel.

## User Commands

### Create a Ticket

```
/ticket open [category]
```

Opens a modal where users can:
- Enter ticket subject
- Describe their issue in detail
- Select category (optional)

A private channel is automatically created!

### View Your Tickets

```
/ticket list
```

Shows all your open tickets with status information.

### Close Your Ticket

```
/ticket close ticket_id: [ID] [reason]
```

Close your own ticket (or admin closes others).

### View Ticket Details

```
/ticket view ticket_id: [ID]
```

See full ticket information including assigned staff and status.

### System Status

```
/ticket status
```

View overall ticket system statistics.

## Staff Commands

### Dashboard

```
/ticketadmin dashboard
```

View real-time statistics:
- Total tickets
- Open tickets
- Closed tickets
- Unassigned tickets
- Assignment rate
- Recent unassigned tickets

### Claim a Ticket

```
/ticket claim ticket_id: [ID]
```

Staff can claim unassigned tickets to work on them.

### Assign Ticket

```
/ticketadmin assign ticket_id: [ID] staff_member: [User]
```

Assign a ticket to a specific staff member.

### Add Internal Notes

```
/ticketadmin notes ticket_id: [ID] note: [Text]
```

Add private notes (visible to staff only) for ticket context.

### Set Priority

```
/ticketadmin priority ticket_id: [ID] priority: [low|normal|high|urgent]
```

Set ticket priority level. Affects channel appearance and urgency.

### Search Tickets

```
/ticketadmin search query: [Text]
```

Search by:
- Ticket ID
- User ID
- Ticket subject
- Status

### Generate Transcript

```
/ticketadmin transcript ticket_id: [ID]
```

Export full ticket conversation as `.txt` file.

## Ticket Lifecycle

```
1. User opens ticket via /ticket open
2. Private channel created automatically
3. Staff see notification in logs
4. Staff claims ticket via button or /ticket claim
5. Staff and user communicate in channel
6. Staff adds notes and sets priority
7. Issue resolved → /ticket close
8. Channel deleted automatically
9. Transcript available if needed
```

## Database Schema

### tickets
```sql
ticket_id (VARCHAR) - Unique ID like TKT-1234
guild_id - Server ID
user_id - Ticket opener
channel_id - Discord channel
category - Ticket category
status - open/closed
assigned_to - Staff member ID
created_at - Creation timestamp
closed_at - Closure timestamp
subject - Ticket title
description - Ticket details
priority - low/normal/high/urgent
is_archived - Archive flag
```

### ticket_messages
```sql
ticket_id - Reference to ticket
author_id - Message sender
message_content - Full message text
created_at - Timestamp
```

### ticket_settings
```sql
guild_id - Server ID
category_channel_id - Ticket category
log_channel_id - Log channel
support_role_id - Staff role
ticket_prefix - ID prefix (default: TKT)
max_open_per_user - Limit per user
auto_close_days - Auto-close after X days
enable_priority - Show priority level
enable_categories - Enable categories
```

## Workflow Example

### For Users:
1. Click "Create Ticket" button
2. Fill in problem details
3. Wait for staff response
4. Discuss in private channel
5. Staff resolves issue
6. Ticket auto-closes

### For Admins:
1. Setup ticket system: `/ticketsetup create-channels`
2. Configure channels: `/ticketsetup configure`
3. View dashboard: `/ticketadmin dashboard`
4. Assign tickets: `/ticketadmin assign`
5. Track resolution: `/ticketadmin notes`
6. Archive transcripts: `/ticketadmin transcript`

## Permissions

**User Tickets:**
- Can open tickets
- Can see own ticket channel
- Can close own ticket

**Staff:**
- Can claim tickets
- Can assign tickets
- Can add notes
- Can see all tickets
- Can close any ticket
- Can generate transcripts

**Admin:**
- Full ticket system access
- Can configure settings
- Can setup channels
- Can manage all tickets

## Customization

### Add Custom Categories

```
/ticketsetup addcategory name: [Name] description: [Description] emoji: [Emoji]
```

Example:
```
/ticketsetup addcategory name: "Bug Report" description: "Report bugs and issues" emoji: "🐛"
/ticketsetup addcategory name: "Feature Request" description: "Suggest new features" emoji: "💡"
/ticketsetup addcategory name: "Account Support" description: "Account-related issues" emoji: "👤"
```

### Ticket ID Format

By default, tickets use format: `TKT-1234`

To customize, update the `ticket_prefix` in database:

```sql
UPDATE ticket_settings SET ticket_prefix = 'SUPPORT' WHERE guild_id = '...';
```

### Auto-Close Settings

Configure tickets to auto-close after N days:

```sql
UPDATE ticket_settings SET auto_close_days = 7 WHERE guild_id = '...';
```

## Troubleshooting

### Ticket not appearing in logs?
- Check log channel is configured: `/ticketsetup configure log-channel: [Channel]`
- Verify bot has permissions to send messages

### Can't see ticket channel?
- Check that bot has proper permissions in category
- Verify user ID matches ticket owner

### Staff can't claim tickets?
- Ensure staff role is configured: `/ticketsetup configure support-role: [Role]`
- Check bot permissions in ticket channels

### Messages not logging?
- Verify `ticket_messages` table exists
- Check database connection

## Database Queries

### Get all open tickets
```sql
SELECT * FROM tickets WHERE status = 'open' AND guild_id = '...' ORDER BY created_at DESC;
```

### Get unassigned tickets
```sql
SELECT * FROM tickets WHERE status = 'open' AND assigned_to IS NULL AND guild_id = '...';
```

### Get staff performance
```sql
SELECT assigned_to, COUNT(*) as closed_count FROM tickets WHERE status = 'closed' AND guild_id = '...' GROUP BY assigned_to;
```

### Generate report
```sql
SELECT
DATE(created_at) as date,
COUNT(*) as total,
COUNT(CASE WHEN status = 'closed' THEN 1 END) as closed
FROM tickets WHERE guild_id = '...' GROUP BY DATE(created_at);
```

## Performance Tips

1. **Index optimization** - Database already has proper indexes
2. **Archive old tickets** - Set `is_archived = true` for tickets > 30 days old
3. **Clean logs** - Periodically delete old `ticket_messages` entries
4. **Batch operations** - Use admin panel for bulk ticket actions

## Support

For issues or feature requests, check:
- Discord.js documentation: https://discord.js.org
- PostgreSQL documentation: https://www.postgresql.org/docs
Loading