$ show Sayrix/Ticket-Bot
This repository is a production-grade Discord bot for managing support tickets, built with TypeScript and the discord.js core library. It provides a complete ticket lifecycle: users open tickets via panels (select menus or buttons), staff can claim, close, reopen, rename, add/remove participants, and the bot generates transcripts via ticket.pm. The architecture follows a modular feature-based pattern with automatic discovery of commands, events, and feature modules from the filesystem. The bot uses SQLite (via drizzle-orm and libsql) for persistence, supports internationalization (English and French), and includes telemetry, update checking, and migration scripts from v3 to v4. Key entry points are the slash commands (/add, /claim, /close, /reopen, /remove, /rename, /unclaim, /cleardm, /mass_add) and interactive components (buttons, selects, modals). External dependencies include Discord API, libsql, drizzle-orm, ticket.pm SDK, and typesafe-i18n.
The LLM identified 2 files worth highlighting for reuse:
Provides a simple, self-contained utility for encoding and decoding structured custom IDs used in Discord interactions. The pattern uses a colon separator and URI-encodes state segments, making it easy to embed feature keys, action names, and arbitrary state into a single string. This component is fully isolated and can be reused in any Discord bot or any application needing structured string IDs.
Implements a generic file-based module discovery system that recursively walks a directory, imports TypeScript/JavaScript files, and filters exported values by type guard. It is used to automatically register commands, events, and features without manual configuration. The pattern is reusable in any Node.js project that needs to auto-discover modules from a directory structure, with minimal adaptation (just change the directory path and type guard).