How jiahong-guan/ticket-bot works
Ticket Bot is a Discord support-ticket application. Server administrators configure panels through a five-step wizard; members use panel buttons to open tickets, while owners and support staff manage ticket access and lifecycle through slash commands or persistent controls. TicketService coordinates channel and permission changes, storage, rate-limit handling, and transcript creation; TinyDB persists guild, panel, ticket, and member state. The README documents these capabilities, but several command and service implementations were not sampled, so their internal links are omitted unless the available evidence supports them.
Main entry points: bot.py Bot runtime · ticket_service.py Ticket lifecycle · database.py Database access · ticket_controls.py Ticket controls
Components 23
Discord entry points
- Application startup
main.py - Bot runtime
bot.py - Panel administration
cogs/admin.py - General commands
cogs/general.py - Setup command
cogs/panels.py - Ticket commands
cogs/tickets.py - Command base
cogs/base_command.py
Ticket workflows
- Panel wizard
utils/views/panel_wizard.py - Ticket controls
utils/views/ticket_controls.py - Ticket lifecycle
utils/ticket_service.py - Transcript renderer
utils/transcript.py
Shared services
- Access checks
utils/checks.py - Edit rate limiter
utils/rate_limit.py - Discord embeds
utils/embeds.py - Error handling
utils/error_handler.py - Domain errors
utils/exceptions.py - Configuration
utils/config.py - Logging
utils/logger.py
Persistence and output
- Database access
utils/database.py - Atomic TinyDB files
db - HTML transcript files
transcripts
Other components
- Server members
- Discord API
Connections 34
- Server members → Discord API: uses commands
README.md - Discord API → Bot runtime: delivers interactions
README.md - Application startup → Bot runtime: starts
main.py - Bot runtime → Database access: opens
bot.py - Bot runtime → Ticket lifecycle: creates
bot.py - Bot runtime → Panel administration: loads cogs
bot.py - Bot runtime → General commands: loads cogs
bot.py - Bot runtime → Setup command: loads cogs
bot.py - Bot runtime → Ticket commands: loads cogs
bot.py - Setup command → Panel wizard: launches
cogs/panels.py - Panel wizard → Database access: saves panel
utils/views/panel_wizard.py - Panel wizard → Discord API: posts panel
utils/views/panel_wizard.py - Ticket commands → Command base: uses base
cogs/tickets.py - Panel administration → Command base: uses base
cogs/admin.py - General commands → Command base: uses base
cogs/general.py - Ticket commands → Ticket lifecycle: manages tickets
- Discord API → Ticket controls: invokes buttons
README.md - Ticket controls → Ticket lifecycle: delegates actions
utils/views/ticket_controls.py - Ticket controls → Access checks: checks access
utils/views/ticket_controls.py - Ticket lifecycle → Database access: reads and writes
utils/ticket_service.py - Ticket lifecycle → Discord API: changes channels
README.md - Ticket lifecycle → Transcript renderer: renders transcript
utils/ticket_service.py - Ticket lifecycle → Edit rate limiter: uses budget
utils/ticket_service.py - Ticket lifecycle → Access checks: uses access checks
utils/ticket_service.py - Transcript renderer → HTML transcript files: writes HTML
- Database access → Atomic TinyDB files: stores tables
README.md - Access checks → Database access: reads guild roles
utils/checks.py - Error handling → Discord embeds: formats replies
utils/error_handler.py - Command base → Error handling: handles command errors
cogs/base_command.py - Ticket controls → Error handling: handles view errors
- Bot runtime → Configuration: uses settings
bot.py - Bot runtime → Ticket controls: registers persistent views
bot.py - Database access → Domain errors: raises failures
utils/database.py - Ticket lifecycle → Domain errors: raises domain errors
utils/ticket_service.py