Skip to content

feat(command): add ticket system#1029

Open
nomnomshark41 wants to merge 18 commits intoallthingslinux:mainfrom
nomnomshark41:feat/tickets
Open

feat(command): add ticket system#1029
nomnomshark41 wants to merge 18 commits intoallthingslinux:mainfrom
nomnomshark41:feat/tickets

Conversation

@nomnomshark41
Copy link

@nomnomshark41 nomnomshark41 commented Aug 21, 2025

Description

This pull request introduces a support ticket system to Tux, including database schema changes, backend controllers, and Discord bot cogs with logging and configuration. The main changes add models and logic to manage tickets, track their status, and log transcripts with event metadata. Additionally, the database controller system is extended to support ticket operations.

Ticket System Implementation

  • Prisma Schema
    • Added a new Ticket model and TicketStatus enum, including fields for ticket metadata and relations to Guild for efficient querying.
    • Updated the Guild model` to include a relation to tickets, enabling guild-level ticket management.

Database Controller Enhancements

  • Implemented TicketController with methods for creating, updating (claim, unclaim, close), querying, and deleting tickets, following best practices for error handling and async operations.
  • Integrated TicketController into the main DatabaseController, allowing unified access to ticket operations alongside existing controllers.
  • Registered the Ticket model in base controller imports and type lists for proper ORM integration (base.py).

Discord Bot Ticket Logging & Configuration

  • Added a new cog TicketLog for enhanced ticket transcript logging, including event tracking (claims, closes, permission changes), message analysis, and metadata-rich transcript files sent to a configurable log channel.
  • Added a configuration cog TicketLogConfig to set and persist the ticket log channel per guild, supporting administrator-only slash commands for setup.

Minor Moderation Command Update

  • Removed the "t" alias from the timeout command to avoid conflicts or confusion.

Guidelines

  • My code follows the style guidelines of this project (formatted with Ruff)

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation if needed

  • My changes generate no new warnings

  • I have tested this change

  • Any dependent changes have been merged and published in downstream modules

  • I have added all appropriate labels to this PR

  • I have followed all of these guidelines.

How Has This Been Tested? (if applicable)

I ran Tux in dev mode and tested it with mods from ATL in a private server.

Screenshots (if applicable)

Please add screenshots to help explain your changes.

Additional Information

Please add any other information that is important to this PR.

Summary by Sourcery

Add a comprehensive support ticket system to the bot, encompassing database schema updates, a new TicketController, Discord commands and cogs for ticket creation and management, interactive UI views, and a transcript logging subsystem with configurable log channel per guild

New Features:

  • Add full support ticket system with commands for creating, claiming, unclaiming, closing, listing, and managing tickets
  • Introduce TicketController with create, claim, unclaim, close, query, and delete operations integrated into the DatabaseController
  • Define Ticket model and TicketStatus enum in Prisma schema and link tickets to Guild and GuildConfig
  • Provide TicketLog cog for transcript logging with event tracking and metadata-rich logs
  • Provide TicketLogConfig cog to configure the ticket log channel per guild
  • Add interactive UI views (RequestCloseView and TicketManagementView) for ticket workflows

Enhancements:

  • Extend base controller imports and DatabaseController to include ticket operations
  • Remove conflicting alias from timeout command

Loading
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.

1 participant